@@ -12,7 +12,7 @@ use self::Destination::*;
12
12
13
13
use syntax_pos:: { DUMMY_SP , FileMap , Span , MultiSpan } ;
14
14
15
- use { Level , CodeSuggestion , DiagnosticBuilder , SubDiagnostic , CodeMapper , DiagnosticId } ;
15
+ use { Level , CodeSuggestion , DiagnosticBuilder , SubDiagnostic , CodeMapperDyn , DiagnosticId } ;
16
16
use snippet:: { Annotation , AnnotationType , Line , MultilineAnnotation , StyledString , Style } ;
17
17
use styled_buffer:: StyledBuffer ;
18
18
@@ -120,7 +120,7 @@ impl ColorConfig {
120
120
121
121
pub struct EmitterWriter {
122
122
dst : Destination ,
123
- cm : Option < Lrc < CodeMapper > > ,
123
+ cm : Option < Lrc < CodeMapperDyn > > ,
124
124
short_message : bool ,
125
125
teach : bool ,
126
126
ui_testing : bool ,
@@ -134,7 +134,7 @@ struct FileWithAnnotatedLines {
134
134
135
135
impl EmitterWriter {
136
136
pub fn stderr ( color_config : ColorConfig ,
137
- code_map : Option < Lrc < CodeMapper > > ,
137
+ code_map : Option < Lrc < CodeMapperDyn > > ,
138
138
short_message : bool ,
139
139
teach : bool )
140
140
-> EmitterWriter {
@@ -149,7 +149,7 @@ impl EmitterWriter {
149
149
}
150
150
151
151
pub fn new ( dst : Box < Write + Send > ,
152
- code_map : Option < Lrc < CodeMapper > > ,
152
+ code_map : Option < Lrc < CodeMapperDyn > > ,
153
153
short_message : bool ,
154
154
teach : bool )
155
155
-> EmitterWriter {
@@ -1195,8 +1195,6 @@ impl EmitterWriter {
1195
1195
level : & Level ,
1196
1196
max_line_num_len : usize )
1197
1197
-> io:: Result < ( ) > {
1198
- use std:: borrow:: Borrow ;
1199
-
1200
1198
if let Some ( ref cm) = self . cm {
1201
1199
let mut buffer = StyledBuffer :: new ( ) ;
1202
1200
@@ -1213,7 +1211,7 @@ impl EmitterWriter {
1213
1211
Some ( Style :: HeaderMsg ) ) ;
1214
1212
1215
1213
// Render the replacements for each suggestion
1216
- let suggestions = suggestion. splice_lines ( cm . borrow ( ) ) ;
1214
+ let suggestions = suggestion. splice_lines ( & * * cm ) ;
1217
1215
1218
1216
let mut row_num = 2 ;
1219
1217
for & ( ref complete, ref parts) in suggestions. iter ( ) . take ( MAX_SUGGESTIONS ) {
0 commit comments