File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,10 +217,14 @@ pub fn generate_bit_stream(
217217 id_collect. insert ( id. clone ( ) , ( adr, span. clone ( ) ) ) ;
218218 } else {
219219 let other_span = ( * id_ref. unwrap ( ) ) . 1 . clone ( ) ;
220- panic ! (
221- "identifier already used there {}..{}" ,
222- other_span. start, other_span. end
220+ let report = miette ! (
221+ labels = vec![
222+ LabeledSpan :: at( other_span, "previously declared here" ) ,
223+ LabeledSpan :: at( span. clone( ) , "declared there" ) ,
224+ ] ,
225+ "Error: Identifier already declared"
223226 ) ;
227+ errors. push ( report) ;
224228 }
225229
226230 String :: new ( )
@@ -236,10 +240,14 @@ pub fn generate_bit_stream(
236240 id_collect. insert ( id. clone ( ) , ( * val, span. clone ( ) ) ) ;
237241 } else {
238242 let other_span = ( * id_ref. unwrap ( ) ) . 1 . clone ( ) ;
239- panic ! (
240- "identifier already used there {}..{}" ,
241- other_span. start, other_span. end
243+ let report = miette ! (
244+ labels = vec![
245+ LabeledSpan :: at( other_span, "previously declared here" ) ,
246+ LabeledSpan :: at( span. clone( ) , "declared there" ) ,
247+ ] ,
248+ "Error: Identifier already declared"
242249 ) ;
250+ errors. push ( report) ;
243251 }
244252
245253 String :: new ( )
You can’t perform that action at this time.
0 commit comments