Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #126949

Closed

Conversation

compiler-errors
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

eggyal and others added 20 commits June 12, 2024 13:01
Whilst incorrect implementations of this trait can cause miscompilation,
they cannot cause memory unsafety in rustc.
It currently goes one token too far.

Example: line 259 of `tests/ui/abi/compatibility.rs`:
```
test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32);
```
This commit changes the span for the second element from `fn(),` to
`fn()`, i.e. removes the extraneous comma.

This doesn't affect any tests. I found it while debugging some other
code. Not a big deal but an easy fix so I figure it worth doing.
Added an associated `const THIS_IMPLEMENTATION_HAS_BEEN_TRIPLE_CHECKED`
to the `StableOrd` trait to ensure that implementors carefully consider
whether the trait's contract is upheld, as incorrect implementations can
cause miscompilations.
Account for `for` lifetimes when constructing closure to see if dereferencing the return value would be valid.

Fix rust-lang#125634, fix rust-lang#124563.
…elwoerister

Un-unsafe the `StableOrd` trait

Whilst incorrect implementations of this trait can cause miscompilation, they cannot cause memory unsafety in rustc.

[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Policy.20of.20.60unsafe.60.20within.20the.20compiler).

cc [MCP 533](rust-lang/compiler-team#533), rust-lang#105175, `@michaelwoerister`

r? `@Nilstrieb`
…nkfelix

Mark assoc tys live only if the corresponding trait is live

r? ```@pnkfelix```
…pan, r=compiler-errors

Fix a span in `parse_ty_bare_fn`.

It currently goes one token too far.

Example: line 259 of `tests/ui/abi/compatibility.rs`:
```
test_abi_compatible!(fn_fn, fn(), fn(i32) -> i32);
```
This commit changes the span for the second element from `fn(),` to `fn()`, i.e. removes the extraneous comma.

This doesn't affect any tests. I found it while debugging some other code. Not a big deal but an easy fix so I figure it worth doing.

r? `@spastorino`
Deny `use<>` for RPITITs

Precise capturing `use<>` syntax is currently a no-op on RPITITs, since GATs have no variance, so all captured lifetimes are captured invariantly.

We don't currently *need* to support `use<>` on RPITITs, since `use<>` is initially intended for migrating RPIT *overcaptures* from edition 2021->2024, but since RPITITs currently capture all in-scope lifetimes, we'll never need to write `use<>` on an RPITIT.

Eventually, though, it would be desirable to support precise capturing on RPITITs, since RPITITs overcapturing by default can be annoying to some folks. But let's separate that (which will likely require some delicate types team work for adding variances to GATs and adjusting the refinement rules) from the stabilization of the feature for edition 2024.

r? oli-obk cc `@traviscross`

Tracking:

- rust-lang#123432
not use offset when there is not ends with brace

Fixes rust-lang#126764
Do not ICE when suggesting dereferencing closure arg

Account for `for` lifetimes when constructing closure to see if dereferencing the return value would be valid.

Fix rust-lang#125634, fix rust-lang#124563.
…r-errors

Don't suggest awaiting in closure patterns

Fixes rust-lang#126903.

For
```rust
async fn do_async() {}

fn main() {
    Some(do_async()).map(|()| {});
}
```
the error is now
```rust
error[E0308]: mismatched types
 --> src/main.rs:4:27
  |
4 |     Some(do_async()).map(|()| {});
  |                           ^^
  |                           |
  |                           expected future, found `()`
  |                           expected due to this
  |
  = note: expected opaque type `impl Future<Output = ()>`
               found unit type `()`
```

Ideally, if `main` were to be `async`, it should be
```rs
error[E0308]: mismatched types
 --> src/main.rs:4:27
  |
4 |     Some(do_async()).map(|()| {});
  |                           ^^
  |                           |
  |                           expected future, found `()`
  |                           expected due to this
  |
  = note: expected opaque type `impl Future<Output = ()>`
               found unit type `()`
help: consider `await`ing on the `Future`
  |
4 |     Some(do_async().await).map(|()| {});
  |                    ++++++
```
However, this would mean `FnCtx::check_pat_top` would have to be called with an `origin_expr` in `rustc_hir_typeck::check::check_fn`, and that expr would have to be somehow plumbed through `FnCtxt::check_expr_closure` and closure signature deduction. I'm willing to work on the plumbing but unsure how to start.
…specify-linker, r=Kobzol

Specify target specific linker for `riscv64gc-gnu` job

In rust-lang#125669 I updated the `riscv64gc-gnu` job to be more in line with other jobs, like the `armhf-gnu` one.

I missed something important, though! Since the `riscv64gc-unknown-linux-gnu` builds go through a cross compiler, invoking `cc` is not correct! That would invoke the `x86_64-unknown-linux-gnu` linker, instead of the `riscv64gc-unknown-linux-gnu` linker.

While developing rust-lang#125669 I assumed this line would have been sufficient, however it was not:

https://github.com/rust-lang/rust/blob/553a69030e5a086eb3841d020db8c9c463948c72/src/ci/docker/host-x86_64/disabled/riscv64gc-gnu/Dockerfile#L27-L28

Unfortunately, without the linker set, `cc` is invoked, and the following linker error occurs:

<details>

<summary>Long output</summary>

```
2024-06-21T14:37:54.4786899Z === HAYSTACK ===
2024-06-21T14:37:54.4787240Z error: linking with `cc` failed: exit status: 1
2024-06-21T14:37:54.4787589Z   |
2024-06-21T14:37:54.4806781Z   = note: LC_ALL="C" PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "/tmp/rustc7Ju6va/symbols.o" "inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o" "inaccessible/tmp/program.dv9uftjrq86w5xa7l2eo7g9l7.rcgu.o" "-Wl,--as-needed" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/inaccessible-temp-dir/inaccessible-temp-dir/rmake_out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libstd-bb9ed017b7d70437.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libpanic_unwind-5b34ef68c22a7b9b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libobject-4b9224407e296f51.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libmemchr-1eaaa8d74bbe0b36.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libaddr2line-b34292f7086867e9.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libgimli-1927540c5dff6690.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/librustc_demangle-ab493befe3742702.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libstd_detect-41195694489636c4.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libhashbrown-6905da49c8a1542a.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/librustc_std_workspace_alloc-bbc6290f03f92349.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libminiz_oxide-7a4683d4a82cf47c.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libadler-071583516cdbce90.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libunwind-d84b176d2f4c1334.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libcfg_if-92b7de0160f87442.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/liblibc-cff1533ea7c26263.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/liballoc-49e374c13f9e6132.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/librustc_std_workspace_core-9389dcc15b2f7f7b.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libcore-46f0fa14905fdc5c.rlib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib/libcompiler_builtins-20e1af401f90cd1c.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/riscv64gc-unknown-linux-gnu/lib" "-o" "program" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
2024-06-21T14:37:54.4823900Z   = note: /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4825032Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4826130Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4827200Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4828279Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4829365Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4830474Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4831554Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4833002Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4834116Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: Relocations in generic ELF (EM: 243)
2024-06-21T14:37:54.4835237Z           /usr/bin/ld: inaccessible/tmp/program.program.45572bc5f2b14090-cgu.0.rcgu.o: error adding symbols: file in wrong format
2024-06-21T14:37:54.4835971Z           collect2: error: ld returned 1 exit status
2024-06-21T14:37:54.4836449Z
2024-06-21T14:37:54.4836584Z
2024-06-21T14:37:54.4836744Z error: aborting due to 1 previous error
2024-06-21T14:37:54.4836983Z
2024-06-21T14:37:54.4836990Z
2024-06-21T14:37:54.4837083Z === NEEDLE ===
2024-06-21T14:37:54.4837518Z failed to find or create the directory specified by `--temps-dir`
2024-06-21T14:37:54.4838250Z thread 'main' panicked at /checkout/tests/run-make/inaccessible-temp-dir/rmake.rs:35:14:
2024-06-21T14:37:54.4838801Z needle was not found in haystack
2024-06-21T14:37:54.4839270Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2024-06-21T14:37:54.4840125Z thread 'main' panicked at /checkout/tests/run-make/inaccessible-temp-dir/rmake.rs:27:5:
2024-06-21T14:37:54.4840759Z called `Result::unwrap()` on an `Err` value: Any { .. }
2024-06-21T14:37:54.4841194Z ------------------------------------------
```

</details>

By setting `--set target.riscv64gc-unknown-linux-gnu.linker=riscv64-linux-gnu-gcc` the correct linker is invoked.

## Testing

> [!NOTE]
> `riscv64gc-unknown-linux-gnu` is a [**Tier 2 with Host Tools** platform](https://doc.rust-lang.org/beta/rustc/platform-support.html), all tests may not necessarily pass! This change should only make fix existing broken tests (like `inaccessible-temp-dir`) while introducing no new breakage.

You can test out the job locally:

```sh
mv src/ci/docker/host-x86_64/disabled/riscv64gc-gnu src/ci/docker/host-x86_64/riscv64gc-gnu
DEPLOY=1 ./src/ci/docker/run.sh riscv64gc-gnu
```
…ieril

Tweak a confusing comment in `create_match_candidates`

This comment was accurate at the time it was written, but various later changes reshuffled things in ways that caused the existing comment to become confusing.

I've therefore tried to clarify that *these* candidates are 1:1 with match arms, while also warning that that isn't the case in general.
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jun 25, 2024
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jun 25, 2024

📌 Commit a765000 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 25, 2024
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 46)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 49)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 61)
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---
diff of stderr:

