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 10 pull requests #119611

Closed
wants to merge 36 commits into from

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

fmease and others added 30 commits December 28, 2023 00:43
It prevents a full rebuild of stage 1 compiler when issuing "x.py test"
with rust.lto != thin-local in config.toml.
`Diagnostic` has 40 methods that return `&mut Self` and could be
considered setters. Four of them have a `set_` prefix. This doesn't seem
necessary for a type that implements the builder pattern. This commit
removes the `set_` prefixes on those four methods.
It's not used, and doesn't quite fit the general pattern.

Also, `Diagnostic::downgrade_to_delayed_bug` doesn't need to return
`&mut Self` for the same reason.
- Move comments onto corresponding `Diagnostic` methods.
- Make formatting more consistent.
`create_almost_fatal` and `emit_almost_fatal` are always used instead.
These are misleading, because the mixture of `Level` and
`rustc_errors::Level` makes it look like there are two different types
involved.
Because it's redundant w.r.t. `Diagnostic::is_lint`, which is present
for every diagnostic level.

`struct_lint_level_impl` was the only place that set the `Error` field
to `true`, and it's also the only place that calls
`Diagnostic::is_lint()` to set the `is_lint` field.
It's not used within the repository in any way (e.g. in tests), and
doesn't seem useful.
It appears it was intended to be tier 3, but was accidentally added to
tier 2.
No functional changes - all checks have been emitted conditionally on
block being rechable already.
Reevaluate `body.should_skip()` after updating the MIR phase to ensure
that injected MIR is processed correctly.

Update a few custom MIR tests that were ill-formed for the injected
phase.
The check attempts to identify potential undefined behaviour, rather
than whether MIR is well-formed. It belongs in the lint not validator.
…mpiler-errors

Make `negative_bounds` internal & fix some of its issues

r? compiler-errors
…ulacrum

bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo

It prevents a full rebuild of stage 1 compiler when issuing "x.py test" with rust.lto != thin-local in config.toml.
…bject-safety-error, r=Nilstrieb

Use `resolutions(()).effective_visiblities` to avoid cycle errors in `report_object_error`

Inside of `report_object_error`, using the `effective_visibilities` query causes cycles since it calls `type_of`, which itself may call `typeck`, which may end up reporting its own object-safety errors.

Fixes rust-lang#119346
Fixes rust-lang#119502
…mpiler-errors

Cleanup error handlers: round 5

More rustc_errors cleanups. A sequel to rust-lang#119171.

r? ```@compiler-errors```
…em,Nilstrieb

Remove `-Zdump-mir-spanview`

The `-Zdump-mir-spanview` flag was added back in rust-lang#76074, as a development/debugging aid for the initial work on what would eventually become `-Cinstrument-coverage`. It causes the compiler to emit an HTML file containing a function's source code, with various spans highlighted based on the contents of MIR.

When the suggestion was made to [triage and remove unnecessary `-Z` flags (Zulip)](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60-Z.60.20option.20triage), I noted that this flag could potentially be worth removing, but I wanted to keep it around to see whether I found it useful for my own coverage work.

But when I actually tried to use it, I ran into various issues (e.g. it crashes on `tests/coverage/closure.rs`). If I can't trust it to work properly without a full overhaul, then instead of diving down a rabbit hole of trying to fix arcane span-handling bugs, it seems better to just remove this obscure old code entirely.

---

```@rustbot``` label +A-code-coverage
…s, r=oli-obk

Remove `-Zreport-delayed-bugs`.

It's not used within the repository in any way (e.g. in tests), and doesn't seem useful.

It was added in rust-lang#52568.

r? ```@oli-obk```
Migrate memory overlap check from validator to lint

The check attempts to identify potential undefined behaviour, rather
than whether MIR is well-formed. It belongs in the lint not validator.

Follow up to changes from rust-lang#119077.
…methods, r=notriddle

[rustdoc] Fix invalid handling for static method calls in jump to definition feature

I realized when working on a clippy lint that static method calls on `Self` could not give me the method `Res`. For that, we need to use `typeck` and so that's what I did in here.

It fixes the linking to static method calls.

r? ```@notriddle```
…trieb

Move `i586-unknown-netbsd` from tier 2 to tier 3 platform support table

It appears it was intended to be tier 3, but was accidentally added to tier 2. Based on inspecting the PR adding it the table rust-lang#117170 and the fact that it is not built in CI which is one of the tier 2 requirements.

cc ```@he32```

r? ```@Nilstrieb```
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jan 5, 2024
@GuillaumeGomez
Copy link
Member Author

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented Jan 5, 2024

📌 Commit 2a10782 has been approved by GuillaumeGomez

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 Jan 5, 2024
@bors
Copy link
Contributor

