@@ -1465,7 +1465,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
14651465 cfg_fn ! ( dropck_eyepatch) ) ) ,
14661466 ( sym:: unwind, Whitelisted , template ! ( List : "allowed|aborts" ) , Gated ( Stability :: Unstable ,
14671467 sym:: unwind_attributes,
1468- "#[unwind] is experimental" ,
1468+ "` #[unwind]` is experimental" ,
14691469 cfg_fn ! ( unwind_attributes) ) ) ,
14701470 ( sym:: used, Whitelisted , template ! ( Word ) , Ungated ) ,
14711471
@@ -1551,13 +1551,13 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
15511551
15521552 ( sym:: alloc_error_handler, Normal , template ! ( Word ) , Gated ( Stability :: Unstable ,
15531553 sym:: alloc_error_handler,
1554- "#[alloc_error_handler] is an unstable feature" ,
1554+ "` #[alloc_error_handler]` is an unstable feature" ,
15551555 cfg_fn ! ( alloc_error_handler) ) ) ,
15561556
15571557 // RFC 2412
15581558 ( sym:: optimize, Whitelisted , template ! ( List : "size|speed" ) , Gated ( Stability :: Unstable ,
15591559 sym:: optimize_attribute,
1560- "#[optimize] attribute is an unstable feature" ,
1560+ "` #[optimize]` attribute is an unstable feature" ,
15611561 cfg_fn ! ( optimize_attribute) ) ) ,
15621562
15631563 // Crate level attributes
@@ -1674,7 +1674,7 @@ impl<'a> Context<'a> {
16741674 if let Some ( content) = attr. meta_item_list ( ) {
16751675 if content. iter ( ) . any ( |c| c. check_name ( sym:: include) ) {
16761676 gate_feature ! ( self , external_doc, attr. span,
1677- "#[doc(include = \" ...\" )] is experimental"
1677+ "` #[doc(include = \" ...\" )]` is experimental"
16781678 ) ;
16791679 }
16801680 }
@@ -1803,7 +1803,7 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(
18031803
18041804 // #23973: do not suggest `#![feature(...)]` if we are in beta/stable
18051805 if sess. unstable_features . is_nightly_build ( ) {
1806- err. help ( & format ! ( "add #![feature({})] to the crate attributes to enable" , feature) ) ;
1806+ err. help ( & format ! ( "add ` #![feature({})]` to the crate attributes to enable" , feature) ) ;
18071807 }
18081808
18091809 // If we're on stable and only emitting a "soft" warning, add a note to
@@ -1985,23 +1985,23 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
19851985 if let Some ( content) = attr. meta_item_list ( ) {
19861986 if content. len ( ) == 1 && content[ 0 ] . check_name ( sym:: cfg) {
19871987 gate_feature_post ! ( & self , doc_cfg, attr. span,
1988- "#[doc(cfg(...))] is experimental"
1988+ "` #[doc(cfg(...))]` is experimental"
19891989 ) ;
19901990 } else if content. iter ( ) . any ( |c| c. check_name ( sym:: masked) ) {
19911991 gate_feature_post ! ( & self , doc_masked, attr. span,
1992- "#[doc(masked)] is experimental"
1992+ "` #[doc(masked)]` is experimental"
19931993 ) ;
19941994 } else if content. iter ( ) . any ( |c| c. check_name ( sym:: spotlight) ) {
19951995 gate_feature_post ! ( & self , doc_spotlight, attr. span,
1996- "#[doc(spotlight)] is experimental"
1996+ "` #[doc(spotlight)]` is experimental"
19971997 ) ;
19981998 } else if content. iter ( ) . any ( |c| c. check_name ( sym:: alias) ) {
19991999 gate_feature_post ! ( & self , doc_alias, attr. span,
2000- "#[doc(alias = \" ...\" )] is experimental"
2000+ "` #[doc(alias = \" ...\" )]` is experimental"
20012001 ) ;
20022002 } else if content. iter ( ) . any ( |c| c. check_name ( sym:: keyword) ) {
20032003 gate_feature_post ! ( & self , doc_keyword, attr. span,
2004- "#[doc(keyword = \" ...\" )] is experimental"
2004+ "` #[doc(keyword = \" ...\" )]` is experimental"
20052005 ) ;
20062006 }
20072007 }
@@ -2044,13 +2044,13 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
20442044 }
20452045 if attr:: contains_name ( & i. attrs [ ..] , sym:: start) {
20462046 gate_feature_post ! ( & self , start, i. span,
2047- "a #[start] function is an experimental \
2047+ "a ` #[start]` function is an experimental \
20482048 feature whose signature may change \
20492049 over time") ;
20502050 }
20512051 if attr:: contains_name ( & i. attrs [ ..] , sym:: main) {
20522052 gate_feature_post ! ( & self , main, i. span,
2053- "declaration of a nonstandard #[main] \
2053+ "declaration of a non-standard ` #[main]` \
20542054 function may change over time, for now \
20552055 a top-level `fn main()` is required") ;
20562056 }
@@ -2638,7 +2638,7 @@ fn maybe_stage_features(span_handler: &Handler, krate: &ast::Crate,
26382638 if attr. check_name ( sym:: feature) {
26392639 let release_channel = option_env ! ( "CFG_RELEASE_CHANNEL" ) . unwrap_or ( "(unknown)" ) ;
26402640 span_err ! ( span_handler, attr. span, E0554 ,
2641- "#![feature] may not be used on the {} release channel" ,
2641+ "` #![feature]` may not be used on the {} release channel" ,
26422642 release_channel) ;
26432643 }
26442644 }
0 commit comments