Render Fn* trait objects and impl types as rust does

This commit is contained in:
Lukas Wirth 2021-01-12 20:19:13 +01:00
parent e9e3ab549d
commit 3d6480bc31
6 changed files with 134 additions and 31 deletions

View file

@ -39,3 +39,18 @@ fn main() {
"#,
);
}
#[test]
fn render_raw_ptr_impl_ty() {
check_types_source_code(
r#"
trait Sized {}
trait Unpin {}
fn foo() -> *const (impl Unpin + Sized) { loop {} }
fn main() {
let foo = foo();
foo;
} //^ *const (impl Unpin + Sized)
"#,
);
}