Skip to content

Commit 9eb0661

Browse files
authored
Unrolled build for rust-lang#120956
Rollup merge of rust-lang#120956 - compiler-errors:clean-type-alias, r=GuillaumeGomez Clean inlined type alias with correct param-env We were cleaning the `hir::Ty` of a type alias item in the param-env of the item that *references* the type alias, and not the alias's own param-env. Fixes rust-lang#120954
2 parents bdc1592 + fc7693d commit 9eb0661

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/librustdoc/clean/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,9 @@ fn maybe_expand_private_type_alias<'tcx>(
18401840
}
18411841
}
18421842

1843-
Some(cx.enter_alias(args, def_id.to_def_id(), |cx| clean_ty(&ty, cx)))
1843+
Some(cx.enter_alias(args, def_id.to_def_id(), |cx| {
1844+
cx.with_param_env(def_id.to_def_id(), |cx| clean_ty(&ty, cx))
1845+
}))
18441846
}
18451847

18461848
pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// check-pass
2+
// compile-flags: -Znormalize-docs
3+
4+
trait Woo<T> {
5+
type Assoc;
6+
}
7+
8+
impl<T> Woo<T> for () {
9+
type Assoc = ();
10+
}
11+
12+
type Alias<P> = <() as Woo<P>>::Assoc;
13+
14+
pub fn hello<S>() -> Alias<S> {}

0 commit comments

Comments
 (0)