@@ -223,21 +223,29 @@ impl<'a> AstValidator<'a> {
223
223
224
224
fn check_trait_fn_not_async ( & self , fn_span : Span , asyncness : Async ) {
225
225
if let Async :: Yes { span, .. } = asyncness {
226
- struct_span_err ! ( self . session, fn_span, E0706 , "trait fns cannot be declared `async`" )
227
- . span_label ( span, "`async` because of this" )
228
- . note ( "`async` trait functions are not currently supported" )
229
- . note (
230
- "consider using the `async-trait` crate: https://crates.io/crates/async-trait" ,
231
- )
232
- . emit ( ) ;
226
+ struct_span_err ! (
227
+ self . session,
228
+ fn_span,
229
+ E0706 ,
230
+ "functions in traits cannot be declared `async`"
231
+ )
232
+ . span_label ( span, "`async` because of this" )
233
+ . note ( "`async` trait functions are not currently supported" )
234
+ . note ( "consider using the `async-trait` crate: https://crates.io/crates/async-trait" )
235
+ . emit ( ) ;
233
236
}
234
237
}
235
238
236
239
fn check_trait_fn_not_const ( & self , constness : Const ) {
237
240
if let Const :: Yes ( span) = constness {
238
- struct_span_err ! ( self . session, span, E0379 , "trait fns cannot be declared const" )
239
- . span_label ( span, "trait fns cannot be const" )
240
- . emit ( ) ;
241
+ struct_span_err ! (
242
+ self . session,
243
+ span,
244
+ E0379 ,
245
+ "functions in traits cannot be declared const"
246
+ )
247
+ . span_label ( span, "functions in traits cannot be const" )
248
+ . emit ( ) ;
241
249
}
242
250
}
243
251
@@ -513,8 +521,11 @@ impl<'a> AstValidator<'a> {
513
521
for param in & generics. params {
514
522
if let GenericParamKind :: Const { .. } = param. kind {
515
523
self . err_handler ( )
516
- . struct_span_err ( span, "const parameters are not permitted in `const fn`" )
517
- . span_label ( const_span, "`const fn` because of this" )
524
+ . struct_span_err (
525
+ span,
526
+ "const parameters are not permitted in const functions" ,
527
+ )
528
+ . span_label ( const_span, "`const` because of this" )
518
529
. emit ( ) ;
519
530
}
520
531
}
0 commit comments