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

Closed
wants to merge 20 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Urgau and others added 20 commits January 20, 2025 18:50
Trim extra whitespace when suggesting removal of invalid qualifiers when
parsing function pointer type.

Fixes: rust-lang#133083

Signed-off-by: Tyrone Wu <[email protected]>
…ptrmetadata, r=davidtwco,RalfJung"

This reverts commit 122a55b.
…r=compiler-errors

Trim extra whitespace in fn ptr suggestion span

Trim extra whitespace when suggesting removal of invalid qualifiers when parsing function pointer type.

Fixes: rust-lang#133083

---

I made a comment about the format of the diagnostic error message in rust-lang#133083 (comment). I think the `.label` may be a little redundant if the diagnostic only highlights the bad qualifier instead of the entire `TyKind::BareFn` span. If it makes sense, I can include it in this PR.
…le, r=Noratrieb

Implement `AtomicT::update` & `AtomicT::try_update`

ACP accepted in rust-lang/libs-team#490

`@rustbot` label +T-libs-api
Enable `unreachable_pub` lint in `alloc`

This PR enables the [`unreachable_pub`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub) lint as warn in the `alloc` crate.

Most of changes are in the btree implementation and in tests.

*The diff was mostly generated with `./x.py fix --stage 1 library/alloc/ -- --broken-code`, as well as manual edits for code in macros and in tests.*

Continuation of rust-lang#134286 and rust-lang#135366

r? libs
…oli-obk

Lower index bounds checking to `PtrMetadata`, this time with the right fake borrow semantics 😸

Change `Rvalue::RawRef` to take a `RawRefKind` instead of just a `Mutability`. Then introduce `RawRefKind::FakeForPtrMetadata` and use that for lowering index bounds checking to a `PtrMetadata`. This new `RawRefKind::FakeForPtrMetadata` acts like a shallow fake borrow in borrowck, which mimics the semantics of the old `Rvalue::Len` operation we're replacing.

We can then use this `RawRefKind` instead of using a span desugaring hack in CTFE.

cc `@scottmcm` `@RalfJung`
Add missing allocator safety in alloc crate

