@@ -348,12 +348,12 @@ impl<'tcx> KaniAttributes<'tcx> {
348348 "Use of unstable feature `{}`: {}" ,
349349 unstable_attr. feature, unstable_attr. reason
350350 ) )
351- . span_note (
351+ . with_span_note (
352352 self . tcx . def_span ( self . item ) ,
353353 format ! ( "the function `{fn_name}` is unstable:" ) ,
354354 )
355- . note ( format ! ( "see issue {} for more information" , unstable_attr. issue) )
356- . help ( format ! ( "use `-Z {}` to enable using this function." , unstable_attr. feature) )
355+ . with_note ( format ! ( "see issue {} for more information" , unstable_attr. issue) )
356+ . with_help ( format ! ( "use `-Z {}` to enable using this function." , unstable_attr. feature) )
357357 . emit ( )
358358 }
359359
@@ -422,7 +422,7 @@ impl<'tcx> KaniAttributes<'tcx> {
422422 self . item_name( ) ,
423423 ) ,
424424 )
425- . span_note ( self . tcx . def_span ( id) , "Try adding a contract to this function." )
425+ . with_span_note ( self . tcx . def_span ( id) , "Try adding a contract to this function." )
426426 . emit ( ) ;
427427 return ;
428428 } ;
@@ -448,7 +448,7 @@ impl<'tcx> KaniAttributes<'tcx> {
448448 self . item_name( ) ,
449449 ) ,
450450 )
451- . span_note (
451+ . with_span_note (
452452 self . tcx . def_span ( def_id) ,
453453 format ! (
454454 "Try adding a contract to this function or use the unsound `{}` attribute instead." ,
@@ -624,7 +624,7 @@ impl<'a> UnstableAttrParseError<'a> {
624624 self . attr . span ,
625625 format ! ( "failed to parse `#[kani::unstable]`: {}" , self . reason) ,
626626 )
627- . note ( format ! (
627+ . with_note ( format ! (
628628 "expected format: #[kani::unstable({}, {}, {})]" ,
629629 r#"feature="<IDENTIFIER>""# , r#"issue="<ISSUE>""# , r#"reason="<DESCRIPTION>""#
630630 ) )
@@ -665,7 +665,7 @@ fn expect_no_args(tcx: TyCtxt, kind: KaniAttributeKind, attr: &Attribute) {
665665 if !attr. is_word ( ) {
666666 tcx. dcx ( )
667667 . struct_span_err ( attr. span , format ! ( "unexpected argument for `{}`" , kind. as_ref( ) ) )
668- . help ( "remove the extra argument" )
668+ . with_help ( "remove the extra argument" )
669669 . emit ( ) ;
670670 }
671671}
0 commit comments