1- error: `#[inline]` attribute cannot be used on function params
1+ error: `#[inline]` attribute cannot be used on const parameters
22 --> $DIR/invalid-attributes-on-const-params-78957.rs:6:16
33 |
44LL | pub struct Foo<#[inline] const N: usize>;
55 | ^^^^^^^^^
66 |
77 = help: `#[inline]` can only be applied to functions
88
9- error: `#[inline]` attribute cannot be used on function params
9+ error: `#[inline]` attribute cannot be used on lifetime parameters
1010 --> $DIR/invalid-attributes-on-const-params-78957.rs:14:17
1111 |
1212LL | pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>);
1313 | ^^^^^^^^^
1414 |
1515 = help: `#[inline]` can only be applied to functions
1616
17- error: `#[inline]` attribute cannot be used on function params
17+ error: `#[inline]` attribute cannot be used on type parameters
1818 --> $DIR/invalid-attributes-on-const-params-78957.rs:22:17
1919 |
2020LL | pub struct Foo3<#[inline] T>(PhantomData<T>);
@@ -40,7 +40,7 @@ error[E0517]: attribute should be applied to a struct, enum, or union
4040LL | pub struct Baz3<#[repr(C)] T>(PhantomData<T>);
4141 | ^ - not a struct, enum, or union
4242
43- error: `#[cold]` attribute cannot be used on function params
43+ error: `#[cold]` attribute cannot be used on const parameters
4444 --> $DIR/invalid-attributes-on-const-params-78957.rs:8:16
4545 |
4646LL | pub struct Bar<#[cold] const N: usize>;
@@ -54,7 +54,7 @@ note: the lint level is defined here
5454LL | #![deny(unused_attributes)]
5555 | ^^^^^^^^^^^^^^^^^
5656
57- error: `#[cold]` attribute cannot be used on function params
57+ error: `#[cold]` attribute cannot be used on lifetime parameters
5858 --> $DIR/invalid-attributes-on-const-params-78957.rs:16:17
5959 |
6060LL | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>);
@@ -63,7 +63,7 @@ LL | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>);
6363 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
6464 = help: `#[cold]` can only be applied to functions
6565
66- error: `#[cold]` attribute cannot be used on function params
66+ error: `#[cold]` attribute cannot be used on type parameters
6767 --> $DIR/invalid-attributes-on-const-params-78957.rs:24:17
6868 |
6969LL | pub struct Bar3<#[cold] T>(PhantomData<T>);
0 commit comments