26   --> $DIR/safe-outside-extern.rs:24:14
27    |
28 LL | type FnPtr = safe fn(i32, i32) -> i32;
+    |              ^^^^^^^^^^^^^^^^^^^^^^^^
30 
31 error: aborting due to 5 previous errors
32 
32 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.gated/safe-outside-extern.gated.stderr
To only update this specific test, also pass `--test-args rust-2024/safe-outside-extern.rs`

error in revision `gated`: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rust-2024/safe-outside-extern.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "gated" "--check-cfg" "cfg(FALSE,gated,ungated)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.gated" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.gated/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe fn foo() {}
   | ^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe static FOO: i32 = 1;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo();
   |     ^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo() {}
   |     ^^^^^^^^^^^^^^^^


error: function pointers cannot be declared with `safe` safety qualifier
   |
   |
LL | type FnPtr = safe fn(i32, i32) -> i32;

error: aborting due to 5 previous errors
------------------------------------------



---- [ui] tests/ui/rust-2024/safe-outside-extern.rs#ungated stdout ----
diff of stderr:

26   --> $DIR/safe-outside-extern.rs:24:14
27    |
28 LL | type FnPtr = safe fn(i32, i32) -> i32;
+    |              ^^^^^^^^^^^^^^^^^^^^^^^^
30 
30 
31 error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.ungated/safe-outside-extern.ungated.stderr
To only update this specific test, also pass `--test-args rust-2024/safe-outside-extern.rs`

