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

[pull] master from rust-lang:master #218

Open
wants to merge 1,570 commits into
base: master
Choose a base branch
from
Open

[pull] master from rust-lang:master #218

wants to merge 1,570 commits into from

Conversation

pull[bot]
Copy link

@pull pull bot commented Jan 18, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Jan 18, 2025
Copy link

stackblitz bot commented Jan 18, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

yegeunyang and others added 28 commits January 28, 2025 20:42
Add some extra pointers for rustdoc frontend devs
Add a link to declare_lint! macro doc in diagnostics.md
Rollup of 7 pull requests

Successful merges:

 - #135625 ([cfg_match] Document the use of expressions.)
 - #135902 (Do not consider child bound assumptions for rigid alias)
 - #135943 (Rename `Piece::String` to `Piece::Lit`)
 - #136104 (Add mermaid graphs of NLL regions and SCCs to polonius MIR dump)
 - #136143 (Update books)
 - #136147 (ABI-required target features: warn when they are missing in base CPU)
 - #136164 (Refactor FnKind variant to hold &Fn)

r? `@ghost`
`@rustbot` modify labels: rollup
Deduplicate operand creation between scalars, non-scalars and string patterns

just something that felt duplicated and would make pattern type handling a bit more roundabout.
Fix SIMD codegen tests on LLVM 20

The splat constants are printed differently on LLVM 20.
Locate asan-odr-win with other sanitizer tests
rustdoc: add nobuild typescript checking to our JS

By nobuild, I mean that the type annotations are all [in comments], not in the "native" typescript syntax. This is a bit uglier, but it lets you rapid-prototype without tsc, works with all the native browser debugging tools, and keeps Node out of Rust's bootstrap chain.

[in comments]: https://news.ycombinator.com/item?id=35892250

This pull request mostly just adds ts-ignore annotations and type declarations. To actually take good advantage of typescript, we'll want to "burn down" this pile of unsafe code until we eventually have a version with almost none of these.

This PR also adds tsc to the mingw-check Dockerfile, so that it can't fall out of date like the Closure annotations did.

https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/typescript

r? `@GuillaumeGomez` `@lolbinarycat`
…-errors

interpret: is_alloc_live: check global allocs last

See #136105 (comment).

(A perf run makes no sense as this is only used by Miri.)
GCI: Don't try to eval / collect mono items inside overly generic free const items

Fixes #136156. Thanks for the pointers, errs!

There's one (preexisting) thing of note (maybe?). There's a difference between `const _: () = panic!();` and `const _<'a>: () = panic!();`: The former is a pre-mono error, the latter is a post-mono error. For comparison, both `fn _f() { const { panic!() } }` and `fn _f<'a: 'a>() { const { panic!() } }` are post-mono errors.

cc `@oli-obk`
r? compiler-errors or reassign
Reject unsound toggling of Arm atomics-32 target feature

This target feature has the same semantics as RISC-V `forced-atomics` target feature that already marked as Forbidden  (llvm/llvm-project@f5ed0cb) and toggling it can cause ABI incompatibility.

https://github.com/rust-lang/rust/blob/2f348cb7ce4063fa4eb40038e6ada3c5214717bd/compiler/rustc_target/src/target_features.rs#L479-L483

