Skip to content

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

WiktorPrzetacznik and others added 14 commits July 28, 2024 16:08
Update NonNull::align_offset quarantees, keeping it in sync with ptr::align_offset
…k-nonnull-alignoffset-update, r=Amanieu

Update NonNull::align_offset quarantees

This PR proposes to update [`NonNull::align_offset`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.align_offset) guarantees, which should to be matched with [`ptr::align_offset`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.align_offset-1)
(as `NonNull::align_offset` delegates to `ptr::align_offset`).

[PR rust-lang#121201](rust-lang#121201) updated only `ptr::align_offset` docs.
…ir, r=davidtwco

Make `validate_mir` ensure the final MIR for all bodies

A lot of the crashes tests use `-Zpolymorphize` or `-Zdump-mir` for their side effect of computing the `optimized_mir` for all bodies, which will uncover bugs with late MIR passes like the inliner. I don't like having all these tests depend on `-Zpolymorphize` (or other hacky ways) for no reason, so this PR extends the `-Zvalidate-mir` flag to ensure `optimized_mir`/`mir_for_ctfe` for all body owners during the analysis phase.

Two thoughts:
1. This could be moved later in the compilation pipeline I guess? I don't really think it matters, though.
1. This could alternatively be expressed using a new flag, though I don't necessarily see much value in separating these.

For example, rust-lang#128171 could have used this flag, in the `tests/ui/polymorphization/inline-incorrect-early-bound.rs`.

r? mir
…=lcnr

Don't implement `AsyncFn` for `FnDef`/`FnPtr` that wouldnt implement `Fn`

Due to unsafety, ABI, or the presence of target features, some `FnDef`/`FnPtr` types don't implement `Fn*`. Do the same for `AsyncFn*`.

Noticed this due to rust-lang#128764, but this isn't really related to that ICE, which is fixed in rust-lang#128792.
… r=jieyouxu

Update E0517 message to reflect RFC 2195.

E0517 occurs when a `#[repr(..)]` attribute is placed on an unsupported item. Currently, the explanation of the error implies that `#[repr(u*/i*)]` cannot be placed on fieldful enums, which is no longer the case since [RFC 2195](rust-lang/rfcs#2195) was [stabilized](rust-lang#60553), which allows placing `#[repr(u*/i*)]` and/or `#[repr(C)]` on fieldful enums to produce a defined layout.

This PR doesn't (currently) add a description of the semantics of placing `#[repr(u*/i*)]` on a fieldful enum to the error explanation, it just removes the claims/implications that it is not allowed.
…petrochenkov

rm `declared_features` field in resolver

r? `@petrochenkov`
…s, r=compiler-errors

Only suggest `#[allow]` for `--warn` and `--deny` lint level flags

`--force-warn` and `--forbid` cannot be overridden
@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Aug 8, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Collaborator

bors commented Aug 8, 2024

📌 Commit f92c323 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 Aug 8, 2024
@bors
Copy link
Collaborator

bors commented Aug 8, 2024

⌛ Testing commit f92c323 with merge 71f4439...

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

Rollup of 7 pull requests

Successful merges:

 - rust-lang#128306 (Update NonNull::align_offset quarantees)
 - rust-lang#128612 (Make `validate_mir` ensure the final MIR for all bodies)
 - rust-lang#128648 (Add regression test)
 - rust-lang#128791 (Don't implement `AsyncFn` for `FnDef`/`FnPtr` that wouldnt implement `Fn`)
 - rust-lang#128795 (Update E0517 message to reflect RFC 2195.)
 - rust-lang#128825 (rm `declared_features` field in resolver)
 - rust-lang#128826 (Only suggest `#[allow]` for `--warn` and `--deny` lint level flags)

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

The job aarch64-apple failed! Check out the build log: (web) (plain)

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

+ error: the feature named `sse2` is not valid for this target
+   --> $DIR/fn-exception.rs:18:18
+    |
+ LL | #[target_feature(enable = "sse2")]
+    |                  ^^^^^^^^^^^^^^^ `sse2` is not valid for this target
+ 
1 error[E0277]: the trait bound `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}: AsyncFn<()>` is not satisfied
2   --> $DIR/fn-exception.rs:24:10

17    |
18 LL |     test(abi);
18 LL |     test(abi);
19    |     ---- ^^^ the trait `AsyncFn<()>` is not implemented for fn item `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}`
-    |     required by a bound introduced by this call
-    |
- note: required by a bound in `test`
-   --> $DIR/fn-exception.rs:21:17
-   --> $DIR/fn-exception.rs:21:17
-    |
- LL | fn test(f: impl async Fn()) {}
- 
- 
- error[E0277]: the trait bound `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}: AsyncFn<()>` is not satisfied
-   --> $DIR/fn-exception.rs:26:10
- LL |     test(target_feature);
- LL |     test(target_feature);
-    |     ---- ^^^^^^^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {target_feature}`
35    |     required by a bound introduced by this call
36    |



The actual stderr differed from the expected stderr.
Actual stderr saved to /Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/async-await/async-closures/fn-exception/fn-exception.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args async-await/async-closures/fn-exception.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.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=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(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" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/async-await/async-closures/fn-exception" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/async-await/async-closures/fn-exception/auxiliary" "--edition=2021"
--- stderr -------------------------------
error: the feature named `sse2` is not valid for this target
##[error]  --> /Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.rs:18:18
   |
   |
LL | #[target_feature(enable = "sse2")]
   |                  ^^^^^^^^^^^^^^^ `sse2` is not valid for this target

error[E0277]: the trait bound `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}: AsyncFn<()>` is not satisfied
##[error]  --> /Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.rs:24:10
   |
LL |     test(unsafety); //~ ERROR the trait bound
   |     ---- ^^^^^^^^ the trait `AsyncFn<()>` is not implemented for fn item `unsafe fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {unsafety}`
   |     required by a bound introduced by this call
   |
note: required by a bound in `test`
  --> /Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.rs:21:17
  --> /Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.rs:21:17
   |
LL | fn test(f: impl async Fn()) {}


error[E0277]: the trait bound `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}: AsyncFn<()>` is not satisfied
##[error]  --> /Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.rs:25:10
   |
LL |     test(abi); //~ ERROR the trait bound
   |     ---- ^^^ the trait `AsyncFn<()>` is not implemented for fn item `extern "C" fn() -> Pin<Box<(dyn Future<Output = ()> + 'static)>> {abi}`
   |     required by a bound introduced by this call
   |
note: required by a bound in `test`
  --> /Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.rs:21:17
  --> /Users/runner/work/rust/rust/tests/ui/async-await/async-closures/fn-exception.rs:21:17
   |
LL | fn test(f: impl async Fn()) {}

error: aborting due to 3 previous errors

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

@bors
Copy link
Collaborator

bors commented Aug 8, 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 Aug 8, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-kbkjllg branch September 1, 2024 17:35
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-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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants