From ced65022dae81b46e629262d8458cc3e5ac8cec1 Mon Sep 17 00:00:00 2001 From: lcnr Date: Tue, 29 Mar 2022 07:29:59 +0200 Subject: [PATCH] update error message --- compiler/rustc_typeck/src/check/dropck.rs | 2 +- src/test/ui/dropck/issue-38868.stderr | 2 +- .../ui/dropck/reject-specialized-drops-8142.stderr | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/rustc_typeck/src/check/dropck.rs b/compiler/rustc_typeck/src/check/dropck.rs index 0b0f7a085fc..41b895f3bbf 100644 --- a/compiler/rustc_typeck/src/check/dropck.rs +++ b/compiler/rustc_typeck/src/check/dropck.rs @@ -86,7 +86,7 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>( err.span_note( item_span, &format!( - "use the same sequence of generic type, lifetime and const parameters \ + "use the same sequence of generic lifetime, type and const parameters \ as the {self_descr} definition", ), ); diff --git a/src/test/ui/dropck/issue-38868.stderr b/src/test/ui/dropck/issue-38868.stderr index f369b74cf55..f267abc0bfa 100644 --- a/src/test/ui/dropck/issue-38868.stderr +++ b/src/test/ui/dropck/issue-38868.stderr @@ -9,7 +9,7 @@ LL | | } | |_^ | = note: `i32` is not a generic parameter -note: use the same sequence of generic type, lifetime and const parameters as the struct definition +note: use the same sequence of generic lifetime, type and const parameters as the struct definition --> $DIR/issue-38868.rs:1:1 | LL | / pub struct List { diff --git a/src/test/ui/dropck/reject-specialized-drops-8142.stderr b/src/test/ui/dropck/reject-specialized-drops-8142.stderr index 82e95ea075d..7f50cf5ab15 100644 --- a/src/test/ui/dropck/reject-specialized-drops-8142.stderr +++ b/src/test/ui/dropck/reject-specialized-drops-8142.stderr @@ -29,7 +29,7 @@ LL | impl Drop for N<'static> { fn drop(&mut self) { } } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `'static` is not a generic parameter -note: use the same sequence of generic type, lifetime and const parameters as the struct definition +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 } @@ -42,7 +42,7 @@ LL | impl Drop for P { fn drop(&mut self) { } } // REJ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `i8` is not a generic parameter -note: use the same sequence of generic type, lifetime and const parameters as the struct definition +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 { x: *const Tp } @@ -79,7 +79,7 @@ LL | impl Drop for V { fn drop(&mut self) { } } // REJ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `One` is mentioned multiple times -note: use the same sequence of generic type, lifetime and const parameters as the struct definition +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 { x: *const Tva, y: *const Tvb } @@ -92,7 +92,7 @@ LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `'lw` is mentioned multiple times -note: use the same sequence of generic type, lifetime and const parameters as the struct definition +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 } @@ -105,7 +105,7 @@ LL | impl Drop for X<3> { fn drop(&mut self) { } } // REJ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `3_usize` is not a generic parameter -note: use the same sequence of generic type, lifetime and const parameters as the struct definition +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; @@ -118,7 +118,7 @@ LL | impl Drop for Y { fn drop(&mut self) { } } // | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `Ca` is mentioned multiple times -note: use the same sequence of generic type, lifetime and const parameters as the struct definition +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;