Skip to content

Conversation

@matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

Muhtasim-Rasheed and others added 17 commits February 1, 2026 19:06
Requiring `fn` in the macro syntax makes it a little more obvious that the
macro declares functions with those names, and makes them easier to grep for.
…=chenyukang

Add FCW for derive helper attributes that will conflict with built-in attributes

Adds a future-compatibility-warning deny-by-default lint that helps catch invalid derive helper attribute names early.

This issues the lint, saying that `ignore` helper will clash with the built-in `ignore` attribute.

```rust
#![crate_type = "proc-macro"]
#![deny(ambiguous_derive_helpers)]
use proc_macro::TokenStream;

#[proc_macro_derive(Trait, attributes(ignore))]
pub fn example(input: TokenStream) -> TokenStream {
    TokenStream::new()
}
```

If you actually tried to use that `ignore` helper attribute, you won't be able to due to the ambiguity:

```rust
#[derive(Trait)]
struct Foo {
    #[ignore]
    field: (),
}
```

Produces:

```
error[E0659]: `ignore` is ambiguous
 --> src/lib.rs:5:7
  |
5 |     #[ignore]
  |       ^^^^^^ ambiguous name
  |
  = note: ambiguous because of a name conflict with a builtin attribute
  = note: `ignore` could refer to a built-in attribute
note: `ignore` could also refer to the derive helper attribute defined here
 --> src/lib.rs:3:10
  |
3 | #[derive(Trait)]
  |          ^^^^^
```
…-message, r=eholk

Add help message suggesting explicit reference cast for From/TryFrom

Closes rust-lang#109829

Improves E0277 diagnostics when a `From` or `TryFrom` implementation is expected, but the provided type is a reference that can be explicitly cast to a type the trait can convert from.
Move `impl Interner for TyCtxt` to its own submodule

This impl is several hundred lines of mostly self-contained, mostly boilerplate code that can be extracted out of the dauntingly large `rustc_middle::ty::context` module.

- The trait and its impl were introduced by rust-lang#97287.

---

There should be no change to compiler behaviour.
…ect-lifetime-diag, r=chenyukang

Modernize diagnostic for indeterminate trait object lifetime bounds

* remove suggestion from the diagnostic message (bad style, too long) and turn it into a structured suggestion
* replace *object type* with *trait object type* since the former is an outdated term
…nkov

typeck: Make it clearer that `check_pat_lit` only handles literal patterns

Nowadays, the `hir::PatExprKind` enum guarantees that “expressions” in patterns can only be paths or literals.

`PatExprKind::Path` is already handled by the previous match arm, so we can make this match arm explicitly match on `PatExprKind::Lit` without losing exhaustiveness.

There should be no actual change to compiler behaviour.
…mimi

Format heterogeneous try blocks

The tracking issue for `try_blocks_heterogeneous` is rust-lang#149488.

This follows the formatting of homogeneous try blocks (feature `try_blocks`) by considering `try bikeshed <type>` to be the equivalent of `try` (in particular a single "token").

An alternative would be to permit breaking between `bikeshed` and `<type>`, but given that those 2 elements are an explicitly temporary part of the syntax, it doesn't seem worth it. There also doesn't seem to be any existing precedent breaking between a keyword and a type. It also doesn't seem to be useful in practice, given that the type itself doesn't break (which is how it works for the return type of closures) and has more chances to dominate the length in case a break is necessary.

Happy to adapt anything in case this formatting is not optimal.

The test is also copied from homogeneous try blocks with 2 additional test cases to demonstrate the behavior with long types.

See [#t-lang > try blocks @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/try.20blocks/near/572387493) for context.
…e, r=lcnr

Uplift `Predicate::allow_normalization` to `rustc_type_ir`

Found this FIXME comment while fixing a bug in rust-analyzer 😄
cc rust-lang/rust-analyzer#21611

r? types
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 10, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) 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-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Feb 10, 2026
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

📌 Commit f1f8dee has been approved by matthiaskrgr

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 Feb 10, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 10, 2026
Rollup of 7 pull requests

