Rollup of 4 pull requests#153654
Closed
JonathanBrouwer wants to merge 13 commits intorust-lang:mainfrom
Closed
Conversation
It's defined in `rustc_span::source_map` which doesn't make any sense because it has nothing to do with source maps. This commit moves it to the crate root, a more sensible spot for something this basic.
Use `coerce_to_pin_ref` and `coerce_pin_ref_to_ref` instead.
…ackh726 Implement coercions between `&pin (mut|const) T` and `&(mut) T` when `T: Unpin` This allows the following (mutual) coercions when `T: Unpin`: - `&T` <-> `Pin<&T>` - `&mut T` <-> `Pin<&mut T>` - `&mut T` -> `Pin<&T>` - `Pin<&mut T>` -> `&T` Part of [Pin Ergonomics](rust-lang#130494).
fix: don't suggest replacing `env!("CARGO_BIN_NAME")` with itself
Some environment variables (e.g. `CARGO_BIN_NAME`) are only available for some targets ([Cargo Targets](https://doc.rust-lang.org/cargo/reference/cargo-targets.html), [§ Environment variables Cargo sets for crates](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates)), and the current diagnostic when copy-pasting code from a binary to a library is kinda confusing:
```rs
const _: &str = env!("CARGO_BIN_NAME");
```
Before:
```
error: environment variable `CARGO_BIN_NAME` not defined at compile time
--> lib.rs:1:17
|
1 | const _: &str = env!("CARGO_BIN_NAME");
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: there is a similar Cargo environment variable: `CARGO_BIN_NAME`
```
After:
```
error: environment variable `CARGO_BIN_NAME` not defined at compile time
--> lib.rs:1:17
|
1 | const _: &str = env!("CARGO_BIN_NAME");
| ^^^^^^^^^^^^^^^^^^^^^^
|
= help: `CARGO_BIN_NAME` may not be available for the current Cargo target
= help: Cargo sets build script variables at run time. Use `std::env::var("CARGO_BIN_NAME")` instead
```
@rustbot label +T-compiler +A-diagnostics +D-confusing
…Brouwer Move `Spanned`. It's defined in `rustc_span::source_map` which doesn't make any sense because it has nothing to do with source maps. This commit moves it to the crate root, a more sensible spot for something this basic. r? @JonathanBrouwer
Avoid projection-only suggestions for inherent assoc types Fixes rust-lang#153539. Type mismatch diagnostics in `note_and_explain_type_err` currently route both `ty::Projectio`n and `ty::Inherent` through the same associated-type suggestion path. For inherent associated types, that path can reach helpers that are only valid for trait projections.
Contributor
Author
|
@bors r+ rollup=never p=5 |
Contributor
Contributor
Author
|
Trying commonly failed jobs |
This comment has been minimized.
This comment has been minimized.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 10, 2026
Rollup of 4 pull requests try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
This pull request was unapproved due to being closed. |
Contributor
|
💔 Test for 4ce740e failed: CI. Failed jobs:
|
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
&pin (mut|const) Tand&(mut) TwhenT: Unpin#149130 (Implement coercions between&pin (mut|const) Tand&(mut) TwhenT: Unpin)env!("CARGO_BIN_NAME")with itself #152302 (fix: don't suggest replacingenv!("CARGO_BIN_NAME")with itself)Spanned. #153641 (MoveSpanned.)r? @ghost
Create a similar rollup