fix bugs in inline/force_inline and diagnostics of all attr parsers

This commit is contained in:
Jana Dönszelmann 2025-03-04 14:17:06 +01:00
parent 566f691374
commit ee976bbbca
No known key found for this signature in database
34 changed files with 600 additions and 270 deletions

View file

@ -1,12 +1,3 @@
error[E0518]: attribute should be applied to function or closure
--> $DIR/multiple-invalid.rs:4:1
|
LL | #[inline]
| ^^^^^^^^^
...
LL | const FOO: u8 = 0;
| ------------------ not a function or closure
error: attribute should be applied to a function definition
--> $DIR/multiple-invalid.rs:6:1
|
@ -16,6 +7,15 @@ LL |
LL | const FOO: u8 = 0;
| ------------------ not a function definition
error[E0518]: attribute should be applied to function or closure
--> $DIR/multiple-invalid.rs:4:1
|
LL | #[inline]
| ^^^^^^^^^
...
LL | const FOO: u8 = 0;
| ------------------ not a function or closure
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0518`.

View file

@ -1,4 +1,4 @@
#[inline()] //~ ERROR E0534
#[inline()] //~ ERROR malformed `inline` attribute input
pub fn something() {}
fn main() {

View file

@ -1,9 +1,22 @@
error[E0534]: expected one argument
error[E0539]: malformed `inline` attribute input
--> $DIR/E0534.rs:1:1
|
LL | #[inline()]
| ^^^^^^^^^^^
|
note: expected a single argument here
--> $DIR/E0534.rs:1:9
|
LL | #[inline()]
| ^^
help: the following are possible correct uses
|
LL | #[inline(always|never)]
| ++++++++++++
LL - #[inline()]
LL + #[inline]
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0534`.
For more information about this error, try `rustc --explain E0539`.

View file

@ -8,7 +8,7 @@ LL | #![rustc_main]
= note: the `#[rustc_main]` attribute is an internal implementation detail that will never be stable
= note: the `#[rustc_main]` attribute is used internally to specify test entry point function
error: valid forms for the attribute are `#[inline]` and `#[inline(always|never)]`
error: valid forms for the attribute are `#[inline(always|never)]` and `#[inline]`
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:46:5
|
LL | #[inline = "2100"] fn f() { }

View file

@ -9,7 +9,6 @@
// Test that invalid force inlining attributes error as expected.
#[rustc_force_inline("foo")]
//~^ ERROR malformed `rustc_force_inline` attribute input
pub fn forced1() {
}

View file

