@@ -19,23 +19,6 @@ pub trait SourceMapGetter {
1919 ) -> Option < String > ;
2020}
2121
22- impl < T > SourceMapGetter for Rc < T >
23- where
24- T : SourceMapGetter + ?Sized ,
25- {
26- fn get_source_map ( & self , file_name : & str ) -> Option < Vec < u8 > > {
27- ( * * self ) . get_source_map ( file_name)
28- }
29-
30- fn get_source_line (
31- & self ,
32- file_name : & str ,
33- line_number : usize ,
34- ) -> Option < String > {
35- ( * * self ) . get_source_line ( file_name, line_number)
36- }
37- }
38-
3922pub enum SourceMapApplication {
4023 /// No mapping was applied, the location is unchanged.
4124 Unchanged ,
@@ -54,18 +37,18 @@ pub enum SourceMapApplication {
5437
5538pub type SourceMapData = Cow < ' static , [ u8 ] > ;
5639
57- pub struct SourceMapper < G : SourceMapGetter > {
40+ pub struct SourceMapper {
5841 maps : HashMap < String , Option < SourceMap > > ,
5942 source_lines : HashMap < ( String , i64 ) , Option < String > > ,
60- getter : Option < G > ,
43+ getter : Option < Rc < dyn SourceMapGetter > > ,
6144 pub ( crate ) ext_source_maps : HashMap < String , SourceMapData > ,
6245 // This is not the right place for this, but it's the easiest way to make
6346 // op_apply_source_map a fast op. This stashing should happen in #[op2].
6447 pub ( crate ) stashed_file_name : Option < String > ,
6548}
6649
67- impl < G : SourceMapGetter > SourceMapper < G > {
68- pub fn new ( getter : Option < G > ) -> Self {
50+ impl SourceMapper {
51+ pub fn new ( getter : Option < Rc < dyn SourceMapGetter > > ) -> Self {
6952 Self {
7053 maps : Default :: default ( ) ,
7154 source_lines : Default :: default ( ) ,
0 commit comments