about summary refs log tree commit diff
path: root/src/test/ui/issues
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2018-11-18 13:25:53 -0500
committerNiko Matsakis <niko@alum.mit.edu>2019-01-02 17:35:06 -0500
commit6cbbee1dc7ec5c680bb5c83af0aa1b16b3a03cc0 (patch)
tree0dc929297bda1fbc9ab4585909457ab3cd16be4f /src/test/ui/issues
parent0a61d682a194954494df3cdefb926172c5d423c4 (diff)
downloadrust-6cbbee1dc7ec5c680bb5c83af0aa1b16b3a03cc0.tar.gz
rust-6cbbee1dc7ec5c680bb5c83af0aa1b16b3a03cc0.zip
apply the new placeholder errors even with just one placeholder
Diffstat (limited to 'src/test/ui/issues')
-rw-r--r--src/test/ui/issues/issue-54302-cases.rs8
-rw-r--r--src/test/ui/issues/issue-54302-cases.stderr37
-rw-r--r--src/test/ui/issues/issue-54302.rs2
-rw-r--r--src/test/ui/issues/issue-54302.stderr10
4 files changed, 20 insertions, 37 deletions
diff --git a/src/test/ui/issues/issue-54302-cases.rs b/src/test/ui/issues/issue-54302-cases.rs
index 286d37b182e..faa116269ee 100644
--- a/src/test/ui/issues/issue-54302-cases.rs
+++ b/src/test/ui/issues/issue-54302-cases.rs
@@ -61,25 +61,25 @@ impl<T> RefFoo<T> for T where for<'a> &'a T: Foo<'static, T> {
 fn coerce_lifetime1(a: &u32) -> &'static u32
 {
     <u32 as RefFoo<u32>>::ref_foo(a)
-    //~^ ERROR cannot infer
+    //~^ ERROR not general enough
 }
 
 fn coerce_lifetime2(a: &i32) -> &'static i32
 {
     <i32 as RefFoo<i32>>::ref_foo(a)
-    //~^ ERROR cannot infer
+    //~^ ERROR not general enough
 }
 
 fn coerce_lifetime3(a: &u64) -> &'static u64
 {
     <u64 as RefFoo<u64>>::ref_foo(a)
-    //~^ ERROR cannot infer
+    //~^ ERROR not general enough
 }
 
 fn coerce_lifetime4(a: &i64) -> &'static i64
 {
     <i64 as RefFoo<i64>>::ref_foo(a)
-    //~^ ERROR cannot infer
+    //~^ ERROR not general enough
 }
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-54302-cases.stderr b/src/test/ui/issues/issue-54302-cases.stderr
index 09a4e091d2b..6469829e789 100644
--- a/src/test/ui/issues/issue-54302-cases.stderr
+++ b/src/test/ui/issues/issue-54302-cases.stderr
@@ -1,51 +1,38 @@
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements
+error: implementation of `Foo` is not general enough
   --> $DIR/issue-54302-cases.rs:63:5
    |
 LL |     <u32 as RefFoo<u32>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U2, name: BrNamed(crate0:DefIndex(1:27), 'a) })...
-   = note: ...but the lifetime must also be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected Foo<'static, u32>
-              found Foo<'_, u32>
+   = note: `&'0 u32` must implement `Foo<'static, u32>` for any lifetime `'0`
+   = note: but `&'1 _` only implements `Foo<'_, _>` for some lifetime `'1`
 
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements
+error: implementation of `Foo` is not general enough
   --> $DIR/issue-54302-cases.rs:69:5
    |
 LL |     <i32 as RefFoo<i32>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U2, name: BrNamed(crate0:DefIndex(1:27), 'a) })...
-   = note: ...but the lifetime must also be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected Foo<'static, i32>
-              found Foo<'_, i32>
+   = note: `&'0 i32` must implement `Foo<'static, i32>` for any lifetime `'0`
+   = note: but `&'1 _` only implements `Foo<'_, _>` for some lifetime `'1`
 
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements
+error: implementation of `Foo` is not general enough
   --> $DIR/issue-54302-cases.rs:75:5
    |
 LL |     <u64 as RefFoo<u64>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U2, name: BrNamed(crate0:DefIndex(1:27), 'a) })...
-   = note: ...but the lifetime must also be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected Foo<'static, u64>
-              found Foo<'_, u64>
+   = note: `&'0 u64` must implement `Foo<'static, u64>` for any lifetime `'0`
+   = note: but `&'1 _` only implements `Foo<'_, _>` for some lifetime `'1`
 
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements
+error: implementation of `Foo` is not general enough
   --> $DIR/issue-54302-cases.rs:81:5
    |
 LL |     <i64 as RefFoo<i64>>::ref_foo(a)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U2, name: BrNamed(crate0:DefIndex(1:27), 'a) })...
-   = note: ...but the lifetime must also be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected Foo<'static, i64>
-              found Foo<'_, i64>
+   = note: `&'0 i64` must implement `Foo<'static, i64>` for any lifetime `'0`
+   = note: but `&'1 _` only implements `Foo<'_, _>` for some lifetime `'1`
 
 error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/issues/issue-54302.rs b/src/test/ui/issues/issue-54302.rs
index 35cdc73a78f..1bfaebc3895 100644
--- a/src/test/ui/issues/issue-54302.rs
+++ b/src/test/ui/issues/issue-54302.rs
@@ -11,7 +11,7 @@ fn main() {
     // Then why does it implement DeserializeOwned? This compiles.
     fn assert_deserialize_owned<T: DeserializeOwned>() {}
     assert_deserialize_owned::<&'static str>();
-    //~^ ERROR E0495
+    //~^ ERROR not general enough
 
     // It correctly does not implement for<'de> Deserialize<'de>.
     //fn assert_hrtb<T: for<'de> Deserialize<'de>>() {}
diff --git a/src/test/ui/issues/issue-54302.stderr b/src/test/ui/issues/issue-54302.stderr
index b456d2582ff..1b255204b6e 100644
--- a/src/test/ui/issues/issue-54302.stderr
+++ b/src/test/ui/issues/issue-54302.stderr
@@ -1,15 +1,11 @@
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'de` due to conflicting requirements
+error: implementation of `Deserialize` is not general enough
   --> $DIR/issue-54302.rs:13:5
    |
 LL |     assert_deserialize_owned::<&'static str>();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U2, name: BrNamed(crate0:DefIndex(1:12), 'de) })...
-   = note: ...but the lifetime must also be valid for the static lifetime...
-   = note: ...so that the types are compatible:
-           expected Deserialize<'de>
-              found Deserialize<'_>
+   = note: `&'static str` must implement `Deserialize<'0>` for any lifetime `'0`
+   = note: but `&str` only implements `Deserialize<'1>` for some lifetime `'1`
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0495`.