@ -1,71 +1,80 @@
error: malformed `rustc_force_inline` attribute input
--> $DIR/invalid.rs:11:1
|
LL | #[rustc_force_inline("foo")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[rustc_force_inline("foo")]
LL + #[rustc_force_inline = "reason"]
|
LL - #[rustc_force_inline("foo")]
LL + #[rustc_force_inline]
|
error: malformed `rustc_force_inline` attribute input
--> $DIR/invalid.rs:16:1
|
LL | #[rustc_force_inline(bar, baz)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[rustc_force_inline(bar, baz)]
LL + #[rustc_force_inline = "reason"]
|
LL - #[rustc_force_inline(bar, baz)]
LL + #[rustc_force_inline]
|
error: malformed `rustc_force_inline` attribute input
--> $DIR/invalid.rs:21:1
|
LL | #[rustc_force_inline(2)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[rustc_force_inline(2)]
LL + #[rustc_force_inline = "reason"]
|
LL - #[rustc_force_inline(2)]
LL + #[rustc_force_inline]
|
error: malformed `rustc_force_inline` attribute input
--> $DIR/invalid.rs:26:1
|
LL | #[rustc_force_inline = 2]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[rustc_force_inline = 2]
LL + #[rustc_force_inline = "reason"]
|
LL - #[rustc_force_inline = 2]
LL + #[rustc_force_inline]
|
error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters
--> $DIR/invalid.rs:133:11
--> $DIR/invalid.rs:132:11
|
LL | fn barqux(#[rustc_force_inline] _x: u32) {}
| ^^^^^^^^^^^^^^^^^^^^^
error[E0539]: malformed `rustc_force_inline` attribute input
--> $DIR/invalid.rs:15:1
|
LL | #[rustc_force_inline(bar, baz)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: expected a single argument here
--> $DIR/invalid.rs:15:21
|
LL | #[rustc_force_inline(bar, baz)]
| ^^^^^^^^^^
help: the following are possible correct uses
|
LL - #[rustc_force_inline(bar, baz)]
LL + #[rustc_force_inline = "reason"]
|
LL - #[rustc_force_inline(bar, baz)]
LL + #[rustc_force_inline(reason)]
|
LL - #[rustc_force_inline(bar, baz)]
LL + #[rustc_force_inline]
|
error[E0539]: malformed `rustc_force_inline` attribute input
--> $DIR/invalid.rs:20:1
|
LL | #[rustc_force_inline(2)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
note: expected a string literal here
--> $DIR/invalid.rs:20:22
|
LL | #[rustc_force_inline(2)]
| ^
help: the following are possible correct uses
|
LL - #[rustc_force_inline(2)]
LL + #[rustc_force_inline = "reason"]
|
LL - #[rustc_force_inline(2)]
LL + #[rustc_force_inline(reason)]
|
LL - #[rustc_force_inline(2)]
LL + #[rustc_force_inline]
|
error[E0539]: malformed `rustc_force_inline` attribute input
--> $DIR/invalid.rs:25:1
|
LL | #[rustc_force_inline = 2]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: expected a string literal here
--> $DIR/invalid.rs:25:24
|
LL | #[rustc_force_inline = 2]
| ^
help: the following are possible correct uses
|
LL - #[rustc_force_inline = 2]
LL + #[rustc_force_inline = "reason"]
|
LL - #[rustc_force_inline = 2]
LL + #[rustc_force_inline(reason)]
|
LL - #[rustc_force_inline = 2]
LL + #[rustc_force_inline]
|
error: attribute should be applied to a function
--> $DIR/invalid.rs:31:1
--> $DIR/invalid.rs:30:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -74,7 +83,7 @@ LL | extern crate std as other_std;
| ------------------------------ not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:35:1
--> $DIR/invalid.rs:34:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -83,7 +92,7 @@ LL | use std::collections::HashMap;
| ------------------------------ not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:39:1
--> $DIR/invalid.rs:38:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -92,7 +101,7 @@ LL | static _FOO: &'static str = "FOO";
| ---------------------------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:43:1
--> $DIR/invalid.rs:42:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -101,7 +110,7 @@ LL | const _BAR: u32 = 3;
| -------------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:47:1
--> $DIR/invalid.rs:46:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -110,7 +119,7 @@ LL | mod foo { }
| ----------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:51:1
--> $DIR/invalid.rs:50:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -125,7 +134,7 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:67:1
--> $DIR/invalid.rs:66:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -134,7 +143,7 @@ LL | type Foo = u32;
| --------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:71:1
--> $DIR/invalid.rs:70:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -147,13 +156,13 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:73:10
--> $DIR/invalid.rs:72:10
|
LL | enum Bar<#[rustc_force_inline] T> {
| ^^^^^^^^^^^^^^^^^^^^^ - not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:75:5
--> $DIR/invalid.rs:74:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -162,7 +171,7 @@ LL | Baz(std::marker::PhantomData<T>),
| -------------------------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:80:1
--> $DIR/invalid.rs:79:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -175,7 +184,7 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:83:5
--> $DIR/invalid.rs:82:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -184,7 +193,7 @@ LL | field: u32,
| ---------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:88:1
--> $DIR/invalid.rs:87:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -196,7 +205,7 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:95:1
--> $DIR/invalid.rs:94:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -211,7 +220,7 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:110:1
--> $DIR/invalid.rs:109:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -220,7 +229,7 @@ LL | trait FooQux = FooBaz;
| ---------------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:114:1
--> $DIR/invalid.rs:113:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -233,7 +242,7 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:122:1
--> $DIR/invalid.rs:121:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -245,7 +254,7 @@ LL | | }
| |_- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:129:1
--> $DIR/invalid.rs:128:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -254,7 +263,7 @@ LL | macro_rules! barqux { ($foo:tt) => { $foo }; }
| ---------------------------------------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:133:11
--> $DIR/invalid.rs:132:11
|
LL | fn barqux(#[rustc_force_inline] _x: u32) {}
| ^^^^^^^^^^^^^^^^^^^^^--------
@ -262,7 +271,7 @@ LL | fn barqux(#[rustc_force_inline] _x: u32) {}
| not a function definition
error: attribute cannot be applied to a `async`, `gen` or `async gen` function
--> $DIR/invalid.rs:137:1
--> $DIR/invalid.rs:136:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -271,7 +280,7 @@ LL | async fn async_foo() {}
| -------------------- `async`, `gen` or `async gen` function
error: attribute cannot be applied to a `async`, `gen` or `async gen` function
--> $DIR/invalid.rs:141:1
--> $DIR/invalid.rs:140:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -280,7 +289,7 @@ LL | gen fn gen_foo() {}
| ---------------- `async`, `gen` or `async gen` function
error: attribute cannot be applied to a `async`, `gen` or `async gen` function
--> $DIR/invalid.rs:145:1
--> $DIR/invalid.rs:144:1
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -289,19 +298,19 @@ LL | async gen fn async_gen_foo() {}
| ---------------------------- `async`, `gen` or `async gen` function
error: attribute should be applied to a function
--> $DIR/invalid.rs:150:14
--> $DIR/invalid.rs:149:14
|
LL | let _x = #[rustc_force_inline] || { };
| ^^^^^^^^^^^^^^^^^^^^^ ------ not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:152:14
--> $DIR/invalid.rs:151:14
|
LL | let _y = #[rustc_force_inline] 3 + 4;
| ^^^^^^^^^^^^^^^^^^^^^ - not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:154:5
--> $DIR/invalid.rs:153:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -310,7 +319,7 @@ LL | let _z = 3;
| ----------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:159:9
--> $DIR/invalid.rs:158:9
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -319,7 +328,7 @@ LL | 1 => (),
| ------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:98:5
--> $DIR/invalid.rs:97:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -328,7 +337,7 @@ LL | type Foo;
| --------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:101:5
--> $DIR/invalid.rs:100:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -337,7 +346,7 @@ LL | const Bar: i32;
| --------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:105:5
--> $DIR/invalid.rs:104:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -346,7 +355,7 @@ LL | fn foo() {}
| ----------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:117:5
--> $DIR/invalid.rs:116:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -355,7 +364,7 @@ LL | fn foo() {}
| ----------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:54:5
--> $DIR/invalid.rs:53:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -364,7 +373,7 @@ LL | static X: &'static u32;
| ----------------------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:58:5
--> $DIR/invalid.rs:57:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -373,7 +382,7 @@ LL | type Y;
| ------- not a function definition
error: attribute should be applied to a function
--> $DIR/invalid.rs:62:5
--> $DIR/invalid.rs:61:5
|
LL | #[rustc_force_inline]
| ^^^^^^^^^^^^^^^^^^^^^
@ -381,5 +390,6 @@ LL |
LL | fn foo();
| --------- not a function definition
error: aborting due to 38 previous errors
error: aborting due to 37 previous errors
For more information about this error, try `rustc --explain E0539`.

View file

@ -1,10 +1,10 @@
#![allow(dead_code)]
#[inline(please,no)] //~ ERROR expected one argument
#[inline(please,no)] //~ ERROR malformed `inline` attribute
fn a() {
}
#[inline()] //~ ERROR expected one argument
#[inline()] //~ ERROR malformed `inline` attribute
fn b() {
}

View file

@ -1,15 +1,42 @@
error[E0534]: expected one argument
error[E0539]: malformed `inline` attribute input
--> $DIR/invalid-inline.rs:3:1
|
LL | #[inline(please,no)]
| ^^^^^^^^^^^^^^^^^^^^
|
note: expected a single argument here
--> $DIR/invalid-inline.rs:3:9
|
LL | #[inline(please,no)]
| ^^^^^^^^^^^
help: the following are possible correct uses
|
LL - #[inline(please,no)]
LL + #[inline(always|never)]
|
LL - #[inline(please,no)]
LL + #[inline]
|
error[E0534]: expected one argument
error[E0539]: malformed `inline` attribute input
--> $DIR/invalid-inline.rs:7:1
|
LL | #[inline()]
| ^^^^^^^^^^^
|
note: expected a single argument here
--> $DIR/invalid-inline.rs:7:9
|
LL | #[inline()]
| ^^
help: the following are possible correct uses
|
LL | #[inline(always|never)]
| ++++++++++++
LL - #[inline()]
LL + #[inline]
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0534`.
For more information about this error, try `rustc --explain E0539`.

View file

@ -9,7 +9,7 @@ fn main() {
#[inline(XYZ)]
let _b = 4;
//~^^ ERROR attribute should be applied to function or closure
//~^^ ERROR malformed `inline` attribute
#[repr(nothing)]
let _x = 0;
@ -29,7 +29,7 @@ fn main() {
#[inline(ABC)]
foo();
//~^^ ERROR attribute should be applied to function or closure
//~^^ ERROR malformed `inline` attribute
let _z = #[repr] 1;
//~^ ERROR malformed `repr` attribute

View file

@ -10,6 +10,26 @@ error: malformed `repr` attribute input
LL | let _z = #[repr] 1;
| ^^^^^^^ help: must be of the form: `#[repr(C)]`
error[E0539]: malformed `inline` attribute input
--> $DIR/issue-43988.rs:10:5
|
LL | #[inline(XYZ)]
| ^^^^^^^^^^^^^^
|
note: valid arguments are `always` or `never`
--> $DIR/issue-43988.rs:10:14
|
LL | #[inline(XYZ)]
| ^^^
help: the following are possible correct uses
|
LL - #[inline(XYZ)]
LL + #[inline(always|never)]
|
LL - #[inline(XYZ)]
LL + #[inline]
|
error[E0552]: unrecognized representation hint
--> $DIR/issue-43988.rs:14:12
|
@ -26,6 +46,26 @@ LL | #[repr(something_not_real)]
|
= help: valid reprs are `Rust` (default), `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
error[E0539]: malformed `inline` attribute input
--> $DIR/issue-43988.rs:30:5
|
LL | #[inline(ABC)]
| ^^^^^^^^^^^^^^
|
note: valid arguments are `always` or `never`
--> $DIR/issue-43988.rs:30:14
|
LL | #[inline(ABC)]
| ^^^
help: the following are possible correct uses
|
LL - #[inline(ABC)]
LL + #[inline(always|never)]
|
LL - #[inline(ABC)]
LL + #[inline]
|
error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43988.rs:5:5
|
@ -34,23 +74,7 @@ LL | #[inline]
LL | let _a = 4;
| ----------- not a function or closure
error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43988.rs:10:5
|
LL | #[inline(XYZ)]
| ^^^^^^^^^^^^^^
LL | let _b = 4;
| ----------- not a function or closure
error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43988.rs:30:5
|
LL | #[inline(ABC)]
| ^^^^^^^^^^^^^^
LL | foo();
| ----- not a function or closure
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0518, E0552.
Some errors have detailed explanations: E0518, E0539, E0552.
For more information about an error, try `rustc --explain E0518`.

View file

@ -1,3 +1,21 @@
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:74:1
|
LL | #[inline(never)]
| ^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:73:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/unused-attr-duplicate.rs:12:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:33:1
|
@ -9,11 +27,6 @@ note: attribute also specified here
|
LL | #[no_link]
| ^^^^^^^^^^
note: the lint level is defined here
--> $DIR/unused-attr-duplicate.rs:12:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:37:1
@ -102,19 +115,6 @@ note: attribute also specified here
LL | #[automatically_derived]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:74:1
|
LL | #[inline(never)]
| ^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:73:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:77:1
|

View file

@ -8,7 +8,7 @@ extern crate std;
// issue#97006
macro_rules! m { ($attr_path: path) => { #[$attr_path] fn f() {} } }
#[inline]
#[attr="Inline(Hint)")]
fn f() { }
fn main() { }

View file

@ -17,15 +17,6 @@ LL | #[ignore()]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: valid forms for the attribute are `#[inline]` and `#[inline(always|never)]`
--> $DIR/malformed-regressions.rs:5:1
|
LL | #[inline = ""]
| ^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated")]`
--> $DIR/malformed-regressions.rs:7:1
|
@ -44,5 +35,14 @@ LL | #[link = ""]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: valid forms for the attribute are `#[inline(always|never)]` and `#[inline]`
--> $DIR/malformed-regressions.rs:5:1
|
LL | #[inline = ""]
| ^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: aborting due to 5 previous errors

View file

@ -1,4 +1,4 @@
#[inline(unknown)] //~ ERROR E0535
#[inline(unknown)] //~ ERROR malformed `inline` attribute
pub fn something() {}
fn main() {

View file

@ -1,11 +1,23 @@
error[E0535]: invalid argument
error[E0539]: malformed `inline` attribute input
--> $DIR/E0535.rs:1:1
|
LL | #[inline(unknown)]
| ^^^^^^^^^^^^^^^^^^
|
note: valid arguments are `always` or `never`
--> $DIR/E0535.rs:1:10
|
LL | #[inline(unknown)]
| ^^^^^^^
help: the following are possible correct uses
|
LL - #[inline(unknown)]
LL + #[inline(always|never)]
|
LL - #[inline(unknown)]
LL + #[inline]
|
= help: valid inline arguments are `always` and `never`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0535`.
For more information about this error, try `rustc --explain E0539`.