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 #119604

Closed
wants to merge 30 commits into from

Conversation

matthiaskrgr
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
Add `E0796` error code.
Add `static_mut_ref` lint.

This is the idea for the 2024 edition.
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.
…twco

Disallow reference to `static mut` and adding `static_mut_ref` lint

Closes rust-lang#114447

r? ``@scottmcm``
…mpiler-errors

Make `negative_bounds` internal & fix some of its issues

r? compiler-errors
…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
…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 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-libs Relevant to the library 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
@matthiaskrgr
Copy link
Member Author

@bors rollup=never p=9

@matthiaskrgr
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Jan 5, 2024

📌 Commit cd5f42f has been approved by matthiaskrgr

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
@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_588dafa2-d319-4f51-887a-828f6e696876
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-vd0snqf
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_588dafa2-d319-4f51-887a-828f6e696876
GITHUB_REF=refs/pull/119604/merge
GITHUB_REF_NAME=119604/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 05:38:20 UTC 2024
  network time: Fri, 05 Jan 2024 05:38:20 GMT
  network time: Fri, 05 Jan 2024 05:38:20 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
   |
   |
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

@bors
Copy link
Contributor

bors commented Jan 5, 2024

⌛ Testing commit cd5f42f with merge 2076173...

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

Rollup of 9 pull requests

Successful merges:

 - rust-lang#117556 (Disallow reference to `static mut` and adding `static_mut_ref` lint)
 - rust-lang#119354 (Make `negative_bounds` internal & fix some of its issues)
 - 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#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

A job failed! Check out the build log: (web) (plain)

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

@matthiaskrgr matthiaskrgr deleted the rollup-vd0snqf branch March 16, 2024 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library 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.