diff --git a/compiler/rustc_ast_lowering/Cargo.toml b/compiler/rustc_ast_lowering/Cargo.toml index ce1c8d4997d74..c2a2bc795c382 100644 --- a/compiler/rustc_ast_lowering/Cargo.toml +++ b/compiler/rustc_ast_lowering/Cargo.toml @@ -3,8 +3,7 @@ name = "rustc_ast_lowering" version = "0.0.0" edition = "2021" -[lib] -doctest = false + [dependencies] rustc_arena = { path = "../rustc_arena" } diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 427b71722abcc..36a493ce02de8 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -1418,6 +1418,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { /// Given a function definition like: /// /// ```rust + /// use std::fmt::Debug; /// fn test<'a, T: Debug>(x: &'a T) -> impl Debug + 'a { /// x /// } @@ -1425,14 +1426,16 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { /// /// we will create a TAIT definition in the HIR like /// - /// ``` + /// ```ignore (cannot-test-this-because-type) /// type TestReturn<'a, T, 'x> = impl Debug + 'x /// ``` - /// - /// and return a type like `TestReturn<'static, T, 'a>`, so that the function looks like: + /// and return a type like `TestReturn<'a, 'x, 'T>`, so that the function looks like: /// /// ```rust - /// fn test<'a, T: Debug>(x: &'a T) -> TestReturn<'static, T, 'a> + /// #![feature(type_alias_impl_trait)] + /// use std::fmt::Debug; + /// type TestReturn<'a, 'x, T> = impl Debug + 'x; + /// fn test<'a, 'x, T: Debug>(x: &'a T) -> TestReturn<'a, 'x, T>{} /// ``` /// /// Note the subtlety around type parameters! The new TAIT, `TestReturn`, inherits all the