From d53133eec22e1e7fc6c25dc595708500f36e9ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Sat, 7 Feb 2026 22:03:40 +0100 Subject: [PATCH 1/2] Remove rustdoc adhoc group --- triagebot.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/triagebot.toml b/triagebot.toml index 0ee3d08530349..4a4054391ce73 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -1488,11 +1488,6 @@ infra-ci = [ "@jdno", "@jieyouxu", ] -rustdoc = [ - "@GuillaumeGomez", - "@notriddle", - "@fmease", -] docs = [ "@ehuss", "@GuillaumeGomez", From 9433d7bcb46c1b103ef29c3dce5f6b3cdfc2a820 Mon Sep 17 00:00:00 2001 From: Ruiyang Wang Date: Sat, 7 Feb 2026 17:57:53 +0000 Subject: [PATCH 2/2] Fix bound var resolution for trait aliases Handle DefKind::TraitAlias in resolve_bound_vars so that associated item constraints and return type notation work through trait aliases. --- .../src/collect/resolve_bound_vars.rs | 5 +++-- .../return-type-notation/trait-alias.rs | 13 +++++++++++++ .../trait-alias-bound-vars.rs | 12 ++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/ui/associated-type-bounds/return-type-notation/trait-alias.rs create mode 100644 tests/ui/associated-type-bounds/trait-alias-bound-vars.rs diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs index 26f79d374075b..d4a01d26a1fc4 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -1695,7 +1695,8 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> { | DefKind::Union | DefKind::Enum | DefKind::TyAlias - | DefKind::Trait, + | DefKind::Trait + | DefKind::TraitAlias, def_id, ) if depth == 0 => Some(def_id), _ => None, @@ -1865,7 +1866,7 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> { if constraint.gen_args.parenthesized == hir::GenericArgsParentheses::ReturnTypeNotation { let bound_vars = if let Some(type_def_id) = type_def_id - && self.tcx.def_kind(type_def_id) == DefKind::Trait + && let DefKind::Trait | DefKind::TraitAlias = self.tcx.def_kind(type_def_id) && let Some((mut bound_vars, assoc_fn)) = BoundVarContext::supertrait_hrtb_vars( self.tcx, type_def_id, diff --git a/tests/ui/associated-type-bounds/return-type-notation/trait-alias.rs b/tests/ui/associated-type-bounds/return-type-notation/trait-alias.rs new file mode 100644 index 0000000000000..88f60a72afa19 --- /dev/null +++ b/tests/ui/associated-type-bounds/return-type-notation/trait-alias.rs @@ -0,0 +1,13 @@ +// Regression test for . +//@ check-pass +#![feature(return_type_notation, trait_alias)] + +trait Tr { + fn f() -> impl Sized; +} + +trait Al = Tr; + +fn f>() {} + +fn main() {} diff --git a/tests/ui/associated-type-bounds/trait-alias-bound-vars.rs b/tests/ui/associated-type-bounds/trait-alias-bound-vars.rs new file mode 100644 index 0000000000000..bf0a17523997d --- /dev/null +++ b/tests/ui/associated-type-bounds/trait-alias-bound-vars.rs @@ -0,0 +1,12 @@ +// Check that we're successfully collecting bound vars behind trait aliases. +// Regression test for . +//@ check-pass +//@ needs-rustc-debug-assertions +#![feature(trait_alias)] + +trait A<'a> { type X; } +trait B: for<'a> A<'a> {} +trait C = B; + +fn f() where T: C {} +fn g() where T: C A<'r>> {}