bors commented Jan 5, 2024

⌛ Testing commit 2a10782 with merge 2b7a8f9...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 5, 2024
…llaumeGomez

Rollup of 10 pull requests

Successful merges:

 - rust-lang#119354 (Make `negative_bounds` internal & fix some of its issues)
 - rust-lang#119414 (bootstrap: Move -Clto= setting from Rustc::run to rustc_cargo)
 - rust-lang#119420 (Handle ForeignItem as TAIT scope.)
 - rust-lang#119506 (Use `resolutions(()).effective_visiblities` to avoid cycle errors in `report_object_error`)
 - rust-lang#119538 (Cleanup error handlers: round 5)
 - rust-lang#119566 (Remove `-Zdump-mir-spanview`)
 - rust-lang#119567 (Remove `-Zreport-delayed-bugs`.)
 - rust-lang#119577 (Migrate memory overlap check from validator to lint)
 - rust-lang#119586 ([rustdoc] Fix invalid handling for static method calls in jump to definition feature)
 - rust-lang#119588 (Move `i586-unknown-netbsd` from tier 2 to tier 3 platform support table)

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

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

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_bd034219-3731-42ff-a0ac-9bd97df624c0
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=rollup-zbc4mc8
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_bd034219-3731-42ff-a0ac-9bd97df624c0
GITHUB_REF=refs/pull/119611/merge
GITHUB_REF_NAME=119611/merge
GITHUB_REF_PROTECTED=false
---
Built container sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
Looks like docker image is the same as before, not uploading
https://ci-caches.rust-lang.org/docker/7ebc15c01a233894034d277c8cce4e949f4e7791f66b4727c8fb6e058a0b8171d6152e1441d677cef0653843ceeee469c097b8699b2bb74249e674f6aa1a8813
sha256:9c3c93a371e5aed5c18185b24f130d95d5140dbd72a9b325e7b6b49e521a4faa
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-16]
##[group]Clock drift check
  local time: Fri Jan  5 10:28:17 UTC 2024
  network time: Fri, 05 Jan 2024 10:28:17 GMT
  network time: Fri, 05 Jan 2024 10:28:17 GMT
##[endgroup]
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-16', '--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-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---

---- [ui] tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs stdout ----
diff of stderr:

- error[E0038]: the trait `MyTrait` cannot be made into an object
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:16:6
-    |
- LL | impl dyn MyTrait {
-    |      ^^^^^^^^^^^ `MyTrait` cannot be made into an object
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
-    |
-    |
- LL | trait MyTrait {
-    |       ------- this trait cannot be made into an object...
- LL |     fn foo(&self) -> impl Marker;
-    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
-    = help: consider moving `foo` to another trait
-    = help: only type `Outer` implements the trait, consider using it directly instead
- 
- error[E0038]: the trait `MyTrait` cannot be made into an object
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:18:15
- LL |     fn other(&self) -> impl Marker {
- LL |     fn other(&self) -> impl Marker {
-    |               ^^^^ `MyTrait` cannot be made into an object
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
-    |
-    |
- LL | trait MyTrait {
-    |       ------- this trait cannot be made into an object...
- LL |     fn foo(&self) -> impl Marker;
-    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
-    = help: consider moving `foo` to another trait
-    = help: only type `Outer` implements the trait, consider using it directly instead
- 
33 error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
34   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:20:22


71    |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
72    |
73    = help: the trait `MyTrait` is implemented for `Outer`
+ 
+ error[E0038]: the trait `MyTrait` cannot be made into an object
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:16:6
+    |
+ LL | impl dyn MyTrait {
+    |      ^^^^^^^^^^^ `MyTrait` cannot be made into an object
+ note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
+    |
+    |
+ LL | trait MyTrait {
+    |       ------- this trait cannot be made into an object...
+ LL |     fn foo(&self) -> impl Marker;
+    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
+    = help: consider moving `foo` to another trait
+    = help: only type `Outer` implements the trait, consider using it directly instead
+ 
+ error[E0038]: the trait `MyTrait` cannot be made into an object
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:18:15
+    |
+ LL |     fn other(&self) -> impl Marker {
+    |               ^^^^ `MyTrait` cannot be made into an object
+ note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
+    |
+    |
+ LL | trait MyTrait {
+    |       ------- this trait cannot be made into an object...
+ LL |     fn foo(&self) -> impl Marker;
+    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
+    = help: consider moving `foo` to another trait
+    = help: only type `Outer` implements the trait, consider using it directly instead
75 error: aborting due to 6 previous errors
76 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety/cycle-effective-visibilities-during-object-safety.stderr
To only update this specific test, also pass `--test-args impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--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/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety" "-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/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:22
   |
LL |         MyTrait::foo(&self)
   |         ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |         required by a bound introduced by this call
   |
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error[E0038]: the trait `MyTrait` cannot be made into an object
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:9
   |
LL |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^ `MyTrait` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:5:22
   |
Build completed unsuccessfully in 0:13:12
Build completed unsuccessfully in 0:13:12
LL | trait MyTrait {
   |       ------- this trait cannot be made into an object...
LL |     fn foo(&self) -> impl Marker;
   |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
   = help: consider moving `foo` to another trait
   = help: only type `Outer` implements the trait, consider using it directly instead

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:9
   |
LL |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:9
   |
LL |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error[E0038]: the trait `MyTrait` cannot be made into an object
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:16:6
   |
LL | impl dyn MyTrait {
   |      ^^^^^^^^^^^ `MyTrait` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:5:22
   |
   |
LL | trait MyTrait {
   |       ------- this trait cannot be made into an object...
LL |     fn foo(&self) -> impl Marker;
   |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
   = help: consider moving `foo` to another trait
   = help: only type `Outer` implements the trait, consider using it directly instead

error[E0038]: the trait `MyTrait` cannot be made into an object
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:18:15
LL |     fn other(&self) -> impl Marker {
LL |     fn other(&self) -> impl Marker {
   |               ^^^^ `MyTrait` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:5:22
   |
   |
LL | trait MyTrait {
   |       ------- this trait cannot be made into an object...
LL |     fn foo(&self) -> impl Marker;
   |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
   = help: consider moving `foo` to another trait
   = help: only type `Outer` implements the trait, consider using it directly instead
error: aborting due to 6 previous errors

Some errors have detailed explanations: E0038, E0277.
For more information about an error, try `rustc --explain E0038`.
---

+ error: unconstrained opaque type
+   --> $DIR/nested-in-anon-const.rs:13:33
+    |
+ LL |                     type B<Z> = impl Sized;
+    |
+    = note: `B` must be used in combination with a concrete type within the same item
+ 
1 error[E0308]: mismatched types
---
- 
- error: unconstrained opaque type
-   --> $DIR/nested-in-anon-const.rs:13:33
-    |
- LL |                     type B<Z> = impl Sized;
-    |
-    = note: `B` must be used in combination with a concrete type within the same item
17 
18 error: aborting due to 2 previous errors
---
--- stderr -------------------------------
error: unconstrained opaque type
##[error]  --> /checkout/tests/ui/type-alias-impl-trait/nested-in-anon-const.rs:13:33
   |
LL |                     type B<Z> = impl Sized;
   |
   = note: `B` must be used in combination with a concrete type within the same item

error[E0308]: mismatched types
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/type-alias-impl-trait/nested-in-anon-const.rs:12:17
   |
LL | /                 { //~ ERROR mismatched types
LL | |                     type B<Z> = impl Sized;
LL | |                     //~^ ERROR unconstrained opaque type
   | |_________________^ expected `usize`, found `()`

error: aborting due to 2 previous errors

@GuillaumeGomez
Copy link
Member Author

Absolutely no idea what caused this failure. Closing for now. Do you have an idea by any chance @fmease?

@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)

---- [ui] tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs stdout ----
diff of stderr:

- error[E0038]: the trait `MyTrait` cannot be made into an object
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:16:6
-    |
- LL | impl dyn MyTrait {
-    |      ^^^^^^^^^^^ `MyTrait` cannot be made into an object
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
-    |
-    |
- LL | trait MyTrait {
-    |       ------- this trait cannot be made into an object...
- LL |     fn foo(&self) -> impl Marker;
-    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
-    = help: consider moving `foo` to another trait
-    = help: only type `Outer` implements the trait, consider using it directly instead
- 
- error[E0038]: the trait `MyTrait` cannot be made into an object
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:18:15
- LL |     fn other(&self) -> impl Marker {
- LL |     fn other(&self) -> impl Marker {
-    |               ^^^^ `MyTrait` cannot be made into an object
- note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
-    |
-    |
- LL | trait MyTrait {
-    |       ------- this trait cannot be made into an object...
- LL |     fn foo(&self) -> impl Marker;
-    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
-    = help: consider moving `foo` to another trait
-    = help: only type `Outer` implements the trait, consider using it directly instead
- 
33 error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
34   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:20:22


71    |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
72    |
73    = help: the trait `MyTrait` is implemented for `Outer`
+ 
+ error[E0038]: the trait `MyTrait` cannot be made into an object
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:16:6
+    |
+ LL | impl dyn MyTrait {
+    |      ^^^^^^^^^^^ `MyTrait` cannot be made into an object
+ note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
+    |
+    |
+ LL | trait MyTrait {
+    |       ------- this trait cannot be made into an object...
+ LL |     fn foo(&self) -> impl Marker;
+    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
+    = help: consider moving `foo` to another trait
+    = help: only type `Outer` implements the trait, consider using it directly instead
+ 
+ error[E0038]: the trait `MyTrait` cannot be made into an object
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:18:15
+    |
+ LL |     fn other(&self) -> impl Marker {
+    |               ^^^^ `MyTrait` cannot be made into an object
+ note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+   --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22
+    |
+    |
+ LL | trait MyTrait {
+    |       ------- this trait cannot be made into an object...
+ LL |     fn foo(&self) -> impl Marker;
+    |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
+    = help: consider moving `foo` to another trait
+    = help: only type `Outer` implements the trait, consider using it directly instead
75 error: aborting due to 6 previous errors
76 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety/cycle-effective-visibilities-during-object-safety.stderr
To only update this specific test, also pass `--test-args impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.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" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--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/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety" "-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/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:22
   |
LL |         MyTrait::foo(&self)
   |         ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |         required by a bound introduced by this call
   |
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error[E0038]: the trait `MyTrait` cannot be made into an object
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:9
   |
LL |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^ `MyTrait` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:5:22
   |
   |
LL | trait MyTrait {
   |       ------- this trait cannot be made into an object...
LL |     fn foo(&self) -> impl Marker;
   |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
   = help: consider moving `foo` to another trait
   = help: only type `Outer` implements the trait, consider using it directly instead

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:9
   |
LL |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:20:9
   |
LL |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`
Build completed unsuccessfully in 0:10:52
Build completed unsuccessfully in 0:10:52
error[E0038]: the trait `MyTrait` cannot be made into an object
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:16:6
   |
LL | impl dyn MyTrait {
   |      ^^^^^^^^^^^ `MyTrait` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:5:22
   |
   |
LL | trait MyTrait {
   |       ------- this trait cannot be made into an object...
LL |     fn foo(&self) -> impl Marker;
   |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
   = help: consider moving `foo` to another trait
   = help: only type `Outer` implements the trait, consider using it directly instead

error[E0038]: the trait `MyTrait` cannot be made into an object
##[error]  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:18:15
LL |     fn other(&self) -> impl Marker {
LL |     fn other(&self) -> impl Marker {
   |               ^^^^ `MyTrait` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/tests/ui/impl-trait/in-trait/cycle-effective-visibilities-during-object-safety.rs:5:22
   |
   |
LL | trait MyTrait {
   |       ------- this trait cannot be made into an object...
LL |     fn foo(&self) -> impl Marker;
   |                      ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type
   = help: consider moving `foo` to another trait
   = help: only type `Outer` implements the trait, consider using it directly instead
error: aborting due to 6 previous errors

Some errors have detailed explanations: E0038, E0277.
For more information about an error, try `rustc --explain E0038`.
---

+ error: unconstrained opaque type
+   --> $DIR/nested-in-anon-const.rs:13:33
+    |
+ LL |                     type B<Z> = impl Sized;
+    |
+    = note: `B` must be used in combination with a concrete type within the same item
+ 
1 error[E0308]: mismatched types
---
- 
- error: unconstrained opaque type
-   --> $DIR/nested-in-anon-const.rs:13:33
-    |
- LL |                     type B<Z> = impl Sized;
-    |
-    = note: `B` must be used in combination with a concrete type within the same item
17 
18 error: aborting due to 2 previous errors
---
--- stderr -------------------------------
error: unconstrained opaque type
##[error]  --> /checkout/tests/ui/type-alias-impl-trait/nested-in-anon-const.rs:13:33
   |
LL |                     type B<Z> = impl Sized;
   |
   = note: `B` must be used in combination with a concrete type within the same item

error[E0308]: mismatched types
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/type-alias-impl-trait/nested-in-anon-const.rs:12:17
   |
LL | /                 { //~ ERROR mismatched types
LL | |                     type B<Z> = impl Sized;
LL | |                     //~^ ERROR unconstrained opaque type
   | |_________________^ expected `usize`, found `()`

error: aborting due to 2 previous errors

@fmease
Copy link
Member

fmease commented Jan 5, 2024

@GuillaumeGomez, I've got it. #117213 has changed the order of some diagnostics which affects both #119420 and #119506. I've bors-unapproved them, they just need to rebase & rebless stderr.

Since the culprits have been eliminated, we should be ready for rollup PRs again while being fair to the 10 rollup=never PRs which have been in the queue for quite a while ;)

@GuillaumeGomez
Copy link
Member Author

Great, thanks!

@GuillaumeGomez GuillaumeGomez deleted the rollup-zbc4mc8 branch January 5, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.