rust/tests
Matthias Krüger 77152955b8
Rollup merge of #127106 - spastorino:improve-unsafe-extern-blocks-diagnostics, r=compiler-errors
Improve unsafe extern blocks diagnostics

Closes #126327

For this code:

```rust
extern {
    pub fn foo();
    pub safe fn bar();
}
```

We get ...

```
error: items in unadorned `extern` blocks cannot have safety qualifiers
 --> test.rs:3:5
  |
3 |     pub safe fn bar();
  |     ^^^^^^^^^^^^^^^^^^
  |
help: add unsafe to this `extern` block
  |
1 | unsafe extern {
  | ++++++

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
 --> test.rs:3:9
  |
3 |     pub safe fn bar();
  |         ^^^^
  |
  = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
  = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
```

And then making the extern block unsafe, we get ...

```
error: extern block cannot be declared unsafe
 --> test.rs:1:1
  |
1 | unsafe extern {
  | ^^^^^^
  |
  = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
  = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable

error: items in unadorned `extern` blocks cannot have safety qualifiers
 --> test.rs:3:5
  |
3 |     pub safe fn bar();
  |     ^^^^^^^^^^^^^^^^^^

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
 --> test.rs:3:9
  |
3 |     pub safe fn bar();
  |         ^^^^
  |
  = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information
  = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.
```

r? ``@compiler-errors``
2024-06-29 22:10:57 +02:00
..
assembly
auxiliary
codegen Updated code for changes to RFC, added additional error handling, added 2024-06-25 19:00:02 +02:00
codegen-units
coverage Rollup merge of #126956 - joboet:fmt_no_extern_ty, r=RalfJung 2024-06-28 08:34:08 +02:00
coverage-run-rustdoc
crashes Do not ICE when suggesting dereferencing closure arg 2024-06-24 03:39:54 +00:00
debuginfo
incremental
mir-opt Rollup merge of #126835 - Nadrieril:reify-decision-tree, r=matthewjasper 2024-06-29 09:14:56 +02:00
pretty
run-make Rollup merge of #127081 - Kobzol:lld-test, r=onur-ozkan 2024-06-29 22:10:57 +02:00
run-pass-valgrind
rustdoc Update tests/rustdoc to new test syntax 2024-06-24 11:08:41 +02:00
rustdoc-gui Update browser-ui-test version to 0.18.0 2024-06-27 00:04:23 +02:00
rustdoc-js
rustdoc-js-std
rustdoc-json
rustdoc-ui Rollup merge of #127016 - bvanjoi:fix-126986, r=GuillaumeGomez 2024-06-28 22:04:16 +02:00
ui Rollup merge of #127106 - spastorino:improve-unsafe-extern-blocks-diagnostics, r=compiler-errors 2024-06-29 22:10:57 +02:00
ui-fulldeps Add method to get all attributes on a definition 2024-06-28 13:24:41 +08:00
COMPILER_TESTS.md