@@ -1465,7 +1465,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
1465
1465
cfg_fn ! ( dropck_eyepatch) ) ) ,
1466
1466
( sym:: unwind, Whitelisted , template ! ( List : "allowed|aborts" ) , Gated ( Stability :: Unstable ,
1467
1467
sym:: unwind_attributes,
1468
- "#[unwind] is experimental" ,
1468
+ "` #[unwind]` is experimental" ,
1469
1469
cfg_fn ! ( unwind_attributes) ) ) ,
1470
1470
( sym:: used, Whitelisted , template ! ( Word ) , Ungated ) ,
1471
1471
@@ -1551,13 +1551,13 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
1551
1551
1552
1552
( sym:: alloc_error_handler, Normal , template ! ( Word ) , Gated ( Stability :: Unstable ,
1553
1553
sym:: alloc_error_handler,
1554
- "#[alloc_error_handler] is an unstable feature" ,
1554
+ "` #[alloc_error_handler]` is an unstable feature" ,
1555
1555
cfg_fn ! ( alloc_error_handler) ) ) ,
1556
1556
1557
1557
// RFC 2412
1558
1558
( sym:: optimize, Whitelisted , template ! ( List : "size|speed" ) , Gated ( Stability :: Unstable ,
1559
1559
sym:: optimize_attribute,
1560
- "#[optimize] attribute is an unstable feature" ,
1560
+ "` #[optimize]` attribute is an unstable feature" ,
1561
1561
cfg_fn ! ( optimize_attribute) ) ) ,
1562
1562
1563
1563
// Crate level attributes
@@ -1674,7 +1674,7 @@ impl<'a> Context<'a> {
1674
1674
if let Some ( content) = attr. meta_item_list ( ) {
1675
1675
if content. iter ( ) . any ( |c| c. check_name ( sym:: include) ) {
1676
1676
gate_feature ! ( self , external_doc, attr. span,
1677
- "#[doc(include = \" ...\" )] is experimental"
1677
+ "` #[doc(include = \" ...\" )]` is experimental"
1678
1678
) ;
1679
1679
}
1680
1680
}
@@ -1803,7 +1803,7 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(
1803
1803
1804
1804
// #23973: do not suggest `#![feature(...)]` if we are in beta/stable
1805
1805
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) ) ;
1807
1807
}
1808
1808
1809
1809
// 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> {
1985
1985
if let Some ( content) = attr. meta_item_list ( ) {
1986
1986
if content. len ( ) == 1 && content[ 0 ] . check_name ( sym:: cfg) {
1987
1987
gate_feature_post ! ( & self , doc_cfg, attr. span,
1988
- "#[doc(cfg(...))] is experimental"
1988
+ "` #[doc(cfg(...))]` is experimental"
1989
1989
) ;
1990
1990
} else if content. iter ( ) . any ( |c| c. check_name ( sym:: masked) ) {
1991
1991
gate_feature_post ! ( & self , doc_masked, attr. span,
1992
- "#[doc(masked)] is experimental"
1992
+ "` #[doc(masked)]` is experimental"
1993
1993
) ;
1994
1994
} else if content. iter ( ) . any ( |c| c. check_name ( sym:: spotlight) ) {
1995
1995
gate_feature_post ! ( & self , doc_spotlight, attr. span,
1996
- "#[doc(spotlight)] is experimental"
1996
+ "` #[doc(spotlight)]` is experimental"
1997
1997
) ;
1998
1998
} else if content. iter ( ) . any ( |c| c. check_name ( sym:: alias) ) {
1999
1999
gate_feature_post ! ( & self , doc_alias, attr. span,
2000
- "#[doc(alias = \" ...\" )] is experimental"
2000
+ "` #[doc(alias = \" ...\" )]` is experimental"
2001
2001
) ;
2002
2002
} else if content. iter ( ) . any ( |c| c. check_name ( sym:: keyword) ) {
2003
2003
gate_feature_post ! ( & self , doc_keyword, attr. span,
2004
- "#[doc(keyword = \" ...\" )] is experimental"
2004
+ "` #[doc(keyword = \" ...\" )]` is experimental"
2005
2005
) ;
2006
2006
}
2007
2007
}
@@ -2044,13 +2044,13 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
2044
2044
}
2045
2045
if attr:: contains_name ( & i. attrs [ ..] , sym:: start) {
2046
2046
gate_feature_post ! ( & self , start, i. span,
2047
- "a #[start] function is an experimental \
2047
+ "a ` #[start]` function is an experimental \
2048
2048
feature whose signature may change \
2049
2049
over time") ;
2050
2050
}
2051
2051
if attr:: contains_name ( & i. attrs [ ..] , sym:: main) {
2052
2052
gate_feature_post ! ( & self , main, i. span,
2053
- "declaration of a nonstandard #[main] \
2053
+ "declaration of a non-standard ` #[main]` \
2054
2054
function may change over time, for now \
2055
2055
a top-level `fn main()` is required") ;
2056
2056
}
@@ -2638,7 +2638,7 @@ fn maybe_stage_features(span_handler: &Handler, krate: &ast::Crate,
2638
2638
if attr. check_name ( sym:: feature) {
2639
2639
let release_channel = option_env ! ( "CFG_RELEASE_CHANNEL" ) . unwrap_or ( "(unknown)" ) ;
2640
2640
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" ,
2642
2642
release_channel) ;
2643
2643
}
2644
2644
}
0 commit comments