@@ -121,12 +121,12 @@ impl CheckAttrVisitor<'tcx> {
121121 lint. build ( "`#[inline]` is ignored on constants" )
122122 . warn (
123123 "this was previously accepted by the compiler but is \
124- being phased out; it will become a hard error in \
125- a future release!",
124+ being phased out; it will become a hard error in \
125+ a future release!",
126126 )
127127 . note (
128128 "see issue #65833 <https://github.com/rust-lang/rust/issues/65833> \
129- for more information",
129+ for more information",
130130 )
131131 . emit ( ) ;
132132 } ) ;
@@ -165,7 +165,7 @@ impl CheckAttrVisitor<'tcx> {
165165 . emit ( ) ;
166166 false
167167 }
168- Target :: Fn | Target :: Method ( ..) | Target :: ForeignFn => true ,
168+ Target :: Fn | Target :: Method ( ..) | Target :: ForeignFn | Target :: Closure => true ,
169169 _ => {
170170 struct_span_err ! (
171171 self . tcx. sess,
@@ -231,8 +231,8 @@ impl CheckAttrVisitor<'tcx> {
231231 lint. build ( "attribute should be applied to a function" )
232232 . warn (
233233 "this was previously accepted by the compiler but is \
234- being phased out; it will become a hard error in \
235- a future release!",
234+ being phased out; it will become a hard error in \
235+ a future release!",
236236 )
237237 . span_label ( * span, "not a function" )
238238 . emit ( ) ;
@@ -313,16 +313,16 @@ impl CheckAttrVisitor<'tcx> {
313313 /// Checks if `#[cold]` is applied to a non-function. Returns `true` if valid.
314314 fn check_cold ( & self , hir_id : HirId , attr : & Attribute , span : & Span , target : Target ) {
315315 match target {
316- Target :: Fn | Target :: Method ( ..) | Target :: ForeignFn => { }
316+ Target :: Fn | Target :: Method ( ..) | Target :: ForeignFn | Target :: Closure => { }
317317 _ => {
318318 // FIXME: #[cold] was previously allowed on non-functions and some crates used
319319 // this, so only emit a warning.
320320 self . tcx . struct_span_lint_hir ( UNUSED_ATTRIBUTES , hir_id, attr. span , |lint| {
321321 lint. build ( "attribute should be applied to a function" )
322322 . warn (
323323 "this was previously accepted by the compiler but is \
324- being phased out; it will become a hard error in \
325- a future release!",
324+ being phased out; it will become a hard error in \
325+ a future release!",
326326 )
327327 . span_label ( * span, "not a function" )
328328 . emit ( ) ;
@@ -343,8 +343,8 @@ impl CheckAttrVisitor<'tcx> {
343343 lint. build ( "attribute should be applied to a foreign function or static" ) ;
344344 diag. warn (
345345 "this was previously accepted by the compiler but is \
346- being phased out; it will become a hard error in \
347- a future release!",
346+ being phased out; it will become a hard error in \
347+ a future release!",
348348 ) ;
349349
350350 // See issue #47725
@@ -409,8 +409,8 @@ impl CheckAttrVisitor<'tcx> {
409409 lint. build ( "attribute should be applied to a function or static" )
410410 . warn (
411411 "this was previously accepted by the compiler but is \
412- being phased out; it will become a hard error in \
413- a future release!",
412+ being phased out; it will become a hard error in \
413+ a future release!",
414414 )
415415 . span_label ( * span, "not a function or static" )
416416 . emit ( ) ;
0 commit comments