@@ -12,7 +12,7 @@ use self::Destination::*;
1212
1313use syntax_pos:: { DUMMY_SP , FileMap , Span , MultiSpan } ;
1414
15- use { Level , CodeSuggestion , DiagnosticBuilder , SubDiagnostic , CodeMapper , DiagnosticId } ;
15+ use { Level , CodeSuggestion , DiagnosticBuilder , SubDiagnostic , CodeMapperDyn , DiagnosticId } ;
1616use snippet:: { Annotation , AnnotationType , Line , MultilineAnnotation , StyledString , Style } ;
1717use styled_buffer:: StyledBuffer ;
1818
@@ -120,7 +120,7 @@ impl ColorConfig {
120120
121121pub struct EmitterWriter {
122122 dst : Destination ,
123- cm : Option < Lrc < CodeMapper > > ,
123+ cm : Option < Lrc < CodeMapperDyn > > ,
124124 short_message : bool ,
125125 teach : bool ,
126126 ui_testing : bool ,
@@ -134,7 +134,7 @@ struct FileWithAnnotatedLines {
134134
135135impl EmitterWriter {
136136 pub fn stderr ( color_config : ColorConfig ,
137- code_map : Option < Lrc < CodeMapper > > ,
137+ code_map : Option < Lrc < CodeMapperDyn > > ,
138138 short_message : bool ,
139139 teach : bool )
140140 -> EmitterWriter {
@@ -149,7 +149,7 @@ impl EmitterWriter {
149149 }
150150
151151 pub fn new ( dst : Box < Write + Send > ,
152- code_map : Option < Lrc < CodeMapper > > ,
152+ code_map : Option < Lrc < CodeMapperDyn > > ,
153153 short_message : bool ,
154154 teach : bool )
155155 -> EmitterWriter {
@@ -1195,8 +1195,6 @@ impl EmitterWriter {
11951195 level : & Level ,
11961196 max_line_num_len : usize )
11971197 -> io:: Result < ( ) > {
1198- use std:: borrow:: Borrow ;
1199-
12001198 if let Some ( ref cm) = self . cm {
12011199 let mut buffer = StyledBuffer :: new ( ) ;
12021200
@@ -1213,7 +1211,7 @@ impl EmitterWriter {
12131211 Some ( Style :: HeaderMsg ) ) ;
12141212
12151213 // Render the replacements for each suggestion
1216- let suggestions = suggestion. splice_lines ( cm . borrow ( ) ) ;
1214+ let suggestions = suggestion. splice_lines ( & * * cm ) ;
12171215
12181216 let mut row_num = 2 ;
12191217 for & ( ref complete, ref parts) in suggestions. iter ( ) . take ( MAX_SUGGESTIONS ) {
0 commit comments