File tree 2 files changed +5
-22
lines changed
compiler/rustc_fluent_macro/src
tests/ui-fulldeps/fluent-messages
2 files changed +5
-22
lines changed Original file line number Diff line number Diff line change @@ -138,25 +138,8 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok
138
138
// with a lowercase as rustc errors do.
139
139
err. replace_range ( 0 ..1 , & err. chars ( ) . next ( ) . unwrap ( ) . to_lowercase ( ) . to_string ( ) ) ;
140
140
141
- let line_starts: Vec < usize > = std:: iter:: once ( 0 )
142
- . chain (
143
- this. source ( )
144
- . char_indices ( )
145
- . filter_map ( |( i, c) | Some ( i + 1 ) . filter ( |_| c == '\n' ) ) ,
146
- )
147
- . collect ( ) ;
148
- let line_start = line_starts
149
- . iter ( )
150
- . enumerate ( )
151
- . map ( |( line, idx) | ( line + 1 , idx) )
152
- . filter ( |( _, idx) | * * idx <= pos. start )
153
- . last ( )
154
- . unwrap ( )
155
- . 0 ;
156
-
157
141
let message = annotate_snippets:: Level :: Error . title ( & err) . snippet (
158
142
Snippet :: source ( this. source ( ) )
159
- . line_start ( line_start)
160
143
. origin ( & relative_ftl_path)
161
144
. fold ( true )
162
145
. annotation ( annotate_snippets:: Level :: Error . span ( pos. start ..pos. end - 1 ) ) ,
Original file line number Diff line number Diff line change @@ -112,11 +112,11 @@ LL | rustc_fluent_macro::fluent_messages! { "./many-lines.ftl" }
112
112
= help: see additional errors emitted
113
113
114
114
error: expected a message field for "no_crate_bar"
115
- --> ./many-lines.ftl:15 :1
116
- |
117
- 15 | no_crate_bar =
118
- | ^^^^^^^^^^^^^^
119
- |
115
+ --> ./many-lines.ftl:8 :1
116
+ |
117
+ 8 | no_crate_bar =
118
+ | ^^^^^^^^^^^^^^
119
+ |
120
120
121
121
error: aborting due to 14 previous errors
122
122
You can’t perform that action at this time.
0 commit comments