[Comment on feature definition in LLVM](https://github.com/llvm/llvm-project/blob/7109f521975e9cc2e8ba4f52ac2a8e1140bd49b5/llvm/lib/Target/ARM/ARMFeatures.td#L572-L574) also says:

> Code built with this feature is not ABI-compatible with code built without this feature, if atomic variables are exposed across the ABI boundary.

r? `@workingjubilee` or `@RalfJung`

`@rustbot` label +O-Arm
…rrors

Render pattern types nicely in mir dumps

avoid falling through to the fallback rendering that just does a hex dump

r? ``@scottmcm``

best reviewed commit by commit
…bishop,Noratrieb

uefi: process: Fix args

- While working on process env support, I found that args were currently broken. Not sure how I missed it in the PR, but well here is the fix.
- Additionally, no point in adding space at the end of args.
Convenience helper for `rustc --print=sysroot`.
Co-authored-by: Oneirical <manchot@videotron.ca>
Subtree update of `rust-analyzer`

r? `@ghost`
Skip const OOM tests on AArch64 Linux through explicit annotations
instead of inside opt-dist.
Intended to avoid confusion in cases like #135952.

Prerequisite for #135960.
Zalathar and others added 30 commits February 1, 2025 12:38
Rollup of 7 pull requests

Successful merges:

 - #135840 (omit unused args warnings for intrinsics without body)
 - #135900 (Manually walk into WF obligations in `BestObligation` proof tree visitor)
 - #136163 (Fix off-by-one error causing slice::sort to abort the program)
 - #136266 (fix broken release notes id)
 - #136314 (Use proper type when applying deref adjustment in const)
 - #136348 (miri: make float min/max non-deterministic)
 - #136351 (Add documentation for derive(CoercePointee))

r? `@ghost`
`@rustbot` modify labels: rollup
ci: use ubuntu 24 on free runners

try-job: aarch64-gnu
try-job: aarch64-gnu-debug
Implement MIR lowering for unsafe binders

This is the final bit of the unsafe binders puzzle. It implements MIR, CTFE, and codegen for unsafe binders, and enforces that (for now) they are `Copy`. Later on, I'll introduce a new trait that relaxes this requirement to being "is `Copy` or `ManuallyDrop<T>`" which more closely models how we treat union fields.

Namely, wrapping unsafe binders is now `Rvalue::WrapUnsafeBinder`, which acts much like an `Rvalue::Aggregate`. Unwrapping unsafe binders are implemented as a MIR projection `ProjectionElem::UnwrapUnsafeBinder`, which acts much like `ProjectionElem::Field`.

Tracking:
- #130516
docs: Documented Send and Sync requirements for Mutex + MutexGuard

This an attempt to continue where #123225 left off.

I did some light clean up from the work done in that PR.
I also documented the `!Send` + `Sync` implementations for `MutexGuard` to the best of my knowledge.
Let me know if I got anything wrong 😄

fixes #122856

cc: ``@IoaNNUwU``

r? ``@joboet``
Implement all mix/max functions in a (hopefully) more optimization amendable way

Previously the graph was like this:

```
min -> Ord::min -> min_by -> match on compare() (in these cases compare = Ord::cmp)
                                      ^
                                      |
                                 min_by_key
```
now it looks like this:
```
min -> Ord::min -> `<=` <- min_by_key

min_by -> `Ordering::is_le` of `compare()`
```
(`max*` and `minmax*` are the exact same, i.e. they also use `<=` and `is_le`)

I'm not sure how to test this, but it should probably be easier for the backend to optimize.

r? `@scottmcm`
cc #115939 (comment)
Stabilize `once_wait`

Closes: #127527.

`@rustbot` label: +T-libs-api

r? libs-api
document that ptr cmp is unsigned

Fixes #77497
Add link attribute for Enzyme's LLVMRust FFI

Since #133429 landed, the compiler doesn't build with `-Zcross-crate-inline-threshold=always`. I don't expect anyone else to test or fix issues with that goofy configuration, so I'm fixing it.

This PR adds a link attribute just like #118142 for all the new LLVMRust functions. They were actually added in #130060 but weren't used until just now.
Rollup of 6 pull requests

Successful merges:

 - #130514 (Implement MIR lowering for unsafe binders)
 - #135684 (docs: Documented Send and Sync requirements for Mutex + MutexGuard)
 - #136307 (Implement all mix/max functions in a (hopefully) more optimization amendable way)
 - #136360 (Stabilize `once_wait`)
 - #136364 (document that ptr cmp is unsigned)
 - #136374 (Add link attribute for Enzyme's LLVMRust FFI)

r? `@ghost`
`@rustbot` modify labels: rollup
Use a more targeted span when suggesting casting an `fn` item to an `fn` pointer.

```
error[E0308]: cannot coerce functions which must be inlined to function pointers
  --> $DIR/cast.rs:10:33
   |
LL |     let _: fn(isize) -> usize = callee;
   |            ------------------   ^^^^^^ cannot coerce functions which must be inlined to function pointers
   |            |
   |            expected due to this
   |
   = note: expected fn pointer `fn(_) -> _`
                 found fn item `fn(_) -> _ {callee}`
   = note: fn items are distinct from fn pointers
help: consider casting to a fn pointer
   |
LL |     let _: fn(isize) -> usize = callee as fn(isize) -> usize;
   |                                        +++++++++++++++++++++
```
```
error[E0308]: mismatched types
  --> $DIR/fn-pointer-mismatch.rs:42:30
   |
LL |     let d: &fn(u32) -> u32 = foo;
   |            ---------------   ^^^ expected `&fn(u32) -> u32`, found fn item
   |            |
   |            expected due to this
   |
   = note: expected reference `&fn(_) -> _`
                found fn item `fn(_) -> _ {foo}`
help: consider using a reference
   |
LL |     let d: &fn(u32) -> u32 = &foo;
   |                              +
```
Previously we'd point at the whole expression for replacement, instead of marking what was being added.

We could also modify the suggestions for `&(name as fn())`, but for that we require storing more accurate spans than we have now.
ci: refactor how directories are removed in free-disk-space disk

try-job: aarch64-gnu
ci: fix explanation why LLVM download is disabled for windows-gnu

Continuation of #132781
Rename `tcx.ensure()` to `tcx.ensure_ok()`, and improve the associated docs

This is all based on my archaeology for https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60TyCtxtEnsure.60.

The main renamings are:
- `tcx.ensure()` → `tcx.ensure_ok()`
- `tcx.ensure_with_value()` → `tcx.ensure_done()`
- Query modifier `ensure_forwards_result_if_red` → `return_result_from_ensure_ok`

Hopefully these new names are a better fit for the *actual* function and purpose of these query call modes.
Rework "long type names" printing logic

Make it so more type-system types can be printed in a shortened version (like `Predicate`s).

Centralize printing the information about the "full type name path".

Make the "long type path" for the file where long types are written part of `Diag`, so that it becomes easier to keep track of it, and ensure it will always will be printed out last in the diagnostic by making its addition to the output implicit.

Tweak the shortening of types in "expected/found" labels.

Remove dead file `note.rs`.
`#[optimize(none)]` implies `#[inline(never)]`

Fixes #136329
Make comma separated lists of anything easier to make for errors

Provide a new function `listify`, meant to be used in cases similar to `pluralize!`. When you have a slice of arbitrary elements that need to be presented to the user, `listify` allows you to turn that into a list of comma separated strings.

This reduces a lot of redundant logic that happens often in diagnostics.
Tweak fn pointer suggestion span

Use a more targeted span when suggesting casting an `fn` item to an `fn` pointer.

```
error[E0308]: cannot coerce functions which must be inlined to function pointers
  --> $DIR/cast.rs:10:33
   |
LL |     let _: fn(isize) -> usize = callee;
   |            ------------------   ^^^^^^ cannot coerce functions which must be inlined to function pointers
   |            |
   |            expected due to this
   |
   = note: expected fn pointer `fn(_) -> _`
                 found fn item `fn(_) -> _ {callee}`
   = note: fn items are distinct from fn pointers
help: consider casting to a fn pointer
   |
LL |     let _: fn(isize) -> usize = callee as fn(isize) -> usize;
   |                                        +++++++++++++++++++++
```
```
error[E0308]: mismatched types
  --> $DIR/fn-pointer-mismatch.rs:42:30
   |
LL |     let d: &fn(u32) -> u32 = foo;
   |            ---------------   ^^^ expected `&fn(u32) -> u32`, found fn item
   |            |
   |            expected due to this
   |
   = note: expected reference `&fn(_) -> _`
                found fn item `fn(_) -> _ {foo}`
help: consider using a reference
   |
LL |     let d: &fn(u32) -> u32 = &foo;
   |                              +
```
Previously we'd point at the whole expression for replacement, instead of marking what was being added.

We could also modify the suggestions for `&(name as fn())`, but for that we require storing more accurate spans than we have now.
Rollup of 7 pull requests

Successful merges:

 - #133266 (ci: fix explanation why LLVM download is disabled for windows-gnu)
 - #136133 (Fix sentence in process::abort)
 - #136279 (Rename `tcx.ensure()` to `tcx.ensure_ok()`, and improve the associated docs)
 - #136328 (Rework "long type names" printing logic)
 - #136358 (`#[optimize(none)]` implies `#[inline(never)]`)
 - #136368 (Make comma separated lists of anything easier to make for errors)
 - #136412 (Tweak fn pointer suggestion span)

r? `@ghost`
`@rustbot` modify labels: rollup
Update cargo

12 commits in cecde95c119a456c30e57d3e4b31fff5a7d83df4..0e3d73849ab8cbbab3ec5c65cbd555586cb21339
2025-01-24 17:15:24 +0000 to 2025-02-01 20:14:40 +0000
- Revert "Conditionally mark the `test` cfg as a well known cfg (rust-lang/cargo#15007)" (rust-lang/cargo#15132)
- Don't suggest `cargo login` when using incompatible credental providers (rust-lang/cargo#15124)
- chore: Update clap_complete (rust-lang/cargo#15121)
- Move the changelog to the cargo book (rust-lang/cargo#15119)
- Conditionally mark the `test` cfg as a well known cfg (rust-lang/cargo#15007)
- fix broken links in the Cargo book (rust-lang/cargo#15109)
- Fix a typo and touch up documentation (rust-lang/cargo#15108)
- Fix shared_std_dependency_rebuild running on Windows (rust-lang/cargo#15111)
- Fix warnings on Windows (rust-lang/cargo#15112)
- fix(login): Deprecate CLI token (rust-lang/cargo#15057)
- Update tests to fix nightly errors (rust-lang/cargo#15110)
- Fix comment on Ord for SourceId (rust-lang/cargo#15103)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.