Skip to content

Commit fc7693d

Browse files
Clean inlined type alias with correct param-env
1 parent 084ce5b commit fc7693d

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)