error in revision `ungated`: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/rust-2024/safe-outside-extern.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--cfg" "ungated" "--check-cfg" "cfg(FALSE,gated,ungated)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.ungated" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.ungated/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe fn foo() {}
   | ^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe static FOO: i32 = 1;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo();
   |     ^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo() {}
   |     ^^^^^^^^^^^^^^^^


error: function pointers cannot be declared with `safe` safety qualifier
   |
   |
LL | type FnPtr = safe fn(i32, i32) -> i32;


error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL | safe fn foo() {}
   | ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL | safe static FOO: i32 = 1;
   | ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL |     safe fn foo();
   |     ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL |     safe fn foo() {}
   |     ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
   |
LL | type FnPtr = safe fn(i32, i32) -> i32;
   |
   = 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
   = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 10 previous errors

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

@bors
Copy link
Contributor

bors commented Jun 25, 2024

⌛ Testing commit a765000 with merge 7716d1a...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 25, 2024
…mpiler-errors

Rollup of 9 pull requests

Successful merges:

 - rust-lang#126326 (Un-unsafe the `StableOrd` trait)
 - rust-lang#126618 (Mark assoc tys live only if the corresponding trait is live)
 - rust-lang#126724 (Fix a span in `parse_ty_bare_fn`.)
 - rust-lang#126746 (Deny `use<>` for RPITITs)
 - rust-lang#126868 (not use offset when there is not ends with brace)
 - rust-lang#126884 (Do not ICE when suggesting dereferencing closure arg)
 - rust-lang#126915 (Don't suggest awaiting in closure patterns)
 - rust-lang#126916 (Specify target specific linker for `riscv64gc-gnu` job)
 - rust-lang#126926 (Tweak a confusing comment in `create_match_candidates`)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
