From 9e5192d917e998d78fd25c4013eb8117f7401068 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 20 Feb 2021 18:51:42 +0100 Subject: Don't lower TypeBound::Lifetime as GenericPredicate::Error --- crates/hir_ty/src/tests/method_resolution.rs | 4 ++-- crates/hir_ty/src/tests/traits.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir_ty/src/tests') diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs index 80e795fbf..659b8fce9 100644 --- a/crates/hir_ty/src/tests/method_resolution.rs +++ b/crates/hir_ty/src/tests/method_resolution.rs @@ -1114,14 +1114,14 @@ fn method_on_dyn_impl() { trait Foo {} impl Foo for u32 {} -impl dyn Foo { +impl dyn Foo + '_ { pub fn dyn_foo(&self) -> u32 { 0 } } fn main() { - let f = &42u32 as &dyn Foo; + let f = &42u32 as &dyn Foo; f.dyn_foo(); // ^u32 } diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 7fce441f2..744fb5ff2 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs @@ -1409,10 +1409,10 @@ fn weird_bounds() { fn test(a: impl Trait + 'lifetime, b: impl 'lifetime, c: impl (Trait), d: impl ('lifetime), e: impl ?Sized, f: impl Trait + ?Sized) {} "#, expect![[r#" - 23..24 'a': impl Trait + {error} - 50..51 'b': impl {error} + 23..24 'a': impl Trait + 50..51 'b': impl 69..70 'c': impl Trait - 86..87 'd': impl {error} + 86..87 'd': impl 107..108 'e': impl {error} 123..124 'f': impl Trait + {error} 147..149 '{}': () -- cgit v1.2.3 From 0799288f0189c07907a30787e7d2f5f0bf960996 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sat, 20 Feb 2021 20:43:04 +0100 Subject: Don't write trailing whitespace when formatting empty GenericPredicates --- crates/hir_ty/src/tests/traits.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src/tests') diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 744fb5ff2..1298e5a88 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs @@ -1410,9 +1410,9 @@ fn weird_bounds() { "#, expect![[r#" 23..24 'a': impl Trait - 50..51 'b': impl + 50..51 'b': impl 69..70 'c': impl Trait - 86..87 'd': impl + 86..87 'd': impl 107..108 'e': impl {error} 123..124 'f': impl Trait + {error} 147..149 '{}': () -- cgit v1.2.3