Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 14 additions & 0 deletions tests/rustdoc-ui/normalize-in-inlined-type-alias.rs
Original file line number Diff line number Diff line change
@@ -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> {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, here we were trying to normalize <() as Woo<P>>::Assoc (the type of Alias<P>) in a param-env that was [S: Sized].