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 20 pull requests #138030

Closed
wants to merge 55 commits into from

Conversation

workingjubilee
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jyn514 and others added 30 commits February 13, 2025 10:24
`py` is not installed by default *and* trying to run it results in a
popup asking if you want to install it. `python3` is installed by
default.

This hopefully should not be too disruptive to people on Windows, since
they should be going through `x.ps1` instead anyway. Just in case, I've
added a check for Cygwin and Msys (i'm not sure how else you'd get a
bash shell on windows).
To make the error cases easier to spot on a quick glance.
In Rust 1.81, we added a FCW lint (including linting in dependencies)
against pointer casts that add an auto trait to dyn bounds.  This was
part of work making casts of pointers involving trait objects stricter
which was needed to restabilize trait upcasting.

We considered just making this a hard error at the time, but opted
against it due to breakage found by crater.  This breakage was mostly
due to the `anymap` crate which has been a persistent problem for us.

It's now a year later, and the fact that this is not yet a hard error
is giving us pause about stabilizing arbitrary self types and
`derive(CoercePointee)`.  So let's now make a hard error of this.
Instead, we adopt the position that introducing an `unsafe` field
itself carries a safety invariant: that if you assign an invariant
to that field weaker than what the field's destructor requires,
you must ensure that field is in a droppable state in your
destructor.

See:
- rust-lang/rfcs#3458 (comment)
- https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/unsafe.20fields.20RFC/near/502113897
It has served us well, but it's time to retire the `Makefile` support
file since this is no longer needed.
And remove outdated requirements to run `run-make` tests on Windows.
This is to make test stderr insensitive to compare-mode / debugger that
changes the test build dir output name.

Previously, this normalized paths up to test-suite-specific build root,
e.g. `/path/to/build/test/ui/`. Now, this normalizes up to test-specific
build root, e.g.
`/path/to/build/test/ui/subdir/$name.$revision.$mode.$debugger/`.
When encountering a resolve E0575 error for an associated method (when a type was expected), see if it could have been an intended return type notation bound.

```
error[E0575]: expected associated type, found associated function `Trait::method`
  --> $DIR/bad-inputs-and-output.rs:31:36
   |
LL | fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {}
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type
   |
help: you might have meant to use the return type notation syntax
   |
LL - fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {}
LL + fn foo_qualified<T: Trait>() where T::method(..): Send {}
   |
```
…yUwU

Clarify why InhabitedPredicate::instantiate_opt exists

At first glance, the extra casework seems pointless and needlessly error-prone. Clarify that there is a reason for it being there.
…rors

Provide more context on resolve error caused from incorrect RTN

When encountering a resolve E0575 error for an associated method (when a type was expected), see if it could have been an intended return type notation bound.

```
error[E0575]: expected associated type, found associated function `Trait::method`
  --> $DIR/bad-inputs-and-output.rs:31:36
   |
LL | fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {}
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^ not a associated type
   |
help: you might have meant to use the return type notation syntax
   |
LL - fn foo_qualified<T: Trait>() where <T as Trait>::method(i32): Send {}
LL + fn foo_qualified<T: Trait>() where T::method(..): Send {}
   |
```

Built on top of rust-lang#137824, only second commit is relevant for review.

r? ``@compiler-errors``
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool 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-infra Relevant to the infrastructure 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Mar 5, 2025
@workingjubilee
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Mar 5, 2025

📌 Commit 26a4195 has been approved by workingjubilee

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 Mar 5, 2025
@bors
Copy link
Contributor

bors commented Mar 5, 2025

⌛ Testing commit 26a4195 with merge d33d937...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 5, 2025
…kingjubilee

Rollup of 20 pull requests

Successful merges:

 - rust-lang#136581 (Retire the legacy `Makefile`-based `run-make` test infra)
 - rust-lang#136764 (Make `ptr_cast_add_auto_to_object` lint into hard error)
 - rust-lang#136798 (Added documentation for flushing per rust-lang#74348)
 - rust-lang#136865 (Perform deeper compiletest path normalization for `$TEST_BUILD_DIR` to account for compare-mode/debugger cases, and normalize long type file filename hashes)
 - rust-lang#136975 (Look for `python3` first on MacOS, not `py`)
 - rust-lang#137240 (Slightly reformat `std::fs::remove_dir_all` error docs)
 - rust-lang#137303 (Remove `MaybeForgetReturn` suggestion)
 - rust-lang#137327 (Undeprecate env::home_dir)
 - rust-lang#137502 (Don't include global asm in `mir_keys`, fix error body synthesis)
 - rust-lang#137534 ([rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden))
 - rust-lang#137565 (Try to point of macro expansion from resolver and method errors if it involves macro var)
 - rust-lang#137643 (Add DWARF test case for non-C-like `repr128` enums)
 - rust-lang#137758 (fix usage of ty decl macro fragments in attributes)
 - rust-lang#137764 (Ensure that negative auto impls are always applicable)
 - rust-lang#137772 (Fix char count in `Display` for `ByteStr`)
 - rust-lang#137798 (ci: use ubuntu 24 on arm large runner)
 - rust-lang#137805 (adjust Layout debug printing to match the internal field name)
 - rust-lang#137808 (Do not require that unsafe fields lack drop glue)
 - rust-lang#137820 (Clarify why InhabitedPredicate::instantiate_opt exists)
 - rust-lang#137825 (Provide more context on resolve error caused from incorrect RTN)

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

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] tests/ui/asm/empty_global_asm.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/asm/fail-const-eval-issue-121099.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/asm/generic-const.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/asm/generic_const_simd_vec_len.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/global-asm-isnt-really-a-mir-body.rs#cfi ... ignored, ignored on targets without CFI sanitizer
test [ui] tests/ui/asm/global-asm-isnt-really-a-mir-body.rs#emit_mir ... FAILED
test [ui] tests/ui/asm/global-asm-isnt-really-a-mir-body.rs#instrument ... ignored, only executed when the operating system is linux
test [ui] tests/ui/asm/global-asm-with-lifetimes.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/asm/bad-template.rs#aarch64 ... ok
test [ui] tests/ui/asm/inline-asm-with-lifetimes.rs#bad ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/asm/inline-asm-with-lifetimes.rs#good ... ignored, ignored on targets without inline assembly support
---
test [ui] tests/ui/wrong-hashset-issue-42918.rs ... ok

