diff options
Diffstat (limited to 'tests')
65 files changed, 1520 insertions, 340 deletions
diff --git a/tests/crashes/127009.rs b/tests/crashes/127009.rs new file mode 100644 index 00000000000..74ca14393e4 --- /dev/null +++ b/tests/crashes/127009.rs @@ -0,0 +1,11 @@ +//@ known-bug: #127009 + +#![feature(non_lifetime_binders)] + +fn b() +where + for<const C: usize> [(); C]: Copy, +{ +} + +fn main() {} diff --git a/tests/run-make/archive-duplicate-names/Makefile b/tests/run-make/archive-duplicate-names/Makefile deleted file mode 100644 index 207eee39299..00000000000 --- a/tests/run-make/archive-duplicate-names/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# When two object archives with the same filename are present, an iterator is supposed to inspect each object, recognize the duplication and extract each one to a different directory. -# This test checks that this duplicate handling behaviour has not been broken. -# See https://github.com/rust-lang/rust/pull/24439 - -# ignore-cross-compile -include ../tools.mk - -all: - mkdir $(TMPDIR)/a - mkdir $(TMPDIR)/b - $(call COMPILE_OBJ,$(TMPDIR)/a/foo.o,foo.c) - $(call COMPILE_OBJ,$(TMPDIR)/b/foo.o,bar.c) - $(AR) crus $(TMPDIR)/libfoo.a $(TMPDIR)/a/foo.o $(TMPDIR)/b/foo.o - $(RUSTC) foo.rs - $(RUSTC) bar.rs - $(call RUN,bar) diff --git a/tests/run-make/archive-duplicate-names/rmake.rs b/tests/run-make/archive-duplicate-names/rmake.rs new file mode 100644 index 00000000000..62a35566199 --- /dev/null +++ b/tests/run-make/archive-duplicate-names/rmake.rs @@ -0,0 +1,37 @@ +// When two object archives with the same filename are present, an iterator is supposed to +// inspect each object, recognize the duplication and extract each one to a different directory. +// This test checks that this duplicate handling behaviour has not been broken. +// See https://github.com/rust-lang/rust/pull/24439 + +//@ ignore-cross-compile +// Reason: the compiled binary is executed + +use run_make_support::{cc, is_msvc, llvm_ar, rfs, run, rustc}; + +fn main() { + rfs::create_dir("a"); + rfs::create_dir("b"); + compile_obj_force_foo("a", "foo"); + compile_obj_force_foo("b", "bar"); + let mut ar = llvm_ar(); + ar.obj_to_ar().arg("libfoo.a"); + if is_msvc() { + ar.arg("a/foo.obj").arg("b/foo.obj").run(); + } else { + ar.arg("a/foo.o").arg("b/foo.o").run(); + } + rustc().input("foo.rs").run(); + rustc().input("bar.rs").run(); + run("bar"); +} + +#[track_caller] +pub fn compile_obj_force_foo(dir: &str, lib_name: &str) { + let obj_file = if is_msvc() { format!("{dir}/foo") } else { format!("{dir}/foo.o") }; + let src = format!("{lib_name}.c"); + if is_msvc() { + cc().arg("-c").out_exe(&obj_file).input(src).run(); + } else { + cc().arg("-v").arg("-c").out_exe(&obj_file).input(src).run(); + }; +} diff --git a/tests/run-make/link-path-order/Makefile b/tests/run-make/link-path-order/Makefile deleted file mode 100644 index a3831a63ac7..00000000000 --- a/tests/run-make/link-path-order/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -# Verifies that the -L arguments given to the linker is in the same order -# as the -L arguments on the rustc command line. - -CORRECT_DIR=$(TMPDIR)/correct -WRONG_DIR=$(TMPDIR)/wrong - -F := $(call NATIVE_STATICLIB_FILE,foo) - -all: $(call NATIVE_STATICLIB,correct) $(call NATIVE_STATICLIB,wrong) - mkdir -p $(CORRECT_DIR) $(WRONG_DIR) - mv $(call NATIVE_STATICLIB,correct) $(CORRECT_DIR)/$(F) - mv $(call NATIVE_STATICLIB,wrong) $(WRONG_DIR)/$(F) - $(RUSTC) main.rs -o $(TMPDIR)/should_succeed -L $(CORRECT_DIR) -L $(WRONG_DIR) - $(call RUN,should_succeed) - $(RUSTC) main.rs -o $(TMPDIR)/should_fail -L $(WRONG_DIR) -L $(CORRECT_DIR) - $(call FAIL,should_fail) diff --git a/tests/run-make/link-path-order/rmake.rs b/tests/run-make/link-path-order/rmake.rs new file mode 100644 index 00000000000..c8e41b2bcf8 --- /dev/null +++ b/tests/run-make/link-path-order/rmake.rs @@ -0,0 +1,33 @@ +// The order in which "library search path" `-L` arguments are given to the command line rustc +// is important. These arguments must match the order of the linker's arguments. In this test, +// fetching the Wrong library before the Correct one causes a function to return 0 instead of the +// expected 1, causing a runtime panic, as expected. +// See https://github.com/rust-lang/rust/pull/16904 + +//@ ignore-cross-compile +// Reason: the compiled binary is executed + +use run_make_support::{build_native_static_lib, path, rfs, run, run_fail, rustc, static_lib_name}; + +fn main() { + build_native_static_lib("correct"); + build_native_static_lib("wrong"); + rfs::create_dir("correct"); + rfs::create_dir("wrong"); + rfs::rename(static_lib_name("correct"), path("correct").join(static_lib_name("foo"))); + rfs::rename(static_lib_name("wrong"), path("wrong").join(static_lib_name("foo"))); + rustc() + .input("main.rs") + .output("should_succeed") + .library_search_path("correct") + .library_search_path("wrong") + .run(); + run("should_succeed"); + rustc() + .input("main.rs") + .output("should_fail") + .library_search_path("wrong") + .library_search_path("correct") + .run(); + run_fail("should_fail"); +} diff --git a/tests/run-make/lto-smoke-c/Makefile b/tests/run-make/lto-smoke-c/Makefile deleted file mode 100644 index f1ba3d95da2..00000000000 --- a/tests/run-make/lto-smoke-c/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -# Apparently older versions of GCC segfault if -g is passed... -CC := $(CC:-g=) - -all: - $(RUSTC) foo.rs -C lto - $(CC) bar.c $(call STATICLIB,foo) \ - $(call OUT_EXE,bar) \ - $(EXTRACFLAGS) $(EXTRACXXFLAGS) - $(call RUN,bar) diff --git a/tests/run-make/lto-smoke-c/rmake.rs b/tests/run-make/lto-smoke-c/rmake.rs new file mode 100644 index 00000000000..70760f730c0 --- /dev/null +++ b/tests/run-make/lto-smoke-c/rmake.rs @@ -0,0 +1,20 @@ +// LLVM's link-time-optimization (LTO) is a useful feature added to Rust in response +// to #10741. This test uses this feature with `-C lto` alongside a native C library, +// and checks that compilation and execution is successful. +// See https://github.com/rust-lang/rust/issues/10741 + +//@ ignore-cross-compile +// Reason: the compiled binary is executed + +use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib_name}; + +fn main() { + rustc().input("foo.rs").arg("-Clto").run(); + cc().input("bar.c") + .arg(static_lib_name("foo")) + .out_exe("bar") + .args(extra_c_flags()) + .args(extra_cxx_flags()) + .run(); + run("bar"); +} diff --git a/tests/run-make/macos-fat-archive/Makefile b/tests/run-make/macos-fat-archive/Makefile deleted file mode 100644 index 0feb39a23cb..00000000000 --- a/tests/run-make/macos-fat-archive/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# only-apple - -include ../tools.mk - -"$(TMPDIR)"/libnative-library.a: native-library.c - $(CC) -arch arm64 -arch x86_64 native-library.c -c -o "$(TMPDIR)"/native-library.o - $(AR) crs "$(TMPDIR)"/libnative-library.a "$(TMPDIR)"/native-library.o - -all: "$(TMPDIR)"/libnative-library.a - $(RUSTC) lib.rs --crate-type=lib -L "native=$(TMPDIR)" -l static=native-library diff --git a/tests/run-make/macos-fat-archive/rmake.rs b/tests/run-make/macos-fat-archive/rmake.rs new file mode 100644 index 00000000000..c9f0fa07693 --- /dev/null +++ b/tests/run-make/macos-fat-archive/rmake.rs @@ -0,0 +1,20 @@ +// macOS (and iOS) has a concept of universal (fat) binaries which contain code for multiple CPU +// architectures in the same file. Apple is migrating from x86_64 to aarch64 CPUs, +// so for the next few years it will be important for macOS developers to +// build "fat" binaries (executables and cdylibs). + +// Rustc used to be unable to handle these special libraries, which was fixed in #98736. If +// compilation in this test is successful, the native fat library was successfully linked to. +// See https://github.com/rust-lang/rust/issues/55235 + +//@ only-apple + +use run_make_support::{cc, llvm_ar, rustc}; + +fn main() { + cc().args(&["-arch", "arm64", "-arch", "x86_64", "native-library.c", "-c"]) + .out_exe("native-library.o") + .run(); + llvm_ar().obj_to_ar().output_input("libnative-library.a", "native-library.o").run(); + rustc().input("lib.rs").crate_type("lib").arg("-lstatic=native-library").run(); +} diff --git a/tests/run-make/manual-link/Makefile b/tests/run-make/manual-link/Makefile deleted file mode 100644 index 8dbf0460fff..00000000000 --- a/tests/run-make/manual-link/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -all: $(TMPDIR)/libbar.a - $(RUSTC) foo.rs -lstatic=bar - $(RUSTC) main.rs - $(call RUN,main) diff --git a/tests/run-make/manual-link/rmake.rs b/tests/run-make/manual-link/rmake.rs new file mode 100644 index 00000000000..1d362172263 --- /dev/null +++ b/tests/run-make/manual-link/rmake.rs @@ -0,0 +1,16 @@ +// A smoke test for the `-l` command line rustc flag, which manually links to the selected +// library. Useful for native libraries, this is roughly equivalent to `#[link]` in Rust code. +// If compilation succeeds, the flag successfully linked the native library. +// See https://github.com/rust-lang/rust/pull/18470 + +//@ ignore-cross-compile +// Reason: the compiled binary is executed + +use run_make_support::{build_native_static_lib, run, rustc}; + +fn main() { + build_native_static_lib("bar"); + rustc().input("foo.rs").arg("-lstatic=bar").run(); + rustc().input("main.rs").run(); + run("main"); +} diff --git a/tests/ui-fulldeps/stable-mir/check_instance.rs b/tests/ui-fulldeps/stable-mir/check_instance.rs index f971426723f..5e3f2557566 100644 --- a/tests/ui-fulldeps/stable-mir/check_instance.rs +++ b/tests/ui-fulldeps/stable-mir/check_instance.rs @@ -33,7 +33,7 @@ fn test_stable_mir() -> ControlFlow<()> { // Get all items and split generic vs monomorphic items. let (generic, mono): (Vec<_>, Vec<_>) = items.into_iter().partition(|item| item.requires_monomorphization()); - assert_eq!(mono.len(), 4, "Expected 2 mono functions and one constant"); + assert_eq!(mono.len(), 3, "Expected 3 mono functions"); assert_eq!(generic.len(), 2, "Expected 2 generic functions"); // For all monomorphic items, get the correspondent instances. diff --git a/tests/ui/asm/binary_asm_labels.stderr b/tests/ui/asm/binary_asm_labels.stderr index 1f2943084f1..206d2da1779 100644 --- a/tests/ui/asm/binary_asm_labels.stderr +++ b/tests/ui/asm/binary_asm_labels.stderr @@ -4,7 +4,9 @@ error: avoid using labels containing only the digits `0` and `1` in inline assem LL | asm!("0: jmp 0b"); | ^ use a different label that doesn't start with `0` or `1` | - = note: an LLVM bug makes these labels ambiguous with a binary literal number + = help: start numbering with `2` instead + = note: an LLVM bug makes these labels ambiguous with a binary literal number on x86 + = note: see <https://github.com/llvm/llvm-project/issues/99547> for more information = note: `#[deny(binary_asm_labels)]` on by default error: avoid using labels containing only the digits `0` and `1` in inline assembly @@ -13,7 +15,9 @@ error: avoid using labels containing only the digits `0` and `1` in inline assem LL | asm!("1: jmp 1b"); | ^ use a different label that doesn't start with `0` or `1` | - = note: an LLVM bug makes these labels ambiguous with a binary literal number + = help: start numbering with `2` instead + = note: an LLVM bug makes these labels ambiguous with a binary literal number on x86 + = note: see <https://github.com/llvm/llvm-project/issues/99547> for more information error: avoid using labels containing only the digits `0` and `1` in inline assembly --> $DIR/binary_asm_labels.rs:13:15 @@ -21,7 +25,9 @@ error: avoid using labels containing only the digits `0` and `1` in inline assem LL | asm!("10: jmp 10b"); | ^^ use a different label that doesn't start with `0` or `1` | - = note: an LLVM bug makes these labels ambiguous with a binary literal number + = help: start numbering with `2` instead + = note: an LLVM bug makes these labels ambiguous with a binary literal number on x86 + = note: see <https://github.com/llvm/llvm-project/issues/99547> for more information error: avoid using labels containing only the digits `0` and `1` in inline assembly --> $DIR/binary_asm_labels.rs:14:15 @@ -29,7 +35,9 @@ error: avoid using labels containing only the digits `0` and `1` in inline assem LL | asm!("01: jmp 01b"); | ^^ use a different label that doesn't start with `0` or `1` | - = note: an LLVM bug makes these labels ambiguous with a binary literal number + = help: start numbering with `2` instead + = note: an LLVM bug makes these labels ambiguous with a binary literal number on x86 + = note: see <https://github.com/llvm/llvm-project/issues/99547> for more information error: avoid using labels containing only the digits `0` and `1` in inline assembly --> $DIR/binary_asm_labels.rs:15:15 @@ -37,7 +45,9 @@ error: avoid using labels containing only the digits `0` and `1` in inline assem LL | asm!("1001101: jmp 1001101b"); | ^^^^^^^ use a different label that doesn't start with `0` or `1` | - = note: an LLVM bug makes these labels ambiguous with a binary literal number + = help: start numbering with `2` instead + = note: an LLVM bug makes these labels ambiguous with a binary literal number on x86 + = note: see <https://github.com/llvm/llvm-project/issues/99547> for more information error: aborting due to 5 previous errors diff --git a/tests/ui/asm/binary_asm_labels_allowed.rs b/tests/ui/asm/binary_asm_labels_allowed.rs new file mode 100644 index 00000000000..a21ab8d70f5 --- /dev/null +++ b/tests/ui/asm/binary_asm_labels_allowed.rs @@ -0,0 +1,17 @@ +//@ build-pass +//@ only-aarch64 + +// The `binary_asm_labels` lint should only be raised on `x86`. Make sure it +// doesn't get raised on other platforms. + +use std::arch::asm; + +fn main() { + unsafe { + asm!("0: bl 0b"); + asm!("1: bl 1b"); + asm!("10: bl 10b"); + asm!("01: bl 01b"); + asm!("1001101: bl 1001101b"); + } +} diff --git a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs index fa0b0fdc136..e07fa78463c 100644 --- a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs +++ b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.rs @@ -5,9 +5,7 @@ #![feature(with_negative_coherence)] trait Trait {} impl<const N: u8> Trait for [(); N] {} -//~^ ERROR: mismatched types impl<const N: i8> Trait for [(); N] {} -//~^ ERROR: mismatched types -//~| ERROR: conflicting implementations of trait `Trait` +//~^ ERROR: conflicting implementations of trait `Trait` fn main() {} diff --git a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr index d65450845bc..2087be8e711 100644 --- a/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr +++ b/tests/ui/coherence/negative-coherence/generic_const_type_mismatch.stderr @@ -1,25 +1,11 @@ error[E0119]: conflicting implementations of trait `Trait` for type `[(); _]` - --> $DIR/generic_const_type_mismatch.rs:9:1 + --> $DIR/generic_const_type_mismatch.rs:8:1 | LL | impl<const N: u8> Trait for [(); N] {} | ----------------------------------- first implementation here -LL | LL | impl<const N: i8> Trait for [(); N] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `[(); _]` -error[E0308]: mismatched types - --> $DIR/generic_const_type_mismatch.rs:7:34 - | -LL | impl<const N: u8> Trait for [(); N] {} - | ^ expected `usize`, found `u8` - -error[E0308]: mismatched types - --> $DIR/generic_const_type_mismatch.rs:9:34 - | -LL | impl<const N: i8> Trait for [(); N] {} - | ^ expected `usize`, found `i8` - -error: aborting due to 3 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0119, E0308. -For more information about an error, try `rustc --explain E0119`. +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/const-generics/bad-subst-const-kind.rs b/tests/ui/const-generics/bad-subst-const-kind.rs index d5913879191..cc2ff9b8dea 100644 --- a/tests/ui/const-generics/bad-subst-const-kind.rs +++ b/tests/ui/const-generics/bad-subst-const-kind.rs @@ -6,7 +6,7 @@ trait Q { } impl<const N: u64> Q for [u8; N] { - //~^ ERROR mismatched types + //~^ ERROR: the constant `N` is not of type `usize` const ASSOC: usize = 1; } diff --git a/tests/ui/const-generics/bad-subst-const-kind.stderr b/tests/ui/const-generics/bad-subst-const-kind.stderr index 6725f6762e4..5c8d9c90363 100644 --- a/tests/ui/const-generics/bad-subst-const-kind.stderr +++ b/tests/ui/const-generics/bad-subst-const-kind.stderr @@ -1,3 +1,9 @@ +error: the constant `N` is not of type `usize` + --> $DIR/bad-subst-const-kind.rs:8:26 + | +LL | impl<const N: u64> Q for [u8; N] { + | ^^^^^^^ expected `usize`, found `u64` + error: the constant `13` is not of type `u64` --> $DIR/bad-subst-const-kind.rs:13:24 | @@ -12,12 +18,5 @@ LL | impl<const N: u64> Q for [u8; N] { | | | unsatisfied trait bound introduced here -error[E0308]: mismatched types - --> $DIR/bad-subst-const-kind.rs:8:31 - | -LL | impl<const N: u64> Q for [u8; N] { - | ^ expected `usize`, found `u64` - error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs index 6b0d9e047db..8e5e23b2337 100644 --- a/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs +++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs @@ -7,7 +7,7 @@ trait Q { impl<const N: u64> Q for [u8; N] {} //~^ ERROR not all trait items implemented -//~| ERROR mismatched types +//~| ERROR the constant `N` is not of type `usize` pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {} //~^ ERROR the constant `13` is not of type `u64` diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr index bb6d650b7ab..e03580ec007 100644 --- a/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr +++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr @@ -1,3 +1,9 @@ +error: the constant `N` is not of type `usize` + --> $DIR/type_mismatch.rs:8:26 + | +LL | impl<const N: u64> Q for [u8; N] {} + | ^^^^^^^ expected `usize`, found `u64` + error[E0046]: not all trait items implemented, missing: `ASSOC` --> $DIR/type_mismatch.rs:8:1 | @@ -29,12 +35,6 @@ LL | pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {} | | | implicitly returns `()` as its body has no tail or `return` expression -error[E0308]: mismatched types - --> $DIR/type_mismatch.rs:8:31 - | -LL | impl<const N: u64> Q for [u8; N] {} - | ^ expected `usize`, found `u64` - error: aborting due to 4 previous errors Some errors have detailed explanations: E0046, E0308. diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs index 51cae20df84..8b7ee577569 100644 --- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs +++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.rs @@ -25,8 +25,8 @@ mod v20 { } impl<const v10: usize> v17<v10, v2> { - //~^ ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1} - //~| ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1} + //~^ ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0} + //~| ERROR maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0} pub const fn v21() -> v18 { //~^ ERROR cannot find type `v18` in this scope v18 { _p: () } diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr index 39f022fbee9..15d3c472585 100644 --- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr +++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr @@ -72,13 +72,13 @@ help: add `#![feature(adt_const_params)]` to the crate attributes to enable more LL + #![feature(adt_const_params)] | -error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1} +error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0} --> $DIR/unevaluated-const-ice-119731.rs:27:37 | LL | impl<const v10: usize> v17<v10, v2> { | ^^ -error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#1} +error: maximum number of nodes exceeded in constant v20::v17::<v10, v2>::{constant#0} --> $DIR/unevaluated-const-ice-119731.rs:27:37 | LL | impl<const v10: usize> v17<v10, v2> { diff --git a/tests/ui/const-generics/issues/issue-88119.stderr b/tests/ui/const-generics/issues/issue-88119.stderr index c17a7d5d9fa..b5eec3046fd 100644 --- a/tests/ui/const-generics/issues/issue-88119.stderr +++ b/tests/ui/const-generics/issues/issue-88119.stderr @@ -1,26 +1,32 @@ -error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated` - --> $DIR/issue-88119.rs:21:5 +error[E0284]: type annotations needed: cannot normalize `<&T as ConstName>::{constant#0}` + --> $DIR/issue-88119.rs:19:49 | -LL | [(); name_len::<T>()]:, - | ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated` +LL | impl<T: ?Sized + ConstName> const ConstName for &T + | ^^ cannot normalize `<&T as ConstName>::{constant#0}` | -note: required by a bound in `<&T as ConstName>` - --> $DIR/issue-88119.rs:21:10 +note: required for `&T` to implement `ConstName` + --> $DIR/issue-88119.rs:19:35 | +LL | impl<T: ?Sized + ConstName> const ConstName for &T + | ^^^^^^^^^ ^^ +LL | where LL | [(); name_len::<T>()]:, - | ^^^^^^^^^^^^^^^ required by this bound in `<&T as ConstName>` + | --------------------- unsatisfied trait bound introduced here -error[E0284]: type annotations needed: cannot satisfy `the constant `name_len::<T>()` can be evaluated` - --> $DIR/issue-88119.rs:28:5 +error[E0284]: type annotations needed: cannot normalize `<&mut T as ConstName>::{constant#0}` + --> $DIR/issue-88119.rs:26:49 | -LL | [(); name_len::<T>()]:, - | ^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `name_len::<T>()` can be evaluated` +LL | impl<T: ?Sized + ConstName> const ConstName for &mut T + | ^^^^^^ cannot normalize `<&mut T as ConstName>::{constant#0}` | -note: required by a bound in `<&mut T as ConstName>` - --> $DIR/issue-88119.rs:28:10 +note: required for `&mut T` to implement `ConstName` + --> $DIR/issue-88119.rs:26:35 | +LL | impl<T: ?Sized + ConstName> const ConstName for &mut T + | ^^^^^^^^^ ^^^^^^ +LL | where LL | [(); name_len::<T>()]:, - | ^^^^^^^^^^^^^^^ required by this bound in `<&mut T as ConstName>` + | --------------------- unsatisfied trait bound introduced here error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs index e7ae2ea1d5a..def4611f94b 100644 --- a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs +++ b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.rs @@ -19,6 +19,8 @@ fn bar<const N: usize>() {} fn foo<const N: usize>() { bar::<{ [1; N] }>(); //~^ ERROR: generic parameters may not be used in const operations + bar::<{ [1; { N + 1 }] }>(); + //~^ ERROR: generic parameters may not be used in const operations } fn main() {} diff --git a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr index 72a6e6977f5..ead6c621d60 100644 --- a/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr +++ b/tests/ui/const-generics/repeat_expr_hack_gives_right_generics.stderr @@ -7,5 +7,14 @@ LL | bar::<{ [1; N] }>(); = help: const parameters may only be used as standalone arguments, i.e. `N` = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions -error: aborting due to 1 previous error +error: generic parameters may not be used in const operations + --> $DIR/repeat_expr_hack_gives_right_generics.rs:22:19 + | +LL | bar::<{ [1; { N + 1 }] }>(); + | ^ cannot perform const operation using `N` + | + = help: const parameters may only be used as standalone arguments, i.e. `N` + = help: add `#![feature(generic_const_exprs)]` to allow generic const expressions + +error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/transmute-fail.rs b/tests/ui/const-generics/transmute-fail.rs index 90afd232534..59b77c678e8 100644 --- a/tests/ui/const-generics/transmute-fail.rs +++ b/tests/ui/const-generics/transmute-fail.rs @@ -10,11 +10,10 @@ fn foo<const W: usize, const H: usize>(v: [[u32;H+1]; W]) -> [[u32; W+1]; H] { } fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] { - //~^ ERROR mismatched types - //~| ERROR mismatched types + //~^ ERROR the constant `W` is not of type `usize` unsafe { std::mem::transmute(v) - //~^ ERROR cannot transmute between types + //~^ ERROR the constant `W` is not of type `usize` } } diff --git a/tests/ui/const-generics/transmute-fail.stderr b/tests/ui/const-generics/transmute-fail.stderr index b76ec10bd3f..b40fb23c331 100644 --- a/tests/ui/const-generics/transmute-fail.stderr +++ b/tests/ui/const-generics/transmute-fail.stderr @@ -1,3 +1,9 @@ +error: the constant `W` is not of type `usize` + --> $DIR/transmute-fail.rs:12:42 + | +LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] { + | ^^^^^^^^^^^^^ expected `usize`, found `bool` + error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> $DIR/transmute-fail.rs:7:5 | @@ -7,17 +13,14 @@ LL | std::mem::transmute(v) = note: source type: `[[u32; H+1]; W]` (size can vary because of [u32; H+1]) = note: target type: `[[u32; W+1]; H]` (size can vary because of [u32; W+1]) -error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:16:5 +error: the constant `W` is not of type `usize` + --> $DIR/transmute-fail.rs:15:5 | LL | std::mem::transmute(v) - | ^^^^^^^^^^^^^^^^^^^ - | - = note: source type: `[[u32; H]; W]` (size can vary because of [u32; H]) - = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W]) + | ^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool` error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:23:5 + --> $DIR/transmute-fail.rs:22:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -26,7 +29,7 @@ LL | std::mem::transmute(v) = note: target type: `[u32; W * H * H]` (this type does not have a fixed size) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:30:5 + --> $DIR/transmute-fail.rs:29:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -35,7 +38,7 @@ LL | std::mem::transmute(v) = note: target type: `[[[u32; 9999999]; 777777777]; 8888888]` (values of the type `[[u32; 9999999]; 777777777]` are too big for the current architecture) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:37:5 + --> $DIR/transmute-fail.rs:36:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -44,7 +47,7 @@ LL | std::mem::transmute(v) = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W]) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:50:5 + --> $DIR/transmute-fail.rs:49:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -53,7 +56,7 @@ LL | std::mem::transmute(v) = note: target type: `[u32; W * H]` (this type does not have a fixed size) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:57:5 + --> $DIR/transmute-fail.rs:56:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -62,7 +65,7 @@ LL | std::mem::transmute(v) = note: target type: `[[u32; W]; H]` (size can vary because of [u32; W]) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:66:5 + --> $DIR/transmute-fail.rs:65:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -71,7 +74,7 @@ LL | std::mem::transmute(v) = note: target type: `[u32; D * W * H]` (this type does not have a fixed size) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:75:5 + --> $DIR/transmute-fail.rs:74:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -80,7 +83,7 @@ LL | std::mem::transmute(v) = note: target type: `[[u32; D * W]; H]` (size can vary because of [u32; D * W]) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:82:5 + --> $DIR/transmute-fail.rs:81:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -89,7 +92,7 @@ LL | std::mem::transmute(v) = note: target type: `[u8; L * 2]` (this type does not have a fixed size) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:89:5 + --> $DIR/transmute-fail.rs:88:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -98,7 +101,7 @@ LL | std::mem::transmute(v) = note: target type: `[u16; L]` (this type does not have a fixed size) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:96:5 + --> $DIR/transmute-fail.rs:95:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -107,7 +110,7 @@ LL | std::mem::transmute(v) = note: target type: `[[u8; 1]; L]` (this type does not have a fixed size) error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-fail.rs:105:5 + --> $DIR/transmute-fail.rs:104:5 | LL | std::mem::transmute(v) | ^^^^^^^^^^^^^^^^^^^ @@ -115,19 +118,6 @@ LL | std::mem::transmute(v) = note: source type: `[[u32; 2 * H]; W + W]` (size can vary because of [u32; 2 * H]) = note: target type: `[[u32; W + W]; 2 * H]` (size can vary because of [u32; W + W]) -error[E0308]: mismatched types - --> $DIR/transmute-fail.rs:12:53 - | -LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] { - | ^ expected `usize`, found `bool` - -error[E0308]: mismatched types - --> $DIR/transmute-fail.rs:12:67 - | -LL | fn bar<const W: bool, const H: usize>(v: [[u32; H]; W]) -> [[u32; W]; H] { - | ^ expected `usize`, found `bool` - -error: aborting due to 15 previous errors +error: aborting due to 14 previous errors -Some errors have detailed explanations: E0308, E0512. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0512`. diff --git a/tests/ui/const-generics/type_mismatch.rs b/tests/ui/const-generics/type_mismatch.rs index daa13277be0..8187c785cd1 100644 --- a/tests/ui/const-generics/type_mismatch.rs +++ b/tests/ui/const-generics/type_mismatch.rs @@ -1,10 +1,10 @@ fn foo<const N: usize>() -> [u8; N] { - bar::<N>() //~ ERROR mismatched types + bar::<N>() //~^ ERROR the constant `N` is not of type `u8` } fn bar<const N: u8>() -> [u8; N] {} -//~^ ERROR mismatched types +//~^ ERROR the constant `N` is not of type `usize` //~| ERROR mismatched types fn main() {} diff --git a/tests/ui/const-generics/type_mismatch.stderr b/tests/ui/const-generics/type_mismatch.stderr index 026999827c0..d1bb5c1242f 100644 --- a/tests/ui/const-generics/type_mismatch.stderr +++ b/tests/ui/const-generics/type_mismatch.stderr @@ -1,3 +1,9 @@ +error: the constant `N` is not of type `usize` + --> $DIR/type_mismatch.rs:6:26 + | +LL | fn bar<const N: u8>() -> [u8; N] {} + | ^^^^^^^ expected `usize`, found `u8` + error: the constant `N` is not of type `u8` --> $DIR/type_mismatch.rs:2:11 | @@ -18,18 +24,6 @@ LL | fn bar<const N: u8>() -> [u8; N] {} | | | implicitly returns `()` as its body has no tail or `return` expression -error[E0308]: mismatched types - --> $DIR/type_mismatch.rs:2:11 - | -LL | bar::<N>() - | ^ expected `u8`, found `usize` - -error[E0308]: mismatched types - --> $DIR/type_mismatch.rs:6:31 - | -LL | fn bar<const N: u8>() -> [u8; N] {} - | ^ expected `usize`, found `u8` - -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/consts/issue-36163.stderr b/tests/ui/consts/issue-36163.stderr index 8a7a0981f41..52d3e003f0a 100644 --- a/tests/ui/consts/issue-36163.stderr +++ b/tests/ui/consts/issue-36163.stderr @@ -1,10 +1,10 @@ -error[E0391]: cycle detected when simplifying constant for the type system `Foo::B::{constant#0}` +error[E0391]: cycle detected when simplifying constant for the type system `Foo::{constant#0}` --> $DIR/issue-36163.rs:4:9 | LL | B = A, | ^ | -note: ...which requires const-evaluating + checking `Foo::B::{constant#0}`... +note: ...which requires const-evaluating + checking `Foo::{constant#0}`... --> $DIR/issue-36163.rs:4:9 | LL | B = A, @@ -19,7 +19,7 @@ note: ...which requires const-evaluating + checking `A`... | LL | const A: isize = Foo::B as isize; | ^^^^^^^^^^^^^^^ - = note: ...which again requires simplifying constant for the type system `Foo::B::{constant#0}`, completing the cycle + = note: ...which again requires simplifying constant for the type system `Foo::{constant#0}`, completing the cycle note: cycle used when checking that `Foo` is well-formed --> $DIR/issue-36163.rs:3:1 | diff --git a/tests/ui/empty/empty-struct-braces-expr.stderr b/tests/ui/empty/empty-struct-braces-expr.stderr index 4604ebeaa8b..28c701443de 100644 --- a/tests/ui/empty/empty-struct-braces-expr.stderr +++ b/tests/ui/empty/empty-struct-braces-expr.stderr @@ -71,12 +71,22 @@ error[E0533]: expected value, found struct variant `E::Empty3` | LL | let e3 = E::Empty3; | ^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let e3 = E::Empty3 {}; + | ++ error[E0533]: expected value, found struct variant `E::Empty3` --> $DIR/empty-struct-braces-expr.rs:19:14 | LL | let e3 = E::Empty3(); | ^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let e3 = E::Empty3 {}; + | ~~ error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1` --> $DIR/empty-struct-braces-expr.rs:23:15 @@ -104,25 +114,34 @@ error[E0599]: no variant or associated item named `Empty3` found for enum `empty --> $DIR/empty-struct-braces-expr.rs:25:19 | LL | let xe3 = XE::Empty3; - | ^^^^^^ - | | - | variant or associated item not found in `XE` - | help: there is a variant with a similar name: `XEmpty3` + | ^^^^^^ variant or associated item not found in `XE` + | +help: there is a variant with a similar name + | +LL | let xe3 = XE::XEmpty3; + | ~~~~~~~ error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:26:19 | LL | let xe3 = XE::Empty3(); - | ^^^^^^ - | | - | variant or associated item not found in `XE` - | help: there is a variant with a similar name: `XEmpty3` + | ^^^^^^ variant or associated item not found in `XE` + | +help: there is a variant with a similar name + | +LL | let xe3 = XE::XEmpty3 {}; + | ~~~~~~~~~~ error[E0599]: no variant named `Empty1` found for enum `empty_struct::XE` --> $DIR/empty-struct-braces-expr.rs:28:9 | LL | XE::Empty1 {}; - | ^^^^^^ help: there is a variant with a similar name: `XEmpty3` + | ^^^^^^ + | +help: there is a variant with a similar name + | +LL | XE::XEmpty3 {}; + | ~~~~~~~~~~ error: aborting due to 9 previous errors diff --git a/tests/ui/enum/error-variant-with-turbofishes.stderr b/tests/ui/enum/error-variant-with-turbofishes.stderr index 66bed1c0d85..ffc2862bfe0 100644 --- a/tests/ui/enum/error-variant-with-turbofishes.stderr +++ b/tests/ui/enum/error-variant-with-turbofishes.stderr @@ -3,6 +3,11 @@ error[E0533]: expected value, found struct variant `Struct<0>::Variant` | LL | let x = Struct::<0>::Variant; | ^^^^^^^^^^^^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let x = Struct::<0>::Variant { x: /* value */ }; + | ++++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/expr/issue-22933-2.stderr b/tests/ui/expr/issue-22933-2.stderr index 8cda8598f3c..dadc3121362 100644 --- a/tests/ui/expr/issue-22933-2.stderr +++ b/tests/ui/expr/issue-22933-2.stderr @@ -5,10 +5,12 @@ LL | enum Delicious { | -------------- variant or associated item `PIE` not found for this enum ... LL | ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, - | ^^^ - | | - | variant or associated item not found in `Delicious` - | help: there is a variant with a similar name: `Pie` + | ^^^ variant or associated item not found in `Delicious` + | +help: there is a variant with a similar name + | +LL | ApplePie = Delicious::Apple as isize | Delicious::Pie as isize, + | ~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-23217.stderr b/tests/ui/issues/issue-23217.stderr index 05ee0474c78..d14da75ab72 100644 --- a/tests/ui/issues/issue-23217.stderr +++ b/tests/ui/issues/issue-23217.stderr @@ -4,10 +4,12 @@ error[E0599]: no variant or associated item named `A` found for enum `SomeEnum` LL | pub enum SomeEnum { | ----------------- variant or associated item `A` not found for this enum LL | B = SomeEnum::A, - | ^ - | | - | variant or associated item not found in `SomeEnum` - | help: there is a variant with a similar name: `B` + | ^ variant or associated item not found in `SomeEnum` + | +help: there is a variant with a similar name + | +LL | B = SomeEnum::B, + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-28971.stderr b/tests/ui/issues/issue-28971.stderr index 26057cbc2d1..7ca57d6b998 100644 --- a/tests/ui/issues/issue-28971.stderr +++ b/tests/ui/issues/issue-28971.stderr @@ -5,10 +5,12 @@ LL | enum Foo { | -------- variant or associated item `Baz` not found for this enum ... LL | Foo::Baz(..) => (), - | ^^^ - | | - | variant or associated item not found in `Foo` - | help: there is a variant with a similar name: `Bar` + | ^^^ variant or associated item not found in `Foo` + | +help: there is a variant with a similar name + | +LL | Foo::Bar(..) => (), + | ~~~ error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable --> $DIR/issue-28971.rs:15:5 diff --git a/tests/ui/issues/issue-34209.stderr b/tests/ui/issues/issue-34209.stderr index 41bc60d03dd..4c61d250f52 100644 --- a/tests/ui/issues/issue-34209.stderr +++ b/tests/ui/issues/issue-34209.stderr @@ -5,7 +5,12 @@ LL | enum S { | ------ variant `B` not found here ... LL | S::B {} => {}, - | ^ help: there is a variant with a similar name: `A` + | ^ + | +help: there is a variant with a similar name + | +LL | S::A {} => {}, + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-4736.stderr b/tests/ui/issues/issue-4736.stderr index 146dd1d57ce..c1ae2c47b43 100644 --- a/tests/ui/issues/issue-4736.stderr +++ b/tests/ui/issues/issue-4736.stderr @@ -9,8 +9,8 @@ LL | let z = NonCopyable{ p: () }; | help: `NonCopyable` is a tuple struct, use the appropriate syntax | -LL | let z = NonCopyable(/* fields */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~ +LL | let z = NonCopyable(/* () */); + | ~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-80607.stderr b/tests/ui/issues/issue-80607.stderr index 20494f319dd..d096910297b 100644 --- a/tests/ui/issues/issue-80607.stderr +++ b/tests/ui/issues/issue-80607.stderr @@ -9,8 +9,8 @@ LL | Enum::V1 { x } | help: `Enum::V1` is a tuple variant, use the appropriate syntax | -LL | Enum::V1(/* fields */) - | ~~~~~~~~~~~~~~~~~~~~~~ +LL | Enum::V1(/* i32 */) + | ~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lifetimes/issue-95023.rs b/tests/ui/lifetimes/issue-95023.rs index 7a67297c763..bcacd01474f 100644 --- a/tests/ui/lifetimes/issue-95023.rs +++ b/tests/ui/lifetimes/issue-95023.rs @@ -9,6 +9,5 @@ impl Fn(&isize) for Error { //~^ ERROR associated function in `impl` without body //~^^ ERROR method `foo` is not a member of trait `Fn` [E0407] //~^^^ ERROR associated type `B` not found for `Self` [E0220] - //~| ERROR associated type `B` not found for `Self` [E0220] } fn main() {} diff --git a/tests/ui/lifetimes/issue-95023.stderr b/tests/ui/lifetimes/issue-95023.stderr index 310dee51406..cbc0eeebee1 100644 --- a/tests/ui/lifetimes/issue-95023.stderr +++ b/tests/ui/lifetimes/issue-95023.stderr @@ -56,15 +56,7 @@ error[E0220]: associated type `B` not found for `Self` LL | fn foo<const N: usize>(&self) -> Self::B<{ N }>; | ^ help: `Self` has the following associated type: `Output` -error[E0220]: associated type `B` not found for `Self` - --> $DIR/issue-95023.rs:8:44 - | -LL | fn foo<const N: usize>(&self) -> Self::B<{ N }>; - | ^ help: `Self` has the following associated type: `Output` - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors Some errors have detailed explanations: E0046, E0183, E0220, E0229, E0277, E0407. For more information about an error, try `rustc --explain E0046`. diff --git a/tests/ui/numeric/numeric-fields.stderr b/tests/ui/numeric/numeric-fields.stderr index 668405ed638..8ab1718ff5e 100644 --- a/tests/ui/numeric/numeric-fields.stderr +++ b/tests/ui/numeric/numeric-fields.stderr @@ -9,8 +9,8 @@ LL | let s = S{0b1: 10, 0: 11}; | help: `S` is a tuple struct, use the appropriate syntax | -LL | let s = S(/* fields */); - | ~~~~~~~~~~~~~~~ +LL | let s = S(/* u8 */, /* u16 */); + | ~~~~~~~~~~~~~~~~~~~~~~ error[E0026]: struct `S` does not have a field named `0x1` --> $DIR/numeric-fields.rs:7:17 diff --git a/tests/ui/parser/struct-literal-variant-in-if.stderr b/tests/ui/parser/struct-literal-variant-in-if.stderr index 9f0c0074d67..15f059f145b 100644 --- a/tests/ui/parser/struct-literal-variant-in-if.stderr +++ b/tests/ui/parser/struct-literal-variant-in-if.stderr @@ -47,6 +47,11 @@ error[E0533]: expected value, found struct variant `E::V` | LL | if x == E::V { field } {} | ^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | if x == (E::V { field }) {} + | + + error[E0308]: mismatched types --> $DIR/struct-literal-variant-in-if.rs:10:20 diff --git a/tests/ui/resolve/issue-18252.stderr b/tests/ui/resolve/issue-18252.stderr index 511b8da716f..6cb9c1f1dd2 100644 --- a/tests/ui/resolve/issue-18252.stderr +++ b/tests/ui/resolve/issue-18252.stderr @@ -3,6 +3,11 @@ error[E0533]: expected value, found struct variant `Foo::Variant` | LL | let f = Foo::Variant(42); | ^^^^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let f = Foo::Variant { x: /* value */ }; + | ~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-19452.stderr b/tests/ui/resolve/issue-19452.stderr index eff89241fd2..aa7b752ca50 100644 --- a/tests/ui/resolve/issue-19452.stderr +++ b/tests/ui/resolve/issue-19452.stderr @@ -3,12 +3,22 @@ error[E0533]: expected value, found struct variant `Homura::Madoka` | LL | let homura = Homura::Madoka; | ^^^^^^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let homura = Homura::Madoka { age: /* value */ }; + | ++++++++++++++++++++ error[E0533]: expected value, found struct variant `issue_19452_aux::Homura::Madoka` --> $DIR/issue-19452.rs:13:18 | LL | let homura = issue_19452_aux::Homura::Madoka; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let homura = issue_19452_aux::Homura::Madoka { age: /* value */ }; + | ++++++++++++++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr index ee3aecddcc3..12a6580048e 100644 --- a/tests/ui/resolve/privacy-enum-ctor.stderr +++ b/tests/ui/resolve/privacy-enum-ctor.stderr @@ -295,6 +295,11 @@ error[E0533]: expected value, found struct variant `Z::Struct` | LL | let _: Z = Z::Struct; | ^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let _: Z = Z::Struct { s: /* value */ }; + | ++++++++++++++++++ error[E0618]: expected function, found enum variant `Z::Unit` --> $DIR/privacy-enum-ctor.rs:31:17 @@ -336,6 +341,11 @@ error[E0533]: expected value, found struct variant `m::E::Struct` | LL | let _: E = m::E::Struct; | ^^^^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let _: E = m::E::Struct { s: /* value */ }; + | ++++++++++++++++++ error[E0618]: expected function, found enum variant `m::E::Unit` --> $DIR/privacy-enum-ctor.rs:47:16 @@ -377,6 +387,11 @@ error[E0533]: expected value, found struct variant `E::Struct` | LL | let _: E = E::Struct; | ^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let _: E = E::Struct { s: /* value */ }; + | ++++++++++++++++++ error[E0618]: expected function, found enum variant `E::Unit` --> $DIR/privacy-enum-ctor.rs:55:16 @@ -400,6 +415,11 @@ error[E0533]: expected value, found struct variant `m::n::Z::Struct` | LL | let _: Z = m::n::Z::Struct; | ^^^^^^^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let _: Z = m::n::Z::Struct { s: /* value */ }; + | ++++++++++++++++++ error: aborting due to 23 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.stderr index 4d543f6a155..7db6a77c77b 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-trait-bounds.stderr @@ -4,20 +4,11 @@ error[E0284]: type annotations needed: cannot normalize `process<T>::{constant#0 LL | fn process<T: const Trait>(input: [(); T::make(2)]) -> [(); T::make(2)] { | ^^^^^^^^^^^^^^^^ cannot normalize `process<T>::{constant#0}` -error[E0284]: type annotations needed: cannot satisfy `the constant `T::make(P)` can be evaluated` - --> $DIR/const-trait-bounds.rs:18:5 +error[E0284]: type annotations needed: cannot normalize `Struct<T, P>::field::{constant#0}` + --> $DIR/const-trait-bounds.rs:20:12 | -LL | [u32; T::make(P)]:, - | ^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `T::make(P)` can be evaluated` - | -note: required by a bound in `Struct` - --> $DIR/const-trait-bounds.rs:18:11 - | -LL | struct Struct<T: const Trait, const P: usize> - | ------ required by a bound in this struct -LL | where -LL | [u32; T::make(P)]:, - | ^^^^^^^^^^ required by this bound in `Struct` +LL | field: [u32; T::make(P)], + | ^^^^^^^^^^^^^^^^^ cannot normalize `Struct<T, P>::field::{constant#0}` error[E0284]: type annotations needed: cannot normalize `process<T>::{constant#1}` --> $DIR/const-trait-bounds.rs:13:5 diff --git a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs index 59a015da84e..fb962ad24bf 100644 --- a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs +++ b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.rs @@ -14,6 +14,5 @@ struct Wrapper<const C: <i32 as Trait>::Type> {} impl<const C: usize> Wrapper<C> {} //~^ ERROR the constant `C` is not of type `<i32 as Trait>::Type` -//~^^ ERROR mismatched types fn main() {} diff --git a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr index 71d4277275f..7094ee8c67c 100644 --- a/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr +++ b/tests/ui/specialization/default-proj-ty-as-type-of-const-issue-125757.stderr @@ -20,17 +20,5 @@ note: required by a const generic parameter in `Wrapper` LL | struct Wrapper<const C: <i32 as Trait>::Type> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this const generic parameter in `Wrapper` -error[E0308]: mismatched types - --> $DIR/default-proj-ty-as-type-of-const-issue-125757.rs:15:30 - | -LL | impl<const C: usize> Wrapper<C> {} - | ^ expected associated type, found `usize` - | - = note: expected associated type `<i32 as Trait>::Type` - found type `usize` - = help: consider constraining the associated type `<i32 as Trait>::Type` to `usize` - = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs index f89a463bc58..a0ee7714417 100644 --- a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs +++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.rs @@ -6,7 +6,6 @@ struct S<const L: usize>; impl<const N: i32> Copy for S<N> {} -//~^ ERROR: mismatched types impl<const M: usize> Copy for S<M> {} //~^ ERROR: conflicting implementations of trait `Copy` for type `S<_>` diff --git a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr index 1dac58e1f69..2953bc95917 100644 --- a/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr +++ b/tests/ui/specialization/min_specialization/bad-const-wf-doesnt-specialize.stderr @@ -1,19 +1,11 @@ error[E0119]: conflicting implementations of trait `Copy` for type `S<_>` - --> $DIR/bad-const-wf-doesnt-specialize.rs:10:1 + --> $DIR/bad-const-wf-doesnt-specialize.rs:9:1 | LL | impl<const N: i32> Copy for S<N> {} | -------------------------------- first implementation here -LL | LL | impl<const M: usize> Copy for S<M> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S<_>` -error[E0308]: mismatched types - --> $DIR/bad-const-wf-doesnt-specialize.rs:8:31 - | -LL | impl<const N: i32> Copy for S<N> {} - | ^ expected `usize`, found `i32` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0119, E0308. -For more information about an error, try `rustc --explain E0119`. +For more information about this error, try `rustc --explain E0119`. diff --git a/tests/ui/stats/hir-stats.stderr b/tests/ui/stats/hir-stats.stderr index a7a612a8a9e..b27f769ba34 100644 --- a/tests/ui/stats/hir-stats.stderr +++ b/tests/ui/stats/hir-stats.stderr @@ -123,15 +123,15 @@ hir-stats Lifetime 24 ( 0.3%) 1 24 hir-stats Mod 32 ( 0.4%) 1 32 hir-stats ExprField 40 ( 0.4%) 1 40 hir-stats TraitItemRef 56 ( 0.6%) 2 28 +hir-stats GenericArg 64 ( 0.7%) 4 16 +hir-stats - Type 16 ( 0.2%) 1 +hir-stats - Lifetime 48 ( 0.5%) 3 hir-stats Local 64 ( 0.7%) 1 64 hir-stats Param 64 ( 0.7%) 2 32 hir-stats Body 72 ( 0.8%) 3 24 hir-stats InlineAsm 72 ( 0.8%) 1 72 hir-stats ImplItemRef 72 ( 0.8%) 2 36 hir-stats Arm 80 ( 0.9%) 2 40 -hir-stats GenericArg 96 ( 1.1%) 4 24 -hir-stats - Type 24 ( 0.3%) 1 -hir-stats - Lifetime 72 ( 0.8%) 3 hir-stats FieldDef 96 ( 1.1%) 2 48 hir-stats Stmt 96 ( 1.1%) 3 32 hir-stats - Let 32 ( 0.4%) 1 @@ -155,8 +155,8 @@ hir-stats Generics 560 ( 6.2%) 10 56 hir-stats Ty 720 ( 8.0%) 15 48 hir-stats - Ptr 48 ( 0.5%) 1 hir-stats - Ref 48 ( 0.5%) 1 -hir-stats - Path 624 ( 6.9%) 13 -hir-stats Expr 768 ( 8.5%) 12 64 +hir-stats - Path 624 ( 7.0%) 13 +hir-stats Expr 768 ( 8.6%) 12 64 hir-stats - Path 64 ( 0.7%) 1 hir-stats - Struct 64 ( 0.7%) 1 hir-stats - Match 64 ( 0.7%) 1 @@ -174,5 +174,5 @@ hir-stats - Use 352 ( 3.9%) 4 hir-stats Path 1_240 (13.8%) 31 40 hir-stats PathSegment 1_920 (21.4%) 40 48 hir-stats ---------------------------------------------------------------- -hir-stats Total 8_992 +hir-stats Total 8_960 hir-stats diff --git a/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr index 40bb87c8a40..1af86860ce1 100644 --- a/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/tests/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -129,6 +129,11 @@ error[E0533]: expected value, found struct variant `E::B` | LL | let _: E = E::B; | ^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | let _: E = E::B { a: /* value */ }; + | ++++++++++++++++++ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:37:20 diff --git a/tests/ui/suggestions/incorrect-variant-literal.rs b/tests/ui/suggestions/incorrect-variant-literal.rs new file mode 100644 index 00000000000..aac2cc54904 --- /dev/null +++ b/tests/ui/suggestions/incorrect-variant-literal.rs @@ -0,0 +1,55 @@ +//@ only-linux +//@ compile-flags: --error-format=human --color=always + +enum Enum { + Unit, + Tuple(i32), + Struct { x: i32 }, +} + +fn main() { + Enum::Unit; + Enum::Tuple; + Enum::Struct; + Enum::Unit(); + Enum::Tuple(); + Enum::Struct(); + Enum::Unit {}; + Enum::Tuple {}; + Enum::Struct {}; + Enum::Unit(0); + Enum::Tuple(0); + Enum::Struct(0); + Enum::Unit { x: 0 }; + Enum::Tuple { x: 0 }; + Enum::Struct { x: 0 }; // ok + Enum::Unit(0, 0); + Enum::Tuple(0, 0); + Enum::Struct(0, 0); + Enum::Unit { x: 0, y: 0 }; + + Enum::Tuple { x: 0, y: 0 }; + + Enum::Struct { x: 0, y: 0 }; + Enum::unit; + Enum::tuple; + Enum::r#struct; + Enum::unit(); + Enum::tuple(); + Enum::r#struct(); + Enum::unit {}; + Enum::tuple {}; + Enum::r#struct {}; + Enum::unit(0); + Enum::tuple(0); + Enum::r#struct(0); + Enum::unit { x: 0 }; + Enum::tuple { x: 0 }; + Enum::r#struct { x: 0 }; + Enum::unit(0, 0); + Enum::tuple(0, 0); + Enum::r#struct(0, 0); + Enum::unit { x: 0, y: 0 }; + Enum::tuple { x: 0, y: 0 }; + Enum::r#struct { x: 0, y: 0 }; +} diff --git a/tests/ui/suggestions/incorrect-variant-literal.svg b/tests/ui/suggestions/incorrect-variant-literal.svg new file mode 100644 index 00000000000..980a7b29a00 --- /dev/null +++ b/tests/ui/suggestions/incorrect-variant-literal.svg @@ -0,0 +1,1028 @@ +<svg width="886px" height="9038px" xmlns="http://www.w3.org/2000/svg"> + <style> + .fg { fill: #AAAAAA } + .bg { background: #000000 } + .fg-ansi256-009 { fill: #FF5555 } + .fg-ansi256-010 { fill: #55FF55 } + .fg-ansi256-012 { fill: #5555FF } + .fg-ansi256-014 { fill: #55FFFF } + .container { + padding: 0 10px; + line-height: 18px; + } + .bold { font-weight: bold; } + tspan { + font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + white-space: pre; + line-height: 18px; + } + </style> + + <rect width="100%" height="100%" y="0" rx="4.5" class="bg" /> + + <text xml:space="preserve" class="container fg"> + <tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[E0533]</tspan><tspan class="bold">: expected value, found struct variant `Enum::Struct`</tspan> +</tspan> + <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:13:5</tspan> +</tspan> + <tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="82px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Struct;</tspan> +</tspan> + <tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">not a value</tspan> +</tspan> + <tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="136px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: you might have meant to create a new value of the struct</tspan> +</tspan> + <tspan x="10px" y="154px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="172px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Struct</tspan><tspan class="fg-ansi256-010"> { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="190px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">++++++++++++++++++</tspan> +</tspan> + <tspan x="10px" y="208px"> +</tspan> + <tspan x="10px" y="226px"><tspan class="fg-ansi256-009 bold">error[E0618]</tspan><tspan class="bold">: expected function, found enum variant `Enum::Unit`</tspan> +</tspan> + <tspan x="10px" y="244px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:14:5</tspan> +</tspan> + <tspan x="10px" y="262px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="280px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Unit,</tspan> +</tspan> + <tspan x="10px" y="298px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">----</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">enum variant `Enum::Unit` defined here</tspan> +</tspan> + <tspan x="10px" y="316px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="334px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Unit();</tspan> +</tspan> + <tspan x="10px" y="352px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^</tspan><tspan class="fg-ansi256-012 bold">--</tspan> +</tspan> + <tspan x="10px" y="370px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="388px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">call expression requires function</tspan> +</tspan> + <tspan x="10px" y="406px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="424px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: `Enum::Unit` is a unit enum variant, and does not take parentheses to be constructed</tspan> +</tspan> + <tspan x="10px" y="442px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="460px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-009">- </tspan><tspan> Enum::Unit</tspan><tspan class="fg-ansi256-009">()</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="478px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-010">+ </tspan><tspan> Enum::Unit;</tspan> +</tspan> + <tspan x="10px" y="496px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="514px"> +</tspan> + <tspan x="10px" y="532px"><tspan class="fg-ansi256-009 bold">error[E0061]</tspan><tspan class="bold">: this enum variant takes 1 argument but 0 arguments were supplied</tspan> +</tspan> + <tspan x="10px" y="550px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:15:5</tspan> +</tspan> + <tspan x="10px" y="568px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="586px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Tuple();</tspan> +</tspan> + <tspan x="10px" y="604px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^</tspan><tspan class="fg-ansi256-012 bold">--</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">argument #1 of type `i32` is missing</tspan> +</tspan> + <tspan x="10px" y="622px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="640px"><tspan class="fg-ansi256-010 bold">note</tspan><tspan>: tuple variant defined here</tspan> +</tspan> + <tspan x="10px" y="658px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:6:5</tspan> +</tspan> + <tspan x="10px" y="676px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="694px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Tuple(i32),</tspan> +</tspan> + <tspan x="10px" y="712px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010 bold">^^^^^</tspan> +</tspan> + <tspan x="10px" y="730px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: provide the argument</tspan> +</tspan> + <tspan x="10px" y="748px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="766px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Tuple</tspan><tspan class="fg-ansi256-010">(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="784px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="802px"> +</tspan> + <tspan x="10px" y="820px"><tspan class="fg-ansi256-009 bold">error[E0533]</tspan><tspan class="bold">: expected value, found struct variant `Enum::Struct`</tspan> +</tspan> + <tspan x="10px" y="838px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:16:5</tspan> +</tspan> + <tspan x="10px" y="856px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="874px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Struct();</tspan> +</tspan> + <tspan x="10px" y="892px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">not a value</tspan> +</tspan> + <tspan x="10px" y="910px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="928px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: you might have meant to create a new value of the struct</tspan> +</tspan> + <tspan x="10px" y="946px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="964px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Struct</tspan><tspan class="fg-ansi256-010"> { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="982px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="1000px"> +</tspan> + <tspan x="10px" y="1018px"><tspan class="fg-ansi256-009 bold">error[E0063]</tspan><tspan class="bold">: missing field `0` in initializer of `Enum`</tspan> +</tspan> + <tspan x="10px" y="1036px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:18:5</tspan> +</tspan> + <tspan x="10px" y="1054px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1072px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Tuple {};</tspan> +</tspan> + <tspan x="10px" y="1090px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">missing `0`</tspan> +</tspan> + <tspan x="10px" y="1108px"> +</tspan> + <tspan x="10px" y="1126px"><tspan class="fg-ansi256-009 bold">error[E0063]</tspan><tspan class="bold">: missing field `x` in initializer of `Enum`</tspan> +</tspan> + <tspan x="10px" y="1144px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:19:5</tspan> +</tspan> + <tspan x="10px" y="1162px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1180px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Struct {};</tspan> +</tspan> + <tspan x="10px" y="1198px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">missing `x`</tspan> +</tspan> + <tspan x="10px" y="1216px"> +</tspan> + <tspan x="10px" y="1234px"><tspan class="fg-ansi256-009 bold">error[E0618]</tspan><tspan class="bold">: expected function, found `Enum`</tspan> +</tspan> + <tspan x="10px" y="1252px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:20:5</tspan> +</tspan> + <tspan x="10px" y="1270px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1288px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Unit,</tspan> +</tspan> + <tspan x="10px" y="1306px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">----</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">`Enum::Unit` defined here</tspan> +</tspan> + <tspan x="10px" y="1324px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="1342px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Unit(0);</tspan> +</tspan> + <tspan x="10px" y="1360px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^</tspan><tspan class="fg-ansi256-012 bold">---</tspan> +</tspan> + <tspan x="10px" y="1378px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1396px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">call expression requires function</tspan> +</tspan> + <tspan x="10px" y="1414px"> +</tspan> + <tspan x="10px" y="1432px"><tspan class="fg-ansi256-009 bold">error[E0533]</tspan><tspan class="bold">: expected value, found struct variant `Enum::Struct`</tspan> +</tspan> + <tspan x="10px" y="1450px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:22:5</tspan> +</tspan> + <tspan x="10px" y="1468px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1486px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Struct(0);</tspan> +</tspan> + <tspan x="10px" y="1504px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">not a value</tspan> +</tspan> + <tspan x="10px" y="1522px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1540px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: you might have meant to create a new value of the struct</tspan> +</tspan> + <tspan x="10px" y="1558px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1576px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Struct</tspan><tspan class="fg-ansi256-010"> { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="1594px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="1612px"> +</tspan> + <tspan x="10px" y="1630px"><tspan class="fg-ansi256-009 bold">error[E0559]</tspan><tspan class="bold">: variant `Enum::Unit` has no field named `x`</tspan> +</tspan> + <tspan x="10px" y="1648px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:23:18</tspan> +</tspan> + <tspan x="10px" y="1666px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1684px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Unit { x: 0 };</tspan> +</tspan> + <tspan x="10px" y="1702px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">`Enum::Unit` does not have this field</tspan> +</tspan> + <tspan x="10px" y="1720px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1738px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">note</tspan><tspan>: all struct fields are already assigned</tspan> +</tspan> + <tspan x="10px" y="1756px"> +</tspan> + <tspan x="10px" y="1774px"><tspan class="fg-ansi256-009 bold">error[E0559]</tspan><tspan class="bold">: variant `Enum::Tuple` has no field named `x`</tspan> +</tspan> + <tspan x="10px" y="1792px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:24:19</tspan> +</tspan> + <tspan x="10px" y="1810px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1828px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Tuple(i32),</tspan> +</tspan> + <tspan x="10px" y="1846px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">-----</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">`Enum::Tuple` defined here</tspan> +</tspan> + <tspan x="10px" y="1864px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="1882px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Tuple { x: 0 };</tspan> +</tspan> + <tspan x="10px" y="1900px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">field does not exist</tspan> +</tspan> + <tspan x="10px" y="1918px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1936px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: `Enum::Tuple` is a tuple variant, use the appropriate syntax</tspan> +</tspan> + <tspan x="10px" y="1954px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="1972px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Tuple</tspan><tspan class="fg-ansi256-010">(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="1990px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="2008px"> +</tspan> + <tspan x="10px" y="2026px"><tspan class="fg-ansi256-009 bold">error[E0618]</tspan><tspan class="bold">: expected function, found `Enum`</tspan> +</tspan> + <tspan x="10px" y="2044px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:26:5</tspan> +</tspan> + <tspan x="10px" y="2062px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2080px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Unit,</tspan> +</tspan> + <tspan x="10px" y="2098px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">----</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">`Enum::Unit` defined here</tspan> +</tspan> + <tspan x="10px" y="2116px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="2134px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Unit(0, 0);</tspan> +</tspan> + <tspan x="10px" y="2152px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^</tspan><tspan class="fg-ansi256-012 bold">------</tspan> +</tspan> + <tspan x="10px" y="2170px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2188px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">call expression requires function</tspan> +</tspan> + <tspan x="10px" y="2206px"> +</tspan> + <tspan x="10px" y="2224px"><tspan class="fg-ansi256-009 bold">error[E0061]</tspan><tspan class="bold">: this enum variant takes 1 argument but 2 arguments were supplied</tspan> +</tspan> + <tspan x="10px" y="2242px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:27:5</tspan> +</tspan> + <tspan x="10px" y="2260px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2278px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Tuple(0, 0);</tspan> +</tspan> + <tspan x="10px" y="2296px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">-</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">unexpected argument #2 of type `{integer}`</tspan> +</tspan> + <tspan x="10px" y="2314px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2332px"><tspan class="fg-ansi256-010 bold">note</tspan><tspan>: tuple variant defined here</tspan> +</tspan> + <tspan x="10px" y="2350px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:6:5</tspan> +</tspan> + <tspan x="10px" y="2368px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2386px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Tuple(i32),</tspan> +</tspan> + <tspan x="10px" y="2404px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010 bold">^^^^^</tspan> +</tspan> + <tspan x="10px" y="2422px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: remove the extra argument</tspan> +</tspan> + <tspan x="10px" y="2440px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2458px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-009">- </tspan><tspan> Enum::Tuple(0</tspan><tspan class="fg-ansi256-009">, 0</tspan><tspan>);</tspan> +</tspan> + <tspan x="10px" y="2476px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-010">+ </tspan><tspan> Enum::Tuple(0);</tspan> +</tspan> + <tspan x="10px" y="2494px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2512px"> +</tspan> + <tspan x="10px" y="2530px"><tspan class="fg-ansi256-009 bold">error[E0533]</tspan><tspan class="bold">: expected value, found struct variant `Enum::Struct`</tspan> +</tspan> + <tspan x="10px" y="2548px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:28:5</tspan> +</tspan> + <tspan x="10px" y="2566px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2584px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Struct(0, 0);</tspan> +</tspan> + <tspan x="10px" y="2602px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">not a value</tspan> +</tspan> + <tspan x="10px" y="2620px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2638px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: you might have meant to create a new value of the struct</tspan> +</tspan> + <tspan x="10px" y="2656px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2674px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Struct</tspan><tspan class="fg-ansi256-010"> { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="2692px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="2710px"> +</tspan> + <tspan x="10px" y="2728px"><tspan class="fg-ansi256-009 bold">error[E0559]</tspan><tspan class="bold">: variant `Enum::Unit` has no field named `x`</tspan> +</tspan> + <tspan x="10px" y="2746px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:29:18</tspan> +</tspan> + <tspan x="10px" y="2764px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2782px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Unit { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="2800px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">`Enum::Unit` does not have this field</tspan> +</tspan> + <tspan x="10px" y="2818px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2836px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">note</tspan><tspan>: all struct fields are already assigned</tspan> +</tspan> + <tspan x="10px" y="2854px"> +</tspan> + <tspan x="10px" y="2872px"><tspan class="fg-ansi256-009 bold">error[E0559]</tspan><tspan class="bold">: variant `Enum::Unit` has no field named `y`</tspan> +</tspan> + <tspan x="10px" y="2890px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:29:24</tspan> +</tspan> + <tspan x="10px" y="2908px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2926px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Unit { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="2944px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">`Enum::Unit` does not have this field</tspan> +</tspan> + <tspan x="10px" y="2962px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="2980px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">note</tspan><tspan>: all struct fields are already assigned</tspan> +</tspan> + <tspan x="10px" y="2998px"> +</tspan> + <tspan x="10px" y="3016px"><tspan class="fg-ansi256-009 bold">error[E0559]</tspan><tspan class="bold">: variant `Enum::Tuple` has no field named `x`</tspan> +</tspan> + <tspan x="10px" y="3034px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:31:19</tspan> +</tspan> + <tspan x="10px" y="3052px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3070px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Tuple(i32),</tspan> +</tspan> + <tspan x="10px" y="3088px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">-----</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">`Enum::Tuple` defined here</tspan> +</tspan> + <tspan x="10px" y="3106px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="3124px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Tuple { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="3142px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">field does not exist</tspan> +</tspan> + <tspan x="10px" y="3160px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3178px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: `Enum::Tuple` is a tuple variant, use the appropriate syntax</tspan> +</tspan> + <tspan x="10px" y="3196px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3214px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Tuple</tspan><tspan class="fg-ansi256-010">(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="3232px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="3250px"> +</tspan> + <tspan x="10px" y="3268px"><tspan class="fg-ansi256-009 bold">error[E0559]</tspan><tspan class="bold">: variant `Enum::Tuple` has no field named `y`</tspan> +</tspan> + <tspan x="10px" y="3286px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:31:25</tspan> +</tspan> + <tspan x="10px" y="3304px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3322px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Tuple(i32),</tspan> +</tspan> + <tspan x="10px" y="3340px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">-----</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">`Enum::Tuple` defined here</tspan> +</tspan> + <tspan x="10px" y="3358px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="3376px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Tuple { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="3394px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">field does not exist</tspan> +</tspan> + <tspan x="10px" y="3412px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3430px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: `Enum::Tuple` is a tuple variant, use the appropriate syntax</tspan> +</tspan> + <tspan x="10px" y="3448px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3466px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::Tuple</tspan><tspan class="fg-ansi256-010">(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="3484px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="3502px"> +</tspan> + <tspan x="10px" y="3520px"><tspan class="fg-ansi256-009 bold">error[E0559]</tspan><tspan class="bold">: variant `Enum::Struct` has no field named `y`</tspan> +</tspan> + <tspan x="10px" y="3538px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:33:26</tspan> +</tspan> + <tspan x="10px" y="3556px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3574px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::Struct { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="3592px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">`Enum::Struct` does not have this field</tspan> +</tspan> + <tspan x="10px" y="3610px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3628px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">note</tspan><tspan>: all struct fields are already assigned</tspan> +</tspan> + <tspan x="10px" y="3646px"> +</tspan> + <tspan x="10px" y="3664px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `unit` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="3682px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:34:11</tspan> +</tspan> + <tspan x="10px" y="3700px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3718px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="3736px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `unit` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="3754px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="3772px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::unit;</tspan> +</tspan> + <tspan x="10px" y="3790px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="3808px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3826px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name (notice the capitalization difference)</tspan> +</tspan> + <tspan x="10px" y="3844px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3862px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Unit</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="3880px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~</tspan> +</tspan> + <tspan x="10px" y="3898px"> +</tspan> + <tspan x="10px" y="3916px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `tuple` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="3934px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:35:11</tspan> +</tspan> + <tspan x="10px" y="3952px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="3970px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="3988px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `tuple` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="4006px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="4024px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::tuple;</tspan> +</tspan> + <tspan x="10px" y="4042px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="4060px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4078px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="4096px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4114px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="4132px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="4150px"> +</tspan> + <tspan x="10px" y="4168px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `r#struct` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="4186px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:36:11</tspan> +</tspan> + <tspan x="10px" y="4204px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4222px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="4240px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `r#struct` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="4258px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="4276px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::r#struct;</tspan> +</tspan> + <tspan x="10px" y="4294px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="4312px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4330px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="4348px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4366px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Struct { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="4384px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="4402px"> +</tspan> + <tspan x="10px" y="4420px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `unit` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="4438px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:37:11</tspan> +</tspan> + <tspan x="10px" y="4456px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4474px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="4492px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `unit` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="4510px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="4528px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::unit();</tspan> +</tspan> + <tspan x="10px" y="4546px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="4564px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4582px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="4600px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4618px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Unit</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="4636px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~</tspan> +</tspan> + <tspan x="10px" y="4654px"> +</tspan> + <tspan x="10px" y="4672px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `tuple` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="4690px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:38:11</tspan> +</tspan> + <tspan x="10px" y="4708px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4726px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="4744px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `tuple` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="4762px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="4780px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::tuple();</tspan> +</tspan> + <tspan x="10px" y="4798px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="4816px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4834px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="4852px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4870px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="4888px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="4906px"> +</tspan> + <tspan x="10px" y="4924px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `r#struct` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="4942px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:39:11</tspan> +</tspan> + <tspan x="10px" y="4960px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="4978px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="4996px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `r#struct` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="5014px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="5032px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::r#struct();</tspan> +</tspan> + <tspan x="10px" y="5050px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="5068px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5086px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="5104px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5122px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Struct { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="5140px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="5158px"> +</tspan> + <tspan x="10px" y="5176px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `unit` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="5194px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:40:11</tspan> +</tspan> + <tspan x="10px" y="5212px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5230px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="5248px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `unit` not found here</tspan> +</tspan> + <tspan x="10px" y="5266px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="5284px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::unit {};</tspan> +</tspan> + <tspan x="10px" y="5302px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^</tspan> +</tspan> + <tspan x="10px" y="5320px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5338px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="5356px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5374px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Unit</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="5392px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~</tspan> +</tspan> + <tspan x="10px" y="5410px"> +</tspan> + <tspan x="10px" y="5428px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `tuple` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="5446px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:41:11</tspan> +</tspan> + <tspan x="10px" y="5464px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5482px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="5500px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `tuple` not found here</tspan> +</tspan> + <tspan x="10px" y="5518px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="5536px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::tuple {};</tspan> +</tspan> + <tspan x="10px" y="5554px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^</tspan> +</tspan> + <tspan x="10px" y="5572px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5590px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="5608px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5626px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="5644px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="5662px"> +</tspan> + <tspan x="10px" y="5680px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `r#struct` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="5698px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:42:11</tspan> +</tspan> + <tspan x="10px" y="5716px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5734px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="5752px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `r#struct` not found here</tspan> +</tspan> + <tspan x="10px" y="5770px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="5788px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::r#struct {};</tspan> +</tspan> + <tspan x="10px" y="5806px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^</tspan> +</tspan> + <tspan x="10px" y="5824px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5842px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="5860px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5878px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Struct { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="5896px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="5914px"> +</tspan> + <tspan x="10px" y="5932px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `unit` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="5950px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:43:11</tspan> +</tspan> + <tspan x="10px" y="5968px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="5986px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="6004px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `unit` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="6022px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="6040px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::unit(0);</tspan> +</tspan> + <tspan x="10px" y="6058px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="6076px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6094px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="6112px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6130px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Unit</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="6148px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~</tspan> +</tspan> + <tspan x="10px" y="6166px"> +</tspan> + <tspan x="10px" y="6184px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `tuple` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="6202px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:44:11</tspan> +</tspan> + <tspan x="10px" y="6220px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6238px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="6256px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `tuple` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="6274px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="6292px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::tuple(0);</tspan> +</tspan> + <tspan x="10px" y="6310px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="6328px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6346px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="6364px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6382px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple</tspan><tspan>(0);</tspan> +</tspan> + <tspan x="10px" y="6400px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~</tspan> +</tspan> + <tspan x="10px" y="6418px"> +</tspan> + <tspan x="10px" y="6436px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `r#struct` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="6454px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:45:11</tspan> +</tspan> + <tspan x="10px" y="6472px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6490px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="6508px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `r#struct` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="6526px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="6544px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::r#struct(0);</tspan> +</tspan> + <tspan x="10px" y="6562px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="6580px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6598px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="6616px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6634px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Struct { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="6652px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="6670px"> +</tspan> + <tspan x="10px" y="6688px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `unit` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="6706px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:46:11</tspan> +</tspan> + <tspan x="10px" y="6724px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6742px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="6760px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `unit` not found here</tspan> +</tspan> + <tspan x="10px" y="6778px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="6796px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::unit { x: 0 };</tspan> +</tspan> + <tspan x="10px" y="6814px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^</tspan> +</tspan> + <tspan x="10px" y="6832px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6850px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="6868px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6886px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Unit</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="6904px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~</tspan> +</tspan> + <tspan x="10px" y="6922px"> +</tspan> + <tspan x="10px" y="6940px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `tuple` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="6958px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:47:11</tspan> +</tspan> + <tspan x="10px" y="6976px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="6994px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="7012px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `tuple` not found here</tspan> +</tspan> + <tspan x="10px" y="7030px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="7048px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::tuple { x: 0 };</tspan> +</tspan> + <tspan x="10px" y="7066px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^</tspan> +</tspan> + <tspan x="10px" y="7084px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7102px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="7120px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7138px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="7156px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="7174px"> +</tspan> + <tspan x="10px" y="7192px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `r#struct` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="7210px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:48:11</tspan> +</tspan> + <tspan x="10px" y="7228px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7246px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="7264px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `r#struct` not found here</tspan> +</tspan> + <tspan x="10px" y="7282px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="7300px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::r#struct { x: 0 };</tspan> +</tspan> + <tspan x="10px" y="7318px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^</tspan> +</tspan> + <tspan x="10px" y="7336px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7354px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="7372px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7390px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Struct { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="7408px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="7426px"> +</tspan> + <tspan x="10px" y="7444px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `unit` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="7462px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:49:11</tspan> +</tspan> + <tspan x="10px" y="7480px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7498px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="7516px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `unit` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="7534px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="7552px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::unit(0, 0);</tspan> +</tspan> + <tspan x="10px" y="7570px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="7588px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7606px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="7624px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7642px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Unit</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="7660px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~</tspan> +</tspan> + <tspan x="10px" y="7678px"> +</tspan> + <tspan x="10px" y="7696px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `tuple` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="7714px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:50:11</tspan> +</tspan> + <tspan x="10px" y="7732px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7750px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="7768px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `tuple` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="7786px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="7804px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::tuple(0, 0);</tspan> +</tspan> + <tspan x="10px" y="7822px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="7840px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7858px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="7876px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="7894px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple</tspan><tspan>(</tspan><tspan class="fg-ansi256-010">/* i32 */</tspan><tspan>);</tspan> +</tspan> + <tspan x="10px" y="7912px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="7930px"> +</tspan> + <tspan x="10px" y="7948px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant or associated item named `r#struct` found for enum `Enum` in the current scope</tspan> +</tspan> + <tspan x="10px" y="7966px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:51:11</tspan> +</tspan> + <tspan x="10px" y="7984px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8002px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="8020px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant or associated item `r#struct` not found for this enum</tspan> +</tspan> + <tspan x="10px" y="8038px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="8056px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::r#struct(0, 0);</tspan> +</tspan> + <tspan x="10px" y="8074px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">variant or associated item not found in `Enum`</tspan> +</tspan> + <tspan x="10px" y="8092px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8110px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="8128px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8146px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Struct { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="8164px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="8182px"> +</tspan> + <tspan x="10px" y="8200px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `unit` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="8218px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:52:11</tspan> +</tspan> + <tspan x="10px" y="8236px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8254px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="8272px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `unit` not found here</tspan> +</tspan> + <tspan x="10px" y="8290px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="8308px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::unit { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="8326px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^</tspan> +</tspan> + <tspan x="10px" y="8344px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8362px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="8380px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8398px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Unit</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="8416px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~</tspan> +</tspan> + <tspan x="10px" y="8434px"> +</tspan> + <tspan x="10px" y="8452px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `tuple` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="8470px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:53:11</tspan> +</tspan> + <tspan x="10px" y="8488px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8506px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="8524px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `tuple` not found here</tspan> +</tspan> + <tspan x="10px" y="8542px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="8560px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::tuple { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="8578px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^</tspan> +</tspan> + <tspan x="10px" y="8596px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8614px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="8632px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8650px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Tuple(/* i32 */)</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="8668px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="8686px"> +</tspan> + <tspan x="10px" y="8704px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: no variant named `r#struct` found for enum `Enum`</tspan> +</tspan> + <tspan x="10px" y="8722px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/incorrect-variant-literal.rs:54:11</tspan> +</tspan> + <tspan x="10px" y="8740px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8758px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> enum Enum {</tspan> +</tspan> + <tspan x="10px" y="8776px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">---------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">variant `r#struct` not found here</tspan> +</tspan> + <tspan x="10px" y="8794px"><tspan class="fg-ansi256-012 bold">...</tspan> +</tspan> + <tspan x="10px" y="8812px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> Enum::r#struct { x: 0, y: 0 };</tspan> +</tspan> + <tspan x="10px" y="8830px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^</tspan> +</tspan> + <tspan x="10px" y="8848px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8866px"><tspan class="fg-ansi256-014 bold">help</tspan><tspan>: there is a variant with a similar name</tspan> +</tspan> + <tspan x="10px" y="8884px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan> +</tspan> + <tspan x="10px" y="8902px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">| </tspan><tspan> Enum::</tspan><tspan class="fg-ansi256-010">Struct { x: /* value */ }</tspan><tspan>;</tspan> +</tspan> + <tspan x="10px" y="8920px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010">~~~~~~~~~~~~~~~~~~~~~~~~~</tspan> +</tspan> + <tspan x="10px" y="8938px"> +</tspan> + <tspan x="10px" y="8956px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="bold">: aborting due to 39 previous errors</tspan> +</tspan> + <tspan x="10px" y="8974px"> +</tspan> + <tspan x="10px" y="8992px"><tspan class="bold">Some errors have detailed explanations: E0061, E0063, E0533, E0559, E0599, E0618.</tspan> +</tspan> + <tspan x="10px" y="9010px"><tspan class="bold">For more information about an error, try `rustc --explain E0061`.</tspan> +</tspan> + <tspan x="10px" y="9028px"> +</tspan> + </text> + +</svg> diff --git a/tests/ui/suggestions/nested-non-tuple-tuple-struct.stderr b/tests/ui/suggestions/nested-non-tuple-tuple-struct.stderr index 948f09fc3fa..4523333850c 100644 --- a/tests/ui/suggestions/nested-non-tuple-tuple-struct.stderr +++ b/tests/ui/suggestions/nested-non-tuple-tuple-struct.stderr @@ -9,8 +9,8 @@ LL | let _x = (S { x: 1.0, y: 2.0 }, S { x: 3.0, y: 4.0 }); | help: `S` is a tuple struct, use the appropriate syntax | -LL | let _x = (S(/* fields */), S { x: 3.0, y: 4.0 }); - | ~~~~~~~~~~~~~~~ +LL | let _x = (S(/* f32 */, /* f32 */), S { x: 3.0, y: 4.0 }); + | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0560]: struct `S` has no field named `y` --> $DIR/nested-non-tuple-tuple-struct.rs:8:27 @@ -23,8 +23,8 @@ LL | let _x = (S { x: 1.0, y: 2.0 }, S { x: 3.0, y: 4.0 }); | help: `S` is a tuple struct, use the appropriate syntax | -LL | let _x = (S(/* fields */), S { x: 3.0, y: 4.0 }); - | ~~~~~~~~~~~~~~~ +LL | let _x = (S(/* f32 */, /* f32 */), S { x: 3.0, y: 4.0 }); + | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0560]: struct `S` has no field named `x` --> $DIR/nested-non-tuple-tuple-struct.rs:8:41 @@ -37,8 +37,8 @@ LL | let _x = (S { x: 1.0, y: 2.0 }, S { x: 3.0, y: 4.0 }); | help: `S` is a tuple struct, use the appropriate syntax | -LL | let _x = (S { x: 1.0, y: 2.0 }, S(/* fields */)); - | ~~~~~~~~~~~~~~~ +LL | let _x = (S { x: 1.0, y: 2.0 }, S(/* f32 */, /* f32 */)); + | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0560]: struct `S` has no field named `y` --> $DIR/nested-non-tuple-tuple-struct.rs:8:49 @@ -51,8 +51,8 @@ LL | let _x = (S { x: 1.0, y: 2.0 }, S { x: 3.0, y: 4.0 }); | help: `S` is a tuple struct, use the appropriate syntax | -LL | let _x = (S { x: 1.0, y: 2.0 }, S(/* fields */)); - | ~~~~~~~~~~~~~~~ +LL | let _x = (S { x: 1.0, y: 2.0 }, S(/* f32 */, /* f32 */)); + | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0559]: variant `E::V` has no field named `x` --> $DIR/nested-non-tuple-tuple-struct.rs:13:22 @@ -65,8 +65,8 @@ LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V { x: 3.0, y: 4.0 }); | help: `E::V` is a tuple variant, use the appropriate syntax | -LL | let _y = (E::V(/* fields */), E::V { x: 3.0, y: 4.0 }); - | ~~~~~~~~~~~~~~~~~~ +LL | let _y = (E::V(/* f32 */, /* f32 */), E::V { x: 3.0, y: 4.0 }); + | ~~~~~~~~~~~~~~~~~~~~~~ error[E0559]: variant `E::V` has no field named `y` --> $DIR/nested-non-tuple-tuple-struct.rs:13:30 @@ -79,8 +79,8 @@ LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V { x: 3.0, y: 4.0 }); | help: `E::V` is a tuple variant, use the appropriate syntax | -LL | let _y = (E::V(/* fields */), E::V { x: 3.0, y: 4.0 }); - | ~~~~~~~~~~~~~~~~~~ +LL | let _y = (E::V(/* f32 */, /* f32 */), E::V { x: 3.0, y: 4.0 }); + | ~~~~~~~~~~~~~~~~~~~~~~ error[E0559]: variant `E::V` has no field named `x` --> $DIR/nested-non-tuple-tuple-struct.rs:13:47 @@ -93,8 +93,8 @@ LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V { x: 3.0, y: 4.0 }); | help: `E::V` is a tuple variant, use the appropriate syntax | -LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V(/* fields */)); - | ~~~~~~~~~~~~~~~~~~ +LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V(/* f32 */, /* f32 */)); + | ~~~~~~~~~~~~~~~~~~~~~~ error[E0559]: variant `E::V` has no field named `y` --> $DIR/nested-non-tuple-tuple-struct.rs:13:55 @@ -107,8 +107,8 @@ LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V { x: 3.0, y: 4.0 }); | help: `E::V` is a tuple variant, use the appropriate syntax | -LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V(/* fields */)); - | ~~~~~~~~~~~~~~~~~~ +LL | let _y = (E::V { x: 1.0, y: 2.0 }, E::V(/* f32 */, /* f32 */)); + | ~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 8 previous errors diff --git a/tests/ui/suggestions/suggest-variants.stderr b/tests/ui/suggestions/suggest-variants.stderr index a422bc65635..d93bf2d8cd7 100644 --- a/tests/ui/suggestions/suggest-variants.stderr +++ b/tests/ui/suggestions/suggest-variants.stderr @@ -5,7 +5,12 @@ LL | enum Shape { | ---------- variant `Squareee` not found here ... LL | println!("My shape is {:?}", Shape::Squareee { size: 5}); - | ^^^^^^^^ help: there is a variant with a similar name: `Square` + | ^^^^^^^^ + | +help: there is a variant with a similar name + | +LL | println!("My shape is {:?}", Shape::Square { size: 5}); + | ~~~~~~ error[E0599]: no variant named `Circl` found for enum `Shape` --> $DIR/suggest-variants.rs:13:41 @@ -14,7 +19,12 @@ LL | enum Shape { | ---------- variant `Circl` not found here ... LL | println!("My shape is {:?}", Shape::Circl { size: 5}); - | ^^^^^ help: there is a variant with a similar name: `Circle` + | ^^^^^ + | +help: there is a variant with a similar name + | +LL | println!("My shape is {:?}", Shape::Circle { size: 5}); + | ~~~~~~ error[E0599]: no variant named `Rombus` found for enum `Shape` --> $DIR/suggest-variants.rs:14:41 @@ -32,10 +42,12 @@ LL | enum Shape { | ---------- variant or associated item `Squareee` not found for this enum ... LL | Shape::Squareee; - | ^^^^^^^^ - | | - | variant or associated item not found in `Shape` - | help: there is a variant with a similar name: `Square` + | ^^^^^^^^ variant or associated item not found in `Shape` + | +help: there is a variant with a similar name + | +LL | Shape::Square { size: /* value */ }; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0599]: no variant or associated item named `Circl` found for enum `Shape` in the current scope --> $DIR/suggest-variants.rs:16:12 @@ -44,10 +56,12 @@ LL | enum Shape { | ---------- variant or associated item `Circl` not found for this enum ... LL | Shape::Circl; - | ^^^^^ - | | - | variant or associated item not found in `Shape` - | help: there is a variant with a similar name: `Circle` + | ^^^^^ variant or associated item not found in `Shape` + | +help: there is a variant with a similar name + | +LL | Shape::Circle { radius: /* value */ }; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0599]: no variant or associated item named `Rombus` found for enum `Shape` in the current scope --> $DIR/suggest-variants.rs:17:12 diff --git a/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs deleted file mode 100644 index bbae67f0bad..00000000000 --- a/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(non_lifetime_binders)] -//~^ WARN the feature `non_lifetime_binders` is incomplete - -fn b() -where - for<const C: usize> [(); C]: Copy, - //~^ ERROR cannot capture late-bound const parameter in constant -{ -} - -fn main() {} diff --git a/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr b/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr deleted file mode 100644 index 4e0441c1c7d..00000000000 --- a/tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.stderr +++ /dev/null @@ -1,19 +0,0 @@ -warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/capture-late-ct-in-anon.rs:1:12 - | -LL | #![feature(non_lifetime_binders)] - | ^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information - = note: `#[warn(incomplete_features)]` on by default - -error: cannot capture late-bound const parameter in constant - --> $DIR/capture-late-ct-in-anon.rs:6:30 - | -LL | for<const C: usize> [(); C]: Copy, - | -------------- ^ - | | - | parameter defined here - -error: aborting due to 1 previous error; 1 warning emitted - diff --git a/tests/ui/transmutability/issue-101739-1.rs b/tests/ui/transmutability/issue-101739-1.rs index 0695d7d409f..20bd7917e53 100644 --- a/tests/ui/transmutability/issue-101739-1.rs +++ b/tests/ui/transmutability/issue-101739-1.rs @@ -7,7 +7,6 @@ mod assert { where Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope //~^ the constant `ASSUME_ALIGNMENT` is not of type `Assume` - //~| ERROR: mismatched types { } } diff --git a/tests/ui/transmutability/issue-101739-1.stderr b/tests/ui/transmutability/issue-101739-1.stderr index 6f79bf7b424..ba18a980f4d 100644 --- a/tests/ui/transmutability/issue-101739-1.stderr +++ b/tests/ui/transmutability/issue-101739-1.stderr @@ -13,13 +13,6 @@ LL | Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, note: required by a const generic parameter in `BikeshedIntrinsicFrom` --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL -error[E0308]: mismatched types - --> $DIR/issue-101739-1.rs:8:41 - | -LL | Dst: BikeshedIntrinsicFrom<Src, ASSUME_ALIGNMENT>, - | ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` - -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0308, E0412. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/transmutability/issue-101739-2.rs b/tests/ui/transmutability/issue-101739-2.rs index 1c0bd29d707..8b36bf3dcb1 100644 --- a/tests/ui/transmutability/issue-101739-2.rs +++ b/tests/ui/transmutability/issue-101739-2.rs @@ -16,7 +16,7 @@ mod assert { where Dst: BikeshedIntrinsicFrom< //~ ERROR trait takes at most 2 generic arguments but 5 generic arguments were supplied Src, - ASSUME_ALIGNMENT, //~ ERROR: mismatched types + ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_VALIDITY, ASSUME_VISIBILITY, diff --git a/tests/ui/transmutability/issue-101739-2.stderr b/tests/ui/transmutability/issue-101739-2.stderr index 38912696c18..519a374dc22 100644 --- a/tests/ui/transmutability/issue-101739-2.stderr +++ b/tests/ui/transmutability/issue-101739-2.stderr @@ -9,13 +9,6 @@ LL | | ASSUME_VALIDITY, LL | | ASSUME_VISIBILITY, | |_____________________________- help: remove these generic arguments -error[E0308]: mismatched types - --> $DIR/issue-101739-2.rs:19:13 - | -LL | ASSUME_ALIGNMENT, - | ^^^^^^^^^^^^^^^^ expected `Assume`, found `bool` - -error: aborting due to 2 previous errors +error: aborting due to 1 previous error -Some errors have detailed explanations: E0107, E0308. -For more information about an error, try `rustc --explain E0107`. +For more information about this error, try `rustc --explain E0107`. diff --git a/tests/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr b/tests/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr index c9ac99ede6f..c21c59397c7 100644 --- a/tests/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr +++ b/tests/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr @@ -3,6 +3,11 @@ error[E0533]: expected value, found struct variant `Alias::Braced` | LL | Alias::Braced; | ^^^^^^^^^^^^^ not a value + | +help: you might have meant to create a new value of the struct + | +LL | Alias::Braced {}; + | ++ error[E0533]: expected unit struct, unit variant or constant, found struct variant `Alias::Braced` --> $DIR/incorrect-variant-form-through-alias-caught.rs:10:9 diff --git a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs index 193544ebd3f..9fc249198d0 100644 --- a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs +++ b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.rs @@ -5,7 +5,7 @@ trait Trait { - fn func<const N: u32>() -> [ (); N ]; //~ ERROR mismatched types + fn func<const N: u32>() -> [ (); N ]; //~ ERROR the constant `N` is not of type `usize` } struct S {} diff --git a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr index 16aaf0615ed..bff926a2081 100644 --- a/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr +++ b/tests/ui/typeck/issue-114918/const-in-impl-fn-return-type.stderr @@ -4,11 +4,11 @@ error[E0308]: mismatched types LL | fn func<const N: u32>() -> [ (); { () }] { | ^^ expected `usize`, found `()` -error[E0308]: mismatched types - --> $DIR/const-in-impl-fn-return-type.rs:8:38 +error: the constant `N` is not of type `usize` + --> $DIR/const-in-impl-fn-return-type.rs:8:32 | LL | fn func<const N: u32>() -> [ (); N ]; - | ^ expected `usize`, found `u32` + | ^^^^^^^^^ expected `usize`, found `u32` error: aborting due to 2 previous errors |