diff of stderr:

26   --> $DIR/safe-outside-extern.rs:24:14
27    |
28 LL | type FnPtr = safe fn(i32, i32) -> i32;
+    |              ^^^^^^^^^^^^^^^^^^^^^^^^
30 
31 error: aborting due to 5 previous errors
32 
32 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.gated/safe-outside-extern.gated.stderr
To only update this specific test, also pass `--test-args rust-2024/safe-outside-extern.rs`

error in revision `gated`: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/rust-2024/safe-outside-extern.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--cfg" "gated" "--check-cfg" "cfg(FALSE,gated,ungated)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.gated" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.gated/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe fn foo() {}
   | ^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe static FOO: i32 = 1;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo();
   |     ^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo() {}
   |     ^^^^^^^^^^^^^^^^


error: function pointers cannot be declared with `safe` safety qualifier
   |
   |
LL | type FnPtr = safe fn(i32, i32) -> i32;

error: aborting due to 5 previous errors
------------------------------------------



---- [ui] tests/ui/rust-2024/safe-outside-extern.rs#ungated stdout ----
diff of stderr:

26   --> $DIR/safe-outside-extern.rs:24:14
27    |
28 LL | type FnPtr = safe fn(i32, i32) -> i32;
+    |              ^^^^^^^^^^^^^^^^^^^^^^^^
30 
30 
31 error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.ungated/safe-outside-extern.ungated.stderr
To only update this specific test, also pass `--test-args rust-2024/safe-outside-extern.rs`

error in revision `ungated`: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/rust-2024/safe-outside-extern.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--cfg" "ungated" "--check-cfg" "cfg(FALSE,gated,ungated)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.ungated" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rust-2024/safe-outside-extern.ungated/auxiliary"
--- stderr -------------------------------
--- stderr -------------------------------
error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe fn foo() {}
   | ^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL | safe static FOO: i32 = 1;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo();
   |     ^^^^^^^^^^^^^^


error: items outside of `unsafe extern { }` cannot be declared with `safe` safety qualifier
   |
LL |     safe fn foo() {}
   |     ^^^^^^^^^^^^^^^^


error: function pointers cannot be declared with `safe` safety qualifier
   |
   |
LL | type FnPtr = safe fn(i32, i32) -> i32;


error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL | safe fn foo() {}
   | ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL | safe static FOO: i32 = 1;
   | ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL |     safe fn foo();
   |     ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
LL |     safe fn foo() {}
   |     ^^^^
   |
   |
   = 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
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental
   |
   |
LL | type FnPtr = safe fn(i32, i32) -> i32;
   |
   = 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
   = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error: aborting due to 10 previous errors

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

@bors
Copy link
Contributor

bors commented Jun 25, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.