From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/generics/issue-83556.rs | 4 ++++ tests/ui/generics/issue-83556.stderr | 8 ++++++++ tests/ui/generics/issue-94432-garbage-ice.rs | 2 +- tests/ui/generics/issue-98432.rs | 2 +- tests/ui/generics/issue-98432.stderr | 8 ++++---- 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 tests/ui/generics/issue-83556.rs create mode 100644 tests/ui/generics/issue-83556.stderr (limited to 'tests/ui/generics') diff --git a/tests/ui/generics/issue-83556.rs b/tests/ui/generics/issue-83556.rs new file mode 100644 index 000000000..7cea1c863 --- /dev/null +++ b/tests/ui/generics/issue-83556.rs @@ -0,0 +1,4 @@ +struct Foo(&'a ()); +//~^ ERROR lifetime parameters must be declared prior to + +fn main() {} diff --git a/tests/ui/generics/issue-83556.stderr b/tests/ui/generics/issue-83556.stderr new file mode 100644 index 000000000..93affaffe --- /dev/null +++ b/tests/ui/generics/issue-83556.stderr @@ -0,0 +1,8 @@ +error: lifetime parameters must be declared prior to type and const parameters + --> $DIR/issue-83556.rs:1:15 + | +LL | struct Foo(&'a ()); + | ----^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T>` + +error: aborting due to previous error + diff --git a/tests/ui/generics/issue-94432-garbage-ice.rs b/tests/ui/generics/issue-94432-garbage-ice.rs index d0709e2d2..4ddb3a7e9 100644 --- a/tests/ui/generics/issue-94432-garbage-ice.rs +++ b/tests/ui/generics/issue-94432-garbage-ice.rs @@ -4,7 +4,7 @@ fn�a(){fn�p(){e}} //~ ERROR unknown start of token: \u{fffd} //~^ ERROR unknown start of token: \u{fffd} -//~^^ ERROR can't use generic parameters from outer function [E0401] +//~^^ ERROR can't use generic parameters from outer item [E0401] //~^^^ WARN type parameter `e` should have an upper camel case name fn main(){} diff --git a/tests/ui/generics/issue-98432.rs b/tests/ui/generics/issue-98432.rs index 780c50d6f..c31dea76c 100644 --- a/tests/ui/generics/issue-98432.rs +++ b/tests/ui/generics/issue-98432.rs @@ -2,7 +2,7 @@ struct Struct(T); impl Struct { const CONST: fn() = || { - struct _Obligation where T:; //~ ERROR can't use generic parameters from outer function + struct _Obligation where T:; //~ ERROR can't use generic parameters from outer item }; } diff --git a/tests/ui/generics/issue-98432.stderr b/tests/ui/generics/issue-98432.stderr index c7b5c3361..0736d9410 100644 --- a/tests/ui/generics/issue-98432.stderr +++ b/tests/ui/generics/issue-98432.stderr @@ -1,13 +1,13 @@ -error[E0401]: can't use generic parameters from outer function +error[E0401]: can't use generic parameters from outer item --> $DIR/issue-98432.rs:5:34 | LL | impl Struct { - | - type parameter from outer function + | - type parameter from outer item LL | const CONST: fn() = || { LL | struct _Obligation where T:; - | - ^ use of generic parameter from outer function + | - ^ use of generic parameter from outer item | | - | help: try using a local generic parameter instead: `` + | help: try introducing a local generic parameter here: `` error: aborting due to previous error -- cgit v1.2.3