Successful merges:

 - #151152 (Add FCW for derive helper attributes that will conflict with built-in attributes)
 - #151954 (Add help message suggesting explicit reference cast for From/TryFrom)
 - #152148 (Move `impl Interner for TyCtxt` to its own submodule)
 - #152226 (Modernize diagnostic for indeterminate trait object lifetime bounds)
 - #150688 (typeck: Make it clearer that `check_pat_lit` only handles literal patterns)
 - #152293 (Format heterogeneous try blocks)
 - #152396 (Uplift `Predicate::allow_normalization` to `rustc_type_ir`)
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    b72a662c47e3   10 days ago   790MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:57ef9cc45f72cc4258ee1baa8243bc3cd55c0a0e570b6768c37346247be35f0d
deleted: sha256:b72a662c47e31df2e7bf59368b2b83be239f02a1baa721393717711a1a719df9
deleted: sha256:3e13ccd80f19769f39008cfc6549938e1ea4905f47b028c1df2dd6085191386c
deleted: sha256:842807995a512b2c5a9b241a3aecdbe79af6b0642d96fa5460cfcf0c9d8be295
deleted: sha256:0f9074b9f46f4570eb7cb4b65fcb3c3d909f9b1d14ca66b30508117b6deda303
deleted: sha256:2ca99cb9251d19157c56b5d91c8961bb4b35196a5ca9b4ffdccbf24abbfe2a5f
---
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_disabled ... ok
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_enabled ... ok
test [ui] tests/ui/abi/abi-sysv64-arg-passing.rs ... ok
test [ui] tests/ui/abi/anon-extern-mod.rs ... ok
test [ui] tests/ui/abi/avr-sram.rs#disable_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#aarch64 ... ok
test [ui] tests/ui/abi/bad-custom.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#arm ... ok
test [ui] tests/ui/abi/avr-sram.rs#has_sram ... ok
test [ui] tests/ui/abi/avr-sram.rs#no_sram ... ok
test [ui] tests/ui/abi/c-zst.rs#aarch64-darwin ... ok
test [ui] tests/ui/abi/c-stack-as-value.rs ... ok
test [ui] tests/ui/abi/c-zst.rs#powerpc-linux ... ok
test [ui] tests/ui/abi/c-zst.rs#s390x-linux ... ok
test [ui] tests/ui/abi/c-zst.rs#sparc64-linux ... ok
---
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/array-slice-vec/vector-no-ann-2.rs ... ok
test [ui] tests/ui/asm/aarch64/arm64ec-sve.rs ... ok
test [ui] tests/ui/array-slice-vec/vector-slice-matching-8498.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/asm-with-nested-closure.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/asm/aarch64v8r.rs#r82 ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... ok
test [ui] tests/ui/asm/binary_asm_labels.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/binary_asm_labels_allowed.rs ... ignored, only executed when the architecture is aarch64
test [ui] tests/ui/asm/cfg-parse-error.rs ... ignored, ignored on targets without inline assembly support
test [ui] tests/ui/asm/cfg.rs#reva ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/cfg.rs#revb ... ignored, only executed when the architecture is x86_64
---
test [ui] tests/ui/const-generics/occurs-check/unused-substs-3.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-2.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-4.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-5.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic-fail.rs ... ok
test [ui] tests/ui/const-generics/ogca/rhs-but-not-root.rs ... ok
test [ui] tests/ui/const-generics/ogca/coherence-ambiguous.rs ... ok
test [ui] tests/ui/const-generics/opaque_types.rs ... ok
test [ui] tests/ui/const-generics/opaque_types2.rs ... ok
test [ui] tests/ui/const-generics/outer-lifetime-in-const-generic-default.rs ... ok
test [ui] tests/ui/const-generics/overlapping_impls.rs ... ok
test [ui] tests/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs#full ... ok
---
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin1 ... ignored, ignored on targets without threading support
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin2 ... ignored, ignored on targets without threading support
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin3 ... ignored, ignored on targets without threading support
test [ui] tests/ui/extern/issue-47725.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ignored, ignored when the architecture is wasm32 (wasi-libc does not have lgamma)
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/issue-13655.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
---
test [ui] tests/ui/feature-gates/feature-gate-macro-derive.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-marker_trait_attr.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-may-dangle.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-mgca-type-const-syntax.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-min-generic-const-args.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-movrs_target_feature.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/feature-gates/feature-gate-min_const_fn.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-more-maybe-bounds.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-naked_functions_rustic_abi.rs ... ignored, only executed when the architecture is x86_64
---
test [ui] tests/ui/imports/ambiguous-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-no-implicit-prelude.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-std.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-core.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-rename-builtin.rs ... ok
---
To only update this specific test, also pass `--test-args attributes/ambiguous_derive_helpers.rs`

error: 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/attributes/ambiguous_derive_helpers.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=wasm32-wasip1" "--check-cfg" "cfg(test,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" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/attributes/ambiguous_derive_helpers" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-wasip1/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
warning: dropping unsupported crate type `proc-macro` for target `wasm32-wasip1`

error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type
##[error]  --> /checkout/tests/ui/attributes/ambiguous_derive_helpers.rs:8:1
   |
LL | #[proc_macro_derive(Trait, attributes(ignore))] //~ ERROR there exists a built-in attribute with the same name
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: there exists a built-in attribute with the same name
##[error]  --> /checkout/tests/ui/attributes/ambiguous_derive_helpers.rs:8:39
   |
LL | #[proc_macro_derive(Trait, attributes(ignore))] //~ ERROR there exists a built-in attribute with the same name
   |                                       ^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #151276 <https://github.com/rust-lang/rust/issues/151276>
note: the lint level is defined here

@rust-bors rust-bors bot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 10, 2026
@rust-bors rust-bors bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

💔 Test for 62463eb failed: CI. Failed job:

@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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 10, 2026

PR #151152, which is a member of this rollup, was unapproved.
This rollup was thus also unapproved.

@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 Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants