diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 89977934cde..abd0b3562d2 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1840,7 +1840,9 @@ fn maybe_expand_private_type_alias<'tcx>( } } - Some(cx.enter_alias(args, def_id.to_def_id(), |cx| clean_ty(&ty, cx))) + Some(cx.enter_alias(args, def_id.to_def_id(), |cx| { + cx.with_param_env(def_id.to_def_id(), |cx| clean_ty(&ty, cx)) + })) } pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type { diff --git a/tests/rustdoc-ui/normalize-in-inlined-type-alias.rs b/tests/rustdoc-ui/normalize-in-inlined-type-alias.rs new file mode 100644 index 00000000000..45e04a70c09 --- /dev/null +++ b/tests/rustdoc-ui/normalize-in-inlined-type-alias.rs @@ -0,0 +1,14 @@ +// check-pass +// compile-flags: -Znormalize-docs + +trait Woo { + type Assoc; +} + +impl Woo for () { + type Assoc = (); +} + +type Alias

= <() as Woo

>::Assoc; + +pub fn hello() -> Alias {}