### PR Description
In the previous PR [rust-lang#135009](rust-lang#135009), PR [rust-lang#134496](rust-lang#134496), some incomplete API documentation issues have been fixed.

Based on these changes,  other inconsistencies related to the allocator have also been identified, including:

- `Box::from_non_null`
- `Box::from_non_null_in`
- `Weak::from_raw`
Document purpose of closure in from_fn.rs more clearly

partial fix for rust-lang#135087 together with rust-lang#135895
…malized, r=lcnr

-Znext-solver: "normalize" signature before checking it mentions self in `deduce_closure_signature`

Fixes rust-lang/trait-system-refactor-initiative#138

r? `@lcnr`

Tbh I wrote so much comments I don't feel like writing it all again but as a description.
…jieyouxu

Fix 2/4 tests skipped by opt-dist

The linker errors were because this one test, strangely, wants itself compiled with `-Ctarget-features=+crt-static`, and yet it looks like the runner image is simply missing static libraries for libc and libm.

Eyeballing the output of
```
rustc +nightly --target=x86_64-pc-windows-msvc -O tests/codegen/vec-shrink-panik.rs --emit=llvm-ir
```
suggests that vec-shrink-panik should pass on Windows. And it's quite disturbing that such a test would have failed only on Windows to start with. Exactly why that was would require some advanced digging, but it looks clean now.
…gross35

Document powf and powi values that are always 1.0

fixes bug rust-lang#90429
@rustbot rustbot added 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. 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 Jan 28, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jan 28, 2025

📌 Commit 5a4325a has been approved by matthiaskrgr

It is now in the queue for this repository.

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

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

Click to see the possible cause of the failure (guessed by this bot)
#21 exporting to docker image format
#21 sending tarball 28.5s done
#21 DONE 43.1s
##[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-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
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-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--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', '--set', 'rust.lld=false', '--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-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---

failures:

---- [ui] tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs#next stdout ----
Saved the actual stderr to "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.next/closure-arg-type-mismatch-issue-45727.next.stderr"

13   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
14 
14 
15 error[E0271]: expected `RangeInclusive<{integer}>` to be an iterator that yields `&&i32`, but it yields `{integer}`
+   --> $DIR/closure-arg-type-mismatch-issue-45727.rs:9:24
17    |
17    |
18 LL |     let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
-    |                                 ^^^^^^ expected `&&i32`, found integer
+    |                        ^^^^ expected `&&i32`, found integer
- error: aborting due to 2 previous errors
- error: aborting due to 2 previous errors
+ error[E0277]: expected a `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
+    |
+    |
+ LL |     let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
+    |                        ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
+    |                        required by a bound introduced by this call
+    |
+    |
+    = help: the trait `for<'a> FnMut(&'a <RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
+    = note: expected a closure with arguments `(&&&i32,)`
+               found a closure with arguments `(&<RangeInclusive<{integer}> as Iterator>::Item,)`
+ note: required by a bound in `find`
+   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+ error: aborting due to 3 previous errors
22 
23 Some errors have detailed explanations: E0271, E0277.
24 For more information about an error, try `rustc --explain E0271`.
24 For more information about an error, try `rustc --explain E0271`.

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:24
- error[E0277]: expected a `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
-   --> /checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:29
-    |                        ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
-    = help: the trait `for<'a> FnMut(&'a <RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
+   --> $DIR/closure-arg-type-mismatch-issue-45727.rs:9:24
+   --> $DIR/closure-arg-type-mismatch-issue-45727.rs:9:24
+    |                        ^^^^ expected `&&i32`, found integer
+ error[E0277]: expected a `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
+    |
+    |
+ LL |     let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
+    |                        ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
+    |                        required by a bound introduced by this call
+    |
+    |
+    = help: the trait `for<'a> FnMut(&'a <RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
+    = note: expected a closure with arguments `(&&&i32,)`
+               found a closure with arguments `(&<RangeInclusive<{integer}> as Iterator>::Item,)`
+ note: required by a bound in `find`
+   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+ error: aborting due to 3 previous errors


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args mismatched_types/closure-arg-type-mismatch-issue-45727.rs`

error in revision `next`: 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/mismatched_types/closure-arg-type-mismatch-issue-45727.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" "next" "--check-cfg" "cfg(test,FALSE,current,next)" "--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/mismatched_types/closure-arg-type-mismatch-issue-45727.next" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Znext-solver"
--- stderr -------------------------------
--- stderr -------------------------------
error[E0277]: expected a `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:6:29: 6:37}`
   |
   |
LL |     let _ = (-10..=10).find(|x: i32| x.signum() == 0);
   |                        ---- ^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:6:29: 6:37}`
   |                        required by a bound introduced by this call
   |
   |
   = help: the trait `for<'a> FnMut(&'a <RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:6:29: 6:37}`
   = note: expected a closure with arguments `(i32,)`
              found a closure with arguments `(&<RangeInclusive<{integer}> as Iterator>::Item,)`
note: required by a bound in `find`


error[E0271]: expected `RangeInclusive<{integer}>` to be an iterator that yields `&&i32`, but it yields `{integer}`
   |
   |
LL |     let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
   |                        ^^^^ expected `&&i32`, found integer

error[E0277]: expected a `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
   |
   |
LL |     let _ = (-10..=10).find(|x: &&&i32| x.signum() == 0);
   |                        ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnMut(&<RangeInclusive<{integer}> as Iterator>::Item)` closure, found `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
   |                        required by a bound introduced by this call
   |
   |
   = help: the trait `for<'a> FnMut(&'a <RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@/checkout/tests/ui/mismatched_types/closure-arg-type-mismatch-issue-45727.rs:9:29: 9:40}`
   = note: expected a closure with arguments `(&&&i32,)`
              found a closure with arguments `(&<RangeInclusive<{integer}> as Iterator>::Item,)`
note: required by a bound in `find`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0271, E0277.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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-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. 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.