Skip to content

Rollup of 5 pull requests - #166394

Closed
JonathanBrouwer wants to merge 75 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-GNTYQTC
Closed

JonathanBrouwer wants to merge 75 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-GNTYQTC

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

A4-Tacks and others added 30 commits October 22, 2026 17:41
Example
---
**Before this PR**

```rust
use itertools::Itertools;
fn main() {
    [1, 2, 3].into_iter() // <- IntoIter<i32, 3>
        .merge_by([2, 4, 6], |a,b|a<b) // <- MergeBy<IntoIter<i32, 3>, IntoIter<i32, 3>, impl FnMut(&i32, &i32) -> bool>
        .next();
}
```

**After this PR**

```rust
use itertools::Itertools;
fn main() {
    [1, 2, 3].into_iter() // <- IntoIter<i32, 3>
        .merge_by([2, 4, 6], |a,b|a<b) // <- impl Iterator<Item = i32>
        .next();
}
```
This is the stored variant of Term, just like StoredGenericArg is the
stored variant of GenericArg.
This is heavily inspired from hir_def::hir::ExprOrPatId and its packed
variant, to wrap either a TypeRefId or a ConstRef.
This replaces InferenceResult::type_of_type_placeholder with
term_of_term_placeholder to additionally record which const a given
const or type placeholder gets resolved to.

Note that while surprising, TypeRef::Placeholder may indeed resolve to
a const because, except for arrays, the parser doesn't know ahead of
time if a _ will resolve to a type or a const.

In the case of an array, we have an Expr::Underscore:
```
let a: [_; _] = [4, 5, 6];
      //^ TypeRef::Placeholder which resolves to the type i32
         //^ Expr::Underscore which resolves to the const 3
```

But for a struct we have a TypeRef::Placeholder:
```
struct S<T, const N: usize>([T; N]);

let s: S<_, _> = S([1, 2, 3]);
       //^ TypeRef::Placeholder which resolves to the type i32
          //^ TypeRef::Placeholder which resolves to the const 3
```
This fixes SourceAnalyzer::type_of_type to replace const infer vars in
types with their resolved value.
add tests for `Pool` and fix ordering issue
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
This environment variable is provided by default.

See: https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables

Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
This environment variable is provided by default.

See: https://docs.github.com/en/actions/reference/workflows-and-actions/variables#default-environment-variables

Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Example
---
**Before this PR**
```text
Roots Scanned 15/16: /home/user/.rustup/toolchains/nightly-aarch64-unknown-linux-gnu/lib/rustlib/src/rust/library/std 93%
```

**After this PR**

```text
Roots Scanned 15/16: library/std 93%
```
minor: short too long roots scanned std path
Previously, r-a didn't implement well-formedness (WF) checks on any types,
treating them all as ambiguous.

Unfortunately, we try to resolve obligations after essentially every
expression:

https://github.com/rust-lang/rust-analyzer/blob/ff7105dd728897503481c79727cd6ead881d80a6/crates/hir-ty/src/infer/expr.rs#L867

and when we resolve obligations, we collect all obligations and then
re-register ambiguous ones:

https://github.com/rust-lang/rust-analyzer/blob/ff7105dd728897503481c79727cd6ead881d80a6/crates/hir-ty/src/next_solver/fulfill.rs#L213

So given N expressions containing closures, we end up doing O(N^2)
work (1 obligation after the first expression, 2 obligations after the
second expression, etc).

Instead, treat all types as well-formed. This also allows
normalisation to work in more scenarios, hence one unit test now
showing a concrete type instead of `impl Trait`.

For reference, the WF implementation in rustc is here:

https://github.com/rust-lang/rust/blob/58cf8f9c35b355199727627d07ae34a4e2846d67/compiler/rustc_trait_selection/src/solve/delegate.rs#L338-L352

https://github.com/rust-lang/rust/blob/58cf8f9c35b355199727627d07ae34a4e2846d67/compiler/rustc_trait_selection/src/traits/wf.rs#L93-L125

AI disclosure: Initial investigation and implementation with an LLM,
but final implementation and review by me. Comments are written by me
or copied from rustc verbatim.
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@3c62857.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
…nkov

Enable static-pie on all Musl targets

This enables ASLR and I don't see a reason not to enable it outside x86_64. Musl supports it just fine and in fact Alpine Linux already patches rustc to enable it on all Musl targets.

cc @Gelbpunkt
…=JonathanBrouwer

Add a reason suggestion for malformed lint attributes

Added a new suggestion to use `reason` when the name of a trailing `NameValue` pair of a lint attribute is not `reason`

For example, given:

`#[allow(dead_code, note = "testing")]`

Compiler suggests:

`#[allow(dead_code, reason = "testing")]`

Edited files:

`compiler/rustc_attr_parsing/src/attributes/lint.rs`
`compiler/rustc_attr_parsing/src/diagnostics.rs`

New tests are added in `tests/ui/attributes/`

`tests/ui/attributes/malformed-lint-reason.rs`
`tests/ui/attributes/malformed-lint-reason.stderr`

r? JonathanBrouwer
…r=Kobzol

Drop references to codebuild

We no longer use AWS CodeBuild for our jobs, so delete or rephrase code that referred to it.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 23, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI 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-clippy Relevant to the Clippy team. 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-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Nov 23, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,dist-various-2,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu,test-x86_64-gnu-llvm-22-3,test-aarch64-msvc-2

@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 12dab99 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 23, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Rollup of 5 pull requests


try-job: dist-various-1
try-job: dist-various-2
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

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

@rust-bors

rust-bors Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit 12dab99 with merge a2aa2e9...

Workflow: https://github.com/rust-lang/rust/actions/runs/45191631521

rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #164918 (Move lint validation to attribute parsing)
 - #166381 (`rust-analyzer` subtree update)
 - #166191 (Enable static-pie on all Musl targets)
 - #166250 (Add a reason suggestion for malformed lint attributes)
 - #166365 (Drop references to codebuild)

Failed merges:

 - #166374 (Undo accidental duplication checking for attributes on macro calls)
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 23, 2026
@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

PR #166365, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

Auto build was cancelled due to unapproval. Cancelled workflows:

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 23, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 23, 2026
@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 7bdbdff failed: CI. Failed jobs:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. 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-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.