add error message when #[naked]
is used with #[test]
This commit is contained in:
parent
7e6c083873
commit
4d082b77af
7 changed files with 112 additions and 0 deletions
14
compiler/rustc_error_codes/src/error_codes/E0798.md
Normal file
14
compiler/rustc_error_codes/src/error_codes/E0798.md
Normal file
|
@ -0,0 +1,14 @@
|
|||
Testing attributes cannot be applied to functions marked with `#[naked]`.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```ignore (requires test runner)
|
||||
#[test]
|
||||
#[should_panic]
|
||||
#[naked]
|
||||
fn foo() {}
|
||||
```
|
||||
|
||||
See [the reference page for testing attributes] for more information.
|
||||
|
||||
[the reference page for testing attributes]: https://doc.rust-lang.org/reference/attributes/testing.html
|
|
@ -536,6 +536,7 @@ E0794: 0794,
|
|||
E0795: 0795,
|
||||
E0796: 0796,
|
||||
E0797: 0797,
|
||||
E0798: 0798,
|
||||
);
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue