diff options
| author | Folkert <folkert@folkertdev.nl> | 2024-07-17 00:03:33 +0200 |
|---|---|---|
| committer | Folkert <folkert@folkertdev.nl> | 2024-07-17 00:04:00 +0200 |
| commit | 4d082b77af1f714df6c407785e1961a9dddd554c (patch) | |
| tree | c73cb2325d16e38d91e13de25cd951574242d56f /compiler/rustc_error_codes/src | |
| parent | 7e6c083873b7b98aa52d47896107af11560aeaf5 (diff) | |
| download | rust-4d082b77af1f714df6c407785e1961a9dddd554c.tar.gz rust-4d082b77af1f714df6c407785e1961a9dddd554c.zip | |
add error message when `#[naked]` is used with `#[test]`
Diffstat (limited to 'compiler/rustc_error_codes/src')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0798.md | 14 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/lib.rs | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0798.md b/compiler/rustc_error_codes/src/error_codes/E0798.md new file mode 100644 index 00000000000..96f25eb4f0e --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0798.md @@ -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 diff --git a/compiler/rustc_error_codes/src/lib.rs b/compiler/rustc_error_codes/src/lib.rs index d13d5e1bca2..2a7bc2501c0 100644 --- a/compiler/rustc_error_codes/src/lib.rs +++ b/compiler/rustc_error_codes/src/lib.rs @@ -536,6 +536,7 @@ E0794: 0794, E0795: 0795, E0796: 0796, E0797: 0797, +E0798: 0798, ); ) } |
