@@ -140,7 +140,7 @@ impl Message {
140140 let name = interner. resolve ( * name) . unwrap ( ) ;
141141
142142 Diagnostic :: error ( )
143- . with_message ( format ! ( "cannot find `{}` in scope" , name ) )
143+ . with_message ( format ! ( "cannot find `{name }` in scope" ) )
144144 . with_labels ( vec ! [ primary_label( range) . with_message( "unbound name" ) ] )
145145 // TODO: list suggestions
146146 }
@@ -177,7 +177,7 @@ impl Message {
177177 . with_labels ( vec ! [
178178 primary_label( arg_range) . with_message( "unexpected argument" ) ,
179179 secondary_label( head_range)
180- . with_message( format!( "expression of type {}" , head_type ) ) ,
180+ . with_message( format!( "expression of type {head_type}" ) ) ,
181181 ] ) ,
182182 Message :: UnknownField {
183183 head_range,
@@ -189,11 +189,11 @@ impl Message {
189189 let label = interner. resolve ( * label) . unwrap ( ) ;
190190
191191 Diagnostic :: error ( )
192- . with_message ( format ! ( "cannot find `{}` in expression" , label ) )
192+ . with_message ( format ! ( "cannot find `{label }` in expression" ) )
193193 . with_labels ( vec ! [
194194 primary_label( label_range) . with_message( "unknown label" ) ,
195195 secondary_label( head_range)
196- . with_message( format!( "expression of type {}" , head_type ) ) ,
196+ . with_message( format!( "expression of type {head_type}" ) ) ,
197197 ] )
198198 // TODO: list suggestions
199199 }
@@ -213,7 +213,7 @@ impl Message {
213213 None => {
214214 let expr_label = interner. resolve ( * expr_label) . unwrap ( ) ;
215215 diagnostic_labels. push ( primary_label ( range) . with_message (
216- format ! ( "unexpected field `{}`" , expr_label , ) ,
216+ format ! ( "unexpected field `{expr_label }`" , ) ,
217217 ) ) ;
218218 continue ' expr_labels;
219219 }
@@ -224,8 +224,7 @@ impl Message {
224224 let type_label = interner. resolve ( * type_label) . unwrap ( ) ;
225225 diagnostic_labels. push (
226226 primary_label ( range) . with_message ( format ! (
227- "expected field `{}`" ,
228- type_label,
227+ "expected field `{type_label}`" ,
229228 ) ) ,
230229 ) ;
231230 continue ' type_labels;
@@ -239,7 +238,7 @@ impl Message {
239238 "missing fields {}" ,
240239 type_labels
241240 . map( |label| interner. resolve( * label) . unwrap( ) )
242- . format_with( ", " , |label, f| f( & format_args!( "`{}`" , label ) ) ) ,
241+ . format_with( ", " , |label, f| f( & format_args!( "`{label }`" ) ) ) ,
243242 ) ) ) ;
244243 } else {
245244 diagnostic_labels
@@ -249,17 +248,17 @@ impl Message {
249248
250249 let found_labels = ( expr_labels. iter ( ) )
251250 . map ( |( _, label) | interner. resolve ( * label) . unwrap ( ) )
252- . format_with ( ", " , |label, f| f ( & format_args ! ( "`{}`" , label ) ) ) ;
251+ . format_with ( ", " , |label, f| f ( & format_args ! ( "`{label }`" ) ) ) ;
253252 let expected_labels = ( type_labels. iter ( ) )
254253 . map ( |label| interner. resolve ( * label) . unwrap ( ) )
255- . format_with ( ", " , |label, f| f ( & format_args ! ( "`{}`" , label ) ) ) ;
254+ . format_with ( ", " , |label, f| f ( & format_args ! ( "`{label }`" ) ) ) ;
256255
257256 Diagnostic :: error ( )
258257 . with_message ( "mismatched field labels in record literal" )
259258 . with_labels ( diagnostic_labels)
260259 . with_notes ( vec ! [
261- format!( "expected fields {}" , expected_labels ) ,
262- format!( " found fields {}" , found_labels ) ,
260+ format!( "expected fields {expected_labels}" ) ,
261+ format!( " found fields {found_labels}" ) ,
263262 ] )
264263 }
265264 Message :: DuplicateFieldLabels { range, labels } => {
@@ -278,7 +277,7 @@ impl Message {
278277 "duplicate fields {}" ,
279278 ( labels. iter( ) )
280279 . map( |( _, label) | interner. resolve( * label) . unwrap( ) )
281- . format_with( ", " , |label, f| f( & format_args!( "`{}`" , label ) ) )
280+ . format_with( ", " , |label, f| f( & format_args!( "`{label }`" ) ) )
282281 ) ] )
283282 }
284283 Message :: ArrayLiteralNotSupported {
@@ -287,9 +286,9 @@ impl Message {
287286 } => Diagnostic :: error ( )
288287 . with_message ( "array literal not supported" )
289288 . with_labels ( vec ! [
290- primary_label( range) . with_message( format!( "expected `{}`" , expected_type ) )
289+ primary_label( range) . with_message( format!( "expected `{expected_type }`" ) )
291290 ] )
292- . with_notes ( vec ! [ format!( "expected `{}`" , expected_type ) ] ) ,
291+ . with_notes ( vec ! [ format!( "expected `{expected_type }`" ) ] ) ,
293292 Message :: MismatchedArrayLength {
294293 range,
295294 found_len,
@@ -300,8 +299,8 @@ impl Message {
300299 primary_label( range) . with_message( "array with invalid length" )
301300 ] )
302301 . with_notes ( vec ! [
303- format!( "expected length {}" , expected_len ) ,
304- format!( " found length {}" , found_len ) ,
302+ format!( "expected length {expected_len}" ) ,
303+ format!( " found length {found_len}" ) ,
305304 ] ) ,
306305 Message :: AmbiguousArrayLiteral { range } => Diagnostic :: error ( )
307306 . with_message ( "ambiguous array literal" )
@@ -318,8 +317,8 @@ impl Message {
318317 primary_label( range) . with_message( "invalid string literal" )
319318 ] )
320319 . with_notes ( vec ! [
321- format!( "expected byte length {}" , expected_len ) ,
322- format!( " found byte length {}" , found_len ) ,
320+ format!( "expected byte length {expected_len}" ) ,
321+ format!( " found byte length {found_len}" ) ,
323322 ] ) ,
324323 Message :: NonAsciiStringLiteral { invalid_range } => Diagnostic :: error ( )
325324 . with_message ( "non-ASCII character found in string literal" )
@@ -332,9 +331,9 @@ impl Message {
332331 } => Diagnostic :: error ( )
333332 . with_message ( "string literal not supported" )
334333 . with_labels ( vec ! [
335- primary_label( range) . with_message( format!( "expected `{}`" , expected_type ) )
334+ primary_label( range) . with_message( format!( "expected `{expected_type }`" ) )
336335 ] )
337- . with_notes ( vec ! [ format!( "expected `{}`" , expected_type ) ] ) ,
336+ . with_notes ( vec ! [ format!( "expected `{expected_type }`" ) ] ) ,
338337 Message :: AmbiguousStringLiteral { range } => Diagnostic :: error ( )
339338 . with_message ( "ambiguous string literal" )
340339 . with_labels ( vec ! [
@@ -349,9 +348,9 @@ impl Message {
349348 } => Diagnostic :: error ( )
350349 . with_message ( "numeric literal not supported" )
351350 . with_labels ( vec ! [
352- primary_label( range) . with_message( format!( "expected `{}`" , expected_type ) )
351+ primary_label( range) . with_message( format!( "expected `{expected_type }`" ) )
353352 ] )
354- . with_notes ( vec ! [ format!( "expected `{}`" , expected_type ) ] ) ,
353+ . with_notes ( vec ! [ format!( "expected `{expected_type }`" ) ] ) ,
355354 Message :: AmbiguousNumericLiteral { range } => Diagnostic :: error ( )
356355 . with_message ( "ambiguous numeric literal" )
357356 . with_labels ( vec ! [
@@ -370,10 +369,10 @@ impl Message {
370369 } => Diagnostic :: error ( )
371370 . with_message ( "mismatched types" )
372371 . with_labels ( vec ! [
373- primary_label( lhs_range) . with_message( format!( "has type `{}`" , lhs ) ) ,
374- primary_label( rhs_range) . with_message( format!( "has type `{}`" , rhs ) ) ,
372+ primary_label( lhs_range) . with_message( format!( "has type `{lhs }`" ) ) ,
373+ primary_label( rhs_range) . with_message( format!( "has type `{rhs }`" ) ) ,
375374 secondary_label( & op. range( ) )
376- . with_message( format!( "no implementation for `{} {} {}`" , lhs , op , rhs ) ) ,
375+ . with_message( format!( "no implementation for `{lhs } {op } {rhs }`" ) ) ,
377376 ] ) ,
378377 Message :: FailedToUnify {
379378 range,
@@ -388,12 +387,11 @@ impl Message {
388387 Error :: Mismatch => Diagnostic :: error ( )
389388 . with_message ( "mismatched types" )
390389 . with_labels ( vec ! [ primary_label( range) . with_message( format!(
391- "type mismatch, expected `{}`, found `{}`" ,
392- lhs, rhs
390+ "type mismatch, expected `{lhs}`, found `{rhs}`"
393391 ) ) ] )
394392 . with_notes ( vec ! [ [
395- format!( "expected `{}`" , lhs ) ,
396- format!( " found `{}`" , rhs ) ,
393+ format!( "expected `{lhs }`" ) ,
394+ format!( " found `{rhs }`" ) ,
397395 ]
398396 . join( "\n " ) ] ) ,
399397 // TODO: reduce confusion around ‘problem spines’
@@ -426,11 +424,10 @@ impl Message {
426424 let name = interner. resolve ( * name) . unwrap ( ) ;
427425
428426 Diagnostic :: note ( )
429- . with_message ( format ! ( "solution found for hole `?{}`" , name ) )
427+ . with_message ( format ! ( "solution found for hole `?{name }`" ) )
430428 . with_labels ( vec ! [ primary_label( range) . with_message( "solution found" ) ] )
431429 . with_notes ( vec ! [ format!(
432- "hole `?{}` can be replaced with `{}`" ,
433- name, expr,
430+ "hole `?{name}` can be replaced with `{expr}`" ,
434431 ) ] )
435432 }
436433 Message :: UnsolvedMetaVar { source } => {
@@ -448,9 +445,9 @@ impl Message {
448445 } ;
449446
450447 Diagnostic :: error ( )
451- . with_message ( format ! ( "failed to infer {}" , source_name ) )
448+ . with_message ( format ! ( "failed to infer {source_name}" ) )
452449 . with_labels ( vec ! [
453- primary_label( range) . with_message( format!( "unsolved {}" , source_name ) )
450+ primary_label( range) . with_message( format!( "unsolved {source_name}" ) )
454451 ] )
455452 }
456453 Message :: CycleDetected { names } => {
@@ -468,8 +465,7 @@ impl Message {
468465 . with_message ( "produced core term without span" )
469466 . with_labels ( vec ! [ primary_label( range) ] )
470467 . with_notes ( vec ! [ format!(
471- "please file a bug report at: {}" ,
472- BUG_REPORT_URL
468+ "please file a bug report at: {BUG_REPORT_URL}"
473469 ) ] ) ,
474470 }
475471 }
0 commit comments