]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/dropck/reject-specialized-drops-8142.stderr
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / dropck / reject-specialized-drops-8142.stderr
index 8dbde9d417df095da5466d3e6ce6418329ef1ed8..7f50cf5ab15d27bfb6d1464da69161116d20a24f 100644 (file)
@@ -22,35 +22,34 @@ note: the implementor must specify the same requirement
 LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0308]: mismatched types
+error[E0366]: `Drop` impls cannot be specialized
   --> $DIR/reject-specialized-drops-8142.rs:34:1
    |
 LL | impl                    Drop for N<'static>     { fn drop(&mut self) { } } // REJECT
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: expected struct `N<'n>`
-              found struct `N<'static>`
-note: the lifetime `'n` as defined here...
-  --> $DIR/reject-specialized-drops-8142.rs:7:10
+   = note: `'static` is not a generic parameter
+note: use the same sequence of generic lifetime, type and const parameters as the struct definition
+  --> $DIR/reject-specialized-drops-8142.rs:7:1
    |
 LL | struct N<'n> { x: &'n i8 }
-   |          ^^
-   = note: ...does not necessarily outlive the static lifetime
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0366]: `Drop` impls cannot be specialized
-  --> $DIR/reject-specialized-drops-8142.rs:41:1
+  --> $DIR/reject-specialized-drops-8142.rs:39:1
    |
 LL | impl              Drop for P<i8>          { fn drop(&mut self) { } } // REJECT
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: use the same sequence of generic type, lifetime and const parameters as the struct definition
+   = note: `i8` is not a generic parameter
+note: use the same sequence of generic lifetime, type and const parameters as the struct definition
   --> $DIR/reject-specialized-drops-8142.rs:9:1
    |
 LL | struct P<Tp> { x: *const Tp }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:44:14
+  --> $DIR/reject-specialized-drops-8142.rs:42:14
    |
 LL | impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
    |              ^^^^^
@@ -62,7 +61,7 @@ LL | struct Q<Tq> { x: *const Tq }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0367]: `Drop` impl requires `AddsRBnd: 'rbnd` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:47:21
+  --> $DIR/reject-specialized-drops-8142.rs:45:21
    |
 LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
    |                     ^^^^^
@@ -74,67 +73,59 @@ LL | struct R<Tr> { x: *const Tr }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0366]: `Drop` impls cannot be specialized
-  --> $DIR/reject-specialized-drops-8142.rs:56:1
+  --> $DIR/reject-specialized-drops-8142.rs:54:1
    |
 LL | impl<One>         Drop for V<One,One>     { fn drop(&mut self) { } } // REJECT
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: use the same sequence of generic type, lifetime and const parameters as the struct definition
+   = note: `One` is mentioned multiple times
+note: use the same sequence of generic lifetime, type and const parameters as the struct definition
   --> $DIR/reject-specialized-drops-8142.rs:15:1
    |
 LL | struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'lw` due to conflicting requirements
-  --> $DIR/reject-specialized-drops-8142.rs:59:1
+error[E0366]: `Drop` impls cannot be specialized
+  --> $DIR/reject-specialized-drops-8142.rs:57:1
    |
 LL | impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: first, the lifetime cannot outlive the lifetime `'l1` as defined here...
-  --> $DIR/reject-specialized-drops-8142.rs:16:10
-   |
-LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
-   |          ^^^
-note: ...but the lifetime must also be valid for the lifetime `'l2` as defined here...
-  --> $DIR/reject-specialized-drops-8142.rs:16:15
+   = note: `'lw` is mentioned multiple times
+note: use the same sequence of generic lifetime, type and const parameters as the struct definition
+  --> $DIR/reject-specialized-drops-8142.rs:16:1
    |
 LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
-   |               ^^^
-note: ...so that the types are compatible
-  --> $DIR/reject-specialized-drops-8142.rs:59:1
-   |
-LL | impl<'lw>         Drop for W<'lw,'lw>     { fn drop(&mut self) { } } // REJECT
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: expected `W<'l1, 'l2>`
-              found `W<'_, '_>`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0366]: `Drop` impls cannot be specialized
-  --> $DIR/reject-specialized-drops-8142.rs:62:1
+  --> $DIR/reject-specialized-drops-8142.rs:60:1
    |
 LL | impl              Drop for X<3>           { fn drop(&mut self) { } } // REJECT
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: use the same sequence of generic type, lifetime and const parameters as the struct definition
+   = note: `3_usize` is not a generic parameter
+note: use the same sequence of generic lifetime, type and const parameters as the struct definition
   --> $DIR/reject-specialized-drops-8142.rs:17:1
    |
 LL | struct X<const Ca: usize>;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0366]: `Drop` impls cannot be specialized
-  --> $DIR/reject-specialized-drops-8142.rs:65:1
+  --> $DIR/reject-specialized-drops-8142.rs:63:1
    |
 LL | impl<const Ca: usize> Drop for Y<Ca, Ca>     { fn drop(&mut self) { } } // REJECT
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: use the same sequence of generic type, lifetime and const parameters as the struct definition
+   = note: `Ca` is mentioned multiple times
+note: use the same sequence of generic lifetime, type and const parameters as the struct definition
   --> $DIR/reject-specialized-drops-8142.rs:18:1
    |
 LL | struct Y<const Ca: usize, const Cb: usize>;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the enum it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:68:14
+  --> $DIR/reject-specialized-drops-8142.rs:66:14
    |
 LL | impl<AddsBnd:Bound> Drop for Enum<AddsBnd> { fn drop(&mut self) { } } // REJECT
    |              ^^^^^
@@ -146,7 +137,7 @@ LL | enum Enum<T> { Variant(T) }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the struct it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:71:14
+  --> $DIR/reject-specialized-drops-8142.rs:69:14
    |
 LL | impl<AddsBnd:Bound> Drop for TupleStruct<AddsBnd> { fn drop(&mut self) { } } // REJECT
    |              ^^^^^
@@ -158,7 +149,7 @@ LL | struct TupleStruct<T>(T);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not
-  --> $DIR/reject-specialized-drops-8142.rs:74:21
+  --> $DIR/reject-specialized-drops-8142.rs:72:21
    |
 LL | impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
    |                     ^^^^^
@@ -171,5 +162,5 @@ LL | union Union<T: Copy> { f: T }
 
 error: aborting due to 13 previous errors
 
-Some errors have detailed explanations: E0308, E0366, E0367, E0495.
-For more information about an error, try `rustc --explain E0308`.
+Some errors have detailed explanations: E0366, E0367.
+For more information about an error, try `rustc --explain E0366`.