Rollup merge of #101904 - Rageking8:fix-101712, r=oli-obk
Add help for invalid inline argument Fixes #101712 Removed 1 part of the test as its identical with another one. Do let me know if this is undesirable, so I can revert those changes.
This commit is contained in:
commit
9f073b0de0
@ -3154,6 +3154,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
|
||||
E0535,
|
||||
"invalid argument"
|
||||
)
|
||||
.help("valid inline arguments are `always` and `never`")
|
||||
.emit();
|
||||
|
||||
InlineAttr::None
|
||||
|
@ -1,19 +1,14 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
#[inline(please_no)] //~ ERROR invalid argument
|
||||
#[inline(please,no)] //~ ERROR expected one argument
|
||||
fn a() {
|
||||
}
|
||||
|
||||
#[inline(please,no)] //~ ERROR expected one argument
|
||||
fn b() {
|
||||
}
|
||||
|
||||
#[inline()] //~ ERROR expected one argument
|
||||
fn c() {
|
||||
fn b() {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
a();
|
||||
b();
|
||||
c();
|
||||
}
|
||||
|
@ -1,22 +1,15 @@
|
||||
error[E0535]: invalid argument
|
||||
--> $DIR/invalid-inline.rs:3:10
|
||||
|
|
||||
LL | #[inline(please_no)]
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0534]: expected one argument
|
||||
--> $DIR/invalid-inline.rs:7:1
|
||||
--> $DIR/invalid-inline.rs:3:1
|
||||
|
|
||||
LL | #[inline(please,no)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0534]: expected one argument
|
||||
--> $DIR/invalid-inline.rs:11:1
|
||||
--> $DIR/invalid-inline.rs:7:1
|
||||
|
|
||||
LL | #[inline()]
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0534, E0535.
|
||||
For more information about an error, try `rustc --explain E0534`.
|
||||
For more information about this error, try `rustc --explain E0534`.
|
||||
|
@ -3,6 +3,8 @@ error[E0535]: invalid argument
|
||||
|
|
||||
LL | #[inline(unknown)]
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: valid inline arguments are `always` and `never`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user