From 3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:43 +0200 Subject: Merging upstream version 1.69.0+dfsg1. Signed-off-by: Daniel Baumann --- .../brackets-to-braces-single-element.stderr | 6 ++--- .../did_you_mean/compatible-variants-in-pat.stderr | 6 ++--- tests/ui/did_you_mean/compatible-variants.stderr | 26 +++++++++++----------- tests/ui/did_you_mean/issue-42764.stderr | 4 ++-- .../issue-46718-struct-pattern-dotdotdot.stderr | 7 +++++- tests/ui/did_you_mean/println-typo.rs | 6 +++++ tests/ui/did_you_mean/println-typo.stderr | 11 +++++++++ tests/ui/did_you_mean/recursion_limit_deref.stderr | 2 +- 8 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 tests/ui/did_you_mean/println-typo.rs create mode 100644 tests/ui/did_you_mean/println-typo.stderr (limited to 'tests/ui/did_you_mean') diff --git a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr index 6ded03e45..a7ec19259 100644 --- a/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr +++ b/tests/ui/did_you_mean/brackets-to-braces-single-element.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:1:24 | LL | const A: [&str; 1] = { "hello" }; - | ^^^^^^^ expected array `[&'static str; 1]`, found `&str` + | ^^^^^^^ expected `[&str; 1]`, found `&str` | help: to create an array, use square brackets instead of curly braces | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:4:19 | LL | const B: &[u32] = &{ 1 }; - | ^^^^^^ expected slice `[u32]`, found integer + | ^^^^^^ expected `&[u32]`, found `&{integer}` | = note: expected reference `&'static [u32]` found reference `&{integer}` @@ -26,7 +26,7 @@ error[E0308]: mismatched types --> $DIR/brackets-to-braces-single-element.rs:7:27 | LL | const C: &&[u32; 1] = &&{ 1 }; - | ^ expected array `[u32; 1]`, found integer + | ^ expected `[u32; 1]`, found integer | help: to create an array, use square brackets instead of curly braces | diff --git a/tests/ui/did_you_mean/compatible-variants-in-pat.stderr b/tests/ui/did_you_mean/compatible-variants-in-pat.stderr index 473468af6..5e48871bb 100644 --- a/tests/ui/did_you_mean/compatible-variants-in-pat.stderr +++ b/tests/ui/did_you_mean/compatible-variants-in-pat.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | match f { | - this expression has type `Foo` LL | Bar { x } => { - | ^^^^^^^^^ expected enum `Foo`, found struct `Bar` + | ^^^^^^^^^ expected `Foo`, found `Bar` | help: try wrapping the pattern in `Foo::Bar` | @@ -22,7 +22,7 @@ LL | match s { LL | S => { | ^ | | - | expected enum `Option`, found struct `S` + | expected `Option`, found `S` | `S` is interpreted as a unit struct, not a new binding | = note: expected enum `Option` @@ -47,7 +47,7 @@ LL | match s { LL | S => { | ^ | | - | expected enum `Result`, found struct `S` + | expected `Result`, found `S` | `S` is interpreted as a unit struct, not a new binding | = note: expected enum `Result` diff --git a/tests/ui/did_you_mean/compatible-variants.stderr b/tests/ui/did_you_mean/compatible-variants.stderr index fe81da198..7b88d93ea 100644 --- a/tests/ui/did_you_mean/compatible-variants.stderr +++ b/tests/ui/did_you_mean/compatible-variants.stderr @@ -7,7 +7,7 @@ LL | / while false { LL | | LL | | f(); LL | | } - | |_____^ expected enum `Option`, found `()` + | |_____^ expected `Option<()>`, found `()` | = note: expected enum `Option<()>` found unit type `()` @@ -26,7 +26,7 @@ error[E0308]: mismatched types LL | fn b() -> Result<(), ()> { | -------------- expected `Result<(), ()>` because of return type LL | f() - | ^^^ expected enum `Result`, found `()` + | ^^^ expected `Result<(), ()>`, found `()` | = note: expected enum `Result<(), ()>` found unit type `()` @@ -45,7 +45,7 @@ LL | / for _ in [1, 2] { LL | | LL | | f(); LL | | } - | |_____^ expected enum `Option`, found `()` + | |_____^ expected `Option<()>`, found `()` | = note: expected enum `Option<()>` found unit type `()` @@ -62,7 +62,7 @@ error[E0308]: `?` operator has incompatible types --> $DIR/compatible-variants.rs:35:5 | LL | c()? - | ^^^^ expected enum `Option`, found `()` + | ^^^^ expected `Option<()>`, found `()` | = note: `?` operator cannot convert from `()` to `Option<()>` = note: expected enum `Option<()>` @@ -85,7 +85,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:42:25 | LL | let _: Option<()> = while false {}; - | ---------- ^^^^^^^^^^^^^^ expected enum `Option`, found `()` + | ---------- ^^^^^^^^^^^^^^ expected `Option<()>`, found `()` | | | expected due to this | @@ -100,7 +100,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:46:9 | LL | while false {} - | ^^^^^^^^^^^^^^ expected enum `Option`, found `()` + | ^^^^^^^^^^^^^^ expected `Option<()>`, found `()` | = note: expected enum `Option<()>` found unit type `()` @@ -117,7 +117,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:50:31 | LL | let _: Result = 1; - | ---------------- ^ expected enum `Result`, found integer + | ---------------- ^ expected `Result`, found integer | | | expected due to this | @@ -134,7 +134,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:53:26 | LL | let _: Option = 1; - | ----------- ^ expected enum `Option`, found integer + | ----------- ^ expected `Option`, found integer | | | expected due to this | @@ -149,7 +149,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:56:28 | LL | let _: Hey = 1; - | ------------- ^ expected enum `Hey`, found integer + | ------------- ^ expected `Hey`, found integer | | | expected due to this | @@ -166,7 +166,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:59:29 | LL | let _: Hey = false; - | -------------- ^^^^^ expected enum `Hey`, found `bool` + | -------------- ^^^^^ expected `Hey`, found `bool` | | | expected due to this | @@ -181,7 +181,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:63:19 | LL | let _ = Foo { bar }; - | ^^^ expected enum `Option`, found `i32` + | ^^^ expected `Option`, found `i32` | = note: expected enum `Option` found type `i32` @@ -194,7 +194,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:80:16 | LL | let a: A = B::Fst; - | - ^^^^^^ expected enum `A`, found enum `B` + | - ^^^^^^ expected `A`, found `B` | | | expected due to this | @@ -207,7 +207,7 @@ error[E0308]: mismatched types --> $DIR/compatible-variants.rs:86:17 | LL | let a: A2 = B::Fst; - | -- ^^^^^^ expected struct `A2`, found enum `B` + | -- ^^^^^^ expected `A2`, found `B` | | | expected due to this | diff --git a/tests/ui/did_you_mean/issue-42764.stderr b/tests/ui/did_you_mean/issue-42764.stderr index 6a7fd8fe2..3819a5a18 100644 --- a/tests/ui/did_you_mean/issue-42764.stderr +++ b/tests/ui/did_you_mean/issue-42764.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-42764.rs:11:43 | LL | this_function_expects_a_double_option(n); - | ------------------------------------- ^ expected enum `DoubleOption`, found `usize` + | ------------------------------------- ^ expected `DoubleOption<_>`, found `usize` | | | arguments to this function are incorrect | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/issue-42764.rs:27:33 | LL | let _c = Context { wrapper: Payload{} }; - | ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload` + | ^^^^^^^^^ expected `Wrapper`, found `Payload` | help: try wrapping the expression in `Wrapper` | diff --git a/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr b/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr index bfe1ed328..589b2c378 100644 --- a/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr +++ b/tests/ui/did_you_mean/issue-46718-struct-pattern-dotdotdot.stderr @@ -2,7 +2,12 @@ error: expected field pattern, found `...` --> $DIR/issue-46718-struct-pattern-dotdotdot.rs:11:55 | LL | PersonalityInventory { expressivity: exp, ... } => exp - | ^^^ help: to omit remaining fields, use one fewer `.`: `..` + | ^^^ + | +help: to omit remaining fields, use `..` + | +LL | PersonalityInventory { expressivity: exp, .. } => exp + | ~~ error: aborting due to previous error diff --git a/tests/ui/did_you_mean/println-typo.rs b/tests/ui/did_you_mean/println-typo.rs new file mode 100644 index 000000000..685b5e1f2 --- /dev/null +++ b/tests/ui/did_you_mean/println-typo.rs @@ -0,0 +1,6 @@ +// https://internals.rust-lang.org/t/18227 + +fn main() { + prinltn!(); //~ ERROR cannot find macro `prinltn` in this scope + //^ a macro with a similar name exists: `println` +} diff --git a/tests/ui/did_you_mean/println-typo.stderr b/tests/ui/did_you_mean/println-typo.stderr new file mode 100644 index 000000000..43b7b1894 --- /dev/null +++ b/tests/ui/did_you_mean/println-typo.stderr @@ -0,0 +1,11 @@ +error: cannot find macro `prinltn` in this scope + --> $DIR/println-typo.rs:4:5 + | +LL | prinltn!(); + | ^^^^^^^ help: a macro with a similar name exists: `println` + --> $SRC_DIR/std/src/macros.rs:LL:COL + | + = note: similarly named macro `println` defined here + +error: aborting due to previous error + diff --git a/tests/ui/did_you_mean/recursion_limit_deref.stderr b/tests/ui/did_you_mean/recursion_limit_deref.stderr index a6b5681a6..32fb628c4 100644 --- a/tests/ui/did_you_mean/recursion_limit_deref.stderr +++ b/tests/ui/did_you_mean/recursion_limit_deref.stderr @@ -10,7 +10,7 @@ error[E0308]: mismatched types --> $DIR/recursion_limit_deref.rs:51:22 | LL | let x: &Bottom = &t; - | ------- ^^ expected struct `Bottom`, found struct `Top` + | ------- ^^ expected `&Bottom`, found `&Top` | | | expected due to this | -- cgit v1.2.3