Clean inlined type alias with correct param-env
This commit is contained in:
parent
084ce5bdb5
commit
fc7693d63b
@ -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 {
|
||||
|
14
tests/rustdoc-ui/normalize-in-inlined-type-alias.rs
Normal file
14
tests/rustdoc-ui/normalize-in-inlined-type-alias.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// check-pass
|
||||
// compile-flags: -Znormalize-docs
|
||||
|
||||
trait Woo<T> {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
impl<T> Woo<T> for () {
|
||||
type Assoc = ();
|
||||
}
|
||||
|
||||
type Alias<P> = <() as Woo<P>>::Assoc;
|
||||
|
||||
pub fn hello<S>() -> Alias<S> {}
|
Loading…
Reference in New Issue
Block a user