failures:

---- [ui] tests/ui/asm/global-asm-isnt-really-a-mir-body.rs#emit_mir stdout ----
error in revision `emit_mir`: test compilation failed although it shouldn't!
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/asm/global-asm-isnt-really-a-mir-body.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=wasm32-wasip1" "--cfg" "emit_mir" "--check-cfg" "cfg(test,FALSE,emit_mir,instrument,cfi)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/global-asm-isnt-really-a-mir-body.emit_mir" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-wasip1/native/rust-test-helpers" "--emit=mir"
--- stderr -------------------------------
error[E0658]: inline assembly is not stable yet on this architecture
##[error]  --> /checkout/tests/ui/asm/global-asm-isnt-really-a-mir-body.rs:21:1
   |
   |
LL | global_asm!("/* {} */", sym foo);
   |
   = note: see issue #93335 <https://github.com/rust-lang/rust/issues/93335> for more information
   = help: add `#![feature(asm_experimental_arch)]` to the crate attributes to enable
   = help: add `#![feature(asm_experimental_arch)]` 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 1 previous error

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


---- [ui] tests/ui/asm/global-asm-with-error.rs stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/asm/global-asm-with-error/global-asm-with-error.stderr"
diff of stderr:

4 LL | global_asm!("/* {} */", sym a);
6 
- error: aborting due to 1 previous error
- 
- For more information about this error, try `rustc --explain E0425`.
- For more information about this error, try `rustc --explain E0425`.
+ 

Note: some mismatched output was normalized before being compared
- error[E0658]: inline assembly is not stable yet on this architecture
-   --> /checkout/tests/ui/asm/global-asm-with-error.rs:6:1
-    |
- LL | global_asm!("/* {} */", sym a);
-    |
-    = note: see issue #93335 <https://github.com/rust-lang/rust/issues/93335> for more information
-    = help: add `#![feature(asm_experimental_arch)]` to the crate attributes to enable
-    = help: add `#![feature(asm_experimental_arch)]` 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 2 previous errors
- 
- Some errors have detailed explanations: E0425, E0658.
- For more information about an error, try `rustc --explain E0425`.
---
To only update this specific test, also pass `--test-args asm/global-asm-with-error.rs`

error: 1 errors occurred comparing output.
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/asm/global-asm-with-error.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=wasm32-wasip1" "--check-cfg" "cfg(test,FALSE)" "--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/asm/global-asm-with-error" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-wasip1/native/rust-test-helpers"
--- stderr -------------------------------
error[E0425]: cannot find value `a` in this scope
##[error]  --> /checkout/tests/ui/asm/global-asm-with-error.rs:6:29
   |
   |
LL | global_asm!("/* {} */", sym a);

error[E0658]: inline assembly is not stable yet on this architecture
##[error]  --> /checkout/tests/ui/asm/global-asm-with-error.rs:6:1
   |
   |
LL | global_asm!("/* {} */", sym a);
   |
   = note: see issue #93335 <https://github.com/rust-lang/rust/issues/93335> for more information
   = help: add `#![feature(asm_experimental_arch)]` to the crate attributes to enable
   = help: add `#![feature(asm_experimental_arch)]` 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 2 previous errors

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



failures:
    [ui] tests/ui/asm/global-asm-isnt-really-a-mir-body.rs#emit_mir

test result: FAILED. 17842 passed; 2 failed; 840 ignored; 0 measured; 0 filtered out; finished in 448.89s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=wasm32-wasip1

@bors
Copy link
Contributor

bors commented Mar 5, 2025

💔 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 Mar 5, 2025
@workingjubilee workingjubilee deleted the rollup-9rrqat7 branch March 5, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-compiletest Area: The compiletest test runner A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc A-tidy Area: The tidy tool rollup A PR which is a rollup 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-infra Relevant to the infrastructure 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. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.