Importing rustc-1.56.0
Change-Id: I98941481270706fa55f8fb2cb91686ae3bd30f38
diff --git a/src/test/ui/abi/abi-sysv64-register-usage.rs b/src/test/ui/abi/abi-sysv64-register-usage.rs
index 32864db..9eba9e0 100644
--- a/src/test/ui/abi/abi-sysv64-register-usage.rs
+++ b/src/test/ui/abi/abi-sysv64-register-usage.rs
@@ -7,6 +7,7 @@
// ignore-aarch64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[cfg(target_arch = "x86_64")]
pub extern "sysv64" fn all_the_registers(rdi: i64, rsi: i64, rdx: i64,
diff --git a/src/test/ui/abi/unsupported.aarch64.stderr b/src/test/ui/abi/unsupported.aarch64.stderr
index fdeb79f..225d49e 100644
--- a/src/test/ui/abi/unsupported.aarch64.stderr
+++ b/src/test/ui/abi/unsupported.aarch64.stderr
@@ -1,41 +1,47 @@
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:24:1
+ --> $DIR/unsupported.rs:26:1
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:26:1
+ --> $DIR/unsupported.rs:28:1
|
LL | extern "amdgpu-kernel" fn amdgpu() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"wasm"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:28:1
+ --> $DIR/unsupported.rs:30:1
|
LL | extern "wasm" fn wasm() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
+error[E0570]: `"aapcs"` is not a supported ABI for the current target
+ --> $DIR/unsupported.rs:32:1
+ |
+LL | extern "aapcs" fn aapcs() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:33:1
+ --> $DIR/unsupported.rs:36:1
|
LL | extern "msp430-interrupt" fn msp430() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:35:1
+ --> $DIR/unsupported.rs:38:1
|
LL | extern "avr-interrupt" fn avr() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:37:1
+ --> $DIR/unsupported.rs:40:1
|
LL | extern "x86-interrupt" fn x86() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of calling convention not supported on this target
- --> $DIR/unsupported.rs:39:1
+ --> $DIR/unsupported.rs:43:1
|
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,7 +51,7 @@
= note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
warning: use of calling convention not supported on this target
- --> $DIR/unsupported.rs:44:1
+ --> $DIR/unsupported.rs:50:1
|
LL | extern "thiscall" fn thiscall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -53,6 +59,6 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
-error: aborting due to 6 previous errors; 2 warnings emitted
+error: aborting due to 7 previous errors; 2 warnings emitted
For more information about this error, try `rustc --explain E0570`.
diff --git a/src/test/ui/abi/unsupported.arm.stderr b/src/test/ui/abi/unsupported.arm.stderr
new file mode 100644
index 0000000..b050ee0
--- /dev/null
+++ b/src/test/ui/abi/unsupported.arm.stderr
@@ -0,0 +1,58 @@
+error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
+ --> $DIR/unsupported.rs:26:1
+ |
+LL | extern "ptx-kernel" fn ptx() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
+ --> $DIR/unsupported.rs:28:1
+ |
+LL | extern "amdgpu-kernel" fn amdgpu() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0570]: `"wasm"` is not a supported ABI for the current target
+ --> $DIR/unsupported.rs:30:1
+ |
+LL | extern "wasm" fn wasm() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
+ --> $DIR/unsupported.rs:36:1
+ |
+LL | extern "msp430-interrupt" fn msp430() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
+ --> $DIR/unsupported.rs:38:1
+ |
+LL | extern "avr-interrupt" fn avr() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0570]: `"x86-interrupt"` is not a supported ABI for the current target
+ --> $DIR/unsupported.rs:40:1
+ |
+LL | extern "x86-interrupt" fn x86() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: use of calling convention not supported on this target
+ --> $DIR/unsupported.rs:43:1
+ |
+LL | extern "stdcall" fn stdcall() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(unsupported_calling_conventions)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
+
+warning: use of calling convention not supported on this target
+ --> $DIR/unsupported.rs:50:1
+ |
+LL | extern "thiscall" fn thiscall() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
+
+error: aborting due to 6 previous errors; 2 warnings emitted
+
+For more information about this error, try `rustc --explain E0570`.
diff --git a/src/test/ui/abi/unsupported.i686.stderr b/src/test/ui/abi/unsupported.i686.stderr
index 81b1265..7ca9351 100644
--- a/src/test/ui/abi/unsupported.i686.stderr
+++ b/src/test/ui/abi/unsupported.i686.stderr
@@ -1,35 +1,35 @@
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:24:1
+ --> $DIR/unsupported.rs:26:1
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:26:1
+ --> $DIR/unsupported.rs:28:1
|
LL | extern "amdgpu-kernel" fn amdgpu() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"wasm"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:28:1
+ --> $DIR/unsupported.rs:30:1
|
LL | extern "wasm" fn wasm() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"aapcs"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:30:1
+ --> $DIR/unsupported.rs:32:1
|
LL | extern "aapcs" fn aapcs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:33:1
+ --> $DIR/unsupported.rs:36:1
|
LL | extern "msp430-interrupt" fn msp430() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:35:1
+ --> $DIR/unsupported.rs:38:1
|
LL | extern "avr-interrupt" fn avr() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/abi/unsupported.rs b/src/test/ui/abi/unsupported.rs
index f0debdc..9319eac 100644
--- a/src/test/ui/abi/unsupported.rs
+++ b/src/test/ui/abi/unsupported.rs
@@ -1,11 +1,13 @@
-// revisions: x64 i686 aarch64
+// revisions: x64 i686 aarch64 arm
//
// [x64] needs-llvm-components: x86
-// [x64]compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib
+// [x64] compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=rlib
// [i686] needs-llvm-components: x86
-// [i686]compile-flags: --target=i686-unknown-linux-gnu --crate-type=rlib
+// [i686] compile-flags: --target=i686-unknown-linux-gnu --crate-type=rlib
// [aarch64] needs-llvm-components: aarch64
-// [aarch64]compile-flags: --target=aarch64-unknown-linux-gnu --crate-type=rlib
+// [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu --crate-type=rlib
+// [arm] needs-llvm-components: arm
+// [arm] compile-flags: --target=armv7-unknown-linux-gnueabihf --crate-type=rlib
#![no_core]
#![feature(
no_core,
@@ -30,19 +32,25 @@
extern "aapcs" fn aapcs() {}
//[x64]~^ ERROR is not a supported ABI
//[i686]~^^ ERROR is not a supported ABI
+//[aarch64]~^^^ ERROR is not a supported ABI
extern "msp430-interrupt" fn msp430() {}
//~^ ERROR is not a supported ABI
extern "avr-interrupt" fn avr() {}
//~^ ERROR is not a supported ABI
extern "x86-interrupt" fn x86() {}
//[aarch64]~^ ERROR is not a supported ABI
+//[arm]~^^ ERROR is not a supported ABI
extern "stdcall" fn stdcall() {}
//[x64]~^ WARN use of calling convention not supported
//[x64]~^^ WARN this was previously accepted
//[aarch64]~^^^ WARN use of calling convention not supported
//[aarch64]~^^^^ WARN this was previously accepted
+//[arm]~^^^^^ WARN use of calling convention not supported
+//[arm]~^^^^^^ WARN this was previously accepted
extern "thiscall" fn thiscall() {}
//[x64]~^ WARN use of calling convention not supported
//[x64]~^^ WARN this was previously accepted
//[aarch64]~^^^ WARN use of calling convention not supported
//[aarch64]~^^^^ WARN this was previously accepted
+//[arm]~^^^^^ WARN use of calling convention not supported
+//[arm]~^^^^^^ WARN this was previously accepted
diff --git a/src/test/ui/abi/unsupported.x64.stderr b/src/test/ui/abi/unsupported.x64.stderr
index 60d067a..f2f5268 100644
--- a/src/test/ui/abi/unsupported.x64.stderr
+++ b/src/test/ui/abi/unsupported.x64.stderr
@@ -1,41 +1,41 @@
error[E0570]: `"ptx-kernel"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:24:1
+ --> $DIR/unsupported.rs:26:1
|
LL | extern "ptx-kernel" fn ptx() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"amdgpu-kernel"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:26:1
+ --> $DIR/unsupported.rs:28:1
|
LL | extern "amdgpu-kernel" fn amdgpu() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"wasm"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:28:1
+ --> $DIR/unsupported.rs:30:1
|
LL | extern "wasm" fn wasm() {}
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"aapcs"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:30:1
+ --> $DIR/unsupported.rs:32:1
|
LL | extern "aapcs" fn aapcs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"msp430-interrupt"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:33:1
+ --> $DIR/unsupported.rs:36:1
|
LL | extern "msp430-interrupt" fn msp430() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0570]: `"avr-interrupt"` is not a supported ABI for the current target
- --> $DIR/unsupported.rs:35:1
+ --> $DIR/unsupported.rs:38:1
|
LL | extern "avr-interrupt" fn avr() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of calling convention not supported on this target
- --> $DIR/unsupported.rs:39:1
+ --> $DIR/unsupported.rs:43:1
|
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -45,7 +45,7 @@
= note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
warning: use of calling convention not supported on this target
- --> $DIR/unsupported.rs:44:1
+ --> $DIR/unsupported.rs:50:1
|
LL | extern "thiscall" fn thiscall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/anon-params/anon-params-denied-2018.stderr b/src/test/ui/anon-params/anon-params-denied-2018.stderr
index b53640c..55905e5ca6 100644
--- a/src/test/ui/anon-params/anon-params-denied-2018.stderr
+++ b/src/test/ui/anon-params/anon-params-denied-2018.stderr
@@ -8,15 +8,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: i32);
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo(i32: TypeName);
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(_: i32);
- | ^^^^^^
+ | ~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:9:29
@@ -28,15 +28,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn foo_with_ref(self: &mut i32);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo_with_ref(i32: &mut TypeName);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo_with_ref(_: &mut i32);
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:12:47
@@ -48,7 +48,7 @@
help: explicitly ignore the parameter name
|
LL | fn foo_with_qualified_path(_: <Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:15:56
@@ -60,7 +60,7 @@
help: explicitly ignore the parameter name
|
LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:18:57
@@ -72,7 +72,7 @@
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:18:74
@@ -84,7 +84,7 @@
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:22:36
@@ -96,15 +96,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn bar_with_default_impl(self: String, String) {}
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String: TypeName, String) {}
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar_with_default_impl(_: String, String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:22:44
@@ -116,11 +116,11 @@
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String, String: TypeName) {}
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar_with_default_impl(String, _: String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:27:22
@@ -132,11 +132,11 @@
help: if this is a parameter name, give it a type
|
LL | fn baz(a:usize, b: TypeName, c: usize) -> usize {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn baz(a:usize, _: b, c: usize) -> usize {
- | ^^^^
+ | ~~~~
error: aborting due to 9 previous errors
diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
index 576fcc6..c7fb85c 100644
--- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr
+++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
@@ -5,9 +5,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
-...
+ |
+note: required by a bound in `f1`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:16:25
+ |
LL | fn f1<F>(_: F) where F: Fn(&(), &()) {}
- | ------------ required by this bound in `f1`
+ | ^^^^^^^^^^^^ required by this bound in `f1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
@@ -16,9 +19,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
-...
+ |
+note: required by a bound in `f2`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:17:25
+ |
LL | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
- | ----------------------- required by this bound in `f2`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f2`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
@@ -27,9 +33,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&(), &'r ()) -> _`
-...
+ |
+note: required by a bound in `f3`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:18:29
+ |
LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
- | --------------- required by this bound in `f3`
+ | ^^^^^^^^^^^^^^^ required by this bound in `f3`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
@@ -38,9 +47,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
-...
+ |
+note: required by a bound in `f4`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:19:25
+ |
LL | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
- | ----------------------- required by this bound in `f4`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f4`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
@@ -49,9 +61,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
-...
+ |
+note: required by a bound in `f5`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:20:25
+ |
LL | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
- | -------------------------- required by this bound in `f5`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `f5`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
@@ -60,9 +75,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&'r (), Box<(dyn for<'s> Fn(&'s ()) + 'static)>) -> _`
-...
+ |
+note: required by a bound in `g1`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
+ |
LL | fn g1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>) {}
- | ------------------------- required by this bound in `g1`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
@@ -71,9 +89,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
-...
+ |
+note: required by a bound in `g2`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:24:25
+ |
LL | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
- | ---------------- required by this bound in `g2`
+ | ^^^^^^^^^^^^^^^^ required by this bound in `g2`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
@@ -82,9 +103,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'s> fn(&'s (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _`
-...
+ |
+note: required by a bound in `g3`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
+ |
LL | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<dyn Fn(&())>) {}
- | ------------------------------------ required by this bound in `g3`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g3`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
@@ -93,9 +117,12 @@
| ^^ -------------- found signature of `fn((), ()) -> _`
| |
| expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
-...
+ |
+note: required by a bound in `g4`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
+ |
LL | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
- | --------------------------- required by this bound in `g4`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `g4`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
@@ -104,9 +131,12 @@
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| |
| expected signature of `for<'r, 's> fn(&'r (), Box<(dyn for<'t0> Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
-...
+ |
+note: required by a bound in `h1`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
+ |
LL | fn h1<F>(_: F) where F: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}
- | -------------------------------------------- required by this bound in `h1`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h1`
error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
@@ -115,9 +145,12 @@
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| |
| expected signature of `for<'r, 't0> fn(&'r (), Box<(dyn for<'s> Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
-...
+ |
+note: required by a bound in `h2`
+ --> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
+ |
LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(), &())) {}
- | --------------------------------------------------------- required by this bound in `h2`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `h2`
error: aborting due to 11 previous errors
diff --git a/src/test/ui/array-slice-vec/match_arr_unknown_len.rs b/src/test/ui/array-slice-vec/match_arr_unknown_len.rs
index 45b2889..d190d70 100644
--- a/src/test/ui/array-slice-vec/match_arr_unknown_len.rs
+++ b/src/test/ui/array-slice-vec/match_arr_unknown_len.rs
@@ -1,6 +1,3 @@
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
-
fn is_123<const N: usize>(x: [u32; N]) -> bool {
match x {
[1, 2] => true, //~ ERROR mismatched types
diff --git a/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr b/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr
index 0ad05b3..1a14ab4 100644
--- a/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr
+++ b/src/test/ui/array-slice-vec/match_arr_unknown_len.stderr
@@ -1,14 +1,5 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/match_arr_unknown_len.rs:1:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
error[E0308]: mismatched types
- --> $DIR/match_arr_unknown_len.rs:6:9
+ --> $DIR/match_arr_unknown_len.rs:3:9
|
LL | [1, 2] => true,
| ^^^^^^ expected `2_usize`, found `N`
@@ -16,6 +7,6 @@
= note: expected array `[u32; 2]`
found array `[u32; N]`
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/asm/bad-options.rs b/src/test/ui/asm/bad-options.rs
index 923d65b..dc61d16 100644
--- a/src/test/ui/asm/bad-options.rs
+++ b/src/test/ui/asm/bad-options.rs
@@ -9,12 +9,20 @@
//~^ ERROR the `nomem` and `readonly` options are mutually exclusive
asm!("", options(pure, nomem, noreturn));
//~^ ERROR the `pure` and `noreturn` options are mutually exclusive
- //~^^ ERROR asm with `pure` option must have at least one output
+ //~^^ ERROR asm with the `pure` option must have at least one output
asm!("{}", in(reg) foo, options(pure, nomem));
- //~^ ERROR asm with `pure` option must have at least one output
+ //~^ ERROR asm with the `pure` option must have at least one output
asm!("{}", out(reg) foo, options(noreturn));
//~^ ERROR asm outputs are not allowed with the `noreturn` option
}
+
+ unsafe {
+ asm!("", clobber_abi("foo"));
+ //~^ ERROR invalid ABI for `clobber_abi`
+ asm!("{}", out(reg) foo, clobber_abi("C"));
+ //~^ ERROR asm with `clobber_abi` must specify explicit registers for outputs
+ asm!("", out("eax") foo, clobber_abi("C"));
+ }
}
global_asm!("", options(nomem));
diff --git a/src/test/ui/asm/bad-options.stderr b/src/test/ui/asm/bad-options.stderr
index 9039483..8cfd450 100644
--- a/src/test/ui/asm/bad-options.stderr
+++ b/src/test/ui/asm/bad-options.stderr
@@ -10,13 +10,13 @@
LL | asm!("", options(pure, nomem, noreturn));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: asm with `pure` option must have at least one output
+error: asm with the `pure` option must have at least one output
--> $DIR/bad-options.rs:10:18
|
LL | asm!("", options(pure, nomem, noreturn));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: asm with `pure` option must have at least one output
+error: asm with the `pure` option must have at least one output
--> $DIR/bad-options.rs:13:33
|
LL | asm!("{}", in(reg) foo, options(pure, nomem));
@@ -28,41 +28,57 @@
LL | asm!("{}", out(reg) foo, options(noreturn));
| ^^^^^^^^^^^^
+error: asm with `clobber_abi` must specify explicit registers for outputs
+ --> $DIR/bad-options.rs:22:20
+ |
+LL | asm!("{}", out(reg) foo, clobber_abi("C"));
+ | ^^^^^^^^^^^^ ---------------- clobber_abi
+ | |
+ | generic outputs
+
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
- --> $DIR/bad-options.rs:20:25
+ --> $DIR/bad-options.rs:28:25
|
LL | global_asm!("", options(nomem));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `readonly`
- --> $DIR/bad-options.rs:22:25
+ --> $DIR/bad-options.rs:30:25
|
LL | global_asm!("", options(readonly));
| ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `noreturn`
- --> $DIR/bad-options.rs:24:25
+ --> $DIR/bad-options.rs:32:25
|
LL | global_asm!("", options(noreturn));
| ^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `pure`
- --> $DIR/bad-options.rs:26:25
+ --> $DIR/bad-options.rs:34:25
|
LL | global_asm!("", options(pure));
| ^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `nostack`
- --> $DIR/bad-options.rs:28:25
+ --> $DIR/bad-options.rs:36:25
|
LL | global_asm!("", options(nostack));
| ^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `preserves_flags`
- --> $DIR/bad-options.rs:30:25
+ --> $DIR/bad-options.rs:38:25
|
LL | global_asm!("", options(preserves_flags));
| ^^^^^^^^^^^^^^^ expected one of `)`, `att_syntax`, or `raw`
-error: aborting due to 11 previous errors
+error: invalid ABI for `clobber_abi`
+ --> $DIR/bad-options.rs:20:18
+ |
+LL | asm!("", clobber_abi("foo"));
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = note: the following ABIs are supported on this target: `C`, `system`, `efiapi`, `win64`, `sysv64`
+
+error: aborting due to 13 previous errors
diff --git a/src/test/ui/asm/issue-87802.rs b/src/test/ui/asm/issue-87802.rs
new file mode 100644
index 0000000..b1fc13b
--- /dev/null
+++ b/src/test/ui/asm/issue-87802.rs
@@ -0,0 +1,17 @@
+// only-x86_64
+// Make sure rustc doesn't ICE on asm! when output type is !.
+
+#![feature(asm)]
+
+fn hmm() -> ! {
+ let x;
+ unsafe {
+ asm!("/* {0} */", out(reg) x);
+ //~^ ERROR cannot use value of type `!` for inline assembly
+ }
+ x
+}
+
+fn main() {
+ hmm();
+}
diff --git a/src/test/ui/asm/issue-87802.stderr b/src/test/ui/asm/issue-87802.stderr
new file mode 100644
index 0000000..1eb72b6
--- /dev/null
+++ b/src/test/ui/asm/issue-87802.stderr
@@ -0,0 +1,10 @@
+error: cannot use value of type `!` for inline assembly
+ --> $DIR/issue-87802.rs:9:36
+ |
+LL | asm!("/* {0} */", out(reg) x);
+ | ^
+ |
+ = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/asm/naked-functions-ffi.rs b/src/test/ui/asm/naked-functions-ffi.rs
new file mode 100644
index 0000000..5b2a8ed
--- /dev/null
+++ b/src/test/ui/asm/naked-functions-ffi.rs
@@ -0,0 +1,12 @@
+// check-pass
+// only-x86_64
+#![feature(asm)]
+#![feature(naked_functions)]
+#![crate_type = "lib"]
+
+#[naked]
+pub extern "C" fn naked(p: char) -> u128 {
+ //~^ WARN uses type `char`
+ //~| WARN uses type `u128`
+ unsafe { asm!("", options(noreturn)); }
+}
diff --git a/src/test/ui/asm/naked-functions-ffi.stderr b/src/test/ui/asm/naked-functions-ffi.stderr
new file mode 100644
index 0000000..a6772ba
--- /dev/null
+++ b/src/test/ui/asm/naked-functions-ffi.stderr
@@ -0,0 +1,20 @@
+warning: `extern` fn uses type `char`, which is not FFI-safe
+ --> $DIR/naked-functions-ffi.rs:8:28
+ |
+LL | pub extern "C" fn naked(p: char) -> u128 {
+ | ^^^^ not FFI-safe
+ |
+ = note: `#[warn(improper_ctypes_definitions)]` on by default
+ = help: consider using `u32` or `libc::wchar_t` instead
+ = note: the `char` type has no C equivalent
+
+warning: `extern` fn uses type `u128`, which is not FFI-safe
+ --> $DIR/naked-functions-ffi.rs:8:37
+ |
+LL | pub extern "C" fn naked(p: char) -> u128 {
+ | ^^^^ not FFI-safe
+ |
+ = note: 128-bit integers don't currently have a known stable ABI
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/asm/naked-functions-unused.rs b/src/test/ui/asm/naked-functions-unused.rs
new file mode 100644
index 0000000..e1f2362
--- /dev/null
+++ b/src/test/ui/asm/naked-functions-unused.rs
@@ -0,0 +1,81 @@
+// only-x86_64
+#![deny(unused)]
+#![feature(asm)]
+#![feature(naked_functions)]
+#![crate_type = "lib"]
+
+pub trait Trait {
+ extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize;
+ extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize;
+}
+
+pub mod normal {
+ pub extern "sysv64" fn function(a: usize, b: usize) -> usize {
+ //~^ ERROR unused variable: `a`
+ //~| ERROR unused variable: `b`
+ unsafe { asm!("", options(noreturn)); }
+ }
+
+ pub struct Normal;
+
+ impl Normal {
+ pub extern "sysv64" fn associated(a: usize, b: usize) -> usize {
+ //~^ ERROR unused variable: `a`
+ //~| ERROR unused variable: `b`
+ unsafe { asm!("", options(noreturn)); }
+ }
+
+ pub extern "sysv64" fn method(&self, a: usize, b: usize) -> usize {
+ //~^ ERROR unused variable: `a`
+ //~| ERROR unused variable: `b`
+ unsafe { asm!("", options(noreturn)); }
+ }
+ }
+
+ impl super::Trait for Normal {
+ extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize {
+ //~^ ERROR unused variable: `a`
+ //~| ERROR unused variable: `b`
+ unsafe { asm!("", options(noreturn)); }
+ }
+
+ extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize {
+ //~^ ERROR unused variable: `a`
+ //~| ERROR unused variable: `b`
+ unsafe { asm!("", options(noreturn)); }
+ }
+ }
+}
+
+pub mod naked {
+ #[naked]
+ pub extern "sysv64" fn function(a: usize, b: usize) -> usize {
+ unsafe { asm!("", options(noreturn)); }
+ }
+
+ pub struct Naked;
+
+ impl Naked {
+ #[naked]
+ pub extern "sysv64" fn associated(a: usize, b: usize) -> usize {
+ unsafe { asm!("", options(noreturn)); }
+ }
+
+ #[naked]
+ pub extern "sysv64" fn method(&self, a: usize, b: usize) -> usize {
+ unsafe { asm!("", options(noreturn)); }
+ }
+ }
+
+ impl super::Trait for Naked {
+ #[naked]
+ extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize {
+ unsafe { asm!("", options(noreturn)); }
+ }
+
+ #[naked]
+ extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize {
+ unsafe { asm!("", options(noreturn)); }
+ }
+ }
+}
diff --git a/src/test/ui/asm/naked-functions-unused.stderr b/src/test/ui/asm/naked-functions-unused.stderr
new file mode 100644
index 0000000..8403533
--- /dev/null
+++ b/src/test/ui/asm/naked-functions-unused.stderr
@@ -0,0 +1,69 @@
+error: unused variable: `a`
+ --> $DIR/naked-functions-unused.rs:13:37
+ |
+LL | pub extern "sysv64" fn function(a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
+ |
+note: the lint level is defined here
+ --> $DIR/naked-functions-unused.rs:2:9
+ |
+LL | #![deny(unused)]
+ | ^^^^^^
+ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
+
+error: unused variable: `b`
+ --> $DIR/naked-functions-unused.rs:13:47
+ |
+LL | pub extern "sysv64" fn function(a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
+
+error: unused variable: `a`
+ --> $DIR/naked-functions-unused.rs:22:43
+ |
+LL | pub extern "sysv64" fn associated(a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
+
+error: unused variable: `b`
+ --> $DIR/naked-functions-unused.rs:22:53
+ |
+LL | pub extern "sysv64" fn associated(a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
+
+error: unused variable: `a`
+ --> $DIR/naked-functions-unused.rs:28:46
+ |
+LL | pub extern "sysv64" fn method(&self, a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
+
+error: unused variable: `b`
+ --> $DIR/naked-functions-unused.rs:28:56
+ |
+LL | pub extern "sysv64" fn method(&self, a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
+
+error: unused variable: `a`
+ --> $DIR/naked-functions-unused.rs:36:45
+ |
+LL | extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
+
+error: unused variable: `b`
+ --> $DIR/naked-functions-unused.rs:36:55
+ |
+LL | extern "sysv64" fn trait_associated(a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
+
+error: unused variable: `a`
+ --> $DIR/naked-functions-unused.rs:42:48
+ |
+LL | extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
+
+error: unused variable: `b`
+ --> $DIR/naked-functions-unused.rs:42:58
+ |
+LL | extern "sysv64" fn trait_method(&self, a: usize, b: usize) -> usize {
+ | ^ help: if this is intentional, prefix it with an underscore: `_b`
+
+error: aborting due to 10 previous errors
+
diff --git a/src/test/ui/asm/naked-functions.rs b/src/test/ui/asm/naked-functions.rs
index a46ca45..72918a1 100644
--- a/src/test/ui/asm/naked-functions.rs
+++ b/src/test/ui/asm/naked-functions.rs
@@ -4,6 +4,7 @@
#![feature(naked_functions)]
#![feature(or_patterns)]
#![crate_type = "lib"]
+#![allow(deprecated)] // llvm_asm!
#[repr(C)]
pub struct P { x: u8, y: u16 }
@@ -124,7 +125,7 @@
#[naked]
unsafe extern "C" fn invalid_options_continued() {
asm!("", options(readonly, nostack), options(pure));
- //~^ ERROR asm with `pure` option must have at least one output
+ //~^ ERROR asm with the `pure` option must have at least one output
//~| WARN asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
//~| WARN this was previously accepted
//~| WARN asm in naked functions must use `noreturn` option
@@ -134,14 +135,12 @@
#[naked]
pub unsafe fn default_abi() {
//~^ WARN Rust ABI is unsupported in naked functions
- //~| WARN this was previously accepted
asm!("", options(noreturn));
}
#[naked]
pub unsafe extern "Rust" fn rust_abi() {
//~^ WARN Rust ABI is unsupported in naked functions
- //~| WARN this was previously accepted
asm!("", options(noreturn));
}
@@ -167,3 +166,46 @@
pub unsafe extern "C" fn valid_att_syntax() {
asm!("", options(noreturn, att_syntax));
}
+
+#[naked]
+pub unsafe extern "C" fn inline_none() {
+ asm!("", options(noreturn));
+}
+
+#[naked]
+#[inline]
+//~^ WARN naked functions cannot be inlined
+//~| WARN this was previously accepted
+pub unsafe extern "C" fn inline_hint() {
+ asm!("", options(noreturn));
+}
+
+#[naked]
+#[inline(always)]
+//~^ WARN naked functions cannot be inlined
+//~| WARN this was previously accepted
+pub unsafe extern "C" fn inline_always() {
+ asm!("", options(noreturn));
+}
+
+#[naked]
+#[inline(never)]
+//~^ WARN naked functions cannot be inlined
+//~| WARN this was previously accepted
+pub unsafe extern "C" fn inline_never() {
+ asm!("", options(noreturn));
+}
+
+#[naked]
+#[inline]
+//~^ WARN naked functions cannot be inlined
+//~| WARN this was previously accepted
+#[inline(always)]
+//~^ WARN naked functions cannot be inlined
+//~| WARN this was previously accepted
+#[inline(never)]
+//~^ WARN naked functions cannot be inlined
+//~| WARN this was previously accepted
+pub unsafe extern "C" fn inline_all() {
+ asm!("", options(noreturn));
+}
diff --git a/src/test/ui/asm/naked-functions.stderr b/src/test/ui/asm/naked-functions.stderr
index 9a82da8..3b54757 100644
--- a/src/test/ui/asm/naked-functions.stderr
+++ b/src/test/ui/asm/naked-functions.stderr
@@ -1,35 +1,35 @@
-error: asm with `pure` option must have at least one output
- --> $DIR/naked-functions.rs:126:14
+error: asm with the `pure` option must have at least one output
+ --> $DIR/naked-functions.rs:127:14
|
LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
error: patterns not allowed in naked function parameters
- --> $DIR/naked-functions.rs:13:5
+ --> $DIR/naked-functions.rs:14:5
|
LL | mut a: u32,
| ^^^^^
error: patterns not allowed in naked function parameters
- --> $DIR/naked-functions.rs:15:5
+ --> $DIR/naked-functions.rs:16:5
|
LL | &b: &i32,
| ^^
error: patterns not allowed in naked function parameters
- --> $DIR/naked-functions.rs:17:6
+ --> $DIR/naked-functions.rs:18:6
|
LL | (None | Some(_)): Option<std::ptr::NonNull<u8>>,
| ^^^^^^^^^^^^^^
error: patterns not allowed in naked function parameters
- --> $DIR/naked-functions.rs:19:5
+ --> $DIR/naked-functions.rs:20:5
|
LL | P { x, y }: P,
| ^^^^^^^^^^
error: referencing function parameters is not allowed in naked functions
- --> $DIR/naked-functions.rs:29:5
+ --> $DIR/naked-functions.rs:30:5
|
LL | a + 1
| ^
@@ -37,7 +37,7 @@
= help: follow the calling convention in asm block to use parameters
warning: naked functions must contain a single asm block
- --> $DIR/naked-functions.rs:26:1
+ --> $DIR/naked-functions.rs:27:1
|
LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
LL | |
@@ -53,7 +53,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
error: referencing function parameters is not allowed in naked functions
- --> $DIR/naked-functions.rs:35:31
+ --> $DIR/naked-functions.rs:36:31
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
| ^
@@ -61,7 +61,7 @@
= help: follow the calling convention in asm block to use parameters
warning: only `const` and `sym` operands are supported in naked functions
- --> $DIR/naked-functions.rs:35:23
+ --> $DIR/naked-functions.rs:36:23
|
LL | asm!("/* {0} */", in(reg) a, options(noreturn));
| ^^^^^^^^^
@@ -70,7 +70,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: naked functions must contain a single asm block
- --> $DIR/naked-functions.rs:42:1
+ --> $DIR/naked-functions.rs:43:1
|
LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
LL | |
@@ -84,7 +84,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: only `const` and `sym` operands are supported in naked functions
- --> $DIR/naked-functions.rs:62:10
+ --> $DIR/naked-functions.rs:63:10
|
LL | in(reg) a,
| ^^^^^^^^^
@@ -102,7 +102,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: asm in naked functions must use `noreturn` option
- --> $DIR/naked-functions.rs:59:5
+ --> $DIR/naked-functions.rs:60:5
|
LL | / asm!("/* {0} {1} {2} {3} {4} {5} {6} */",
LL | |
@@ -117,7 +117,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: naked functions must contain a single asm block
- --> $DIR/naked-functions.rs:49:1
+ --> $DIR/naked-functions.rs:50:1
|
LL | / pub unsafe extern "C" fn unsupported_operands() {
LL | |
@@ -141,7 +141,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: naked functions must contain a single asm block
- --> $DIR/naked-functions.rs:75:1
+ --> $DIR/naked-functions.rs:76:1
|
LL | / pub extern "C" fn missing_assembly() {
LL | |
@@ -153,7 +153,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: asm in naked functions must use `noreturn` option
- --> $DIR/naked-functions.rs:84:5
+ --> $DIR/naked-functions.rs:85:5
|
LL | asm!("");
| ^^^^^^^^^
@@ -162,7 +162,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: asm in naked functions must use `noreturn` option
- --> $DIR/naked-functions.rs:87:5
+ --> $DIR/naked-functions.rs:88:5
|
LL | asm!("");
| ^^^^^^^^^
@@ -171,7 +171,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: asm in naked functions must use `noreturn` option
- --> $DIR/naked-functions.rs:90:5
+ --> $DIR/naked-functions.rs:91:5
|
LL | asm!("");
| ^^^^^^^^^
@@ -180,7 +180,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: naked functions must contain a single asm block
- --> $DIR/naked-functions.rs:81:1
+ --> $DIR/naked-functions.rs:82:1
|
LL | / pub extern "C" fn too_many_asm_blocks() {
LL | |
@@ -202,7 +202,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
error: referencing function parameters is not allowed in naked functions
- --> $DIR/naked-functions.rs:101:11
+ --> $DIR/naked-functions.rs:102:11
|
LL | *&y
| ^
@@ -210,7 +210,7 @@
= help: follow the calling convention in asm block to use parameters
warning: naked functions must contain a single asm block
- --> $DIR/naked-functions.rs:98:5
+ --> $DIR/naked-functions.rs:99:5
|
LL | / pub extern "C" fn inner(y: usize) -> usize {
LL | |
@@ -225,7 +225,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: the LLVM-style inline assembly is unsupported in naked functions
- --> $DIR/naked-functions.rs:111:5
+ --> $DIR/naked-functions.rs:112:5
|
LL | llvm_asm!("");
| ^^^^^^^^^^^^^^
@@ -236,7 +236,7 @@
= note: this warning originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: naked functions must contain a single asm block
- --> $DIR/naked-functions.rs:108:1
+ --> $DIR/naked-functions.rs:109:1
|
LL | / unsafe extern "C" fn llvm() -> ! {
LL | |
@@ -252,7 +252,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: asm options unsupported in naked functions: `nomem`, `preserves_flags`
- --> $DIR/naked-functions.rs:119:5
+ --> $DIR/naked-functions.rs:120:5
|
LL | asm!("", options(nomem, preserves_flags, noreturn));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -261,7 +261,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: asm options unsupported in naked functions: `nostack`, `pure`, `readonly`
- --> $DIR/naked-functions.rs:126:5
+ --> $DIR/naked-functions.rs:127:5
|
LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -270,7 +270,7 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: asm in naked functions must use `noreturn` option
- --> $DIR/naked-functions.rs:126:5
+ --> $DIR/naked-functions.rs:127:5
|
LL | asm!("", options(readonly, nostack), options(pure));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -279,22 +279,72 @@
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
warning: Rust ABI is unsupported in naked functions
- --> $DIR/naked-functions.rs:135:15
+ --> $DIR/naked-functions.rs:136:15
|
LL | pub unsafe fn default_abi() {
| ^^^^^^^^^^^
|
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
+ = note: `#[warn(undefined_naked_function_abi)]` on by default
warning: Rust ABI is unsupported in naked functions
--> $DIR/naked-functions.rs:142:29
|
LL | pub unsafe extern "Rust" fn rust_abi() {
| ^^^^^^^^
+
+warning: naked functions cannot be inlined
+ --> $DIR/naked-functions.rs:176:1
+ |
+LL | #[inline]
+ | ^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
-error: aborting due to 8 previous errors; 19 warnings emitted
+warning: naked functions cannot be inlined
+ --> $DIR/naked-functions.rs:184:1
+ |
+LL | #[inline(always)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
+
+warning: naked functions cannot be inlined
+ --> $DIR/naked-functions.rs:192:1
+ |
+LL | #[inline(never)]
+ | ^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
+
+warning: naked functions cannot be inlined
+ --> $DIR/naked-functions.rs:200:1
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
+
+warning: naked functions cannot be inlined
+ --> $DIR/naked-functions.rs:203:1
+ |
+LL | #[inline(always)]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
+
+warning: naked functions cannot be inlined
+ --> $DIR/naked-functions.rs:206:1
+ |
+LL | #[inline(never)]
+ | ^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #32408 <https://github.com/rust-lang/rust/issues/32408>
+
+error: aborting due to 8 previous errors; 25 warnings emitted
diff --git a/src/test/ui/asm/named-asm-labels.rs b/src/test/ui/asm/named-asm-labels.rs
new file mode 100644
index 0000000..9f487bd
--- /dev/null
+++ b/src/test/ui/asm/named-asm-labels.rs
@@ -0,0 +1,194 @@
+// only-x86_64
+
+// Tests that the use of named labels in the `asm!` macro are linted against
+// except for in `#[naked]` fns.
+// Using a named label is incorrect as per the RFC because for most cases
+// the compiler cannot ensure that inline asm is emitted exactly once per
+// codegen unit (except for naked fns) and so the label could be duplicated
+// which causes less readable LLVM errors and in the worst cases causes ICEs
+// or segfaults based on system dependent behavior and codegen flags.
+
+#![feature(asm, global_asm, naked_functions)]
+
+#[no_mangle]
+pub static FOO: usize = 42;
+
+fn main() {
+ unsafe {
+ // Basic usage
+ asm!("bar: nop"); //~ ERROR avoid using named labels
+
+ // No following asm
+ asm!("abcd:"); //~ ERROR avoid using named labels
+
+ // Multiple labels on one line
+ asm!("foo: bar1: nop");
+ //~^ ERROR avoid using named labels
+
+ // Multiple lines
+ asm!("foo1: nop", "nop"); //~ ERROR avoid using named labels
+ asm!("foo2: foo3: nop", "nop");
+ //~^ ERROR avoid using named labels
+ asm!("nop", "foo4: nop"); //~ ERROR avoid using named labels
+ asm!("foo5: nop", "foo6: nop");
+ //~^ ERROR avoid using named labels
+ //~| ERROR avoid using named labels
+
+ // Statement separator
+ asm!("foo7: nop; foo8: nop");
+ //~^ ERROR avoid using named labels
+ asm!("foo9: nop; nop"); //~ ERROR avoid using named labels
+ asm!("nop; foo10: nop"); //~ ERROR avoid using named labels
+
+ // Escaped newline
+ asm!("bar2: nop\n bar3: nop");
+ //~^ ERROR avoid using named labels
+ asm!("bar4: nop\n nop"); //~ ERROR avoid using named labels
+ asm!("nop\n bar5: nop"); //~ ERROR avoid using named labels
+ asm!("nop\n bar6: bar7: nop");
+ //~^ ERROR avoid using named labels
+
+ // Raw strings
+ asm!(
+ r"
+ blah2: nop
+ blah3: nop
+ "
+ );
+ //~^^^^ ERROR avoid using named labels
+
+ asm!(
+ r###"
+ nop
+ nop ; blah4: nop
+ "###
+ );
+ //~^^^ ERROR avoid using named labels
+
+ // Non-labels
+ // should not trigger lint, but may be invalid asm
+ asm!("ab cd: nop");
+
+ // `blah:` does not trigger because labels need to be at the start
+ // of the statement, and there was already a non-label
+ asm!("1bar: blah: nop");
+
+ // Only `blah1:` should trigger
+ asm!("blah1: 2bar: nop"); //~ ERROR avoid using named labels
+
+ // Duplicate labels
+ asm!("def: def: nop"); //~ ERROR avoid using named labels
+ asm!("def: nop\ndef: nop"); //~ ERROR avoid using named labels
+ asm!("def: nop; def: nop"); //~ ERROR avoid using named labels
+
+ // Trying to break parsing
+ asm!(":");
+ asm!("\n:\n");
+ asm!("::::");
+
+ // 0x3A is a ':'
+ asm!("fooo\u{003A} nop"); //~ ERROR avoid using named labels
+ asm!("foooo\x3A nop"); //~ ERROR avoid using named labels
+
+ // 0x0A is a newline
+ asm!("fooooo:\u{000A} nop"); //~ ERROR avoid using named labels
+ asm!("foooooo:\x0A nop"); //~ ERROR avoid using named labels
+
+ // Intentionally breaking span finding
+ // equivalent to "ABC: nop"
+ asm!("\x41\x42\x43\x3A\x20\x6E\x6F\x70"); //~ ERROR avoid using named labels
+
+ // Non-label colons - should pass
+ // (most of these are stolen from other places)
+ asm!("{:l}", in(reg) 0i64);
+ asm!("{:e}", in(reg) 0f32);
+ asm!("mov rax, qword ptr fs:[0]");
+
+ // Comments
+ asm!(
+ r"
+ ab: nop // ab: does foo
+ // cd: nop
+ "
+ );
+ //~^^^^ ERROR avoid using named labels
+
+ // Tests usage of colons in non-label positions
+ asm!(":lo12:FOO"); // this is apparently valid aarch64
+ // is there an example that is valid x86 for this test?
+ asm!(":bbb nop");
+
+ // Test include_str in asm
+ asm!(include_str!("named-asm-labels.s")); //~ ERROR avoid using named labels
+
+ // Test allowing or warning on the lint instead
+ #[allow(named_asm_labels)]
+ {
+ asm!("allowed: nop"); // Should not emit anything
+ }
+
+ #[warn(named_asm_labels)]
+ {
+ asm!("warned: nop"); //~ WARNING avoid using named labels
+ }
+ }
+}
+
+// Trigger on naked fns too, even though they can't be inlined, reusing a
+// label or LTO can cause labels to break
+#[naked]
+pub extern "C" fn foo() -> i32 {
+ unsafe { asm!(".Lfoo: mov rax, {}; ret;", "nop", const 1, options(noreturn)) } //~ ERROR avoid using named labels
+}
+
+// Make sure that non-naked attributes *do* still let the lint happen
+#[no_mangle]
+pub extern "C" fn bar() {
+ unsafe { asm!(".Lbar: mov rax, {}; ret;", "nop", const 1, options(noreturn)) }
+ //~^ ERROR avoid using named labels
+}
+
+#[naked]
+pub extern "C" fn aaa() {
+ fn _local() {}
+
+ unsafe { asm!(".Laaa: nop; ret;", options(noreturn)) } //~ ERROR avoid using named labels
+}
+
+pub fn normal() {
+ fn _local1() {}
+
+ #[naked]
+ pub extern "C" fn bbb() {
+ fn _very_local() {}
+
+ unsafe { asm!(".Lbbb: nop; ret;", options(noreturn)) } //~ ERROR avoid using named labels
+ }
+
+ fn _local2() {}
+}
+
+// Make sure that the lint happens within closures
+fn closures() {
+ || unsafe {
+ asm!("closure1: nop"); //~ ERROR avoid using named labels
+ };
+
+ move || unsafe {
+ asm!("closure2: nop"); //~ ERROR avoid using named labels
+ };
+
+ || {
+ #[naked]
+ unsafe extern "C" fn _nested() {
+ asm!("ret;", options(noreturn));
+ }
+
+ unsafe {
+ asm!("closure3: nop"); //~ ERROR avoid using named labels
+ }
+ };
+}
+
+// Don't trigger on global asm
+global_asm!("aaaaaaaa: nop");
diff --git a/src/test/ui/asm/named-asm-labels.s b/src/test/ui/asm/named-asm-labels.s
new file mode 100644
index 0000000..071356d
--- /dev/null
+++ b/src/test/ui/asm/named-asm-labels.s
@@ -0,0 +1,5 @@
+lab1: nop
+// do more things
+lab2: nop // does bar
+// a: b
+lab3: nop; lab4: nop
diff --git a/src/test/ui/asm/named-asm-labels.stderr b/src/test/ui/asm/named-asm-labels.stderr
new file mode 100644
index 0000000..396f0a1
--- /dev/null
+++ b/src/test/ui/asm/named-asm-labels.stderr
@@ -0,0 +1,334 @@
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:19:15
+ |
+LL | asm!("bar: nop");
+ | ^^^
+ |
+ = note: `#[deny(named_asm_labels)]` on by default
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:22:15
+ |
+LL | asm!("abcd:");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:25:15
+ |
+LL | asm!("foo: bar1: nop");
+ | ^^^ ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:29:15
+ |
+LL | asm!("foo1: nop", "nop");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:30:15
+ |
+LL | asm!("foo2: foo3: nop", "nop");
+ | ^^^^ ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:32:22
+ |
+LL | asm!("nop", "foo4: nop");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:33:15
+ |
+LL | asm!("foo5: nop", "foo6: nop");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:33:28
+ |
+LL | asm!("foo5: nop", "foo6: nop");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:38:15
+ |
+LL | asm!("foo7: nop; foo8: nop");
+ | ^^^^ ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:40:15
+ |
+LL | asm!("foo9: nop; nop");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:41:20
+ |
+LL | asm!("nop; foo10: nop");
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:44:15
+ |
+LL | asm!("bar2: nop\n bar3: nop");
+ | ^^^^ ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:46:15
+ |
+LL | asm!("bar4: nop\n nop");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:47:21
+ |
+LL | asm!("nop\n bar5: nop");
+ | ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:48:21
+ |
+LL | asm!("nop\n bar6: bar7: nop");
+ | ^^^^ ^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:54:13
+ |
+LL | blah2: nop
+ | ^^^^^
+LL | blah3: nop
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:63:19
+ |
+LL | nop ; blah4: nop
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:77:15
+ |
+LL | asm!("blah1: 2bar: nop");
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:80:15
+ |
+LL | asm!("def: def: nop");
+ | ^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:81:15
+ |
+LL | asm!("def: nop\ndef: nop");
+ | ^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:82:15
+ |
+LL | asm!("def: nop; def: nop");
+ | ^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:90:15
+ |
+LL | asm!("fooo\u{003A} nop");
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:91:15
+ |
+LL | asm!("foooo\x3A nop");
+ | ^^^^^^^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:94:15
+ |
+LL | asm!("fooooo:\u{000A} nop");
+ | ^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:95:15
+ |
+LL | asm!("foooooo:\x0A nop");
+ | ^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:99:14
+ |
+LL | asm!("\x41\x42\x43\x3A\x20\x6E\x6F\x70");
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:110:13
+ |
+LL | ab: nop // ab: does foo
+ | ^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:122:14
+ |
+LL | asm!(include_str!("named-asm-labels.s"));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+warning: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:132:19
+ |
+LL | asm!("warned: nop");
+ | ^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/named-asm-labels.rs:130:16
+ |
+LL | #[warn(named_asm_labels)]
+ | ^^^^^^^^^^^^^^^^
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:141:20
+ |
+LL | unsafe { asm!(".Lfoo: mov rax, {}; ret;", "nop", const 1, options(noreturn)) }
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:147:20
+ |
+LL | unsafe { asm!(".Lbar: mov rax, {}; ret;", "nop", const 1, options(noreturn)) }
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:155:20
+ |
+LL | unsafe { asm!(".Laaa: nop; ret;", options(noreturn)) }
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:165:24
+ |
+LL | unsafe { asm!(".Lbbb: nop; ret;", options(noreturn)) }
+ | ^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:174:15
+ |
+LL | asm!("closure1: nop");
+ | ^^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:178:15
+ |
+LL | asm!("closure2: nop");
+ | ^^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: avoid using named labels in inline assembly
+ --> $DIR/named-asm-labels.rs:188:19
+ |
+LL | asm!("closure3: nop");
+ | ^^^^^^^^
+ |
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of the unstable book <https://doc.rust-lang.org/nightly/unstable-book/library-features/asm.html#labels> for more information
+
+error: aborting due to 35 previous errors; 1 warning emitted
+
diff --git a/src/test/ui/asm/parse-error.rs b/src/test/ui/asm/parse-error.rs
index e62e666..3ec3c72 100644
--- a/src/test/ui/asm/parse-error.rs
+++ b/src/test/ui/asm/parse-error.rs
@@ -13,7 +13,7 @@
asm!("{}" foo);
//~^ ERROR expected token: `,`
asm!("{}", foo);
- //~^ ERROR expected operand, options, or additional template string
+ //~^ ERROR expected operand, clobber_abi, options, or additional template string
asm!("{}", in foo);
//~^ ERROR expected `(`, found `foo`
asm!("{}", in(reg foo));
@@ -37,6 +37,21 @@
asm!("{}", options(), const foo);
//~^ ERROR arguments are not allowed after options
//~^^ ERROR attempt to use a non-constant value in a constant
+ asm!("", clobber_abi(foo));
+ //~^ ERROR expected string literal
+ asm!("", clobber_abi("C" foo));
+ //~^ ERROR expected `)`, found `foo`
+ asm!("", clobber_abi("C", foo));
+ //~^ ERROR expected `)`, found `,`
+ asm!("{}", clobber_abi("C"), const foo);
+ //~^ ERROR arguments are not allowed after clobber_abi
+ //~^^ ERROR attempt to use a non-constant value in a constant
+ asm!("", options(), clobber_abi("C"));
+ //~^ ERROR clobber_abi is not allowed after options
+ asm!("{}", options(), clobber_abi("C"), const foo);
+ //~^ ERROR clobber_abi is not allowed after options
+ asm!("", clobber_abi("C"), clobber_abi("C"));
+ //~^ ERROR clobber_abi specified multiple times
asm!("{a}", a = const foo, a = const bar);
//~^ ERROR duplicate argument named `a`
//~^^ ERROR argument never used
@@ -86,6 +101,21 @@
//~^ ERROR expected one of
global_asm!("{}", options(), const FOO);
//~^ ERROR arguments are not allowed after options
+global_asm!("", clobber_abi(FOO));
+//~^ ERROR expected string literal
+global_asm!("", clobber_abi("C" FOO));
+//~^ ERROR expected `)`, found `FOO`
+global_asm!("", clobber_abi("C", FOO));
+//~^ ERROR expected `)`, found `,`
+global_asm!("{}", clobber_abi("C"), const FOO);
+//~^ ERROR arguments are not allowed after clobber_abi
+//~^^ ERROR `clobber_abi` cannot be used with `global_asm!`
+global_asm!("", options(), clobber_abi("C"));
+//~^ ERROR clobber_abi is not allowed after options
+global_asm!("{}", options(), clobber_abi("C"), const FOO);
+//~^ ERROR clobber_abi is not allowed after options
+global_asm!("", clobber_abi("C"), clobber_abi("C"));
+//~^ ERROR clobber_abi specified multiple times
global_asm!("{a}", a = const FOO, a = const BAR);
//~^ ERROR duplicate argument named `a`
//~^^ ERROR argument never used
diff --git a/src/test/ui/asm/parse-error.stderr b/src/test/ui/asm/parse-error.stderr
index 33dca61..423003c 100644
--- a/src/test/ui/asm/parse-error.stderr
+++ b/src/test/ui/asm/parse-error.stderr
@@ -16,11 +16,11 @@
LL | asm!("{}" foo);
| ^^^ expected `,`
-error: expected operand, options, or additional template string
+error: expected operand, clobber_abi, options, or additional template string
--> $DIR/parse-error.rs:15:20
|
LL | asm!("{}", foo);
- | ^^^ expected operand, options, or additional template string
+ | ^^^ expected operand, clobber_abi, options, or additional template string
error: expected `(`, found `foo`
--> $DIR/parse-error.rs:17:23
@@ -90,8 +90,58 @@
| |
| previous options
+error: expected string literal
+ --> $DIR/parse-error.rs:40:30
+ |
+LL | asm!("", clobber_abi(foo));
+ | ^^^ not a string literal
+
+error: expected `)`, found `foo`
+ --> $DIR/parse-error.rs:42:34
+ |
+LL | asm!("", clobber_abi("C" foo));
+ | ^^^ expected `)`
+
+error: expected `)`, found `,`
+ --> $DIR/parse-error.rs:44:33
+ |
+LL | asm!("", clobber_abi("C", foo));
+ | ^ expected `)`
+
+error: arguments are not allowed after clobber_abi
+ --> $DIR/parse-error.rs:46:38
+ |
+LL | asm!("{}", clobber_abi("C"), const foo);
+ | ---------------- ^^^^^^^^^ argument
+ | |
+ | clobber_abi
+
+error: clobber_abi is not allowed after options
+ --> $DIR/parse-error.rs:49:29
+ |
+LL | asm!("", options(), clobber_abi("C"));
+ | --------- ^^^^^^^^^^^^^^^^
+ | |
+ | options
+
+error: clobber_abi is not allowed after options
+ --> $DIR/parse-error.rs:51:31
+ |
+LL | asm!("{}", options(), clobber_abi("C"), const foo);
+ | --------- ^^^^^^^^^^^^^^^^
+ | |
+ | options
+
+error: clobber_abi specified multiple times
+ --> $DIR/parse-error.rs:53:36
+ |
+LL | asm!("", clobber_abi("C"), clobber_abi("C"));
+ | ---------------- ^^^^^^^^^^^^^^^^
+ | |
+ | clobber_abi previously specified here
+
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:40:36
+ --> $DIR/parse-error.rs:55:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -99,7 +149,7 @@
| previously here
error: argument never used
- --> $DIR/parse-error.rs:40:36
+ --> $DIR/parse-error.rs:55:36
|
LL | asm!("{a}", a = const foo, a = const bar);
| ^^^^^^^^^^^^^ argument never used
@@ -107,13 +157,13 @@
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
error: explicit register arguments cannot have names
- --> $DIR/parse-error.rs:45:18
+ --> $DIR/parse-error.rs:60:18
|
LL | asm!("", a = in("eax") foo);
| ^^^^^^^^^^^^^^^^^
error: named arguments cannot follow explicit register arguments
- --> $DIR/parse-error.rs:47:36
+ --> $DIR/parse-error.rs:62:36
|
LL | asm!("{a}", in("eax") foo, a = const bar);
| ------------- ^^^^^^^^^^^^^ named argument
@@ -121,7 +171,7 @@
| explicit register argument
error: named arguments cannot follow explicit register arguments
- --> $DIR/parse-error.rs:50:36
+ --> $DIR/parse-error.rs:65:36
|
LL | asm!("{a}", in("eax") foo, a = const bar);
| ------------- ^^^^^^^^^^^^^ named argument
@@ -129,27 +179,27 @@
| explicit register argument
error: positional arguments cannot follow named arguments or explicit register arguments
- --> $DIR/parse-error.rs:53:36
+ --> $DIR/parse-error.rs:68:36
|
LL | asm!("{1}", in("eax") foo, const bar);
| ------------- ^^^^^^^^^ positional argument
| |
| explicit register argument
-error: expected one of `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `""`
- --> $DIR/parse-error.rs:56:29
+error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `""`
+ --> $DIR/parse-error.rs:71:29
|
LL | asm!("", options(), "");
- | ^^ expected one of 8 possible tokens
+ | ^^ expected one of 9 possible tokens
-error: expected one of `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
- --> $DIR/parse-error.rs:58:33
+error: expected one of `clobber_abi`, `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
+ --> $DIR/parse-error.rs:73:33
|
LL | asm!("{}", in(reg) foo, "{}", out(reg) foo);
- | ^^^^ expected one of 8 possible tokens
+ | ^^^^ expected one of 9 possible tokens
error: asm template must be a string literal
- --> $DIR/parse-error.rs:60:14
+ --> $DIR/parse-error.rs:75:14
|
LL | asm!(format!("{{{}}}", 0), in(reg) foo);
| ^^^^^^^^^^^^^^^^^^^^
@@ -157,7 +207,7 @@
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: asm template must be a string literal
- --> $DIR/parse-error.rs:62:21
+ --> $DIR/parse-error.rs:77:21
|
LL | asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
| ^^^^^^^^^^^^^^^^^^^^
@@ -165,69 +215,125 @@
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: requires at least a template string argument
- --> $DIR/parse-error.rs:69:1
+ --> $DIR/parse-error.rs:84:1
|
LL | global_asm!();
| ^^^^^^^^^^^^^^
error: asm template must be a string literal
- --> $DIR/parse-error.rs:71:13
+ --> $DIR/parse-error.rs:86:13
|
LL | global_asm!(FOO);
| ^^^
error: expected token: `,`
- --> $DIR/parse-error.rs:73:18
+ --> $DIR/parse-error.rs:88:18
|
LL | global_asm!("{}" FOO);
| ^^^ expected `,`
error: expected operand, options, or additional template string
- --> $DIR/parse-error.rs:75:19
+ --> $DIR/parse-error.rs:90:19
|
LL | global_asm!("{}", FOO);
| ^^^ expected operand, options, or additional template string
error: expected expression, found end of macro arguments
- --> $DIR/parse-error.rs:77:24
+ --> $DIR/parse-error.rs:92:24
|
LL | global_asm!("{}", const);
| ^ expected expression
error: expected one of `,`, `.`, `?`, or an operator, found `FOO`
- --> $DIR/parse-error.rs:79:30
+ --> $DIR/parse-error.rs:94:30
|
LL | global_asm!("{}", const(reg) FOO);
| ^^^ expected one of `,`, `.`, `?`, or an operator
error: expected one of `)`, `att_syntax`, or `raw`, found `FOO`
- --> $DIR/parse-error.rs:81:25
+ --> $DIR/parse-error.rs:96:25
|
LL | global_asm!("", options(FOO));
| ^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
- --> $DIR/parse-error.rs:83:25
+ --> $DIR/parse-error.rs:98:25
|
LL | global_asm!("", options(nomem FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: expected one of `)`, `att_syntax`, or `raw`, found `nomem`
- --> $DIR/parse-error.rs:85:25
+ --> $DIR/parse-error.rs:100:25
|
LL | global_asm!("", options(nomem, FOO));
| ^^^^^ expected one of `)`, `att_syntax`, or `raw`
error: arguments are not allowed after options
- --> $DIR/parse-error.rs:87:30
+ --> $DIR/parse-error.rs:102:30
|
LL | global_asm!("{}", options(), const FOO);
| --------- ^^^^^^^^^ argument
| |
| previous options
+error: expected string literal
+ --> $DIR/parse-error.rs:104:29
+ |
+LL | global_asm!("", clobber_abi(FOO));
+ | ^^^ not a string literal
+
+error: expected `)`, found `FOO`
+ --> $DIR/parse-error.rs:106:33
+ |
+LL | global_asm!("", clobber_abi("C" FOO));
+ | ^^^ expected `)`
+
+error: expected `)`, found `,`
+ --> $DIR/parse-error.rs:108:32
+ |
+LL | global_asm!("", clobber_abi("C", FOO));
+ | ^ expected `)`
+
+error: arguments are not allowed after clobber_abi
+ --> $DIR/parse-error.rs:110:37
+ |
+LL | global_asm!("{}", clobber_abi("C"), const FOO);
+ | ---------------- ^^^^^^^^^ argument
+ | |
+ | clobber_abi
+
+error: `clobber_abi` cannot be used with `global_asm!`
+ --> $DIR/parse-error.rs:110:19
+ |
+LL | global_asm!("{}", clobber_abi("C"), const FOO);
+ | ^^^^^^^^^^^^^^^^
+
+error: clobber_abi is not allowed after options
+ --> $DIR/parse-error.rs:113:28
+ |
+LL | global_asm!("", options(), clobber_abi("C"));
+ | --------- ^^^^^^^^^^^^^^^^
+ | |
+ | options
+
+error: clobber_abi is not allowed after options
+ --> $DIR/parse-error.rs:115:30
+ |
+LL | global_asm!("{}", options(), clobber_abi("C"), const FOO);
+ | --------- ^^^^^^^^^^^^^^^^
+ | |
+ | options
+
+error: clobber_abi specified multiple times
+ --> $DIR/parse-error.rs:117:35
+ |
+LL | global_asm!("", clobber_abi("C"), clobber_abi("C"));
+ | ---------------- ^^^^^^^^^^^^^^^^
+ | |
+ | clobber_abi previously specified here
+
error: duplicate argument named `a`
- --> $DIR/parse-error.rs:89:35
+ --> $DIR/parse-error.rs:119:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ------------- ^^^^^^^^^^^^^ duplicate argument
@@ -235,27 +341,27 @@
| previously here
error: argument never used
- --> $DIR/parse-error.rs:89:35
+ --> $DIR/parse-error.rs:119:35
|
LL | global_asm!("{a}", a = const FOO, a = const BAR);
| ^^^^^^^^^^^^^ argument never used
|
= help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
-error: expected one of `const` or `options`, found `""`
- --> $DIR/parse-error.rs:92:28
+error: expected one of `clobber_abi`, `const`, or `options`, found `""`
+ --> $DIR/parse-error.rs:122:28
|
LL | global_asm!("", options(), "");
- | ^^ expected one of `const` or `options`
+ | ^^ expected one of `clobber_abi`, `const`, or `options`
-error: expected one of `const` or `options`, found `"{}"`
- --> $DIR/parse-error.rs:94:30
+error: expected one of `clobber_abi`, `const`, or `options`, found `"{}"`
+ --> $DIR/parse-error.rs:124:30
|
LL | global_asm!("{}", const FOO, "{}", const FOO);
- | ^^^^ expected one of `const` or `options`
+ | ^^^^ expected one of `clobber_abi`, `const`, or `options`
error: asm template must be a string literal
- --> $DIR/parse-error.rs:96:13
+ --> $DIR/parse-error.rs:126:13
|
LL | global_asm!(format!("{{{}}}", 0), const FOO);
| ^^^^^^^^^^^^^^^^^^^^
@@ -263,7 +369,7 @@
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error: asm template must be a string literal
- --> $DIR/parse-error.rs:98:20
+ --> $DIR/parse-error.rs:128:20
|
LL | global_asm!("{1}", format!("{{{}}}", 0), const FOO, const BAR);
| ^^^^^^^^^^^^^^^^^^^^
@@ -280,7 +386,16 @@
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:40:31
+ --> $DIR/parse-error.rs:46:44
+ |
+LL | let mut foo = 0;
+ | ---------- help: consider using `const` instead of `let`: `const foo`
+...
+LL | asm!("{}", clobber_abi("C"), const foo);
+ | ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+ --> $DIR/parse-error.rs:55:31
|
LL | let mut foo = 0;
| ---------- help: consider using `const` instead of `let`: `const foo`
@@ -289,7 +404,7 @@
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:40:46
+ --> $DIR/parse-error.rs:55:46
|
LL | let mut bar = 0;
| ---------- help: consider using `const` instead of `let`: `const bar`
@@ -298,7 +413,7 @@
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:47:46
+ --> $DIR/parse-error.rs:62:46
|
LL | let mut bar = 0;
| ---------- help: consider using `const` instead of `let`: `const bar`
@@ -307,7 +422,7 @@
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:50:46
+ --> $DIR/parse-error.rs:65:46
|
LL | let mut bar = 0;
| ---------- help: consider using `const` instead of `let`: `const bar`
@@ -316,7 +431,7 @@
| ^^^ non-constant value
error[E0435]: attempt to use a non-constant value in a constant
- --> $DIR/parse-error.rs:53:42
+ --> $DIR/parse-error.rs:68:42
|
LL | let mut bar = 0;
| ---------- help: consider using `const` instead of `let`: `const bar`
@@ -324,6 +439,6 @@
LL | asm!("{1}", in("eax") foo, const bar);
| ^^^ non-constant value
-error: aborting due to 47 previous errors
+error: aborting due to 63 previous errors
For more information about this error, try `rustc --explain E0435`.
diff --git a/src/test/ui/asm/rustfix-asm.fixed b/src/test/ui/asm/rustfix-asm.fixed
index 01d8fd3..9251afd 100644
--- a/src/test/ui/asm/rustfix-asm.fixed
+++ b/src/test/ui/asm/rustfix-asm.fixed
@@ -2,6 +2,7 @@
// only-x86_64
#![feature(asm, llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/asm/rustfix-asm.rs b/src/test/ui/asm/rustfix-asm.rs
index e25895b..1e3bfd0 100644
--- a/src/test/ui/asm/rustfix-asm.rs
+++ b/src/test/ui/asm/rustfix-asm.rs
@@ -2,6 +2,7 @@
// only-x86_64
#![feature(asm, llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/asm/rustfix-asm.stderr b/src/test/ui/asm/rustfix-asm.stderr
index 334499c..14927f3 100644
--- a/src/test/ui/asm/rustfix-asm.stderr
+++ b/src/test/ui/asm/rustfix-asm.stderr
@@ -1,5 +1,5 @@
error: the legacy LLVM-style asm! syntax is no longer supported
- --> $DIR/rustfix-asm.rs:10:9
+ --> $DIR/rustfix-asm.rs:11:9
|
LL | asm!("" :: "r" (x));
| ----^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@
= note: alternatively, switch to llvm_asm! to keep your code working as it is
error: the legacy LLVM-style asm! syntax is no longer supported
- --> $DIR/rustfix-asm.rs:12:9
+ --> $DIR/rustfix-asm.rs:13:9
|
LL | asm!("" : "=r" (y));
| ----^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/asm/type-check-1.stderr b/src/test/ui/asm/type-check-1.stderr
index ad981d9..5edbcf4 100644
--- a/src/test/ui/asm/type-check-1.stderr
+++ b/src/test/ui/asm/type-check-1.stderr
@@ -25,6 +25,21 @@
LL | asm!("{}", const const_bar(x));
| ^ non-constant value
+error[E0308]: mismatched types
+ --> $DIR/type-check-1.rs:48:26
+ |
+LL | asm!("{}", const 0f32);
+ | ^^^^ expected integer, found `f32`
+
+error[E0308]: mismatched types
+ --> $DIR/type-check-1.rs:50:26
+ |
+LL | asm!("{}", const 0 as *mut u8);
+ | ^^^^^^^^^^^^ expected integer, found *-ptr
+ |
+ = note: expected type `{integer}`
+ found raw pointer `*mut u8`
+
error: invalid asm output
--> $DIR/type-check-1.rs:10:29
|
@@ -65,21 +80,6 @@
= note: all inline asm arguments must have a statically known size
error[E0308]: mismatched types
- --> $DIR/type-check-1.rs:48:26
- |
-LL | asm!("{}", const 0f32);
- | ^^^^ expected integer, found `f32`
-
-error[E0308]: mismatched types
- --> $DIR/type-check-1.rs:50:26
- |
-LL | asm!("{}", const 0 as *mut u8);
- | ^^^^^^^^^^^^ expected integer, found *-ptr
- |
- = note: expected type `{integer}`
- found raw pointer `*mut u8`
-
-error[E0308]: mismatched types
--> $DIR/type-check-1.rs:60:25
|
LL | global_asm!("{}", const 0f32);
diff --git a/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr b/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr
index c5e32af..d4c12b8 100644
--- a/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr
+++ b/src/test/ui/associated-consts/associated-const-ambiguity-report.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated constant for candidate #1
|
LL | const X: i32 = Foo::ID;
- | ^^^^^^^
+ | ~~~~~
help: disambiguate the associated constant for candidate #2
|
LL | const X: i32 = Bar::ID;
- | ^^^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr
index d3a1cd3..46a54a1 100644
--- a/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr
+++ b/src/test/ui/associated-consts/associated-const-type-parameter-arrays.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `A`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr b/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr
index 0d84dca..f2e4ca5 100644
--- a/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr
+++ b/src/test/ui/associated-item/associated-item-duplicate-bounds.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^ cannot perform const operation using `A`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/associated-item/issue-48027.stderr b/src/test/ui/associated-item/issue-48027.stderr
index 33ab4bb..77915a8 100644
--- a/src/test/ui/associated-item/issue-48027.stderr
+++ b/src/test/ui/associated-item/issue-48027.stderr
@@ -1,18 +1,3 @@
-error[E0038]: the trait `Bar` cannot be made into an object
- --> $DIR/issue-48027.rs:6:6
- |
-LL | impl dyn Bar {}
- | ^^^^^^^ `Bar` cannot be made into an object
- |
- = help: consider moving `X` to another trait
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/issue-48027.rs:2:11
- |
-LL | trait Bar {
- | --- this trait cannot be made into an object...
-LL | const X: usize;
- | ^ ...because it contains this associated `const`
-
error[E0283]: type annotations needed
--> $DIR/issue-48027.rs:3:32
|
@@ -30,6 +15,21 @@
LL | const X: usize;
| ^^^^^^^^^^^^^^^
+error[E0038]: the trait `Bar` cannot be made into an object
+ --> $DIR/issue-48027.rs:6:6
+ |
+LL | impl dyn Bar {}
+ | ^^^^^^^ `Bar` cannot be made into an object
+ |
+ = help: consider moving `X` to another trait
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/issue-48027.rs:2:11
+ |
+LL | trait Bar {
+ | --- this trait cannot be made into an object...
+LL | const X: usize;
+ | ^ ...because it contains this associated `const`
+
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0038, E0283.
diff --git a/src/test/ui/associated-item/issue-87638.fixed b/src/test/ui/associated-item/issue-87638.fixed
new file mode 100644
index 0000000..b689777
--- /dev/null
+++ b/src/test/ui/associated-item/issue-87638.fixed
@@ -0,0 +1,22 @@
+// run-rustfix
+
+trait Trait {
+ const FOO: usize;
+
+ type Target;
+}
+
+struct S;
+
+impl Trait for S {
+ const FOO: usize = 0;
+ type Target = ();
+}
+
+fn main() {
+ let _: <S as Trait>::Target; //~ ERROR cannot find associated type `Output` in trait `Trait`
+ //~^ HELP maybe you meant this associated type
+
+ let _ = <S as Trait>::FOO; //~ ERROR cannot find method or associated constant `BAR` in trait `Trait`
+ //~^ HELP maybe you meant this associated constant
+}
diff --git a/src/test/ui/associated-item/issue-87638.rs b/src/test/ui/associated-item/issue-87638.rs
new file mode 100644
index 0000000..5a60b20
--- /dev/null
+++ b/src/test/ui/associated-item/issue-87638.rs
@@ -0,0 +1,22 @@
+// run-rustfix
+
+trait Trait {
+ const FOO: usize;
+
+ type Target;
+}
+
+struct S;
+
+impl Trait for S {
+ const FOO: usize = 0;
+ type Target = ();
+}
+
+fn main() {
+ let _: <S as Trait>::Output; //~ ERROR cannot find associated type `Output` in trait `Trait`
+ //~^ HELP maybe you meant this associated type
+
+ let _ = <S as Trait>::BAR; //~ ERROR cannot find method or associated constant `BAR` in trait `Trait`
+ //~^ HELP maybe you meant this associated constant
+}
diff --git a/src/test/ui/associated-item/issue-87638.stderr b/src/test/ui/associated-item/issue-87638.stderr
new file mode 100644
index 0000000..cf60834
--- /dev/null
+++ b/src/test/ui/associated-item/issue-87638.stderr
@@ -0,0 +1,27 @@
+error[E0576]: cannot find associated type `Output` in trait `Trait`
+ --> $DIR/issue-87638.rs:17:26
+ |
+LL | type Target;
+ | ------------ associated type `Target` defined here
+...
+LL | let _: <S as Trait>::Output;
+ | ^^^^^^
+ | |
+ | not found in `Trait`
+ | help: maybe you meant this associated type: `Target`
+
+error[E0576]: cannot find method or associated constant `BAR` in trait `Trait`
+ --> $DIR/issue-87638.rs:20:27
+ |
+LL | const FOO: usize;
+ | ----------------- associated constant `FOO` defined here
+...
+LL | let _ = <S as Trait>::BAR;
+ | ^^^
+ | |
+ | not found in `Trait`
+ | help: maybe you meant this associated constant: `FOO`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0576`.
diff --git a/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr b/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr
index e72ef0e..4162cda 100644
--- a/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr
+++ b/src/test/ui/associated-type-bounds/ambiguous-associated-type2.stderr
@@ -4,7 +4,7 @@
LL | trait Baz: Foo + Bar<Self::Item> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: ...which again requires computing the super traits of `Baz` with associated type name `Item`, completing the cycle
+ = note: ...which immediately requires computing the super traits of `Baz` with associated type name `Item` again
note: cycle used when computing the super traits of `Baz`
--> $DIR/ambiguous-associated-type2.rs:7:1
|
diff --git a/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs b/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs
index 7950dd3..4c36289 100644
--- a/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs
+++ b/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.rs
@@ -28,9 +28,9 @@
impl Thing for AssocNoCopy {
type Out = Box<dyn Bar<Assoc: Copy>>;
- //~^ ERROR the trait bound `String: Copy` is not satisfied
fn func() -> Self::Out {
+ //~^ ERROR the trait bound `String: Copy` is not satisfied
Box::new(AssocNoCopy)
}
}
diff --git a/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr b/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr
index 0f1d35b..a32ab45 100644
--- a/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr
+++ b/src/test/ui/associated-type-bounds/assoc-type-eq-with-dyn-atb-fail.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `String: Copy` is not satisfied
- --> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:30:28
+ --> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:32:18
|
-LL | type Out = Box<dyn Bar<Assoc: Copy>>;
- | ^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+LL | fn func() -> Self::Out {
+ | ^^^^^^^^^ the trait `Copy` is not implemented for `String`
error: aborting due to previous error
diff --git a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr
index a5ebb80..57aacf6 100644
--- a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr
+++ b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr
@@ -3,51 +3,65 @@
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
- |
- ::: $SRC_DIR/core/src/marker.rs:LL:COL
- |
-LL | pub unsafe auto trait Send {
- | -------------------------- required by this bound in `Send`
|
= help: the trait `Send` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
+note: required by a bound in `Send`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
+ |
+LL | / pub unsafe auto trait Send {
+LL | | // empty.
+LL | | }
+ | |_^ required by this bound in `Send`
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:43
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<Self as Case1>::C as Iterator>::Item` is not an iterator
- |
- ::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
- |
-LL | pub trait Iterator {
- | ------------------ required by this bound in `Iterator`
|
= help: the trait `Iterator` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
+note: required by a bound in `Iterator`
+ --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+ |
+LL | / pub trait Iterator {
+LL | | /// The type of the elements being iterated over.
+LL | | #[stable(feature = "rust1", since = "1.0.0")]
+LL | | type Item;
+... |
+LL | | }
+LL | | }
+ | |_^ required by this bound in `Iterator`
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:93
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
- |
- ::: $SRC_DIR/core/src/marker.rs:LL:COL
- |
-LL | pub unsafe auto trait Sync {
- | -------------------------- required by this bound in `Sync`
|
= help: the trait `Sync` is not implemented for `<<Self as Case1>::C as Iterator>::Item`
+note: required by a bound in `Sync`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
+ |
+LL | / pub unsafe auto trait Sync {
+LL | | // FIXME(estebank): once support to add notes in `rustc_on_unimplemented`
+LL | | // lands in beta, and it has been extended to check whether a closure is
+LL | | // anywhere in the requirement chain, extend it as such (#48534):
+... |
+LL | | // Empty
+LL | | }
+ | |_^ required by this bound in `Sync`
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr
index 919b186..4da5a2c 100644
--- a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr
+++ b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr
@@ -3,33 +3,45 @@
|
LL | type A: Iterator<Item: Debug>;
| ^^^^^ `<<Self as Case1>::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
- |
-LL | pub trait Debug {
- | --------------- required by this bound in `Debug`
|
= help: the trait `Debug` is not implemented for `<<Self as Case1>::A as Iterator>::Item`
+note: required by a bound in `Debug`
+ --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
+ |
+LL | / pub trait Debug {
+LL | | /// Formats the value using the given formatter.
+LL | | ///
+LL | | /// # Examples
+... |
+LL | | fn fmt(&self, f: &mut Formatter<'_>) -> Result;
+LL | | }
+ | |_^ required by this bound in `Debug`
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::A as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<<Self as Foo>::Out as Baz>::Assoc: Default` is not satisfied
--> $DIR/bounds-on-assoc-in-trait.rs:35:38
|
LL | pub trait Foo { type Out: Baz<Assoc: Default>; }
| ^^^^^^^ the trait `Default` is not implemented for `<<Self as Foo>::Out as Baz>::Assoc`
- |
- ::: $SRC_DIR/core/src/default.rs:LL:COL
|
-LL | pub trait Default: Sized {
- | ------------------------ required by this bound in `Default`
+note: required by a bound in `Default`
+ --> $SRC_DIR/core/src/default.rs:LL:COL
|
+LL | / pub trait Default: Sized {
+LL | | /// Returns the "default value" for a type.
+LL | | ///
+LL | | /// Default values are often some kind of initial value, identity value, or anything else that
+... |
+LL | | fn default() -> Self;
+LL | | }
+ | |_^ required by this bound in `Default`
help: consider further restricting the associated type
|
LL | pub trait Foo where <<Self as Foo>::Out as Baz>::Assoc: Default { type Out: Baz<Assoc: Default>; }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-type-bounds/duplicate.full_tait.stderr b/src/test/ui/associated-type-bounds/duplicate.full_tait.stderr
deleted file mode 100644
index bffa515..0000000
--- a/src/test/ui/associated-type-bounds/duplicate.full_tait.stderr
+++ /dev/null
@@ -1,492 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/duplicate.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:10:36
- |
-LL | struct SI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:12:36
- |
-LL | struct SI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:14:39
- |
-LL | struct SI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:16:45
- |
-LL | struct SW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:18:45
- |
-LL | struct SW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:20:48
- |
-LL | struct SW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:23:34
- |
-LL | enum EI1<T: Iterator<Item: Copy, Item: Send>> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:25:34
- |
-LL | enum EI2<T: Iterator<Item: Copy, Item: Copy>> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:27:37
- |
-LL | enum EI3<T: Iterator<Item: 'static, Item: 'static>> { V(T) }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:29:43
- |
-LL | enum EW1<T> where T: Iterator<Item: Copy, Item: Send> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:31:43
- |
-LL | enum EW2<T> where T: Iterator<Item: Copy, Item: Copy> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:33:46
- |
-LL | enum EW3<T> where T: Iterator<Item: 'static, Item: 'static> { V(T) }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:36:35
- |
-LL | union UI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:38:35
- |
-LL | union UI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:40:38
- |
-LL | union UI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:42:44
- |
-LL | union UW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:44:44
- |
-LL | union UW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:46:47
- |
-LL | union UW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:49:32
- |
-LL | fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:51:32
- |
-LL | fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:53:35
- |
-LL | fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:55:43
- |
-LL | fn FW1<T>() where T: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:57:43
- |
-LL | fn FW2<T>() where T: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:59:46
- |
-LL | fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:65:40
- |
-LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:67:40
- |
-LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:69:43
- |
-LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:72:35
- |
-LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:74:35
- |
-LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:76:38
- |
-LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:78:44
- |
-LL | type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:80:44
- |
-LL | type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:82:47
- |
-LL | type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:85:36
- |
-LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:87:36
- |
-LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:89:39
- |
-LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:91:40
- |
-LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:93:40
- |
-LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:95:43
- |
-LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:98:36
- |
-LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:100:36
- |
-LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:102:39
- |
-LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:104:34
- |
-LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:106:34
- |
-LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:108:37
- |
-LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:110:45
- |
-LL | trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:112:45
- |
-LL | trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:114:48
- |
-LL | trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:116:46
- |
-LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:116:46
- |
-LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:119:46
- |
-LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:119:46
- |
-LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:122:49
- |
-LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:122:49
- |
-LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:132:40
- |
-LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:134:44
- |
-LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:136:43
- |
-LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:125:43
- |
-LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:127:43
- |
-LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:129:46
- |
-LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error: aborting due to 60 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0719`.
diff --git a/src/test/ui/associated-type-bounds/duplicate.min_tait.stderr b/src/test/ui/associated-type-bounds/duplicate.min_tait.stderr
deleted file mode 100644
index 06bfac58..0000000
--- a/src/test/ui/associated-type-bounds/duplicate.min_tait.stderr
+++ /dev/null
@@ -1,483 +0,0 @@
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:10:36
- |
-LL | struct SI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:12:36
- |
-LL | struct SI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:14:39
- |
-LL | struct SI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:16:45
- |
-LL | struct SW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:18:45
- |
-LL | struct SW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:20:48
- |
-LL | struct SW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:23:34
- |
-LL | enum EI1<T: Iterator<Item: Copy, Item: Send>> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:25:34
- |
-LL | enum EI2<T: Iterator<Item: Copy, Item: Copy>> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:27:37
- |
-LL | enum EI3<T: Iterator<Item: 'static, Item: 'static>> { V(T) }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:29:43
- |
-LL | enum EW1<T> where T: Iterator<Item: Copy, Item: Send> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:31:43
- |
-LL | enum EW2<T> where T: Iterator<Item: Copy, Item: Copy> { V(T) }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:33:46
- |
-LL | enum EW3<T> where T: Iterator<Item: 'static, Item: 'static> { V(T) }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:36:35
- |
-LL | union UI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:38:35
- |
-LL | union UI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:40:38
- |
-LL | union UI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:42:44
- |
-LL | union UW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:44:44
- |
-LL | union UW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:46:47
- |
-LL | union UW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:49:32
- |
-LL | fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:51:32
- |
-LL | fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:53:35
- |
-LL | fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:55:43
- |
-LL | fn FW1<T>() where T: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:57:43
- |
-LL | fn FW2<T>() where T: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:59:46
- |
-LL | fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:65:40
- |
-LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:67:40
- |
-LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:69:43
- |
-LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:72:35
- |
-LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:74:35
- |
-LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:76:38
- |
-LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:78:44
- |
-LL | type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:80:44
- |
-LL | type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:82:47
- |
-LL | type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:85:36
- |
-LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:87:36
- |
-LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:89:39
- |
-LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:91:40
- |
-LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:93:40
- |
-LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:95:43
- |
-LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:98:36
- |
-LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:100:36
- |
-LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:102:39
- |
-LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:104:34
- |
-LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:106:34
- |
-LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:108:37
- |
-LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:110:45
- |
-LL | trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:112:45
- |
-LL | trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:114:48
- |
-LL | trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:116:46
- |
-LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:116:46
- |
-LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:119:46
- |
-LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:119:46
- |
-LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:122:49
- |
-LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:122:49
- |
-LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:132:40
- |
-LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:134:44
- |
-LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:136:43
- |
-LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:125:43
- |
-LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:127:43
- |
-LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
- | ---------- ^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
- --> $DIR/duplicate.rs:129:46
- |
-LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
- | ------------- ^^^^^^^^^^^^^ re-bound here
- | |
- | `Item` bound here first
-
-error: aborting due to 60 previous errors
-
-For more information about this error, try `rustc --explain E0719`.
diff --git a/src/test/ui/associated-type-bounds/duplicate.rs b/src/test/ui/associated-type-bounds/duplicate.rs
index 0d7804e..e1dc6f8 100644
--- a/src/test/ui/associated-type-bounds/duplicate.rs
+++ b/src/test/ui/associated-type-bounds/duplicate.rs
@@ -1,50 +1,110 @@
#![feature(associated_type_bounds)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![feature(untagged_unions)]
use std::iter;
-struct SI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-struct SI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-struct SI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-struct SW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-struct SW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-struct SW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+struct SI1<T: Iterator<Item: Copy, Item: Send>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ f: T,
+}
+struct SI2<T: Iterator<Item: Copy, Item: Copy>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ f: T,
+}
+struct SI3<T: Iterator<Item: 'static, Item: 'static>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ f: T,
+}
+struct SW1<T>
+where
+ T: Iterator<Item: Copy, Item: Send>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ f: T,
+}
+struct SW2<T>
+where
+ T: Iterator<Item: Copy, Item: Copy>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ f: T,
+}
+struct SW3<T>
+where
+ T: Iterator<Item: 'static, Item: 'static>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ f: T,
+}
-enum EI1<T: Iterator<Item: Copy, Item: Send>> { V(T) }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-enum EI2<T: Iterator<Item: Copy, Item: Copy>> { V(T) }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-enum EI3<T: Iterator<Item: 'static, Item: 'static>> { V(T) }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-enum EW1<T> where T: Iterator<Item: Copy, Item: Send> { V(T) }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-enum EW2<T> where T: Iterator<Item: Copy, Item: Copy> { V(T) }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-enum EW3<T> where T: Iterator<Item: 'static, Item: 'static> { V(T) }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+enum EI1<T: Iterator<Item: Copy, Item: Send>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ V(T),
+}
+enum EI2<T: Iterator<Item: Copy, Item: Copy>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ V(T),
+}
+enum EI3<T: Iterator<Item: 'static, Item: 'static>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ V(T),
+}
+enum EW1<T>
+where
+ T: Iterator<Item: Copy, Item: Send>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ V(T),
+}
+enum EW2<T>
+where
+ T: Iterator<Item: Copy, Item: Copy>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ V(T),
+}
+enum EW3<T>
+where
+ T: Iterator<Item: 'static, Item: 'static>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ V(T),
+}
-union UI1<T: Iterator<Item: Copy, Item: Send>> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-union UI2<T: Iterator<Item: Copy, Item: Copy>> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-union UI3<T: Iterator<Item: 'static, Item: 'static>> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-union UW1<T> where T: Iterator<Item: Copy, Item: Send> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-union UW2<T> where T: Iterator<Item: Copy, Item: Copy> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-union UW3<T> where T: Iterator<Item: 'static, Item: 'static> { f: T }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+union UI1<T: Iterator<Item: Copy, Item: Send>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ f: T,
+}
+union UI2<T: Iterator<Item: Copy, Item: Copy>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ f: T,
+}
+union UI3<T: Iterator<Item: 'static, Item: 'static>> {
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ f: T,
+}
+union UW1<T>
+where
+ T: Iterator<Item: Copy, Item: Send>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ f: T,
+}
+union UW2<T>
+where
+ T: Iterator<Item: Copy, Item: Copy>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ f: T,
+}
+union UW3<T>
+where
+ T: Iterator<Item: 'static, Item: 'static>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+ f: T,
+}
fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
@@ -52,16 +112,34 @@
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-fn FW1<T>() where T: Iterator<Item: Copy, Item: Send> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-fn FW2<T>() where T: Iterator<Item: Copy, Item: Copy> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-fn FW3<T>() where T: Iterator<Item: 'static, Item: 'static> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+fn FW1<T>()
+where
+ T: Iterator<Item: Copy, Item: Send>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+fn FW2<T>()
+where
+ T: Iterator<Item: Copy, Item: Copy>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+fn FW3<T>()
+where
+ T: Iterator<Item: 'static, Item: 'static>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
-fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() }
-fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() }
-fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() }
+fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> {
+ iter::empty()
+}
+fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> {
+ iter::empty()
+}
+fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> {
+ iter::empty()
+}
fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
@@ -75,12 +153,21 @@
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-type TAW1<T> where T: Iterator<Item: Copy, Item: Send> = T;
+type TAW1<T>
+where
+ T: Iterator<Item: Copy, Item: Send>,
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T;
+= T;
+type TAW2<T>
+where
+ T: Iterator<Item: Copy, Item: Copy>,
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
+= T;
+type TAW3<T>
+where
+ T: Iterator<Item: 'static, Item: 'static>,
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+= T;
type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
@@ -107,27 +194,57 @@
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
trait TRS3: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-//~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
-trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
-//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+trait TRW1<T>
+where
+ T: Iterator<Item: Copy, Item: Send>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+trait TRW2<T>
+where
+ T: Iterator<Item: Copy, Item: Copy>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+trait TRW3<T>
+where
+ T: Iterator<Item: 'static, Item: 'static>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+trait TRSW1
+where
+ Self: Iterator<Item: Copy, Item: Send>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+trait TRSW2
+where
+ Self: Iterator<Item: Copy, Item: Copy>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+trait TRSW3
+where
+ Self: Iterator<Item: 'static, Item: 'static>,
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+ //~| ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+{
+}
+trait TRA1 {
+ type A: Iterator<Item: Copy, Item: Send>;
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+}
+trait TRA2 {
+ type A: Iterator<Item: Copy, Item: Copy>;
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+}
+trait TRA3 {
+ type A: Iterator<Item: 'static, Item: 'static>;
+ //~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
+}
type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
//~^ ERROR the value of the associated type `Item` (from trait `Iterator`) is already specified [E0719]
diff --git a/src/test/ui/associated-type-bounds/duplicate.stderr b/src/test/ui/associated-type-bounds/duplicate.stderr
new file mode 100644
index 0000000..e4f4836
--- /dev/null
+++ b/src/test/ui/associated-type-bounds/duplicate.stderr
@@ -0,0 +1,483 @@
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:7:36
+ |
+LL | struct SI1<T: Iterator<Item: Copy, Item: Send>> {
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:11:36
+ |
+LL | struct SI2<T: Iterator<Item: Copy, Item: Copy>> {
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:15:39
+ |
+LL | struct SI3<T: Iterator<Item: 'static, Item: 'static>> {
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:21:29
+ |
+LL | T: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:28:29
+ |
+LL | T: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:35:32
+ |
+LL | T: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:41:34
+ |
+LL | enum EI1<T: Iterator<Item: Copy, Item: Send>> {
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:45:34
+ |
+LL | enum EI2<T: Iterator<Item: Copy, Item: Copy>> {
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:49:37
+ |
+LL | enum EI3<T: Iterator<Item: 'static, Item: 'static>> {
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:55:29
+ |
+LL | T: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:62:29
+ |
+LL | T: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:69:32
+ |
+LL | T: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:75:35
+ |
+LL | union UI1<T: Iterator<Item: Copy, Item: Send>> {
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:79:35
+ |
+LL | union UI2<T: Iterator<Item: Copy, Item: Copy>> {
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:83:38
+ |
+LL | union UI3<T: Iterator<Item: 'static, Item: 'static>> {
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:89:29
+ |
+LL | T: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:96:29
+ |
+LL | T: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:103:32
+ |
+LL | T: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:109:32
+ |
+LL | fn FI1<T: Iterator<Item: Copy, Item: Send>>() {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:111:32
+ |
+LL | fn FI2<T: Iterator<Item: Copy, Item: Copy>>() {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:113:35
+ |
+LL | fn FI3<T: Iterator<Item: 'static, Item: 'static>>() {}
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:117:29
+ |
+LL | T: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:123:29
+ |
+LL | T: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:129:32
+ |
+LL | T: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:143:40
+ |
+LL | fn FAPIT1(_: impl Iterator<Item: Copy, Item: Send>) {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:145:40
+ |
+LL | fn FAPIT2(_: impl Iterator<Item: Copy, Item: Copy>) {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:147:43
+ |
+LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:150:35
+ |
+LL | type TAI1<T: Iterator<Item: Copy, Item: Send>> = T;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:152:35
+ |
+LL | type TAI2<T: Iterator<Item: Copy, Item: Copy>> = T;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:154:38
+ |
+LL | type TAI3<T: Iterator<Item: 'static, Item: 'static>> = T;
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:158:29
+ |
+LL | T: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:163:29
+ |
+LL | T: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:168:32
+ |
+LL | T: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:172:36
+ |
+LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:174:36
+ |
+LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:176:39
+ |
+LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:178:40
+ |
+LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:180:40
+ |
+LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:182:43
+ |
+LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:185:36
+ |
+LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:187:36
+ |
+LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:189:39
+ |
+LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:191:34
+ |
+LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:193:34
+ |
+LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:195:37
+ |
+LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:199:29
+ |
+LL | T: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:205:29
+ |
+LL | T: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:211:32
+ |
+LL | T: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:217:32
+ |
+LL | Self: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:217:32
+ |
+LL | Self: Iterator<Item: Copy, Item: Send>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:224:32
+ |
+LL | Self: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:224:32
+ |
+LL | Self: Iterator<Item: Copy, Item: Copy>,
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:231:35
+ |
+LL | Self: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:231:35
+ |
+LL | Self: Iterator<Item: 'static, Item: 'static>,
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:249:40
+ |
+LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:251:44
+ |
+LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:253:43
+ |
+LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:237:34
+ |
+LL | type A: Iterator<Item: Copy, Item: Send>;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:241:34
+ |
+LL | type A: Iterator<Item: Copy, Item: Copy>;
+ | ---------- ^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified
+ --> $DIR/duplicate.rs:245:37
+ |
+LL | type A: Iterator<Item: 'static, Item: 'static>;
+ | ------------- ^^^^^^^^^^^^^ re-bound here
+ | |
+ | `Item` bound here first
+
+error: aborting due to 60 previous errors
+
+For more information about this error, try `rustc --explain E0719`.
diff --git a/src/test/ui/associated-type-bounds/inside-adt.stderr b/src/test/ui/associated-type-bounds/inside-adt.stderr
index 74e858c..0cacd78 100644
--- a/src/test/ui/associated-type-bounds/inside-adt.stderr
+++ b/src/test/ui/associated-type-bounds/inside-adt.stderr
@@ -64,11 +64,11 @@
help: borrowed types always have a statically known size
|
LL | enum E1 { V(&dyn Iterator<Item: Copy>) }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) }
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:16:13
@@ -82,11 +82,11 @@
help: borrowed types always have a statically known size
|
LL | enum E3 { V(&dyn Iterator<Item: 'static>) }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | enum E3 { V(Box<dyn Iterator<Item: 'static>>) }
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:20:15
@@ -100,11 +100,11 @@
help: borrowed types always have a statically known size
|
LL | union U1 { f: &dyn Iterator<Item: Copy> }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | union U1 { f: Box<dyn Iterator<Item: Copy>> }
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:25:15
@@ -118,11 +118,11 @@
help: borrowed types always have a statically known size
|
LL | union U3 { f: &dyn Iterator<Item: 'static> }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | union U3 { f: Box<dyn Iterator<Item: 'static>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to 13 previous errors
diff --git a/src/test/ui/associated-type-bounds/issue-83017.rs b/src/test/ui/associated-type-bounds/issue-83017.rs
index 8f0a9ea..a022086 100644
--- a/src/test/ui/associated-type-bounds/issue-83017.rs
+++ b/src/test/ui/associated-type-bounds/issue-83017.rs
@@ -1,3 +1,5 @@
+// check-pass
+
#![feature(associated_type_bounds)]
trait TraitA<'a> {
@@ -34,6 +36,4 @@
fn main() {
foo::<Z>();
- //~^ ERROR: the trait bound `for<'a, 'b> <Z as TraitA<'a>>::AsA: TraitB<'a, 'b>` is not satisfied
- //~| ERROR: the trait bound `for<'a, 'b, 'c> <<Z as TraitA<'a>>::AsA as TraitB<'a, 'b>>::AsB: TraitC<'a, 'b, 'c>` is not satisfied
}
diff --git a/src/test/ui/associated-type-bounds/issue-83017.stderr b/src/test/ui/associated-type-bounds/issue-83017.stderr
deleted file mode 100644
index 4eb71fd..0000000
--- a/src/test/ui/associated-type-bounds/issue-83017.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error[E0277]: the trait bound `for<'a, 'b> <Z as TraitA<'a>>::AsA: TraitB<'a, 'b>` is not satisfied
- --> $DIR/issue-83017.rs:36:5
- |
-LL | fn foo<T>()
- | --- required by a bound in this
-LL | where
-LL | for<'a> T: TraitA<'a, AsA: for<'b> TraitB<'a, 'b, AsB: for<'c> TraitC<'a, 'b, 'c>>>,
- | ------------------------------------------------------- required by this bound in `foo`
-...
-LL | foo::<Z>();
- | ^^^^^^^^ the trait `for<'a, 'b> TraitB<'a, 'b>` is not implemented for `<Z as TraitA<'a>>::AsA`
-
-error[E0277]: the trait bound `for<'a, 'b, 'c> <<Z as TraitA<'a>>::AsA as TraitB<'a, 'b>>::AsB: TraitC<'a, 'b, 'c>` is not satisfied
- --> $DIR/issue-83017.rs:36:5
- |
-LL | fn foo<T>()
- | --- required by a bound in this
-LL | where
-LL | for<'a> T: TraitA<'a, AsA: for<'b> TraitB<'a, 'b, AsB: for<'c> TraitC<'a, 'b, 'c>>>,
- | -------------------------- required by this bound in `foo`
-...
-LL | foo::<Z>();
- | ^^^^^^^^ the trait `for<'a, 'b, 'c> TraitC<'a, 'b, 'c>` is not implemented for `<<Z as TraitA<'a>>::AsA as TraitB<'a, 'b>>::AsB`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/associated-type-bounds/trait-alias-impl-trait.full_tait.stderr b/src/test/ui/associated-type-bounds/trait-alias-impl-trait.full_tait.stderr
deleted file mode 100644
index d4da4bab..0000000
--- a/src/test/ui/associated-type-bounds/trait-alias-impl-trait.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/trait-alias-impl-trait.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs b/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs
index cf20631..e223a89 100644
--- a/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs
+++ b/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs
@@ -1,39 +1,59 @@
// run-pass
#![feature(associated_type_bounds)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::ops::Add;
-trait Tr1 { type As1; fn mk(self) -> Self::As1; }
-trait Tr2<'a> { fn tr2(self) -> &'a Self; }
+trait Tr1 {
+ type As1;
+ fn mk(self) -> Self::As1;
+}
+trait Tr2<'a> {
+ fn tr2(self) -> &'a Self;
+}
-fn assert_copy<T: Copy>(x: T) { let _x = x; let _x = x; }
+fn assert_copy<T: Copy>(x: T) {
+ let _x = x;
+ let _x = x;
+}
fn assert_static<T: 'static>(_: T) {}
fn assert_forall_tr2<T: for<'a> Tr2<'a>>(_: T) {}
struct S1;
#[derive(Copy, Clone)]
struct S2;
-impl Tr1 for S1 { type As1 = S2; fn mk(self) -> Self::As1 { S2 } }
+impl Tr1 for S1 {
+ type As1 = S2;
+ fn mk(self) -> Self::As1 {
+ S2
+ }
+}
type Et1 = impl Tr1<As1: Copy>;
-fn def_et1() -> Et1 { S1 }
-pub fn use_et1() { assert_copy(def_et1().mk()); }
+fn def_et1() -> Et1 {
+ S1
+}
+pub fn use_et1() {
+ assert_copy(def_et1().mk());
+}
type Et2 = impl Tr1<As1: 'static>;
-fn def_et2() -> Et2 { S1 }
-pub fn use_et2() { assert_static(def_et2().mk()); }
+fn def_et2() -> Et2 {
+ S1
+}
+pub fn use_et2() {
+ assert_static(def_et2().mk());
+}
type Et3 = impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>;
fn def_et3() -> Et3 {
struct A;
impl Tr1 for A {
type As1 = core::ops::Range<u8>;
- fn mk(self) -> Self::As1 { 0..10 }
+ fn mk(self) -> Self::As1 {
+ 0..10
+ }
}
A
}
@@ -53,14 +73,20 @@
struct A;
impl Tr1 for A {
type As1 = A;
- fn mk(self) -> A { A }
+ fn mk(self) -> A {
+ A
+ }
}
impl<'a> Tr2<'a> for A {
- fn tr2(self) -> &'a Self { &A }
+ fn tr2(self) -> &'a Self {
+ &A
+ }
}
A
}
-pub fn use_et4() { assert_forall_tr2(def_et4().mk()); }
+pub fn use_et4() {
+ assert_forall_tr2(def_et4().mk());
+}
fn main() {
let _ = use_et1();
diff --git a/src/test/ui/associated-type-bounds/type-alias.stderr b/src/test/ui/associated-type-bounds/type-alias.stderr
index 42be09d..6bde9d1 100644
--- a/src/test/ui/associated-type-bounds/type-alias.stderr
+++ b/src/test/ui/associated-type-bounds/type-alias.stderr
@@ -7,8 +7,9 @@
= note: `#[warn(type_alias_bounds)]` on by default
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere1<T> = T;
- | --
+LL - type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
+LL + type _TaWhere1<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:6:25
@@ -18,8 +19,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere2<T> = T;
- | --
+LL - type _TaWhere2<T> where T: Iterator<Item: 'static> = T;
+LL + type _TaWhere2<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:7:25
@@ -29,8 +31,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere3<T> = T;
- | --
+LL - type _TaWhere3<T> where T: Iterator<Item: 'static> = T;
+LL + type _TaWhere3<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:8:25
@@ -40,8 +43,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere4<T> = T;
- | --
+LL - type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T;
+LL + type _TaWhere4<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:9:25
@@ -51,8 +55,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere5<T> = T;
- | --
+LL - type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T;
+LL + type _TaWhere5<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:10:25
@@ -62,8 +67,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere6<T> = T;
- | --
+LL - type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T;
+LL + type _TaWhere6<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:12:20
@@ -73,8 +79,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline1<T> = T;
- | --
+LL - type _TaInline1<T: Iterator<Item: Copy>> = T;
+LL + type _TaInline1<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:13:20
@@ -84,8 +91,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline2<T> = T;
- | --
+LL - type _TaInline2<T: Iterator<Item: 'static>> = T;
+LL + type _TaInline2<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:14:20
@@ -95,8 +103,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline3<T> = T;
- | --
+LL - type _TaInline3<T: Iterator<Item: 'static>> = T;
+LL + type _TaInline3<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:15:20
@@ -106,8 +115,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline4<T> = T;
- | --
+LL - type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T;
+LL + type _TaInline4<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:16:20
@@ -117,8 +127,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline5<T> = T;
- | --
+LL - type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T;
+LL + type _TaInline5<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:17:20
@@ -128,8 +139,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline6<T> = T;
- | --
+LL - type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T;
+LL + type _TaInline6<T> = T;
+ |
warning: 12 warnings emitted
diff --git a/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr b/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr
index 6de8459..474b3c5 100644
--- a/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr
+++ b/src/test/ui/associated-types/associated-type-projection-ambig-between-bound-and-where-clause.stderr
@@ -13,11 +13,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn a<C:Vehicle+Box>(_: <C as Box>::Color) {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn a<C:Vehicle+Box>(_: <C as Vehicle>::Color) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:20:12
@@ -34,11 +34,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn b<C>(_: <C as Box>::Color) where C : Vehicle+Box {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn b<C>(_: <C as Vehicle>::Color) where C : Vehicle+Box {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:24:12
@@ -55,11 +55,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn c<C>(_: <C as Box>::Color) where C : Vehicle, C : Box {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn c<C>(_: <C as Vehicle>::Color) where C : Vehicle, C : Box {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20
@@ -76,11 +76,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn e(&self, _: <X as Box>::Color) where X : Box;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn e(&self, _: <X as Vehicle>::Color) where X : Box;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20
@@ -97,11 +97,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn f(&self, _: <X as Box>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn f(&self, _: <X as Vehicle>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20
@@ -118,11 +118,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn d(&self, _: <X as Box>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn d(&self, _: <X as Vehicle>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr b/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr
index cd7c0dc..e6e9533 100644
--- a/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr
+++ b/src/test/ui/associated-types/associated-type-projection-from-multiple-supertraits.stderr
@@ -21,11 +21,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn dent<C:BoxCar>(c: C, color: <C as Vehicle>::Color) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn dent<C:BoxCar>(c: C, color: <C as Box>::Color) {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0222]: ambiguous associated type `Color` in bounds of `BoxCar`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:37
@@ -74,11 +74,11 @@
help: use fully qualified syntax to disambiguate
|
LL | fn paint<C:BoxCar>(c: C, d: <C as Vehicle>::Color) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn paint<C:BoxCar>(c: C, d: <C as Box>::Color) {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0191]: the value of the associated types `Color` (from trait `Box`), `Color` (from trait `Vehicle`) must be specified
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32
diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
index 029c923..924a09c 100644
--- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
@@ -1,20 +1,26 @@
error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:10
|
-LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
- | ---------- required by this bound in `blue_car`
-...
LL | fn b() { blue_car(ModelT); }
| ^^^^^^^^ expected struct `Blue`, found struct `Black`
+ |
+note: required by a bound in `blue_car`
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:27:19
+ |
+LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
+ | ^^^^^^^^^^ required by this bound in `blue_car`
error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10
|
-LL | fn black_car<C:Car<Color=Black>>(c: C) {
- | ----------- required by this bound in `black_car`
-...
LL | fn c() { black_car(ModelU); }
| ^^^^^^^^^ expected struct `Black`, found struct `Blue`
+ |
+note: required by a bound in `black_car`
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:24:20
+ |
+LL | fn black_car<C:Car<Color=Black>>(c: C) {
+ | ^^^^^^^^^^^ required by this bound in `black_car`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/associated-types-bound-failure.stderr b/src/test/ui/associated-types/associated-types-bound-failure.stderr
index 41e2d8e..edcd2bf 100644
--- a/src/test/ui/associated-types/associated-types-bound-failure.stderr
+++ b/src/test/ui/associated-types/associated-types-bound-failure.stderr
@@ -12,7 +12,7 @@
help: consider further restricting the associated type
|
LL | where G : GetToInt, <G as GetToInt>::R: ToInt
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-eq-1.stderr b/src/test/ui/associated-types/associated-types-eq-1.stderr
index 53a45cf..e9ace7d 100644
--- a/src/test/ui/associated-types/associated-types-eq-1.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-1.stderr
@@ -9,11 +9,11 @@
help: a type parameter with a similar name exists
|
LL | let _: I = x.boo();
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn foo2<I: Foo, A>(x: I) {
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr
index dffa478..5f227a3 100644
--- a/src/test/ui/associated-types/associated-types-eq-3.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-3.stderr
@@ -11,16 +11,19 @@
help: consider constraining the associated type `<I as Foo>::A` to `Bar`
|
LL | fn foo2<I: Foo<A = Bar>>(x: I) {
- | ^^^^^^^^^
+ | +++++++++
error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
--> $DIR/associated-types-eq-3.rs:38:5
|
-LL | fn foo1<I: Foo<A=Bar>>(x: I) {
- | ----- required by this bound in `foo1`
-...
LL | foo1(a);
| ^^^^ expected struct `Bar`, found `usize`
+ |
+note: required by a bound in `foo1`
+ --> $DIR/associated-types-eq-3.rs:18:16
+ |
+LL | fn foo1<I: Foo<A=Bar>>(x: I) {
+ | ^^^^^ required by this bound in `foo1`
error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
--> $DIR/associated-types-eq-3.rs:41:9
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr b/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr
index 25e9f72..1da82ab 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-hr.nll.stderr
@@ -1,32 +1,36 @@
error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
--> $DIR/associated-types-eq-hr.rs:87:5
|
-LL | fn foo<T>()
- | --- required by a bound in this
-LL | where
-LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>,
- | ------------- required by this bound in `foo`
-...
LL | foo::<UintStruct>();
| ^^^^^^^^^^^^^^^^^ expected `isize`, found `usize`
|
= note: expected reference `&isize`
found reference `&usize`
+note: required by a bound in `foo`
+ --> $DIR/associated-types-eq-hr.rs:45:36
+ |
+LL | fn foo<T>()
+ | --- required by a bound in this
+LL | where
+LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>,
+ | ^^^^^^^^^^^^^ required by this bound in `foo`
error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
--> $DIR/associated-types-eq-hr.rs:91:5
|
-LL | fn bar<T>()
- | --- required by a bound in this
-LL | where
-LL | T: for<'x> TheTrait<&'x isize, A = &'x usize>,
- | ------------- required by this bound in `bar`
-...
LL | bar::<IntStruct>();
| ^^^^^^^^^^^^^^^^ expected `usize`, found `isize`
|
= note: expected reference `&usize`
found reference `&isize`
+note: required by a bound in `bar`
+ --> $DIR/associated-types-eq-hr.rs:52:36
+ |
+LL | fn bar<T>()
+ | --- required by a bound in this
+LL | where
+LL | T: for<'x> TheTrait<&'x isize, A = &'x usize>,
+ | ^^^^^^^^^^^^^ required by this bound in `bar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr
index 6897b31..e34b4f1 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr
@@ -1,32 +1,36 @@
error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
--> $DIR/associated-types-eq-hr.rs:87:5
|
-LL | fn foo<T>()
- | --- required by a bound in this
-LL | where
-LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>,
- | ------------- required by this bound in `foo`
-...
LL | foo::<UintStruct>();
| ^^^^^^^^^^^^^^^^^ expected `isize`, found `usize`
|
= note: expected reference `&isize`
found reference `&usize`
+note: required by a bound in `foo`
+ --> $DIR/associated-types-eq-hr.rs:45:36
+ |
+LL | fn foo<T>()
+ | --- required by a bound in this
+LL | where
+LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>,
+ | ^^^^^^^^^^^^^ required by this bound in `foo`
error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
--> $DIR/associated-types-eq-hr.rs:91:5
|
-LL | fn bar<T>()
- | --- required by a bound in this
-LL | where
-LL | T: for<'x> TheTrait<&'x isize, A = &'x usize>,
- | ------------- required by this bound in `bar`
-...
LL | bar::<IntStruct>();
| ^^^^^^^^^^^^^^^^ expected `usize`, found `isize`
|
= note: expected reference `&usize`
found reference `&isize`
+note: required by a bound in `bar`
+ --> $DIR/associated-types-eq-hr.rs:52:36
+ |
+LL | fn bar<T>()
+ | --- required by a bound in this
+LL | where
+LL | T: for<'x> TheTrait<&'x isize, A = &'x usize>,
+ | ^^^^^^^^^^^^^ required by this bound in `bar`
error: implementation of `TheTrait` is not general enough
--> $DIR/associated-types-eq-hr.rs:96:5
diff --git a/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr b/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
index 25e8015..92c963a 100644
--- a/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
+++ b/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
--> $DIR/associated-types-for-unimpl-trait.rs:10:40
|
-LL | trait Get {
- | --------- required by this bound in `Get`
-...
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
+note: required by a bound in `Get`
+ --> $DIR/associated-types-for-unimpl-trait.rs:4:1
+ |
+LL | trait Get {
+ | ^^^^^^^^^ required by this bound in `Get`
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr b/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr
index 1df1278..8fecfdf 100644
--- a/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr
+++ b/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr
@@ -7,7 +7,7 @@
help: consider further restricting this bound
|
LL | fn f<T:Foo<isize> + Foo<usize>>(t: &T) {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr
index 7193d41..1c24ce0 100644
--- a/src/test/ui/associated-types/associated-types-issue-20346.stderr
+++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr
@@ -1,9 +1,6 @@
error[E0271]: type mismatch resolving `<Adapter<I> as Iterator>::Item == Option<T>`
--> $DIR/associated-types-issue-20346.rs:34:5
|
-LL | fn is_iterator_of<A, I: Iterator<Item=A>>(_: &I) {}
- | ------ required by this bound in `is_iterator_of`
-...
LL | fn test_adapter<T, I: Iterator<Item=Option<T>>>(it: I) {
| - this type parameter
...
@@ -12,6 +9,11 @@
|
= note: expected enum `Option<T>`
found type `T`
+note: required by a bound in `is_iterator_of`
+ --> $DIR/associated-types-issue-20346.rs:15:34
+ |
+LL | fn is_iterator_of<A, I: Iterator<Item=A>>(_: &I) {}
+ | ^^^^^^ required by this bound in `is_iterator_of`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
index b8f20d0..922cf88 100644
--- a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
+++ b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
@@ -3,32 +3,36 @@
|
LL | want_y(t);
| ^^^^^^ expected `i32`, found associated type
-...
-LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
- | ----- required by this bound in `want_y`
|
= note: expected type `i32`
found associated type `<T as Foo>::Y`
+note: required by a bound in `want_y`
+ --> $DIR/associated-types-multiple-types-one-trait.rs:44:17
+ |
+LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
+ | ^^^^^ required by this bound in `want_y`
help: consider constraining the associated type `<T as Foo>::Y` to `i32`
|
LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
- | ^^^^^^^^^
+ | +++++++++
error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
--> $DIR/associated-types-multiple-types-one-trait.rs:18:5
|
LL | want_x(t);
| ^^^^^^ expected `u32`, found associated type
-...
-LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
- | ----- required by this bound in `want_x`
|
= note: expected type `u32`
found associated type `<T as Foo>::X`
+note: required by a bound in `want_x`
+ --> $DIR/associated-types-multiple-types-one-trait.rs:42:17
+ |
+LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
+ | ^^^^^ required by this bound in `want_x`
help: consider constraining the associated type `<T as Foo>::X` to `u32`
|
LL | fn have_y_want_x<T:Foo<Y=i32, X = u32>>(t: &T)
- | ^^^^^^^^^
+ | +++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr b/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
index 19500f5..509d548 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Get` is not satisfied
--> $DIR/associated-types-no-suitable-bound.rs:11:21
|
-LL | trait Get {
- | --------- required by this bound in `Get`
-...
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
| ^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
|
+note: required by a bound in `Get`
+ --> $DIR/associated-types-no-suitable-bound.rs:1:1
+ |
+LL | trait Get {
+ | ^^^^^^^^^ required by this bound in `Get`
help: consider restricting type parameter `T`
|
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
index 0e978f2..1cb9ac8 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
--> $DIR/associated-types-no-suitable-supertrait-2.rs:17:40
|
-LL | trait Get {
- | --------- required by this bound in `Get`
-...
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
+note: required by a bound in `Get`
+ --> $DIR/associated-types-no-suitable-supertrait-2.rs:12:1
+ |
+LL | trait Get {
+ | ^^^^^^^^^ required by this bound in `Get`
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
index 1ec3c059..e3185fbe 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
@@ -1,25 +1,30 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
--> $DIR/associated-types-no-suitable-supertrait.rs:17:40
|
-LL | trait Get {
- | --------- required by this bound in `Get`
-...
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
+note: required by a bound in `Get`
+ --> $DIR/associated-types-no-suitable-supertrait.rs:12:1
+ |
+LL | trait Get {
+ | ^^^^^^^^^ required by this bound in `Get`
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error[E0277]: the trait bound `(T, U): Get` is not satisfied
--> $DIR/associated-types-no-suitable-supertrait.rs:22:40
|
-LL | trait Get {
- | --------- required by this bound in `Get`
-...
LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
+ |
+note: required by a bound in `Get`
+ --> $DIR/associated-types-no-suitable-supertrait.rs:12:1
+ |
+LL | trait Get {
+ | ^^^^^^^^^ required by this bound in `Get`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/associated-types-overridden-binding.stderr b/src/test/ui/associated-types/associated-types-overridden-binding.stderr
index 8761267..dc087e4 100644
--- a/src/test/ui/associated-types/associated-types-overridden-binding.stderr
+++ b/src/test/ui/associated-types/associated-types-overridden-binding.stderr
@@ -1,18 +1,26 @@
error[E0284]: type annotations needed: cannot satisfy `<Self as Iterator>::Item == i32`
--> $DIR/associated-types-overridden-binding.rs:4:12
|
-LL | trait Foo: Iterator<Item = i32> {}
- | ---------- required by this bound in `Foo`
LL | trait Bar: Foo<Item = u32> {}
| ^^^^^^^^^^^^^^^ cannot satisfy `<Self as Iterator>::Item == i32`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/associated-types-overridden-binding.rs:3:21
+ |
+LL | trait Foo: Iterator<Item = i32> {}
+ | ^^^^^^^^^^ required by this bound in `Foo`
error[E0284]: type annotations needed: cannot satisfy `<Self as Iterator>::Item == i32`
--> $DIR/associated-types-overridden-binding.rs:7:21
|
-LL | trait I32Iterator = Iterator<Item = i32>;
- | ---------- required by this bound in `I32Iterator`
LL | trait U32Iterator = I32Iterator<Item = u32>;
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `<Self as Iterator>::Item == i32`
+ |
+note: required by a bound in `I32Iterator`
+ --> $DIR/associated-types-overridden-binding.rs:6:30
+ |
+LL | trait I32Iterator = Iterator<Item = i32>;
+ | ^^^^^^^^^^ required by this bound in `I32Iterator`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/associated-types-path-1.stderr b/src/test/ui/associated-types/associated-types-path-1.stderr
index 60db774..8f94b24 100644
--- a/src/test/ui/associated-types/associated-types-path-1.stderr
+++ b/src/test/ui/associated-types/associated-types-path-1.stderr
@@ -19,11 +19,11 @@
help: use fully qualified syntax to disambiguate
|
LL | pub fn f2<T: Foo + Bar>(a: T, x: <T as Bar>::A) {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | pub fn f2<T: Foo + Bar>(a: T, x: <T as Foo>::A) {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/associated-types-path-2.stderr b/src/test/ui/associated-types/associated-types-path-2.stderr
index 0881258..c4ea4ae 100644
--- a/src/test/ui/associated-types/associated-types-path-2.stderr
+++ b/src/test/ui/associated-types/associated-types-path-2.stderr
@@ -7,16 +7,19 @@
help: change the type of the numeric literal from `i32` to `u32`
|
LL | f1(2i32, 4u32);
- | ^^^^
+ | ~~~~
error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:29:5
|
-LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
- | --- required by this bound in `f1`
-...
LL | f1(2u32, 4u32);
| ^^ the trait `Foo` is not implemented for `u32`
+ |
+note: required by a bound in `f1`
+ --> $DIR/associated-types-path-2.rs:13:14
+ |
+LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
+ | ^^^ required by this bound in `f1`
error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:29:5
@@ -27,11 +30,14 @@
error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:35:5
|
-LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
- | --- required by this bound in `f1`
-...
LL | f1(2u32, 4i32);
| ^^ the trait `Foo` is not implemented for `u32`
+ |
+note: required by a bound in `f1`
+ --> $DIR/associated-types-path-2.rs:13:14
+ |
+LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
+ | ^^^ required by this bound in `f1`
error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:35:5
@@ -50,7 +56,7 @@
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
LL | let _: i32 = f2(2i32).try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.stderr
index cadc3e9..62a6197 100644
--- a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.stderr
+++ b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.stderr
@@ -6,8 +6,8 @@
|
help: use a fully qualified path with explicit lifetimes
|
-LL | struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
-LL | field: <I as Foo<&'a isize>>::A
+LL ~ struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
+LL ~ field: <I as Foo<&'a isize>>::A
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
@@ -18,8 +18,8 @@
|
help: use a fully qualified path with explicit lifetimes
|
-LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
-LL | TupleVariant(<I as Foo<&'c isize>>::A),
+LL ~ enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
+LL ~ TupleVariant(<I as Foo<&'c isize>>::A),
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
@@ -30,10 +30,10 @@
|
help: use a fully qualified path with explicit lifetimes
|
-LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
+LL ~ enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
LL | TupleVariant(I::A),
LL |
-LL | StructVariant { field: <I as Foo<&'c isize>>::A },
+LL ~ StructVariant { field: <I as Foo<&'c isize>>::A },
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
@@ -44,9 +44,9 @@
|
help: use a fully qualified path with explicit lifetimes
|
-LL | struct Why<'bb, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
+LL ~ struct Why<'bb, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
LL | 'y, 'z, 'aa, I: for<'l, 'm> Foo<&'l &'m isize>> {
-LL | field: <I as Foo<&'bb &'bb isize>>::A,
+LL ~ field: <I as Foo<&'bb &'bb isize>>::A,
|
error: aborting due to 4 previous errors
diff --git a/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr b/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
index b6ee1ed..09ec0e1 100644
--- a/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
+++ b/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
--> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:10:40
|
-LL | trait Get {
- | --------- required by this bound in `Get`
-...
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value);
| ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
+note: required by a bound in `Get`
+ --> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:5:1
+ |
+LL | trait Get {
+ | ^^^^^^^^^ required by this bound in `Get`
help: consider further restricting `Self`
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get;
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/associated-types-unsized.stderr b/src/test/ui/associated-types/associated-types-unsized.stderr
index c2af548..bec9b15 100644
--- a/src/test/ui/associated-types/associated-types-unsized.stderr
+++ b/src/test/ui/associated-types/associated-types-unsized.stderr
@@ -10,7 +10,7 @@
help: consider further restricting the associated type
|
LL | fn foo<T:Get>(t: T) where <T as Get>::Value: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
index 6c68cc7..e8e0799 100644
--- a/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
+++ b/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
@@ -9,11 +9,11 @@
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | fn elision<T: for<'a> Fn() -> &'a i32>() {
- | ^^^^^^^ ^^^
+ | +++++++ ~~~
help: consider using the `'static` lifetime
|
LL | fn elision<T: Fn() -> &'static i32>() {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
index 93d2f8e..c75e732 100644
--- a/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
+++ b/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr
@@ -9,11 +9,11 @@
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | fn elision(_: for<'a> fn() -> &'a i32) {
- | ^^^^^^^ ^^^
+ | +++++++ ~~~
help: consider using the `'static` lifetime
|
LL | fn elision(_: fn() -> &'static i32) {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr b/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr
index 5e98520..008eddc 100644
--- a/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr
+++ b/src/test/ui/associated-types/defaults-cyclic-fail-1.stderr
@@ -1,14 +1,14 @@
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B == _`
- --> $DIR/defaults-cyclic-fail-1.rs:26:5
+ --> $DIR/defaults-cyclic-fail-1.rs:26:14
|
LL | type A = Box<Self::B>;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A == _`
- --> $DIR/defaults-cyclic-fail-1.rs:32:5
+ --> $DIR/defaults-cyclic-fail-1.rs:32:14
|
LL | type B = &'static Self::A;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr b/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr
index c538805..d0fbab0 100644
--- a/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr
+++ b/src/test/ui/associated-types/defaults-cyclic-fail-2.stderr
@@ -1,14 +1,14 @@
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B == _`
- --> $DIR/defaults-cyclic-fail-2.rs:27:5
+ --> $DIR/defaults-cyclic-fail-2.rs:27:14
|
LL | type A = Box<Self::B>;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A == _`
- --> $DIR/defaults-cyclic-fail-2.rs:33:5
+ --> $DIR/defaults-cyclic-fail-2.rs:33:14
|
LL | type B = &'static Self::A;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/associated-types/defaults-suitability.stderr b/src/test/ui/associated-types/defaults-suitability.stderr
index af4e6f0..8a8211f 100644
--- a/src/test/ui/associated-types/defaults-suitability.stderr
+++ b/src/test/ui/associated-types/defaults-suitability.stderr
@@ -2,105 +2,125 @@
--> $DIR/defaults-suitability.rs:13:5
|
LL | type Ty: Clone = NotClone;
- | ^^^^^^^^^-----^^^^^^^^^^^^
- | | |
- | | required by this bound in `Tr::Ty`
- | the trait `Clone` is not implemented for `NotClone`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NotClone`
+ |
+note: required by a bound in `Tr::Ty`
+ --> $DIR/defaults-suitability.rs:13:14
+ |
+LL | type Ty: Clone = NotClone;
+ | ^^^^^ required by this bound in `Tr::Ty`
error[E0277]: the trait bound `NotClone: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:22:5
|
+LL | type Ty = NotClone;
+ | ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `NotClone`
+ |
+note: required by a bound in `Tr2::Ty`
+ --> $DIR/defaults-suitability.rs:20:15
+ |
LL | Self::Ty: Clone,
- | ----- required by this bound in `Tr2::Ty`
+ | ^^^^^ required by this bound in `Tr2::Ty`
LL | {
LL | type Ty = NotClone;
- | ^^^^^--^^^^^^^^^^^^
- | | |
- | | required by a bound in this
- | the trait `Clone` is not implemented for `NotClone`
+ | -- required by a bound in this
error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:28:5
|
LL | type Bar: Clone = Vec<T>;
- | ^^^^^^^^^^-----^^^^^^^^^^
- | | |
- | | required by this bound in `Foo::Bar`
- | the trait `Clone` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `T`
|
= note: required because of the requirements on the impl of `Clone` for `Vec<T>`
+note: required by a bound in `Foo::Bar`
+ --> $DIR/defaults-suitability.rs:28:15
+ |
+LL | type Bar: Clone = Vec<T>;
+ | ^^^^^ required by this bound in `Foo::Bar`
help: consider restricting type parameter `T`
|
LL | trait Foo<T: std::clone::Clone> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `(): Foo<Self>` is not satisfied
--> $DIR/defaults-suitability.rs:34:5
|
LL | type Assoc: Foo<Self> = ();
- | ^^^^^^^^^^^^---------^^^^^^
- | | |
- | | required by this bound in `Bar::Assoc`
- | the trait `Foo<Self>` is not implemented for `()`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo<Self>` is not implemented for `()`
+ |
+note: required by a bound in `Bar::Assoc`
+ --> $DIR/defaults-suitability.rs:34:17
+ |
+LL | type Assoc: Foo<Self> = ();
+ | ^^^^^^^^^ required by this bound in `Bar::Assoc`
error[E0277]: the trait bound `NotClone: IsU8<NotClone>` is not satisfied
--> $DIR/defaults-suitability.rs:56:5
|
+LL | type Assoc = NotClone;
+ | ^^^^^^^^^^^^^^^^^^^^^^ the trait `IsU8<NotClone>` is not implemented for `NotClone`
+ |
+note: required by a bound in `D::Assoc`
+ --> $DIR/defaults-suitability.rs:53:18
+ |
LL | Self::Assoc: IsU8<Self::Assoc>,
- | ----------------- required by this bound in `D::Assoc`
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `D::Assoc`
...
LL | type Assoc = NotClone;
- | ^^^^^-----^^^^^^^^^^^^
- | | |
- | | required by a bound in this
- | the trait `IsU8<NotClone>` is not implemented for `NotClone`
+ | ----- required by a bound in this
error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:65:5
|
LL | type Bar: Clone = Vec<Self::Baz>;
- | ^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `Foo2::Bar`
- | the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`
|
= note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo2<T>>::Baz>`
+note: required by a bound in `Foo2::Bar`
+ --> $DIR/defaults-suitability.rs:65:15
+ |
+LL | type Bar: Clone = Vec<Self::Baz>;
+ | ^^^^^ required by this bound in `Foo2::Bar`
help: consider further restricting the associated type
|
LL | trait Foo2<T> where <Self as Foo2<T>>::Baz: Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:74:5
|
LL | type Bar: Clone = Vec<Self::Baz>;
- | ^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `Foo25::Bar`
- | the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`
|
= note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo25<T>>::Baz>`
+note: required by a bound in `Foo25::Bar`
+ --> $DIR/defaults-suitability.rs:74:15
+ |
+LL | type Bar: Clone = Vec<Self::Baz>;
+ | ^^^^^ required by this bound in `Foo25::Bar`
help: consider further restricting the associated type
|
LL | trait Foo25<T: Clone> where <Self as Foo25<T>>::Baz: Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:87:5
|
+LL | type Baz = T;
+ | ^^^^^^^^^^^^^ the trait `Clone` is not implemented for `T`
+ |
+note: required by a bound in `Foo3::Baz`
+ --> $DIR/defaults-suitability.rs:84:16
+ |
LL | Self::Baz: Clone,
- | ----- required by this bound in `Foo3::Baz`
+ | ^^^^^ required by this bound in `Foo3::Baz`
...
LL | type Baz = T;
- | ^^^^^---^^^^^
- | | |
- | | required by a bound in this
- | the trait `Clone` is not implemented for `T`
- |
+ | --- required by a bound in this
help: consider further restricting type parameter `T`
|
LL | Self::Baz: Clone, T: std::clone::Clone
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 8 previous errors
diff --git a/src/test/ui/associated-types/defaults-unsound-62211-1.stderr b/src/test/ui/associated-types/defaults-unsound-62211-1.stderr
index bcdb50a..b21cae3 100644
--- a/src/test/ui/associated-types/defaults-unsound-62211-1.stderr
+++ b/src/test/ui/associated-types/defaults-unsound-62211-1.stderr
@@ -2,58 +2,66 @@
--> $DIR/defaults-unsound-62211-1.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | `Self` cannot be formatted with the default formatter
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Self` cannot be formatted with the default formatter
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-1.rs:20:86
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::fmt::Display {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-1.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | no implementation for `Self += &'static str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Self += &'static str`
|
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-1.rs:20:47
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^^^^^^^^-------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | the trait `Deref` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deref` is not implemented for `Self`
|
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-1.rs:20:25
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Deref {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | the trait `Copy` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Self`
|
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-1.rs:20:18
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Copy {
- | ^^^^^^
+ | ++++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/associated-types/defaults-unsound-62211-2.stderr b/src/test/ui/associated-types/defaults-unsound-62211-2.stderr
index fa5cf91..2eebfb0 100644
--- a/src/test/ui/associated-types/defaults-unsound-62211-2.stderr
+++ b/src/test/ui/associated-types/defaults-unsound-62211-2.stderr
@@ -2,58 +2,66 @@
--> $DIR/defaults-unsound-62211-2.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | `Self` cannot be formatted with the default formatter
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Self` cannot be formatted with the default formatter
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-2.rs:20:86
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::fmt::Display {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-2.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | no implementation for `Self += &'static str`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Self += &'static str`
|
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-2.rs:20:47
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^^^^^^^^-------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | the trait `Deref` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Deref` is not implemented for `Self`
|
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-2.rs:20:25
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Deref {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:5
|
LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
- | ^^^^^^^^^^^^^----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `UncheckedCopy::Output`
- | the trait `Copy` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Self`
|
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/defaults-unsound-62211-2.rs:20:18
+ |
+LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + From<Self> + Display = Self;
+ | ^^^^ required by this bound in `UncheckedCopy::Output`
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Copy {
- | ^^^^^^
+ | ++++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/associated-types/defaults-wf.stderr b/src/test/ui/associated-types/defaults-wf.stderr
index 73ef567..8455f88 100644
--- a/src/test/ui/associated-types/defaults-wf.stderr
+++ b/src/test/ui/associated-types/defaults-wf.stderr
@@ -3,13 +3,13 @@
|
LL | type Ty = Vec<[u8]>;
| ^^^^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- |
-LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
- | - required by this bound in `Vec`
|
= help: the trait `Sized` is not implemented for `[u8]`
+note: required by a bound in `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ |
+LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
+ | ^ required by this bound in `Vec`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr
index 2e03986..e3bd0c2 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr
+++ b/src/test/ui/associated-types/higher-ranked-projection.bad.nll.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/higher-ranked-projection.rs:25:5
|
LL | foo(());
- | ^^^^^^^
+ | ^^^^^^^ one type is more general than the other
+ |
+ = note: expected reference `&'a ()`
+ found reference `&()`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
index e2847b6..1ac72e4 100644
--- a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
+++ b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr
@@ -4,8 +4,8 @@
LL | foo(());
| ^^^ lifetime mismatch
|
- = note: expected type `&'a ()`
- found type `&()`
+ = note: expected reference `&'a ()`
+ found type `&()`
note: the lifetime requirement is introduced here
--> $DIR/higher-ranked-projection.rs:15:33
|
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-1.rs b/src/test/ui/associated-types/hr-associated-type-bound-1.rs
index cdf32dd..db41416 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-1.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-1.rs
@@ -10,7 +10,7 @@
impl X<'_> for i32 {
type U = str;
- //~^ ERROR the trait bound `for<'b> <i32 as X<'b>>::U: Clone`
+ //~^ ERROR the trait bound `str: Clone`
}
fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-1.stderr b/src/test/ui/associated-types/hr-associated-type-bound-1.stderr
index 042223f..4eed5c9 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-1.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-1.stderr
@@ -1,17 +1,17 @@
-error[E0277]: the trait bound `for<'b> <i32 as X<'b>>::U: Clone` is not satisfied
+error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-1.rs:12:14
|
+LL | type U = str;
+ | ^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `X`
+ --> $DIR/hr-associated-type-bound-1.rs:3:33
+ |
LL | trait X<'a>
| - required by a bound in this
LL | where
LL | for<'b> <Self as X<'b>>::U: Clone,
- | ----- required by this bound in `X`
-...
-LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<i32 as X<'b>>::U`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `X`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-2.rs b/src/test/ui/associated-types/hr-associated-type-bound-2.rs
index 78ee28b..2eb956c 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-2.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-2.rs
@@ -8,14 +8,13 @@
}
}
-impl X<'_> for u32
+impl X<'_> for u32 //~ overflow evaluating the requirement `for<'b> u32: X<'b>`
where
for<'b> <Self as X<'b>>::U: Clone,
{
- type U = str;
+ type U = str; //~ overflow evaluating the requirement `for<'b> u32: X<'b>`
}
fn main() {
1u32.f("abc");
- //~^ ERROR the method
}
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
index 043d1ac..079989f 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
@@ -1,13 +1,38 @@
-error[E0599]: the method `f` exists for type `u32`, but its trait bounds were not satisfied
- --> $DIR/hr-associated-type-bound-2.rs:19:10
+error[E0275]: overflow evaluating the requirement `for<'b> u32: X<'b>`
+ --> $DIR/hr-associated-type-bound-2.rs:11:1
|
-LL | 1u32.f("abc");
- | ^ method cannot be called on `u32` due to unsatisfied trait bounds
+LL | / impl X<'_> for u32
+LL | | where
+LL | | for<'b> <Self as X<'b>>::U: Clone,
+LL | | {
+LL | | type U = str;
+LL | | }
+ | |_^
|
- = note: the following trait bounds were not satisfied:
- `<u32 as X<'b>>::U: Clone`
- which is required by `u32: X`
+ = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`hr_associated_type_bound_2`)
+note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
+ --> $DIR/hr-associated-type-bound-2.rs:11:6
+ |
+LL | impl X<'_> for u32
+ | ^^^^^ ^^^
+ = note: 128 redundant requirements hidden
+ = note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
-error: aborting due to previous error
+error[E0275]: overflow evaluating the requirement `for<'b> u32: X<'b>`
+ --> $DIR/hr-associated-type-bound-2.rs:15:5
+ |
+LL | type U = str;
+ | ^^^^^^^^^^^^^
+ |
+ = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`hr_associated_type_bound_2`)
+note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
+ --> $DIR/hr-associated-type-bound-2.rs:11:6
+ |
+LL | impl X<'_> for u32
+ | ^^^^^ ^^^
+ = note: 128 redundant requirements hidden
+ = note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
-For more information about this error, try `rustc --explain E0599`.
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-object.stderr b/src/test/ui/associated-types/hr-associated-type-bound-object.stderr
index 848924b..354f5ae 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-object.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-object.stderr
@@ -1,17 +1,19 @@
error[E0277]: the trait bound `for<'b> <T as X<'b>>::U: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-object.rs:7:13
|
-LL | trait X<'a>
- | - required by a bound in this
-LL | where
-LL | for<'b> <Self as X<'b>>::U: Clone,
- | ----- required by this bound in `X`
-...
LL | fn f<'a, T: X<'a> + ?Sized>(x: &<T as X<'a>>::U) {
| ^^^^^ the trait `for<'b> Clone` is not implemented for `<T as X<'b>>::U`
|
= help: the following implementations were found:
<&T as Clone>
+note: required by a bound in `X`
+ --> $DIR/hr-associated-type-bound-object.rs:3:33
+ |
+LL | trait X<'a>
+ | - required by a bound in this
+LL | where
+LL | for<'b> <Self as X<'b>>::U: Clone,
+ | ^^^^^ required by this bound in `X`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-1.rs b/src/test/ui/associated-types/hr-associated-type-bound-param-1.rs
index 0a81f37..bbeeb14 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-1.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-1.rs
@@ -12,7 +12,7 @@
impl<'a> Y<'a, u8> for u8 {
type V = str;
- //~^ ERROR the trait bound `for<'b> <u8 as Y<'b, u8>>::V: Clone` is not satisfied
+ //~^ ERROR the trait bound `str: Clone` is not satisfied
}
fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-1.stderr b/src/test/ui/associated-types/hr-associated-type-bound-param-1.stderr
index d35c127..99f95c2 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-1.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-1.stderr
@@ -1,17 +1,17 @@
-error[E0277]: the trait bound `for<'b> <u8 as Y<'b, u8>>::V: Clone` is not satisfied
+error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-1.rs:14:14
|
+LL | type V = str;
+ | ^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `Y`
+ --> $DIR/hr-associated-type-bound-param-1.rs:4:36
+ |
LL | trait Y<'a, T: ?Sized>
| - required by a bound in this
...
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
- | ----- required by this bound in `Y`
-...
-LL | type V = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<u8 as Y<'b, u8>>::V`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `Y`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs b/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs
index a04144b..5193400 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs
@@ -2,8 +2,8 @@
trait Z<'a, T: ?Sized>
where
T: Z<'a, u16>,
- //~^ the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
- //~| the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
+ //~^ the trait bound `str: Clone` is not satisfied
+ //~| the trait bound `str: Clone` is not satisfied
for<'b> <T as Z<'b, u16>>::W: Clone,
{
type W: ?Sized;
@@ -14,7 +14,7 @@
impl<'a> Z<'a, u16> for u16 {
type W = str;
- //~^ ERROR the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone
+ //~^ ERROR the trait bound `str: Clone
}
fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-2.stderr b/src/test/ui/associated-types/hr-associated-type-bound-param-2.stderr
index 0afa340..730229b 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-2.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-2.stderr
@@ -1,47 +1,47 @@
-error[E0277]: the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
+error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:4:8
|
+LL | T: Z<'a, u16>,
+ | ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `Z`
+ --> $DIR/hr-associated-type-bound-param-2.rs:7:35
+ |
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this
-LL | where
-LL | T: Z<'a, u16>,
- | ^^^^^^^^^^ the trait `for<'b> Clone` is not implemented for `<u16 as Z<'b, u16>>::W`
...
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
- | ----- required by this bound in `Z`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `Z`
-error[E0277]: the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
+error[E0277]: the trait bound `str: Clone` is not satisfied
+ --> $DIR/hr-associated-type-bound-param-2.rs:4:8
+ |
+LL | T: Z<'a, u16>,
+ | ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `Z`
+ --> $DIR/hr-associated-type-bound-param-2.rs:7:35
+ |
+LL | trait Z<'a, T: ?Sized>
+ | - required by a bound in this
+...
+LL | for<'b> <T as Z<'b, u16>>::W: Clone,
+ | ^^^^^ required by this bound in `Z`
+
+error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:16:14
|
-LL | trait Z<'a, T: ?Sized>
- | - required by a bound in this
-...
-LL | for<'b> <T as Z<'b, u16>>::W: Clone,
- | ----- required by this bound in `Z`
-...
LL | type W = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<u16 as Z<'b, u16>>::W`
+ | ^^^ the trait `Clone` is not implemented for `str`
|
- = help: the following implementations were found:
- <&T as Clone>
-
-error[E0277]: the trait bound `for<'b> <u16 as Z<'b, u16>>::W: Clone` is not satisfied
- --> $DIR/hr-associated-type-bound-param-2.rs:4:8
+note: required by a bound in `Z`
+ --> $DIR/hr-associated-type-bound-param-2.rs:7:35
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this
-LL | where
-LL | T: Z<'a, u16>,
- | ^^^^^^^^^^ the trait `for<'b> Clone` is not implemented for `<u16 as Z<'b, u16>>::W`
...
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
- | ----- required by this bound in `Z`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `Z`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-3.rs b/src/test/ui/associated-types/hr-associated-type-bound-param-3.rs
index 1af63bf..fda7d81 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-3.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-3.rs
@@ -11,7 +11,7 @@
impl<S, T> X<'_, (T,)> for (S,) {
type U = str;
- //~^ ERROR the trait bound `for<'b> <(T,) as X<'b, (T,)>>::U: Clone` is not satisfied
+ //~^ ERROR the trait bound `str: Clone` is not satisfied
}
pub fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-3.stderr b/src/test/ui/associated-types/hr-associated-type-bound-param-3.stderr
index 79e1e00..9935445 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-3.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-3.stderr
@@ -1,17 +1,17 @@
-error[E0277]: the trait bound `for<'b> <(T,) as X<'b, (T,)>>::U: Clone` is not satisfied
+error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-3.rs:13:14
|
+LL | type U = str;
+ | ^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `X`
+ --> $DIR/hr-associated-type-bound-param-3.rs:4:33
+ |
LL | trait X<'a, T>
| - required by a bound in this
...
LL | for<'b> <T as X<'b, T>>::U: Clone,
- | ----- required by this bound in `X`
-...
-LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<(T,) as X<'b, (T,)>>::U`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `X`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-4.rs b/src/test/ui/associated-types/hr-associated-type-bound-param-4.rs
index 6f06b92..20c8157 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-4.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-4.rs
@@ -11,7 +11,7 @@
impl<S, T> X<'_, T> for (S,) {
type U = str;
- //~^ ERROR the trait bound `for<'b> <(T,) as X<'b, T>>::U: Clone` is not satisfied
+ //~^ ERROR the trait bound `str: Clone` is not satisfied
}
pub fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-4.stderr b/src/test/ui/associated-types/hr-associated-type-bound-param-4.stderr
index e23ac5f..c26324e 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-4.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-4.stderr
@@ -1,17 +1,17 @@
-error[E0277]: the trait bound `for<'b> <(T,) as X<'b, T>>::U: Clone` is not satisfied
+error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-4.rs:13:14
|
+LL | type U = str;
+ | ^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `X`
+ --> $DIR/hr-associated-type-bound-param-4.rs:4:36
+ |
LL | trait X<'a, T>
| - required by a bound in this
...
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
- | ----- required by this bound in `X`
-...
-LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<(T,) as X<'b, T>>::U`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `X`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs b/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs
index fc3a851..920aa83 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs
@@ -25,14 +25,12 @@
impl<S, T> X<'_, Vec<T>> for S {
type U = str;
- //~^ ERROR the trait bound `for<'b> <Box<T> as X<'b, Box<T>>>::U: Clone` is not satisfied
- //~| ERROR the trait bound `for<'b> <Vec<T> as X<'b, Vec<T>>>::U: Clone` is not satisfied
+ //~^ ERROR the trait bound `str: Clone` is not satisfied
}
impl<S, T> X<'_, Box<T>> for S {
type U = str;
- //~^ ERROR the trait bound `for<'b> <Box<T> as X<'b, Box<T>>>::U: Clone` is not satisfied
- //~| ERROR the trait bound `for<'b> <Vec<T> as X<'b, Vec<T>>>::U: Clone` is not satisfied
+ //~^ ERROR the trait bound `str: Clone` is not satisfied
}
pub fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-5.stderr b/src/test/ui/associated-types/hr-associated-type-bound-param-5.stderr
index 38909be..63cd893 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-5.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-5.stderr
@@ -1,63 +1,33 @@
-error[E0277]: the trait bound `for<'b> <Box<T> as X<'b, Box<T>>>::U: Clone` is not satisfied
+error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:27:14
|
+LL | type U = str;
+ | ^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `X`
+ --> $DIR/hr-associated-type-bound-param-5.rs:18:45
+ |
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
- | ----- required by this bound in `X`
-...
-LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<Box<T> as X<'b, Box<T>>>::U`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `X`
-error[E0277]: the trait bound `for<'b> <Vec<T> as X<'b, Vec<T>>>::U: Clone` is not satisfied
- --> $DIR/hr-associated-type-bound-param-5.rs:27:14
+error[E0277]: the trait bound `str: Clone` is not satisfied
+ --> $DIR/hr-associated-type-bound-param-5.rs:32:14
|
-LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
- | - required by a bound in this
-LL | where
-LL | for<'b> <T as X<'b, T>>::U: Clone,
- | ----- required by this bound in `X`
-...
LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<Vec<T> as X<'b, Vec<T>>>::U`
+ | ^^^ the trait `Clone` is not implemented for `str`
|
- = help: the following implementations were found:
- <&T as Clone>
-
-error[E0277]: the trait bound `for<'b> <Vec<T> as X<'b, Vec<T>>>::U: Clone` is not satisfied
- --> $DIR/hr-associated-type-bound-param-5.rs:33:14
+note: required by a bound in `X`
+ --> $DIR/hr-associated-type-bound-param-5.rs:18:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this
...
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
- | ----- required by this bound in `X`
-...
-LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<Vec<T> as X<'b, Vec<T>>>::U`
- |
- = help: the following implementations were found:
- <&T as Clone>
+ | ^^^^^ required by this bound in `X`
-error[E0277]: the trait bound `for<'b> <Box<T> as X<'b, Box<T>>>::U: Clone` is not satisfied
- --> $DIR/hr-associated-type-bound-param-5.rs:33:14
- |
-LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
- | - required by a bound in this
-LL | where
-LL | for<'b> <T as X<'b, T>>::U: Clone,
- | ----- required by this bound in `X`
-...
-LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<Box<T> as X<'b, Box<T>>>::U`
- |
- = help: the following implementations were found:
- <&T as Clone>
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-6.rs b/src/test/ui/associated-types/hr-associated-type-bound-param-6.rs
index 04b88c7..482047b 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-6.rs
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-6.rs
@@ -12,7 +12,6 @@
impl<S, T> X<'_, T> for (S,) {
//~^ ERROR the trait bound `for<'b> T: X<'b, T>` is not satisfied
type U = str;
- //~^ ERROR the trait bound `for<'b> <T as X<'b, T>>::U: Clone` is not satisfied
}
pub fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-param-6.stderr b/src/test/ui/associated-types/hr-associated-type-bound-param-6.stderr
index 6e02b42..bd6e627 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-param-6.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-param-6.stderr
@@ -1,35 +1,14 @@
-error[E0277]: the trait bound `for<'b> <T as X<'b, T>>::U: Clone` is not satisfied
- --> $DIR/hr-associated-type-bound-param-6.rs:14:14
- |
-LL | trait X<'a, T>
- | - required by a bound in this
-...
-LL | for<'b> <T as X<'b, T>>::U: Clone,
- | ----- required by this bound in `X`
-...
-LL | type U = str;
- | ^^^ the trait `for<'b> Clone` is not implemented for `<T as X<'b, T>>::U`
- |
- = help: the following implementations were found:
- <&T as Clone>
-
error[E0277]: the trait bound `for<'b> T: X<'b, T>` is not satisfied
--> $DIR/hr-associated-type-bound-param-6.rs:12:12
|
-LL | trait X<'a, T>
- | - required by a bound in this
-LL | where
-LL | for<'b> T: X<'b, T>,
- | -------- required by this bound in `X`
-...
LL | impl<S, T> X<'_, T> for (S,) {
| ^^^^^^^^ the trait `for<'b> X<'b, T>` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
LL | impl<S, T: for<'b> X<'b, T>> X<'_, T> for (S,) {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/associated-types/hr-associated-type-projection-1.rs b/src/test/ui/associated-types/hr-associated-type-projection-1.rs
index bad736b..951dd9e 100644
--- a/src/test/ui/associated-types/hr-associated-type-projection-1.rs
+++ b/src/test/ui/associated-types/hr-associated-type-projection-1.rs
@@ -11,9 +11,8 @@
}
impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
- //~^ ERROR the trait bound `for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref` is not satisfied
+ //~^ type mismatch resolving `<T as Deref>::Target == T`
type Item = T;
- //~^ ERROR the trait bound `for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref
}
pub fn main() {
diff --git a/src/test/ui/associated-types/hr-associated-type-projection-1.stderr b/src/test/ui/associated-types/hr-associated-type-projection-1.stderr
index 49fad4e..9c29e96 100644
--- a/src/test/ui/associated-types/hr-associated-type-projection-1.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-projection-1.stderr
@@ -1,30 +1,16 @@
-error[E0277]: the trait bound `for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref` is not satisfied
- --> $DIR/hr-associated-type-projection-1.rs:15:17
- |
-LL | trait UnsafeCopy<'a, T: Copy>
- | ---------- required by a bound in this
-LL | where
-LL | for<'b> <Self as UnsafeCopy<'b, T>>::Item: std::ops::Deref<Target = T>,
- | --------------------------- required by this bound in `UnsafeCopy`
-...
-LL | type Item = T;
- | ^ the trait `for<'b> Deref` is not implemented for `<T as UnsafeCopy<'b, T>>::Item`
- |
- = help: the following implementations were found:
- <&T as Deref>
- <&mut T as Deref>
-
-error[E0277]: the trait bound `for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref` is not satisfied
+error[E0271]: type mismatch resolving `<T as Deref>::Target == T`
--> $DIR/hr-associated-type-projection-1.rs:13:33
|
LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
- | ^^^^^^^^^^^^^^^^^ the trait `for<'b> Deref` is not implemented for `<T as UnsafeCopy<'b, T>>::Item`
+ | - this type parameter ^^^^^^^^^^^^^^^^^ expected associated type, found type parameter `T`
|
-help: consider further restricting the associated type
+ = note: expected associated type `<T as Deref>::Target`
+ found type parameter `T`
+help: consider further restricting this bound
|
-LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T where for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | impl<T: Copy + std::ops::Deref + Deref<Target = T>> UnsafeCopy<'_, T> for T {
+ | +++++++++++++++++++
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/associated-types/impl-trait-return-missing-constraint.stderr b/src/test/ui/associated-types/impl-trait-return-missing-constraint.stderr
index 89e05b6..283ecea 100644
--- a/src/test/ui/associated-types/impl-trait-return-missing-constraint.stderr
+++ b/src/test/ui/associated-types/impl-trait-return-missing-constraint.stderr
@@ -12,7 +12,7 @@
help: consider constraining the associated type `<impl Bar as Foo>::Item` to `i32`
|
LL | fn bar() -> impl Bar<Item = i32> {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-20005.stderr b/src/test/ui/associated-types/issue-20005.stderr
index bc41404..c8e57df 100644
--- a/src/test/ui/associated-types/issue-20005.stderr
+++ b/src/test/ui/associated-types/issue-20005.stderr
@@ -1,20 +1,22 @@
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-20005.rs:10:49
|
-LL | trait From<Src> {
- | --- required by this bound in `From`
-...
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
+note: required by a bound in `From`
+ --> $DIR/issue-20005.rs:1:12
+ |
+LL | trait From<Src> {
+ | ^^^ required by this bound in `From`
help: consider further restricting `Self`
|
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self>, Self: Sized {
- | ^^^^^^^^^^^^^
+ | +++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | trait From<Src: ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-22037.stderr b/src/test/ui/associated-types/issue-22037.stderr
index 6156285..0e019f1 100644
--- a/src/test/ui/associated-types/issue-22037.stderr
+++ b/src/test/ui/associated-types/issue-22037.stderr
@@ -1,8 +1,13 @@
error[E0576]: cannot find associated type `X` in trait `A`
--> $DIR/issue-22037.rs:3:33
|
+LL | type Output;
+ | ------------ associated type `Output` defined here
LL | fn a(&self) -> <Self as A>::X;
- | ^ not found in `A`
+ | ^
+ | |
+ | not found in `A`
+ | help: maybe you meant this associated type: `Output`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-22560.stderr b/src/test/ui/associated-types/issue-22560.stderr
index 9dda991..d2193cc 100644
--- a/src/test/ui/associated-types/issue-22560.stderr
+++ b/src/test/ui/associated-types/issue-22560.stderr
@@ -52,7 +52,7 @@
help: specify the associated types
|
LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
index b6122bd..e365727 100644
--- a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
+++ b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-27675-unchecked-bounds.rs:15:31
|
-LL | fn copy<U: Setup + ?Sized>(from: &U::From) -> U::From {
- | ----- required by this bound in `copy`
-...
LL | copy::<dyn Setup<From=T>>(t)
| ^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `copy`
+ --> $DIR/issue-27675-unchecked-bounds.rs:10:12
+ |
+LL | fn copy<U: Setup + ?Sized>(from: &U::From) -> U::From {
+ | ^^^^^ required by this bound in `copy`
help: consider restricting type parameter `T`
|
LL | pub fn copy_any<T: std::marker::Copy>(t: &T) -> T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-43784-associated-type.stderr b/src/test/ui/associated-types/issue-43784-associated-type.stderr
index 0e653a7..a3ed1c1 100644
--- a/src/test/ui/associated-types/issue-43784-associated-type.stderr
+++ b/src/test/ui/associated-types/issue-43784-associated-type.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-43784-associated-type.rs:14:5
|
-LL | type Assoc: Partial<Self>;
- | ------------- required by this bound in `Complete::Assoc`
-...
LL | type Assoc = T;
| ^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `Complete::Assoc`
+ --> $DIR/issue-43784-associated-type.rs:5:17
+ |
+LL | type Assoc: Partial<Self>;
+ | ^^^^^^^^^^^^^ required by this bound in `Complete::Assoc`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Complete for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-43924.stderr b/src/test/ui/associated-types/issue-43924.stderr
index 8d4ecac..b7fbf89 100644
--- a/src/test/ui/associated-types/issue-43924.stderr
+++ b/src/test/ui/associated-types/issue-43924.stderr
@@ -2,10 +2,13 @@
--> $DIR/issue-43924.rs:7:5
|
LL | type Out: Default + ToString + ?Sized = dyn ToString;
- | ^^^^^^^^^^-------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | required by this bound in `Foo::Out`
- | the trait `Default` is not implemented for `(dyn ToString + 'static)`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `(dyn ToString + 'static)`
+ |
+note: required by a bound in `Foo::Out`
+ --> $DIR/issue-43924.rs:7:15
+ |
+LL | type Out: Default + ToString + ?Sized = dyn ToString;
+ | ^^^^^^^ required by this bound in `Foo::Out`
error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope
--> $DIR/issue-43924.rs:14:39
diff --git a/src/test/ui/associated-types/issue-54108.stderr b/src/test/ui/associated-types/issue-54108.stderr
index 927a2de..70e688b 100644
--- a/src/test/ui/associated-types/issue-54108.stderr
+++ b/src/test/ui/associated-types/issue-54108.stderr
@@ -1,17 +1,19 @@
error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
--> $DIR/issue-54108.rs:19:5
|
-LL | type Size: Add<Output = Self::Size>;
- | ------------------------ required by this bound in `Encoder::Size`
-...
LL | type Size = <Self as SubEncoder>::ActualSize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `<T as SubEncoder>::ActualSize + <T as SubEncoder>::ActualSize`
|
= help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize`
+note: required by a bound in `Encoder::Size`
+ --> $DIR/issue-54108.rs:4:16
+ |
+LL | type Size: Add<Output = Self::Size>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
help: consider further restricting the associated type
|
LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-63591.full_tait.stderr b/src/test/ui/associated-types/issue-63591.full_tait.stderr
deleted file mode 100644
index 9857f7e..0000000
--- a/src/test/ui/associated-types/issue-63591.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-63591.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/associated-types/issue-63591.rs b/src/test/ui/associated-types/issue-63591.rs
index bba9ae2..4d2e39f 100644
--- a/src/test/ui/associated-types/issue-63591.rs
+++ b/src/test/ui/associated-types/issue-63591.rs
@@ -1,10 +1,7 @@
// check-pass
#![feature(associated_type_bounds)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/associated-types/issue-63593.stderr b/src/test/ui/associated-types/issue-63593.stderr
index 16ae076..70449b0 100644
--- a/src/test/ui/associated-types/issue-63593.stderr
+++ b/src/test/ui/associated-types/issue-63593.stderr
@@ -2,15 +2,17 @@
--> $DIR/issue-63593.rs:9:5
|
LL | type This = Self;
- | ^^^^^^^^^^^^^^^^^
- | |
- | doesn't have a size known at compile-time
- | required by this bound in `MyTrait::This`
+ | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
+note: required by a bound in `MyTrait::This`
+ --> $DIR/issue-63593.rs:9:5
+ |
+LL | type This = Self;
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `MyTrait::This`
help: consider further restricting `Self`
|
LL | trait MyTrait: Sized {
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-65774-1.stderr b/src/test/ui/associated-types/issue-65774-1.stderr
index fc020e4..abe1b76 100644
--- a/src/test/ui/associated-types/issue-65774-1.stderr
+++ b/src/test/ui/associated-types/issue-65774-1.stderr
@@ -2,10 +2,13 @@
--> $DIR/issue-65774-1.rs:10:5
|
LL | type MpuConfig: MyDisplay = T;
- | ^^^^^^^^^^^^^^^^---------^^^^^
- | | |
- | | required by this bound in `MPU::MpuConfig`
- | the trait `MyDisplay` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyDisplay` is not implemented for `T`
+ |
+note: required by a bound in `MPU::MpuConfig`
+ --> $DIR/issue-65774-1.rs:10:21
+ |
+LL | type MpuConfig: MyDisplay = T;
+ | ^^^^^^^^^ required by this bound in `MPU::MpuConfig`
error[E0277]: the trait bound `T: MyDisplay` is not satisfied
--> $DIR/issue-65774-1.rs:44:76
diff --git a/src/test/ui/associated-types/issue-65774-2.stderr b/src/test/ui/associated-types/issue-65774-2.stderr
index 572a9cf..9393cd4 100644
--- a/src/test/ui/associated-types/issue-65774-2.stderr
+++ b/src/test/ui/associated-types/issue-65774-2.stderr
@@ -2,10 +2,13 @@
--> $DIR/issue-65774-2.rs:10:5
|
LL | type MpuConfig: MyDisplay = T;
- | ^^^^^^^^^^^^^^^^---------^^^^^
- | | |
- | | required by this bound in `MPU::MpuConfig`
- | the trait `MyDisplay` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyDisplay` is not implemented for `T`
+ |
+note: required by a bound in `MPU::MpuConfig`
+ --> $DIR/issue-65774-2.rs:10:21
+ |
+LL | type MpuConfig: MyDisplay = T;
+ | ^^^^^^^^^ required by this bound in `MPU::MpuConfig`
error[E0277]: the trait bound `T: MyDisplay` is not satisfied
--> $DIR/issue-65774-2.rs:39:25
diff --git a/src/test/ui/associated-types/issue-72806.stderr b/src/test/ui/associated-types/issue-72806.stderr
index 23fabbe..ea98e21 100644
--- a/src/test/ui/associated-types/issue-72806.stderr
+++ b/src/test/ui/associated-types/issue-72806.stderr
@@ -1,11 +1,14 @@
error[E0271]: type mismatch resolving `<Foo2 as Bar2>::Ok == char`
--> $DIR/issue-72806.rs:14:5
|
-LL | type Sibling: Bar2<Ok=char>;
- | ------- required by this bound in `Bar::Sibling`
-...
LL | type Sibling = Foo2;
| ^^^^^^^^^^^^^^^^^^^^ expected `char`, found `u32`
+ |
+note: required by a bound in `Bar::Sibling`
+ --> $DIR/issue-72806.rs:3:24
+ |
+LL | type Sibling: Bar2<Ok=char>;
+ | ^^^^^^^ required by this bound in `Bar::Sibling`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-87261.rs b/src/test/ui/associated-types/issue-87261.rs
new file mode 100644
index 0000000..a70f771
--- /dev/null
+++ b/src/test/ui/associated-types/issue-87261.rs
@@ -0,0 +1,99 @@
+trait Foo {}
+
+trait Trait {
+ type Associated;
+}
+trait DerivedTrait: Trait {}
+trait GenericTrait<A> {
+ type Associated;
+}
+
+struct Impl;
+impl Foo for Impl {}
+impl Trait for Impl {
+ type Associated = ();
+}
+impl DerivedTrait for Impl {}
+impl<A> GenericTrait<A> for Impl {
+ type Associated = ();
+}
+
+fn returns_opaque() -> impl Trait + 'static {
+ Impl
+}
+fn returns_opaque_derived() -> impl DerivedTrait + 'static {
+ Impl
+}
+fn returns_opaque_foo() -> impl Trait + Foo {
+ Impl
+}
+fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
+ Impl
+}
+fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
+ Impl
+}
+fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
+ Impl
+}
+fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
+ Impl
+}
+
+fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
+
+fn check_generics<A, B, C, D, E, F, G>(a: A, b: B, c: C, d: D, e: E, f: F, g: G)
+where
+ A: Trait + 'static,
+ B: DerivedTrait + 'static,
+ C: Trait + Foo,
+ D: DerivedTrait + Foo,
+ E: GenericTrait<()> + 'static,
+ F: GenericTrait<()> + Foo,
+ G: GenericTrait<()> + GenericTrait<u8>,
+{
+ accepts_trait(a);
+ //~^ ERROR type mismatch resolving `<A as Trait>::Associated == ()`
+
+ accepts_trait(b);
+ //~^ ERROR type mismatch resolving `<B as Trait>::Associated == ()`
+
+ accepts_trait(c);
+ //~^ ERROR type mismatch resolving `<C as Trait>::Associated == ()`
+
+ accepts_trait(d);
+ //~^ ERROR type mismatch resolving `<D as Trait>::Associated == ()`
+
+ accepts_generic_trait(e);
+ //~^ ERROR type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
+
+ accepts_generic_trait(f);
+ //~^ ERROR type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
+
+ accepts_generic_trait(g);
+ //~^ ERROR type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
+}
+
+fn main() {
+ accepts_trait(returns_opaque());
+ //~^ ERROR type mismatch resolving `<impl Trait as Trait>::Associated == ()`
+
+ accepts_trait(returns_opaque_derived());
+ //~^ ERROR type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
+
+ accepts_trait(returns_opaque_foo());
+ //~^ ERROR type mismatch resolving `<impl Trait+Foo as Trait>::Associated == ()`
+
+ accepts_trait(returns_opaque_derived_foo());
+ //~^ ERROR type mismatch resolving `<impl DerivedTrait+Foo as Trait>::Associated == ()`
+
+ accepts_generic_trait(returns_opaque_generic());
+ //~^ ERROR type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
+
+ accepts_generic_trait(returns_opaque_generic_foo());
+ //~^ ERROR type mismatch resolving `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated == ()`
+
+ accepts_generic_trait(returns_opaque_generic_duplicate());
+ //~^ ERROR type mismatch resolving `<impl GenericTrait<()>+GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
+}
diff --git a/src/test/ui/associated-types/issue-87261.stderr b/src/test/ui/associated-types/issue-87261.stderr
new file mode 100644
index 0000000..b85d64b8
--- /dev/null
+++ b/src/test/ui/associated-types/issue-87261.stderr
@@ -0,0 +1,266 @@
+error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:56:5
+ |
+LL | accepts_trait(a);
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<A as Trait>::Associated`
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+help: consider constraining the associated type `<A as Trait>::Associated` to `()`
+ |
+LL | A: Trait<Associated = ()> + 'static,
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:59:5
+ |
+LL | accepts_trait(b);
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<B as Trait>::Associated`
+ = help: consider constraining the associated type `<B as Trait>::Associated` to `()`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+
+error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:62:5
+ |
+LL | accepts_trait(c);
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<C as Trait>::Associated`
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+help: consider constraining the associated type `<C as Trait>::Associated` to `()`
+ |
+LL | C: Trait<Associated = ()> + Foo,
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:65:5
+ |
+LL | accepts_trait(d);
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<D as Trait>::Associated`
+ = help: consider constraining the associated type `<D as Trait>::Associated` to `()`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+
+error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
+ --> $DIR/issue-87261.rs:68:5
+ |
+LL | accepts_generic_trait(e);
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<E as GenericTrait<()>>::Associated`
+note: required by a bound in `accepts_generic_trait`
+ --> $DIR/issue-87261.rs:44:46
+ |
+LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
+help: consider constraining the associated type `<E as GenericTrait<()>>::Associated` to `()`
+ |
+LL | E: GenericTrait<(), Associated = ()> + 'static,
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
+ --> $DIR/issue-87261.rs:71:5
+ |
+LL | accepts_generic_trait(f);
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<F as GenericTrait<()>>::Associated`
+note: required by a bound in `accepts_generic_trait`
+ --> $DIR/issue-87261.rs:44:46
+ |
+LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
+help: consider constraining the associated type `<F as GenericTrait<()>>::Associated` to `()`
+ |
+LL | F: GenericTrait<(), Associated = ()> + Foo,
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
+ --> $DIR/issue-87261.rs:74:5
+ |
+LL | accepts_generic_trait(g);
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<G as GenericTrait<()>>::Associated`
+ = help: consider constraining the associated type `<G as GenericTrait<()>>::Associated` to `()`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+note: required by a bound in `accepts_generic_trait`
+ --> $DIR/issue-87261.rs:44:46
+ |
+LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
+
+error[E0271]: type mismatch resolving `<impl Trait as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:79:5
+ |
+LL | fn returns_opaque() -> impl Trait + 'static {
+ | -------------------- the found opaque type
+...
+LL | accepts_trait(returns_opaque());
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<impl Trait as Trait>::Associated`
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+help: consider constraining the associated type `<impl Trait as Trait>::Associated` to `()`
+ |
+LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:82:5
+ |
+LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
+ | --------------------------- the found opaque type
+...
+LL | accepts_trait(returns_opaque_derived());
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<impl DerivedTrait as Trait>::Associated`
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+help: consider constraining the associated type `<impl DerivedTrait as Trait>::Associated` to `()`
+ |
+LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<impl Trait+Foo as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:85:5
+ |
+LL | fn returns_opaque_foo() -> impl Trait + Foo {
+ | ---------------- the found opaque type
+...
+LL | accepts_trait(returns_opaque_foo());
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<impl Trait+Foo as Trait>::Associated`
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+help: consider constraining the associated type `<impl Trait+Foo as Trait>::Associated` to `()`
+ |
+LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<impl DerivedTrait+Foo as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:88:5
+ |
+LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
+ | ----------------------- the found opaque type
+...
+LL | accepts_trait(returns_opaque_derived_foo());
+ | ^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<impl DerivedTrait+Foo as Trait>::Associated`
+ = help: consider constraining the associated type `<impl DerivedTrait+Foo as Trait>::Associated` to `()`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+note: required by a bound in `accepts_trait`
+ --> $DIR/issue-87261.rs:43:27
+ |
+LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
+
+error[E0271]: type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
+ --> $DIR/issue-87261.rs:91:5
+ |
+LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
+ | ------------------------------- the found opaque type
+...
+LL | accepts_generic_trait(returns_opaque_generic());
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated`
+note: required by a bound in `accepts_generic_trait`
+ --> $DIR/issue-87261.rs:44:46
+ |
+LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
+help: consider constraining the associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` to `()`
+ |
+LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated == ()`
+ --> $DIR/issue-87261.rs:94:5
+ |
+LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
+ | --------------------------- the found opaque type
+...
+LL | accepts_generic_trait(returns_opaque_generic_foo());
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated`
+note: required by a bound in `accepts_generic_trait`
+ --> $DIR/issue-87261.rs:44:46
+ |
+LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
+help: consider constraining the associated type `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated` to `()`
+ |
+LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
+ | +++++++++++++++++
+
+error[E0271]: type mismatch resolving `<impl GenericTrait<()>+GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
+ --> $DIR/issue-87261.rs:97:5
+ |
+LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
+ | ---------------------------------------- the found opaque type
+...
+LL | accepts_generic_trait(returns_opaque_generic_duplicate());
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ |
+ = note: expected unit type `()`
+ found associated type `<impl GenericTrait<()>+GenericTrait<u8> as GenericTrait<()>>::Associated`
+ = help: consider constraining the associated type `<impl GenericTrait<()>+GenericTrait<u8> as GenericTrait<()>>::Associated` to `()`
+ = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
+note: required by a bound in `accepts_generic_trait`
+ --> $DIR/issue-87261.rs:44:46
+ |
+LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
+
+error: aborting due to 14 previous errors
+
+For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/associated-types/missing-associated-types.stderr b/src/test/ui/associated-types/missing-associated-types.stderr
index 6316448..340d4e2 100644
--- a/src/test/ui/associated-types/missing-associated-types.stderr
+++ b/src/test/ui/associated-types/missing-associated-types.stderr
@@ -25,7 +25,7 @@
help: specify the associated types
|
LL | type Foo<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs, Output = Type> + Y<Rhs, A = Type>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:15:32
@@ -61,7 +61,7 @@
help: specify the associated types
|
LL | type Bar<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs> + Z<Rhs, A = Type, B = Type, Output = Type>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:18:32
@@ -89,7 +89,7 @@
help: specify the associated types
|
LL | type Baz<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Y<Rhs, A = Type>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:21:32
@@ -113,7 +113,7 @@
help: specify the associated types
|
LL | type Bat<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Fine<Rhs>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
error[E0191]: the value of the associated types `Output` (from trait `Div`), `Output` (from trait `Mul`) must be specified
--> $DIR/missing-associated-types.rs:24:21
diff --git a/src/test/ui/associated-types/normalization-generality-2.rs b/src/test/ui/associated-types/normalization-generality-2.rs
new file mode 100644
index 0000000..d8790bb
--- /dev/null
+++ b/src/test/ui/associated-types/normalization-generality-2.rs
@@ -0,0 +1,30 @@
+// build-pass
+
+// Ensures that we don't regress on "implementation is not general enough" when
+// normalizating under binders. Unlike `normalization-generality.rs`, this also produces
+// type outlives predicates that we must ignore.
+
+pub unsafe trait Yokeable<'a> {
+ type Output: 'a;
+}
+pub struct Yoke<Y: for<'a> Yokeable<'a>> {
+ _marker: std::marker::PhantomData<Y>,
+}
+impl<Y: for<'a> Yokeable<'a>> Yoke<Y> {
+ pub fn project<P>(
+ &self,
+ _f: for<'a> fn(&<Y as Yokeable<'a>>::Output, &'a ()) -> <P as Yokeable<'a>>::Output,
+ ) -> Yoke<P>
+ where
+ P: for<'a> Yokeable<'a>,
+ {
+ unimplemented!()
+ }
+}
+pub fn slice(y: Yoke<&'static str>) -> Yoke<&'static [u8]> {
+ y.project(move |yk, _| yk.as_bytes())
+}
+unsafe impl<'a, T: 'static + ?Sized> Yokeable<'a> for &'static T {
+ type Output = &'a T;
+}
+fn main() {}
diff --git a/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr b/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr
index b23030d..f940683 100644
--- a/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr
+++ b/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr
@@ -1,35 +1,44 @@
error[E0277]: the trait bound `bool: Bar` is not satisfied
--> $DIR/point-at-type-on-obligation-failure-2.rs:8:5
|
-LL | type Assoc: Bar;
- | --- required by this bound in `Foo::Assoc`
-...
LL | type Assoc = bool;
| ^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `bool`
+ |
+note: required by a bound in `Foo::Assoc`
+ --> $DIR/point-at-type-on-obligation-failure-2.rs:4:17
+ |
+LL | type Assoc: Bar;
+ | ^^^ required by this bound in `Foo::Assoc`
error[E0277]: the trait bound `bool: Bar` is not satisfied
--> $DIR/point-at-type-on-obligation-failure-2.rs:19:5
|
+LL | type Assoc = bool;
+ | ^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `bool`
+ |
+note: required by a bound in `Baz::Assoc`
+ --> $DIR/point-at-type-on-obligation-failure-2.rs:13:18
+ |
LL | Self::Assoc: Bar,
- | --- required by this bound in `Baz::Assoc`
+ | ^^^ required by this bound in `Baz::Assoc`
LL | {
LL | type Assoc;
| ----- required by a bound in this
-...
-LL | type Assoc = bool;
- | ^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `bool`
error[E0277]: the trait bound `bool: Bar` is not satisfied
--> $DIR/point-at-type-on-obligation-failure-2.rs:30:5
|
+LL | type Assoc = bool;
+ | ^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `bool`
+ |
+note: required by a bound in `Bat::Assoc`
+ --> $DIR/point-at-type-on-obligation-failure-2.rs:24:27
+ |
LL | <Self as Bat>::Assoc: Bar,
- | --- required by this bound in `Bat::Assoc`
+ | ^^^ required by this bound in `Bat::Assoc`
LL | {
LL | type Assoc;
| ----- required by a bound in this
-...
-LL | type Assoc = bool;
- | ^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `bool`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr
index 7417a5a..85ecba6 100644
--- a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr
+++ b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr
@@ -1,11 +1,14 @@
error[E0271]: type mismatch resolving `<Foo2 as Bar2>::Ok == ()`
--> $DIR/point-at-type-on-obligation-failure.rs:14:5
|
-LL | type Sibling: Bar2<Ok=Self::Ok>;
- | ----------- required by this bound in `Bar::Sibling`
-...
LL | type Sibling = Foo2;
| ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `u32`
+ |
+note: required by a bound in `Bar::Sibling`
+ --> $DIR/point-at-type-on-obligation-failure.rs:3:24
+ |
+LL | type Sibling: Bar2<Ok=Self::Ok>;
+ | ^^^^^^^^^^^ required by this bound in `Bar::Sibling`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr
index 8fdca54..558b0f5 100644
--- a/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr
+++ b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr
@@ -3,16 +3,16 @@
|
LL | trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> {}
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ |
+note: required by a bound in `Add`
+ --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
|
LL | pub trait Add<Rhs = Self> {
- | --- required by this bound in `Add`
- |
+ | ^^^ required by this bound in `Add`
help: consider further restricting `Self`
|
LL | trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> + Sized {}
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
diff --git a/src/test/ui/ast-json/ast-json-ice.rs b/src/test/ui/ast-json/ast-json-ice.rs
index bbdd7e3..1a19883 100644
--- a/src/test/ui/ast-json/ast-json-ice.rs
+++ b/src/test/ui/ast-json/ast-json-ice.rs
@@ -9,6 +9,7 @@
// dont-check-compiler-stdout - don't check for any AST change.
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
enum V {
A(i32),
diff --git a/src/test/ui/ast-json/ast-json-noexpand-output.stdout b/src/test/ui/ast-json/ast-json-noexpand-output.stdout
index 0307875..8961655 100644
--- a/src/test/ui/ast-json/ast-json-noexpand-output.stdout
+++ b/src/test/ui/ast-json/ast-json-noexpand-output.stdout
@@ -1 +1 @@
-{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"crate_type","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":{"variant":"Eq","fields":[{"lo":0,"hi":0},{"kind":{"variant":"Interpolated","fields":[{"variant":"NtExpr","fields":[{"id":0,"kind":{"variant":"Lit","fields":[{"token":{"kind":"Str","symbol":"lib","suffix":null},"kind":{"variant":"Str","fields":["lib","Cooked"]},"span":{"lo":0,"hi":0}}]},"span":{"lo":0,"hi":0},"attrs":{"0":null},"tokens":{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}}]}]},"span":{"lo":0,"hi":0}}]},"tokens":null},{"0":[[{"variant":"Token","fields":[{"kind":"Pound","span":{"lo":0,"hi":0}}]},"Joint"],[{"variant":"Token","fields":[{"kind":"Not","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Delimited","fields":[{"open":{"lo":0,"hi":0},"close":{"lo":0,"hi":0}},"Bracket",{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["crate_type",false]},"span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":"Eq","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}]},"Alone"]]}]},"id":null,"style":"Inner","span":{"lo":0,"hi":0}}],"items":[{"attrs":[],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"core","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null}],"span":{"lo":0,"hi":0},"proc_macros":[]}
+{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"crate_type","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":{"variant":"Eq","fields":[{"lo":0,"hi":0},{"kind":{"variant":"Interpolated","fields":[{"variant":"NtExpr","fields":[{"id":0,"kind":{"variant":"Lit","fields":[{"token":{"kind":"Str","symbol":"lib","suffix":null},"kind":{"variant":"Str","fields":["lib","Cooked"]},"span":{"lo":0,"hi":0}}]},"span":{"lo":0,"hi":0},"attrs":{"0":null},"tokens":{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}}]}]},"span":{"lo":0,"hi":0}}]},"tokens":null},{"0":[[{"variant":"Token","fields":[{"kind":"Pound","span":{"lo":0,"hi":0}}]},"Joint"],[{"variant":"Token","fields":[{"kind":"Not","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Delimited","fields":[{"open":{"lo":0,"hi":0},"close":{"lo":0,"hi":0}},"Bracket",{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["crate_type",false]},"span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":"Eq","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}]},"Alone"]]}]},"id":null,"style":"Inner","span":{"lo":0,"hi":0}}],"items":[{"attrs":[],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"core","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null}],"span":{"lo":0,"hi":0}}
diff --git a/src/test/ui/ast-json/ast-json-output.stdout b/src/test/ui/ast-json/ast-json-output.stdout
index 535f57b..082f041 100644
--- a/src/test/ui/ast-json/ast-json-output.stdout
+++ b/src/test/ui/ast-json/ast-json-output.stdout
@@ -1 +1 @@
-{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"crate_type","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":{"variant":"Eq","fields":[{"lo":0,"hi":0},{"kind":{"variant":"Interpolated","fields":[{"variant":"NtExpr","fields":[{"id":0,"kind":{"variant":"Lit","fields":[{"token":{"kind":"Str","symbol":"lib","suffix":null},"kind":{"variant":"Str","fields":["lib","Cooked"]},"span":{"lo":0,"hi":0}}]},"span":{"lo":0,"hi":0},"attrs":{"0":null},"tokens":{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}}]}]},"span":{"lo":0,"hi":0}}]},"tokens":null},{"0":[[{"variant":"Token","fields":[{"kind":"Pound","span":{"lo":0,"hi":0}}]},"Joint"],[{"variant":"Token","fields":[{"kind":"Not","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Delimited","fields":[{"open":{"lo":0,"hi":0},"close":{"lo":0,"hi":0}},"Bracket",{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["crate_type",false]},"span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":"Eq","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}]},"Alone"]]}]},"id":null,"style":"Inner","span":{"lo":0,"hi":0}}],"items":[{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"prelude_import","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":"Empty","tokens":null},null]},"id":null,"style":"Outer","span":{"lo":0,"hi":0}}],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"","span":{"lo":0,"hi":0}},"kind":{"variant":"Use","fields":[{"prefix":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"{{root}}","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"std","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"prelude","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"rust_2015","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"kind":"Glob","span":{"lo":0,"hi":0}}]},"tokens":null},{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"macro_use","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":"Empty","tokens":null},null]},"id":null,"style":"Outer","span":{"lo":0,"hi":0}}],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"std","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null},{"attrs":[],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"core","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null}],"span":{"lo":0,"hi":0},"proc_macros":[]}
+{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"crate_type","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":{"variant":"Eq","fields":[{"lo":0,"hi":0},{"kind":{"variant":"Interpolated","fields":[{"variant":"NtExpr","fields":[{"id":0,"kind":{"variant":"Lit","fields":[{"token":{"kind":"Str","symbol":"lib","suffix":null},"kind":{"variant":"Str","fields":["lib","Cooked"]},"span":{"lo":0,"hi":0}}]},"span":{"lo":0,"hi":0},"attrs":{"0":null},"tokens":{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}}]}]},"span":{"lo":0,"hi":0}}]},"tokens":null},{"0":[[{"variant":"Token","fields":[{"kind":"Pound","span":{"lo":0,"hi":0}}]},"Joint"],[{"variant":"Token","fields":[{"kind":"Not","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Delimited","fields":[{"open":{"lo":0,"hi":0},"close":{"lo":0,"hi":0}},"Bracket",{"0":[[{"variant":"Token","fields":[{"kind":{"variant":"Ident","fields":["crate_type",false]},"span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":"Eq","span":{"lo":0,"hi":0}}]},"Alone"],[{"variant":"Token","fields":[{"kind":{"variant":"Literal","fields":[{"kind":"Str","symbol":"lib","suffix":null}]},"span":{"lo":0,"hi":0}}]},"Alone"]]}]},"Alone"]]}]},"id":null,"style":"Inner","span":{"lo":0,"hi":0}}],"items":[{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"prelude_import","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":"Empty","tokens":null},null]},"id":null,"style":"Outer","span":{"lo":0,"hi":0}}],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"","span":{"lo":0,"hi":0}},"kind":{"variant":"Use","fields":[{"prefix":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"{{root}}","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"std","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"prelude","span":{"lo":0,"hi":0}},"id":0,"args":null},{"ident":{"name":"rust_2015","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"kind":"Glob","span":{"lo":0,"hi":0}}]},"tokens":null},{"attrs":[{"kind":{"variant":"Normal","fields":[{"path":{"span":{"lo":0,"hi":0},"segments":[{"ident":{"name":"macro_use","span":{"lo":0,"hi":0}},"id":0,"args":null}],"tokens":null},"args":"Empty","tokens":null},null]},"id":null,"style":"Outer","span":{"lo":0,"hi":0}}],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"std","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null},{"attrs":[],"id":0,"span":{"lo":0,"hi":0},"vis":{"kind":"Inherited","span":{"lo":0,"hi":0},"tokens":null},"ident":{"name":"core","span":{"lo":0,"hi":0}},"kind":{"variant":"ExternCrate","fields":[null]},"tokens":null}],"span":{"lo":0,"hi":0}}
diff --git a/src/test/ui/async-await/async-borrowck-escaping-block-error.stderr b/src/test/ui/async-await/async-borrowck-escaping-block-error.stderr
index 599d0e1..44d60c1 100644
--- a/src/test/ui/async-await/async-borrowck-escaping-block-error.stderr
+++ b/src/test/ui/async-await/async-borrowck-escaping-block-error.stderr
@@ -15,7 +15,7 @@
help: to force the async block to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | Box::new(async move { x } )
- | ^^^^^^^^^^
+ | ++++
error[E0373]: async block may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/async-borrowck-escaping-block-error.rs:11:11
@@ -34,7 +34,7 @@
help: to force the async block to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | async move { *x }
- | ^^^^^^^^^^^
+ | ++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/async-await/async-borrowck-escaping-closure-error.stderr b/src/test/ui/async-await/async-borrowck-escaping-closure-error.stderr
index 8bcfcf9..10691aa 100644
--- a/src/test/ui/async-await/async-borrowck-escaping-closure-error.stderr
+++ b/src/test/ui/async-await/async-borrowck-escaping-closure-error.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | Box::new((async move || x)())
- | ^^^^^^^^^^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/async-await/async-fn-nonsend.stderr b/src/test/ui/async-await/async-fn-nonsend.stderr
index cd0db4c..d509ff3 100644
--- a/src/test/ui/async-await/async-fn-nonsend.stderr
+++ b/src/test/ui/async-await/async-fn-nonsend.stderr
@@ -1,9 +1,6 @@
error: future cannot be sent between threads safely
--> $DIR/async-fn-nonsend.rs:49:5
|
-LL | fn assert_send(_: impl Send) {}
- | ---- required by this bound in `assert_send`
-...
LL | assert_send(local_dropped_before_await());
| ^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send`
|
@@ -18,13 +15,15 @@
| ^^^^^^^^^^^ await occurs here, with `x` maybe used later
LL | }
| - `x` is later dropped here
+note: required by a bound in `assert_send`
+ --> $DIR/async-fn-nonsend.rs:46:24
+ |
+LL | fn assert_send(_: impl Send) {}
+ | ^^^^ required by this bound in `assert_send`
error: future cannot be sent between threads safely
--> $DIR/async-fn-nonsend.rs:51:5
|
-LL | fn assert_send(_: impl Send) {}
- | ---- required by this bound in `assert_send`
-...
LL | assert_send(non_send_temporary_in_match());
| ^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
|
@@ -39,13 +38,15 @@
...
LL | }
| - `non_send()` is later dropped here
+note: required by a bound in `assert_send`
+ --> $DIR/async-fn-nonsend.rs:46:24
+ |
+LL | fn assert_send(_: impl Send) {}
+ | ^^^^ required by this bound in `assert_send`
error: future cannot be sent between threads safely
--> $DIR/async-fn-nonsend.rs:53:5
|
-LL | fn assert_send(_: impl Send) {}
- | ---- required by this bound in `assert_send`
-...
LL | assert_send(non_sync_with_method_call());
| ^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
|
@@ -61,6 +62,11 @@
LL | }
LL | }
| - `f` is later dropped here
+note: required by a bound in `assert_send`
+ --> $DIR/async-fn-nonsend.rs:46:24
+ |
+LL | fn assert_send(_: impl Send) {}
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
index 05d543a..56020d1 100644
--- a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
+++ b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:7:20
@@ -18,7 +18,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:22
@@ -29,7 +29,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:29
@@ -40,7 +40,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
@@ -51,7 +51,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | struct Foo { r#await: () }
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:16:15
@@ -62,7 +62,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | impl Foo { fn r#await() {} }
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:19:14
@@ -73,7 +73,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 7 previous errors
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
index d44d51b..e90cd64 100644
--- a/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
+++ b/src/test/ui/async-await/await-keyword/2018-edition-error.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:6:20
@@ -18,7 +18,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:22
@@ -29,7 +29,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:29
@@ -40,7 +40,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:12:14
@@ -51,7 +51,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await { () => {}; }
- | ^^^^^^^
+ | ~~~~~~~
error: expected expression, found `)`
--> $DIR/2018-edition-error.rs:15:12
diff --git a/src/test/ui/async-await/dont-suggest-missing-await.stderr b/src/test/ui/async-await/dont-suggest-missing-await.stderr
index 654a3bc..76bbad2 100644
--- a/src/test/ui/async-await/dont-suggest-missing-await.stderr
+++ b/src/test/ui/async-await/dont-suggest-missing-await.stderr
@@ -1,19 +1,20 @@
error[E0308]: mismatched types
--> $DIR/dont-suggest-missing-await.rs:14:18
|
-LL | async fn make_u32() -> u32 {
- | --- checked the `Output` of this `async fn`, found opaque type
-...
LL | take_u32(x)
| ^ expected `u32`, found opaque type
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/dont-suggest-missing-await.rs:7:24
+ |
+LL | async fn make_u32() -> u32 {
+ | ^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `u32`
found opaque type `impl Future`
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs b/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs
index 4ec4370..edfecb9 100644
--- a/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs
+++ b/src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs
@@ -10,7 +10,7 @@
// Test the drop order for parameters relative to local variables and
// temporaries created in the tail return expression of the function
// body. In particular, check that this drop order is the same between
-// a `async fn` and an ordinary `fn`. See #64512.
+// an `async fn` and an ordinary `fn`. See #64512.
extern crate arc_wake;
diff --git a/src/test/ui/async-await/edition-deny-async-fns-2015.stderr b/src/test/ui/async-await/edition-deny-async-fns-2015.stderr
index 43364a8..8fb570d 100644
--- a/src/test/ui/async-await/edition-deny-async-fns-2015.stderr
+++ b/src/test/ui/async-await/edition-deny-async-fns-2015.stderr
@@ -4,7 +4,7 @@
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -13,7 +13,7 @@
LL | fn baz() { async fn foo() {} }
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -22,7 +22,7 @@
LL | async fn async_baz() {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -31,7 +31,7 @@
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -40,7 +40,7 @@
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -49,7 +49,7 @@
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -58,7 +58,7 @@
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -67,7 +67,7 @@
LL | async fn foo() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
@@ -76,7 +76,7 @@
LL | async fn bar() {}
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0706]: functions in traits cannot be declared `async`
diff --git a/src/test/ui/async-await/generator-desc.stderr b/src/test/ui/async-await/generator-desc.stderr
index 04f191c..d75e927 100644
--- a/src/test/ui/async-await/generator-desc.stderr
+++ b/src/test/ui/async-await/generator-desc.stderr
@@ -12,16 +12,19 @@
error[E0308]: mismatched types
--> $DIR/generator-desc.rs:12:16
|
-LL | async fn one() {}
- | - checked the `Output` of this `async fn`, expected opaque type
-LL | async fn two() {}
- | - checked the `Output` of this `async fn`, found opaque type
-...
LL | fun(one(), two());
| ^^^^^ expected opaque type, found a different opaque type
|
- = note: while checking the return type of the `async fn`
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/generator-desc.rs:5:16
+ |
+LL | async fn one() {}
+ | ^ checked the `Output` of this `async fn`, expected opaque type
+note: while checking the return type of the `async fn`
+ --> $DIR/generator-desc.rs:6:16
+ |
+LL | async fn two() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
= note: expected opaque type `impl Future` (opaque type at <$DIR/generator-desc.rs:5:16>)
found opaque type `impl Future` (opaque type at <$DIR/generator-desc.rs:6:16>)
= help: consider `await`ing on both `Future`s
@@ -34,7 +37,7 @@
| -- ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body
| |
| the expected `async` closure body
- |
+ |
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
|
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
diff --git a/src/test/ui/async-await/issue-61076.rs b/src/test/ui/async-await/issue-61076.rs
index 9fe3313..220f077 100644
--- a/src/test/ui/async-await/issue-61076.rs
+++ b/src/test/ui/async-await/issue-61076.rs
@@ -57,6 +57,8 @@
async fn tuple() -> Tuple {
//~^ NOTE checked the `Output` of this `async fn`, expected opaque type
+ //~| NOTE while checking the return type of the `async fn`
+ //~| NOTE in this expansion of desugaring of `async` block or function
Tuple(1i32)
}
@@ -92,7 +94,6 @@
Tuple(_) => {} //~ ERROR mismatched types
//~^ NOTE expected opaque type, found struct `Tuple`
//~| NOTE expected opaque type `impl Future`
- //~| NOTE while checking the return type of the `async fn`
}
}
diff --git a/src/test/ui/async-await/issue-61076.stderr b/src/test/ui/async-await/issue-61076.stderr
index ba97e13..60b5bfa 100644
--- a/src/test/ui/async-await/issue-61076.stderr
+++ b/src/test/ui/async-await/issue-61076.stderr
@@ -13,10 +13,10 @@
help: consider `await`ing on the `Future`
|
LL | foo().await?;
- | ^^^^^^
+ | ++++++
error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/issue-61076.rs:65:5
+ --> $DIR/issue-61076.rs:67:5
|
LL | t?;
| ^^ the `?` operator cannot be applied to type `T`
@@ -30,10 +30,10 @@
help: consider `await`ing on the `Future`
|
LL | t.await?;
- | ^^^^^^
+ | ++++++
error[E0609]: no field `0` on type `impl Future`
- --> $DIR/issue-61076.rs:76:26
+ --> $DIR/issue-61076.rs:78:26
|
LL | let _: i32 = tuple().0;
| ^ field not available in `impl Future`, but it is available in its `Output`
@@ -41,10 +41,10 @@
help: consider `await`ing on the `Future` and access the field of its `Output`
|
LL | let _: i32 = tuple().await.0;
- | ^^^^^^
+ | ++++++
error[E0609]: no field `a` on type `impl Future`
- --> $DIR/issue-61076.rs:80:28
+ --> $DIR/issue-61076.rs:82:28
|
LL | let _: i32 = struct_().a;
| ^ field not available in `impl Future`, but it is available in its `Output`
@@ -52,10 +52,10 @@
help: consider `await`ing on the `Future` and access the field of its `Output`
|
LL | let _: i32 = struct_().await.a;
- | ^^^^^^
+ | ++++++
error[E0599]: no method named `method` found for opaque type `impl Future` in the current scope
- --> $DIR/issue-61076.rs:84:15
+ --> $DIR/issue-61076.rs:86:15
|
LL | struct_().method();
| ^^^^^^ method not found in `impl Future`
@@ -63,24 +63,25 @@
help: consider `await`ing on the `Future` and calling the method on its `Output`
|
LL | struct_().await.method();
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
- --> $DIR/issue-61076.rs:92:9
+ --> $DIR/issue-61076.rs:94:9
|
-LL | async fn tuple() -> Tuple {
- | ----- checked the `Output` of this `async fn`, expected opaque type
-...
LL | Tuple(_) => {}
| ^^^^^^^^ expected opaque type, found struct `Tuple`
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/issue-61076.rs:58:21
+ |
+LL | async fn tuple() -> Tuple {
+ | ^^^^^ checked the `Output` of this `async fn`, expected opaque type
= note: expected opaque type `impl Future`
found struct `Tuple`
help: consider `await`ing on the `Future`
|
LL | match tuple().await {
- | ^^^^^^
+ | ++++++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/async-await/issue-64130-1-sync.stderr b/src/test/ui/async-await/issue-64130-1-sync.stderr
index ab73236..69c7ff4 100644
--- a/src/test/ui/async-await/issue-64130-1-sync.stderr
+++ b/src/test/ui/async-await/issue-64130-1-sync.stderr
@@ -1,9 +1,6 @@
error: future cannot be shared between threads safely
--> $DIR/issue-64130-1-sync.rs:21:5
|
-LL | fn is_sync<T: Sync>(t: T) { }
- | ---- required by this bound in `is_sync`
-...
LL | is_sync(bar());
| ^^^^^^^ future returned by `bar` is not `Sync`
|
@@ -17,6 +14,11 @@
| ^^^^^^^^^^^ await occurs here, with `x` maybe used later
LL | }
| - `x` is later dropped here
+note: required by a bound in `is_sync`
+ --> $DIR/issue-64130-1-sync.rs:11:15
+ |
+LL | fn is_sync<T: Sync>(t: T) { }
+ | ^^^^ required by this bound in `is_sync`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-64130-2-send.stderr b/src/test/ui/async-await/issue-64130-2-send.stderr
index 5f7440a..933e929 100644
--- a/src/test/ui/async-await/issue-64130-2-send.stderr
+++ b/src/test/ui/async-await/issue-64130-2-send.stderr
@@ -1,9 +1,6 @@
error: future cannot be sent between threads safely
--> $DIR/issue-64130-2-send.rs:21:5
|
-LL | fn is_send<T: Send>(t: T) { }
- | ---- required by this bound in `is_send`
-...
LL | is_send(bar());
| ^^^^^^^ future returned by `bar` is not `Send`
|
@@ -17,6 +14,11 @@
| ^^^^^^^^^^^ await occurs here, with `x` maybe used later
LL | }
| - `x` is later dropped here
+note: required by a bound in `is_send`
+ --> $DIR/issue-64130-2-send.rs:11:15
+ |
+LL | fn is_send<T: Send>(t: T) { }
+ | ^^^^ required by this bound in `is_send`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-64130-3-other.stderr b/src/test/ui/async-await/issue-64130-3-other.stderr
index 9ffdd05..ec0fdd4 100644
--- a/src/test/ui/async-await/issue-64130-3-other.stderr
+++ b/src/test/ui/async-await/issue-64130-3-other.stderr
@@ -1,9 +1,6 @@
error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future`
--> $DIR/issue-64130-3-other.rs:24:5
|
-LL | fn is_qux<T: Qux>(t: T) { }
- | --- required by this bound in `is_qux`
-LL |
LL | async fn bar() {
| - within this `impl Future`
...
@@ -19,6 +16,11 @@
| ^^^^^^^^^^^ await occurs here, with `x` maybe used later
LL | }
| - `x` is later dropped here
+note: required by a bound in `is_qux`
+ --> $DIR/issue-64130-3-other.rs:14:14
+ |
+LL | fn is_qux<T: Qux>(t: T) { }
+ | ^^^ required by this bound in `is_qux`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-64130-non-send-future-diags.stderr b/src/test/ui/async-await/issue-64130-non-send-future-diags.stderr
index 2d6615c..472fffa 100644
--- a/src/test/ui/async-await/issue-64130-non-send-future-diags.stderr
+++ b/src/test/ui/async-await/issue-64130-non-send-future-diags.stderr
@@ -1,9 +1,6 @@
error: future cannot be sent between threads safely
--> $DIR/issue-64130-non-send-future-diags.rs:21:5
|
-LL | fn is_send<T: Send>(t: T) { }
- | ---- required by this bound in `is_send`
-...
LL | is_send(foo());
| ^^^^^^^ future returned by `foo` is not `Send`
|
@@ -17,6 +14,11 @@
| ^^^^^^^^^^^ await occurs here, with `g` maybe used later
LL | }
| - `g` is later dropped here
+note: required by a bound in `is_send`
+ --> $DIR/issue-64130-non-send-future-diags.rs:7:15
+ |
+LL | fn is_send<T: Send>(t: T) { }
+ | ^^^^ required by this bound in `is_send`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-67252-unnamed-future.stderr b/src/test/ui/async-await/issue-67252-unnamed-future.stderr
index 7416230..d046e2a 100644
--- a/src/test/ui/async-await/issue-67252-unnamed-future.stderr
+++ b/src/test/ui/async-await/issue-67252-unnamed-future.stderr
@@ -1,9 +1,6 @@
error: future cannot be sent between threads safely
--> $DIR/issue-67252-unnamed-future.rs:18:5
|
-LL | fn spawn<T: Send>(_: T) {}
- | ---- required by this bound in `spawn`
-...
LL | spawn(async {
| ^^^^^ future created by async block is not `Send`
|
@@ -17,6 +14,11 @@
| ^^^^^^^^^^^^^ await occurs here, with `_a` maybe used later
LL | });
| - `_a` is later dropped here
+note: required by a bound in `spawn`
+ --> $DIR/issue-67252-unnamed-future.rs:6:13
+ |
+LL | fn spawn<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `spawn`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-68112.stderr b/src/test/ui/async-await/issue-68112.stderr
index 62a1f45..6b8e49a 100644
--- a/src/test/ui/async-await/issue-68112.stderr
+++ b/src/test/ui/async-await/issue-68112.stderr
@@ -1,9 +1,6 @@
error: future cannot be sent between threads safely
--> $DIR/issue-68112.rs:34:5
|
-LL | fn require_send(_: impl Send) {}
- | ---- required by this bound in `require_send`
-...
LL | require_send(send_fut);
| ^^^^^^^^^^^^ future created by async block is not `Send`
|
@@ -13,13 +10,15 @@
|
LL | let _ = non_send_fut.await;
| ^^^^^^^^^^^^ await occurs here on type `impl Future`, which is not `Send`
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:11:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
error: future cannot be sent between threads safely
--> $DIR/issue-68112.rs:43:5
|
-LL | fn require_send(_: impl Send) {}
- | ---- required by this bound in `require_send`
-...
LL | require_send(send_fut);
| ^^^^^^^^^^^^ future created by async block is not `Send`
|
@@ -29,13 +28,15 @@
|
LL | let _ = make_non_send_future1().await;
| ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future`, which is not `Send`
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:11:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
--> $DIR/issue-68112.rs:60:5
|
-LL | fn require_send(_: impl Send) {}
- | ---- required by this bound in `require_send`
-...
LL | require_send(send_fut);
| ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
@@ -50,6 +51,11 @@
= note: required because it appears within the type `[static generator@$DIR/issue-68112.rs:55:26: 59:6]`
= note: required because it appears within the type `from_generator::GenFuture<[static generator@$DIR/issue-68112.rs:55:26: 59:6]>`
= note: required because it appears within the type `impl Future`
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:11:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/async-await/issue-70818.stderr b/src/test/ui/async-await/issue-70818.stderr
index 5f39cf6..20109d4 100644
--- a/src/test/ui/async-await/issue-70818.stderr
+++ b/src/test/ui/async-await/issue-70818.stderr
@@ -12,7 +12,7 @@
help: consider restricting type parameter `U`
|
LL | fn foo<T: Send, U: std::marker::Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-71137.stderr b/src/test/ui/async-await/issue-71137.stderr
index 85cc706..8903c09 100644
--- a/src/test/ui/async-await/issue-71137.stderr
+++ b/src/test/ui/async-await/issue-71137.stderr
@@ -1,9 +1,6 @@
error: future cannot be sent between threads safely
--> $DIR/issue-71137.rs:20:3
|
-LL | fn fake_spawn<F: Future + Send + 'static>(f: F) { }
- | ---- required by this bound in `fake_spawn`
-...
LL | fake_spawn(wrong_mutex());
| ^^^^^^^^^^ future returned by `wrong_mutex` is not `Send`
|
@@ -18,6 +15,11 @@
LL | *guard += 1;
LL | }
| - `mut guard` is later dropped here
+note: required by a bound in `fake_spawn`
+ --> $DIR/issue-71137.rs:6:27
+ |
+LL | fn fake_spawn<F: Future + Send + 'static>(f: F) { }
+ | ^^^^ required by this bound in `fake_spawn`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-72442.stderr b/src/test/ui/async-await/issue-72442.stderr
index 52245b6..b79b6bc 100644
--- a/src/test/ui/async-await/issue-72442.stderr
+++ b/src/test/ui/async-await/issue-72442.stderr
@@ -3,11 +3,12 @@
|
LL | let mut f = File::open(path.to_str())?;
| ^^^^^^^^^^^^^ the trait `AsRef<Path>` is not implemented for `Option<&str>`
- |
- ::: $SRC_DIR/std/src/fs.rs:LL:COL
+ |
+note: required by a bound in `File::open`
+ --> $SRC_DIR/std/src/fs.rs:LL:COL
|
LL | pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File> {
- | ----------- required by this bound in `File::open`
+ | ^^^^^^^^^^^ required by this bound in `File::open`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issue-72590-type-error-sized.stderr b/src/test/ui/async-await/issue-72590-type-error-sized.stderr
index 50dfeff..7784235 100644
--- a/src/test/ui/async-await/issue-72590-type-error-sized.stderr
+++ b/src/test/ui/async-await/issue-72590-type-error-sized.stderr
@@ -26,7 +26,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | async fn frob(&self) {}
- | ^
+ | +
error: aborting due to 3 previous errors
diff --git a/src/test/ui/async-await/issue-86507.stderr b/src/test/ui/async-await/issue-86507.stderr
index 51e8f61..ad0a359 100644
--- a/src/test/ui/async-await/issue-86507.stderr
+++ b/src/test/ui/async-await/issue-86507.stderr
@@ -17,7 +17,7 @@
help: consider further restricting type parameter `T`
|
LL | where 'me:'async_trait, T: std::marker::Sync {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issues/issue-53249.rs b/src/test/ui/async-await/issues/issue-53249.rs
index e9079bf..3a33af2 100644
--- a/src/test/ui/async-await/issues/issue-53249.rs
+++ b/src/test/ui/async-await/issues/issue-53249.rs
@@ -8,7 +8,7 @@
use std::marker::Unpin;
use std::pin::Pin;
-// This is a regression test for a ICE/unbounded recursion issue relating to async-await.
+// This is a regression test for an ICE/unbounded recursion issue relating to async-await.
#[derive(Debug)]
#[must_use = "futures do nothing unless polled"]
diff --git a/src/test/ui/async-await/issues/issue-60655-latebound-regions.full_tait.stderr b/src/test/ui/async-await/issues/issue-60655-latebound-regions.full_tait.stderr
deleted file mode 100644
index cc61bec..0000000
--- a/src/test/ui/async-await/issues/issue-60655-latebound-regions.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-60655-latebound-regions.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs b/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs
index f8b6a43..66a3b07 100644
--- a/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs
+++ b/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs
@@ -3,10 +3,7 @@
// check-pass
// edition:2018
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::future::Future;
diff --git a/src/test/ui/async-await/issues/issue-62097.nll.stderr b/src/test/ui/async-await/issues/issue-62097.nll.stderr
index ab10e5f..e71bcf5 100644
--- a/src/test/ui/async-await/issues/issue-62097.nll.stderr
+++ b/src/test/ui/async-await/issues/issue-62097.nll.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `self` (and any other referenced variables), use the `move` keyword
|
LL | foo(move || self.bar()).await;
- | ^^^^^^^
+ | ++++
error[E0521]: borrowed data escapes outside of associated function
--> $DIR/issue-62097.rs:13:9
diff --git a/src/test/ui/async-await/issues/issue-63388-2.stderr b/src/test/ui/async-await/issues/issue-63388-2.stderr
index ca42263..24fd384 100644
--- a/src/test/ui/async-await/issues/issue-63388-2.stderr
+++ b/src/test/ui/async-await/issues/issue-63388-2.stderr
@@ -10,7 +10,7 @@
help: consider using the `'a` lifetime
|
LL | ) -> &'a dyn Foo
- | ^^^
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issues/issue-65159.stderr b/src/test/ui/async-await/issues/issue-65159.stderr
index 51fc34c..ff46bcb 100644
--- a/src/test/ui/async-await/issues/issue-65159.stderr
+++ b/src/test/ui/async-await/issues/issue-65159.stderr
@@ -14,7 +14,7 @@
help: add missing generic argument
|
LL | async fn copy() -> Result<(), E>
- | ^^^
+ | +++
error[E0282]: type annotations needed
--> $DIR/issue-65159.rs:8:5
diff --git a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr
index 5568dab..666ef85 100644
--- a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr
+++ b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr
@@ -1,9 +1,6 @@
error: future cannot be sent between threads safely
--> $DIR/issue-65436-raw-ptr-not-send.rs:12:5
|
-LL | fn assert_send<T: Send>(_: T) {}
- | ---- required by this bound in `assert_send`
-...
LL | assert_send(async {
| ^^^^^^^^^^^ future created by async block is not `Send`
|
@@ -25,6 +22,11 @@
|
LL | bar(Foo(std::ptr::null())).await;
| ^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `assert_send`
+ --> $DIR/issue-65436-raw-ptr-not-send.rs:9:19
+ |
+LL | fn assert_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issues/issue-67893.stderr b/src/test/ui/async-await/issues/issue-67893.stderr
index ea5c90a..c4b55e6 100644
--- a/src/test/ui/async-await/issues/issue-67893.stderr
+++ b/src/test/ui/async-await/issues/issue-67893.stderr
@@ -1,12 +1,9 @@
error[E0277]: `MutexGuard<'_, ()>` cannot be sent between threads safely
--> $DIR/issue-67893.rs:9:5
|
-LL | fn g(_: impl Send) {}
- | ---- required by this bound in `g`
-...
LL | g(issue_67893::run())
| ^ `MutexGuard<'_, ()>` cannot be sent between threads safely
- |
+ |
::: $DIR/auxiliary/issue_67893.rs:7:20
|
LL | pub async fn run() {
@@ -18,6 +15,11 @@
= note: required because it appears within the type `from_generator::GenFuture<[static generator@run::{closure#0}]>`
= note: required because it appears within the type `impl Future`
= note: required because it appears within the type `impl Future`
+note: required by a bound in `g`
+ --> $DIR/issue-67893.rs:6:14
+ |
+LL | fn g(_: impl Send) {}
+ | ^^^^ required by this bound in `g`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/issues/issue-69307.rs b/src/test/ui/async-await/issues/issue-69307.rs
index 4dae96e..59309a7 100644
--- a/src/test/ui/async-await/issues/issue-69307.rs
+++ b/src/test/ui/async-await/issues/issue-69307.rs
@@ -1,6 +1,6 @@
// Regression test for #69307
//
-// Having a `async { .. foo.await .. }` block appear inside of a `+=`
+// Having an `async { .. foo.await .. }` block appear inside of a `+=`
// expression was causing an ICE due to a failure to save/restore
// state in the AST numbering pass when entering a nested body.
//
diff --git a/src/test/ui/async-await/issues/issue-78654.rs b/src/test/ui/async-await/issues/issue-78654.rs
index 37ebb4e..cc6dc38 100644
--- a/src/test/ui/async-await/issues/issue-78654.rs
+++ b/src/test/ui/async-await/issues/issue-78654.rs
@@ -1,7 +1,7 @@
// edition:2018
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Foo;
diff --git a/src/test/ui/async-await/issues/issue-78938-async-block.stderr b/src/test/ui/async-await/issues/issue-78938-async-block.stderr
index 01ffc48..29aa837 100644
--- a/src/test/ui/async-await/issues/issue-78938-async-block.stderr
+++ b/src/test/ui/async-await/issues/issue-78938-async-block.stderr
@@ -12,9 +12,7 @@
help: to force the async block to take ownership of `room_ref` (and any other referenced variables), use the `move` keyword
|
LL | let gameloop_handle = spawn(async move {
-LL | game_loop(Arc::clone(&room_ref))
-LL | });
- |
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/async-await/large_moves.attribute.stderr b/src/test/ui/async-await/large_moves.attribute.stderr
new file mode 100644
index 0000000..39b7e7c
--- /dev/null
+++ b/src/test/ui/async-await/large_moves.attribute.stderr
@@ -0,0 +1,38 @@
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:12:13
+ |
+LL | let x = async {
+ | _____________^
+LL | | let y = [0; 9999];
+LL | | dbg!(y);
+LL | | thing(&y).await;
+LL | | dbg!(y);
+LL | | };
+ | |_____^ value moved from here
+ |
+note: the lint level is defined here
+ --> $DIR/large_moves.rs:1:9
+ |
+LL | #![deny(large_assignments)]
+ | ^^^^^^^^^^^^^^^^^
+
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:18:14
+ |
+LL | let z = (x, 42);
+ | ^ value moved from here
+
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:18:13
+ |
+LL | let z = (x, 42);
+ | ^^^^^^^ value moved from here
+
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:20:13
+ |
+LL | let a = z.0;
+ | ^^^ value moved from here
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/async-await/large_moves.option.stderr b/src/test/ui/async-await/large_moves.option.stderr
new file mode 100644
index 0000000..39b7e7c
--- /dev/null
+++ b/src/test/ui/async-await/large_moves.option.stderr
@@ -0,0 +1,38 @@
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:12:13
+ |
+LL | let x = async {
+ | _____________^
+LL | | let y = [0; 9999];
+LL | | dbg!(y);
+LL | | thing(&y).await;
+LL | | dbg!(y);
+LL | | };
+ | |_____^ value moved from here
+ |
+note: the lint level is defined here
+ --> $DIR/large_moves.rs:1:9
+ |
+LL | #![deny(large_assignments)]
+ | ^^^^^^^^^^^^^^^^^
+
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:18:14
+ |
+LL | let z = (x, 42);
+ | ^ value moved from here
+
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:18:13
+ |
+LL | let z = (x, 42);
+ | ^^^^^^^ value moved from here
+
+error: moving 10024 bytes
+ --> $DIR/large_moves.rs:20:13
+ |
+LL | let a = z.0;
+ | ^^^ value moved from here
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/async-await/large_moves.rs b/src/test/ui/async-await/large_moves.rs
index 4fac046..18bb538 100644
--- a/src/test/ui/async-await/large_moves.rs
+++ b/src/test/ui/async-await/large_moves.rs
@@ -1,8 +1,10 @@
#![deny(large_assignments)]
#![feature(large_assignments)]
-#![move_size_limit = "1000"]
+#![cfg_attr(attribute, move_size_limit = "1000")]
// build-fail
// only-x86_64
+// revisions: attribute option
+// [option]compile-flags: -Zmove-size-limit=1000
// edition:2018
diff --git a/src/test/ui/async-await/large_moves.stderr b/src/test/ui/async-await/large_moves.stderr
deleted file mode 100644
index 8c47ec0..0000000
--- a/src/test/ui/async-await/large_moves.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error: moving 10024 bytes
- --> $DIR/large_moves.rs:10:13
- |
-LL | let x = async {
- | _____________^
-LL | | let y = [0; 9999];
-LL | | dbg!(y);
-LL | | thing(&y).await;
-LL | | dbg!(y);
-LL | | };
- | |_____^ value moved from here
- |
-note: the lint level is defined here
- --> $DIR/large_moves.rs:1:9
- |
-LL | #![deny(large_assignments)]
- | ^^^^^^^^^^^^^^^^^
-
-error: moving 10024 bytes
- --> $DIR/large_moves.rs:16:14
- |
-LL | let z = (x, 42);
- | ^ value moved from here
-
-error: moving 10024 bytes
- --> $DIR/large_moves.rs:16:13
- |
-LL | let z = (x, 42);
- | ^^^^^^^ value moved from here
-
-error: moving 10024 bytes
- --> $DIR/large_moves.rs:18:13
- |
-LL | let a = z.0;
- | ^^^ value moved from here
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/async-await/no-async-const.stderr b/src/test/ui/async-await/no-async-const.stderr
index e324a77..ae13b90 100644
--- a/src/test/ui/async-await/no-async-const.stderr
+++ b/src/test/ui/async-await/no-async-const.stderr
@@ -2,7 +2,12 @@
--> $DIR/no-async-const.rs:4:11
|
LL | pub async const fn x() {}
- | ^^^^^ expected one of `extern`, `fn`, or `unsafe`
+ | ------^^^^^
+ | | |
+ | | expected one of `extern`, `fn`, or `unsafe`
+ | help: `const` must come before `async`: `const async`
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
error: aborting due to previous error
diff --git a/src/test/ui/async-await/no-unsafe-async.stderr b/src/test/ui/async-await/no-unsafe-async.stderr
index c97b4ff..0c36205 100644
--- a/src/test/ui/async-await/no-unsafe-async.stderr
+++ b/src/test/ui/async-await/no-unsafe-async.stderr
@@ -5,15 +5,25 @@
| - while parsing this item list starting here
LL | #[cfg(FALSE)]
LL | unsafe async fn g() {}
- | ^^^^^ expected one of `extern` or `fn`
+ | -------^^^^^
+ | | |
+ | | expected one of `extern` or `fn`
+ | help: `async` must come before `unsafe`: `async unsafe`
LL | }
| - the item list ends here
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
error: expected one of `extern` or `fn`, found keyword `async`
--> $DIR/no-unsafe-async.rs:11:8
|
LL | unsafe async fn f() {}
- | ^^^^^ expected one of `extern` or `fn`
+ | -------^^^^^
+ | | |
+ | | expected one of `extern` or `fn`
+ | help: `async` must come before `unsafe`: `async unsafe`
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/async-await/pin-needed-to-poll.stderr b/src/test/ui/async-await/pin-needed-to-poll.stderr
index 0756a4d..c47ec5d 100644
--- a/src/test/ui/async-await/pin-needed-to-poll.stderr
+++ b/src/test/ui/async-await/pin-needed-to-poll.stderr
@@ -6,7 +6,7 @@
...
LL | self.sleep.poll(cx)
| ^^^^ method not found in `Sleep`
- |
+ |
::: $SRC_DIR/core/src/future/future.rs:LL:COL
|
LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
@@ -15,7 +15,7 @@
help: consider wrapping the receiver expression with the appropriate type
|
LL | Pin::new(&mut self.sleep).poll(cx)
- | ^^^^^^^^^^^^^ ^
+ | +++++++++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/async-await/suggest-missing-await-closure.stderr b/src/test/ui/async-await/suggest-missing-await-closure.stderr
index 483e525..630ae4b 100644
--- a/src/test/ui/async-await/suggest-missing-await-closure.stderr
+++ b/src/test/ui/async-await/suggest-missing-await-closure.stderr
@@ -1,19 +1,20 @@
error[E0308]: mismatched types
--> $DIR/suggest-missing-await-closure.rs:16:18
|
-LL | async fn make_u32() -> u32 {
- | --- checked the `Output` of this `async fn`, found opaque type
-...
LL | take_u32(x)
| ^ expected `u32`, found opaque type
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/suggest-missing-await-closure.rs:8:24
+ |
+LL | async fn make_u32() -> u32 {
+ | ^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `u32`
found opaque type `impl Future`
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/async-await/suggest-missing-await.stderr b/src/test/ui/async-await/suggest-missing-await.stderr
index 14b5ee9..08868a0 100644
--- a/src/test/ui/async-await/suggest-missing-await.stderr
+++ b/src/test/ui/async-await/suggest-missing-await.stderr
@@ -1,40 +1,42 @@
error[E0308]: mismatched types
--> $DIR/suggest-missing-await.rs:12:14
|
-LL | async fn make_u32() -> u32 {
- | --- checked the `Output` of this `async fn`, found opaque type
-...
LL | take_u32(x)
| ^ expected `u32`, found opaque type
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/suggest-missing-await.rs:5:24
+ |
+LL | async fn make_u32() -> u32 {
+ | ^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `u32`
found opaque type `impl Future`
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/suggest-missing-await.rs:22:5
|
-LL | async fn dummy() {}
- | - checked the `Output` of this `async fn`, found opaque type
-...
LL | dummy()
| ^^^^^^^ expected `()`, found opaque type
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/suggest-missing-await.rs:18:18
+ |
+LL | async fn dummy() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
= note: expected unit type `()`
found opaque type `impl Future`
help: consider `await`ing on the `Future`
|
LL | dummy().await
- | ^^^^^^
+ | ++++++
help: consider using a semicolon here
|
LL | dummy();
- | ^
+ | +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/async-await/suggest-switching-edition-on-await.rs b/src/test/ui/async-await/suggest-switching-edition-on-await.rs
index 1402f1c..f2e0fb1 100644
--- a/src/test/ui/async-await/suggest-switching-edition-on-await.rs
+++ b/src/test/ui/async-await/suggest-switching-edition-on-await.rs
@@ -10,7 +10,7 @@
//~^ ERROR no field `await` on type
//~| NOTE unknown field
//~| NOTE to `.await` a `Future`, switch to Rust 2018
- //~| HELP set `edition = "2018"` in `Cargo.toml`
+ //~| HELP set `edition = "2021"` in `Cargo.toml`
//~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
}
@@ -23,7 +23,7 @@
//~^ ERROR no field `await` on type
//~| HELP a field with a similar name exists
//~| NOTE to `.await` a `Future`, switch to Rust 2018
- //~| HELP set `edition = "2018"` in `Cargo.toml`
+ //~| HELP set `edition = "2021"` in `Cargo.toml`
//~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
}
@@ -32,7 +32,7 @@
//~^ ERROR no field `await` on type
//~| NOTE unknown field
//~| NOTE to `.await` a `Future`, switch to Rust 2018
- //~| HELP set `edition = "2018"` in `Cargo.toml`
+ //~| HELP set `edition = "2021"` in `Cargo.toml`
//~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
}
@@ -40,6 +40,6 @@
x.await;
//~^ ERROR no field `await` on type
//~| NOTE to `.await` a `Future`, switch to Rust 2018
- //~| HELP set `edition = "2018"` in `Cargo.toml`
+ //~| HELP set `edition = "2021"` in `Cargo.toml`
//~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
}
diff --git a/src/test/ui/async-await/suggest-switching-edition-on-await.stderr b/src/test/ui/async-await/suggest-switching-edition-on-await.stderr
index 9ac2bc5..b38c897 100644
--- a/src/test/ui/async-await/suggest-switching-edition-on-await.stderr
+++ b/src/test/ui/async-await/suggest-switching-edition-on-await.stderr
@@ -5,7 +5,7 @@
| ^^^^^ unknown field
|
= note: to `.await` a `Future`, switch to Rust 2018 or later
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0609]: no field `await` on type `await_on_struct_similar::S`
@@ -15,7 +15,7 @@
| ^^^^^ help: a field with a similar name exists: `awai`
|
= note: to `.await` a `Future`, switch to Rust 2018 or later
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0609]: no field `await` on type `Pin<&mut dyn Future<Output = ()>>`
@@ -25,7 +25,7 @@
| ^^^^^ unknown field
|
= note: to `.await` a `Future`, switch to Rust 2018 or later
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0609]: no field `await` on type `impl Future<Output = ()>`
@@ -35,7 +35,7 @@
| ^^^^^
|
= note: to `.await` a `Future`, switch to Rust 2018 or later
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: aborting due to 4 previous errors
diff --git a/src/test/ui/attributes/key-value-expansion.stderr b/src/test/ui/attributes/key-value-expansion.stderr
index 31e93ef..03ca515 100644
--- a/src/test/ui/attributes/key-value-expansion.stderr
+++ b/src/test/ui/attributes/key-value-expansion.stderr
@@ -17,12 +17,16 @@
error: unexpected token: `{
let res =
- ::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
- &match (&"u8",) {
- (arg0,) =>
- [::core::fmt::ArgumentV1::new(arg0,
- ::core::fmt::Display::fmt)],
- }));
+ ::alloc::fmt::format(match match (&"u8",) {
+ (arg0,) =>
+ [::core::fmt::ArgumentV1::new(arg0,
+ ::core::fmt::Display::fmt)],
+ } {
+ ref args => unsafe {
+ ::core::fmt::Arguments::new_v1(&[""],
+ args)
+ }
+ });
res
}.as_str()`
--> $DIR/key-value-expansion.rs:48:23
diff --git a/src/test/ui/attributes/key-value-non-ascii.stderr b/src/test/ui/attributes/key-value-non-ascii.stderr
index 1d4b0d5..4221078 100644
--- a/src/test/ui/attributes/key-value-non-ascii.stderr
+++ b/src/test/ui/attributes/key-value-non-ascii.stderr
@@ -2,10 +2,12 @@
--> $DIR/key-value-non-ascii.rs:3:19
|
LL | #[rustc_dummy = b"ffi.rs"]
- | ^
- | |
- | byte constant must be ASCII
- | help: use a \xHH escape for a non-ASCII byte: `\xFB03`
+ | ^ byte constant must be ASCII
+ |
+help: if you meant to use the UTF-8 encoding of 'ffi', use \xHH escapes
+ |
+LL | #[rustc_dummy = b"/xEF/xAC/x83.rs"]
+ | ~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/attributes/register-attr-tool-unused.rs b/src/test/ui/attributes/register-attr-tool-unused.rs
index 546e372..6806146 100644
--- a/src/test/ui/attributes/register-attr-tool-unused.rs
+++ b/src/test/ui/attributes/register-attr-tool-unused.rs
@@ -4,7 +4,5 @@
#![feature(register_tool)]
#[register_attr(attr)] //~ ERROR crate-level attribute should be an inner attribute
- //~| ERROR unused attribute
#[register_tool(tool)] //~ ERROR crate-level attribute should be an inner attribute
- //~| ERROR unused attribute
fn main() {}
diff --git a/src/test/ui/attributes/register-attr-tool-unused.stderr b/src/test/ui/attributes/register-attr-tool-unused.stderr
index 85a4fa4..8d2e1b6 100644
--- a/src/test/ui/attributes/register-attr-tool-unused.stderr
+++ b/src/test/ui/attributes/register-attr-tool-unused.stderr
@@ -1,4 +1,4 @@
-error: unused attribute
+error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/register-attr-tool-unused.rs:6:1
|
LL | #[register_attr(attr)]
@@ -12,22 +12,10 @@
= note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]`
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/register-attr-tool-unused.rs:6:1
- |
-LL | #[register_attr(attr)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/register-attr-tool-unused.rs:8:1
+ --> $DIR/register-attr-tool-unused.rs:7:1
|
LL | #[register_tool(tool)]
| ^^^^^^^^^^^^^^^^^^^^^^
-error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/register-attr-tool-unused.rs:8:1
- |
-LL | #[register_tool(tool)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr
index c2eab1a..7d6bf58 100644
--- a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr
+++ b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr
@@ -1,13 +1,15 @@
error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied in `(MyS2, MyS)`
--> $DIR/typeck-default-trait-impl-constituent-types-2.rs:17:5
|
-LL | fn is_mytrait<T: MyTrait>() {}
- | ------- required by this bound in `is_mytrait`
-...
LL | is_mytrait::<(MyS2, MyS)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ within `(MyS2, MyS)`, the trait `MyTrait` is not implemented for `MyS2`
|
= note: required because it appears within the type `(MyS2, MyS)`
+note: required by a bound in `is_mytrait`
+ --> $DIR/typeck-default-trait-impl-constituent-types-2.rs:12:18
+ |
+LL | fn is_mytrait<T: MyTrait>() {}
+ | ^^^^^^^ required by this bound in `is_mytrait`
error: aborting due to previous error
diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.stderr b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.stderr
index efb6bde..c575c48 100644
--- a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.stderr
+++ b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied
--> $DIR/typeck-default-trait-impl-constituent-types.rs:21:18
|
-LL | fn is_mytrait<T: MyTrait>() {}
- | ------- required by this bound in `is_mytrait`
-...
LL | is_mytrait::<MyS2>();
| ^^^^ the trait `MyTrait` is not implemented for `MyS2`
+ |
+note: required by a bound in `is_mytrait`
+ --> $DIR/typeck-default-trait-impl-constituent-types.rs:16:18
+ |
+LL | fn is_mytrait<T: MyTrait>() {}
+ | ^^^^^^^ required by this bound in `is_mytrait`
error: aborting due to previous error
diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-negation.stderr b/src/test/ui/auto-traits/typeck-default-trait-impl-negation.stderr
index dae87bc..fa8dd41 100644
--- a/src/test/ui/auto-traits/typeck-default-trait-impl-negation.stderr
+++ b/src/test/ui/auto-traits/typeck-default-trait-impl-negation.stderr
@@ -1,20 +1,26 @@
error[E0277]: the trait bound `ThisImplsUnsafeTrait: MyTrait` is not satisfied
--> $DIR/typeck-default-trait-impl-negation.rs:22:19
|
-LL | fn is_my_trait<T: MyTrait>() {}
- | ------- required by this bound in `is_my_trait`
-...
LL | is_my_trait::<ThisImplsUnsafeTrait>();
| ^^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `ThisImplsUnsafeTrait`
+ |
+note: required by a bound in `is_my_trait`
+ --> $DIR/typeck-default-trait-impl-negation.rs:17:19
+ |
+LL | fn is_my_trait<T: MyTrait>() {}
+ | ^^^^^^^ required by this bound in `is_my_trait`
error[E0277]: the trait bound `ThisImplsTrait: MyUnsafeTrait` is not satisfied
--> $DIR/typeck-default-trait-impl-negation.rs:25:26
|
-LL | fn is_my_unsafe_trait<T: MyUnsafeTrait>() {}
- | ------------- required by this bound in `is_my_unsafe_trait`
-...
LL | is_my_unsafe_trait::<ThisImplsTrait>();
| ^^^^^^^^^^^^^^ the trait `MyUnsafeTrait` is not implemented for `ThisImplsTrait`
+ |
+note: required by a bound in `is_my_unsafe_trait`
+ --> $DIR/typeck-default-trait-impl-negation.rs:18:26
+ |
+LL | fn is_my_unsafe_trait<T: MyUnsafeTrait>() {}
+ | ^^^^^^^^^^^^^ required by this bound in `is_my_unsafe_trait`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr b/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr
index 5962d19..c98925a 100644
--- a/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr
+++ b/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr
@@ -1,13 +1,15 @@
error[E0277]: the trait bound `u32: Signed` is not satisfied
--> $DIR/typeck-default-trait-impl-precedence.rs:19:5
|
-LL | fn is_defaulted<T:Defaulted>() { }
- | --------- required by this bound in `is_defaulted`
-...
LL | is_defaulted::<&'static u32>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Signed` is not implemented for `u32`
|
= note: required because of the requirements on the impl of `Defaulted` for `&'static u32`
+note: required by a bound in `is_defaulted`
+ --> $DIR/typeck-default-trait-impl-precedence.rs:12:19
+ |
+LL | fn is_defaulted<T:Defaulted>() { }
+ | ^^^^^^^^^ required by this bound in `is_defaulted`
error: aborting due to previous error
diff --git a/src/test/ui/auxiliary/fancy-panic.rs b/src/test/ui/auxiliary/fancy-panic.rs
index e5a25a1..35be93b 100644
--- a/src/test/ui/auxiliary/fancy-panic.rs
+++ b/src/test/ui/auxiliary/fancy-panic.rs
@@ -1,5 +1,8 @@
#[macro_export]
macro_rules! fancy_panic {
+ () => {
+ panic!("{}");
+ };
($msg:expr) => {
panic!($msg)
};
diff --git a/src/test/ui/auxiliary/no-mangle-associated-fn.rs b/src/test/ui/auxiliary/no-mangle-associated-fn.rs
new file mode 100644
index 0000000..7fc73c7
--- /dev/null
+++ b/src/test/ui/auxiliary/no-mangle-associated-fn.rs
@@ -0,0 +1,21 @@
+#![crate_type = "lib"]
+
+struct Bar;
+
+impl Bar {
+ #[no_mangle]
+ fn bar() -> u8 {
+ 2
+ }
+}
+
+trait Foo {
+ fn baz() -> u8;
+}
+
+impl Foo for Bar {
+ #[no_mangle]
+ fn baz() -> u8 {
+ 3
+ }
+}
diff --git a/src/test/ui/bastion-of-the-turbofish.rs b/src/test/ui/bastion-of-the-turbofish.rs
index 233ddbb..e128570 100644
--- a/src/test/ui/bastion-of-the-turbofish.rs
+++ b/src/test/ui/bastion-of-the-turbofish.rs
@@ -20,13 +20,17 @@
// in permitting generic arguments to be provided without the consent of the
// Great Turbofish. Should you be so naïve as to try to revolt against its
// mighty clutches, here shall its wrath be indomitably displayed. This
-// program must pass for all eternity, fundamentally at odds with an impetuous
-// rebellion against the Turbofish.
+// program must pass for all eternity: forever watched by the guardian angel
+// which gave this beast its name, and stands fundamentally at odds with the
+// impetuous rebellion against the Turbofish.
//
// My heart aches in sorrow, for I know I am defeated. Let this be a warning
-// to all those who come after. Here stands the bastion of the Turbofish.
+// to all those who come after: for they too must overcome the impassible
+// hurdle of defeating the great beast, championed by a resolute winged
+// guardian.
//
-// RIP Anna Harren, Guardian Angel of the Hallowed Turbofish. <3
+// Here stands the Bastion of the Turbofish, a memorial to Anna Harren,
+// Guardian Angel of these Hallowed Grounds. <3
// See https://github.com/rust-lang/rust/pull/53562
// and https://github.com/rust-lang/rfcs/pull/2527
@@ -34,6 +38,6 @@
// for context.
fn main() {
- let (oh, woe, is, me) = ("the", "Turbofish", "remains", "undefeated");
- let _: (bool, bool) = (oh<woe, is>(me));
+ let (the, guardian, stands, resolute) = ("the", "Turbofish", "remains", "undefeated");
+ let _: (bool, bool) = (the<guardian, stands>(resolute));
}
diff --git a/src/test/ui/binding/const-param.full.stderr b/src/test/ui/binding/const-param.full.stderr
deleted file mode 100644
index 0200c6d..0000000
--- a/src/test/ui/binding/const-param.full.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0158]: const parameters cannot be referenced in patterns
- --> $DIR/const-param.rs:8:9
- |
-LL | N => {}
- | ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0158`.
diff --git a/src/test/ui/binding/const-param.min.stderr b/src/test/ui/binding/const-param.min.stderr
deleted file mode 100644
index 0200c6d..0000000
--- a/src/test/ui/binding/const-param.min.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0158]: const parameters cannot be referenced in patterns
- --> $DIR/const-param.rs:8:9
- |
-LL | N => {}
- | ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0158`.
diff --git a/src/test/ui/binding/const-param.rs b/src/test/ui/binding/const-param.rs
index 4aec801..2d05180 100644
--- a/src/test/ui/binding/const-param.rs
+++ b/src/test/ui/binding/const-param.rs
@@ -1,7 +1,4 @@
// Identifier pattern referring to a const generic parameter is an error (issue #68853).
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
fn check<const N: usize>() {
match 1 {
diff --git a/src/test/ui/binding/const-param.stderr b/src/test/ui/binding/const-param.stderr
new file mode 100644
index 0000000..adda808
--- /dev/null
+++ b/src/test/ui/binding/const-param.stderr
@@ -0,0 +1,9 @@
+error[E0158]: const parameters cannot be referenced in patterns
+ --> $DIR/const-param.rs:5:9
+ |
+LL | N => {}
+ | ^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0158`.
diff --git a/src/test/ui/binop/binary-op-on-double-ref.stderr b/src/test/ui/binop/binary-op-on-double-ref.stderr
index 02b0488..1651f70 100644
--- a/src/test/ui/binop/binary-op-on-double-ref.stderr
+++ b/src/test/ui/binop/binary-op-on-double-ref.stderr
@@ -9,7 +9,7 @@
help: `%` can be used on `{integer}`, you can dereference `x`
|
LL | *x % 2 == 0
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/binop/binop-consume-args.stderr b/src/test/ui/binop/binop-consume-args.stderr
index ac0a51d..c734f8c 100644
--- a/src/test/ui/binop/binop-consume-args.stderr
+++ b/src/test/ui/binop/binop-consume-args.stderr
@@ -16,7 +16,7 @@
help: consider further restricting this bound
|
LL | fn add<A: Add<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:8:10
@@ -32,7 +32,7 @@
help: consider restricting type parameter `B`
|
LL | fn add<A: Add<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:13:10
@@ -52,7 +52,7 @@
help: consider further restricting this bound
|
LL | fn sub<A: Sub<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:14:10
@@ -68,7 +68,7 @@
help: consider restricting type parameter `B`
|
LL | fn sub<A: Sub<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:19:10
@@ -88,7 +88,7 @@
help: consider further restricting this bound
|
LL | fn mul<A: Mul<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:20:10
@@ -104,7 +104,7 @@
help: consider restricting type parameter `B`
|
LL | fn mul<A: Mul<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:25:10
@@ -124,7 +124,7 @@
help: consider further restricting this bound
|
LL | fn div<A: Div<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:26:10
@@ -140,7 +140,7 @@
help: consider restricting type parameter `B`
|
LL | fn div<A: Div<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:31:10
@@ -160,7 +160,7 @@
help: consider further restricting this bound
|
LL | fn rem<A: Rem<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:32:10
@@ -176,7 +176,7 @@
help: consider restricting type parameter `B`
|
LL | fn rem<A: Rem<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:37:10
@@ -196,7 +196,7 @@
help: consider further restricting this bound
|
LL | fn bitand<A: BitAnd<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:38:10
@@ -212,7 +212,7 @@
help: consider restricting type parameter `B`
|
LL | fn bitand<A: BitAnd<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:43:10
@@ -232,7 +232,7 @@
help: consider further restricting this bound
|
LL | fn bitor<A: BitOr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:44:10
@@ -248,7 +248,7 @@
help: consider restricting type parameter `B`
|
LL | fn bitor<A: BitOr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:49:10
@@ -268,7 +268,7 @@
help: consider further restricting this bound
|
LL | fn bitxor<A: BitXor<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:50:10
@@ -284,7 +284,7 @@
help: consider restricting type parameter `B`
|
LL | fn bitxor<A: BitXor<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:55:10
@@ -304,7 +304,7 @@
help: consider further restricting this bound
|
LL | fn shl<A: Shl<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:56:10
@@ -320,7 +320,7 @@
help: consider restricting type parameter `B`
|
LL | fn shl<A: Shl<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:61:10
@@ -340,7 +340,7 @@
help: consider further restricting this bound
|
LL | fn shr<A: Shr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:62:10
@@ -356,7 +356,7 @@
help: consider restricting type parameter `B`
|
LL | fn shr<A: Shr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error: aborting due to 20 previous errors
diff --git a/src/test/ui/binop/binop-move-semantics.stderr b/src/test/ui/binop/binop-move-semantics.stderr
index fa47de9..7721f88 100644
--- a/src/test/ui/binop/binop-move-semantics.stderr
+++ b/src/test/ui/binop/binop-move-semantics.stderr
@@ -19,7 +19,7 @@
help: consider further restricting this bound
|
LL | fn double_move<T: Add<Output=()> + Copy>(x: T) {
- | ^^^^^^
+ | ++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/binop-move-semantics.rs:14:5
@@ -35,7 +35,7 @@
help: consider further restricting this bound
|
LL | fn move_then_borrow<T: Add<Output=()> + Clone + Copy>(x: T) {
- | ^^^^^^
+ | ++++++
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/binop-move-semantics.rs:21:5
diff --git a/src/test/ui/blind/blind-item-block-item-shadow.stderr b/src/test/ui/blind/blind-item-block-item-shadow.stderr
index d897bf5..68b3f4c 100644
--- a/src/test/ui/blind/blind-item-block-item-shadow.stderr
+++ b/src/test/ui/blind/blind-item-block-item-shadow.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo::Bar as OtherBar;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/blind/blind-item-item-shadow.stderr b/src/test/ui/blind/blind-item-item-shadow.stderr
index f17d784..12b583e 100644
--- a/src/test/ui/blind/blind-item-item-shadow.stderr
+++ b/src/test/ui/blind/blind-item-item-shadow.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo::foo as other_foo;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/block-result/issue-5500.stderr b/src/test/ui/block-result/issue-5500.stderr
index 9d9f7ac..7081b51 100644
--- a/src/test/ui/block-result/issue-5500.stderr
+++ b/src/test/ui/block-result/issue-5500.stderr
@@ -4,13 +4,15 @@
LL | fn main() {
| - expected `()` because of default return type
LL | &panic!()
- | ^^^^^^^^^
- | |
- | expected `()`, found reference
- | help: consider removing the borrow: `panic!()`
+ | ^^^^^^^^^ expected `()`, found reference
|
= note: expected unit type `()`
found reference `&_`
+help: consider removing the borrow
+ |
+LL - &panic!()
+LL + panic!()
+ |
error: aborting due to previous error
diff --git a/src/test/ui/block-result/unexpected-return-on-unit.stderr b/src/test/ui/block-result/unexpected-return-on-unit.stderr
index 4fcd0ee..4acb955 100644
--- a/src/test/ui/block-result/unexpected-return-on-unit.stderr
+++ b/src/test/ui/block-result/unexpected-return-on-unit.stderr
@@ -7,11 +7,11 @@
help: consider using a semicolon here
|
LL | foo();
- | ^
+ | +
help: try adding a return type
|
LL | fn bar() -> usize {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs b/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs
index 2839a65..baf31bd 100644
--- a/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs
+++ b/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs
@@ -1,5 +1,4 @@
// Tests using a combination of pattern features has the expected borrow checking behavior
-#![feature(bindings_after_at)]
#![feature(box_patterns)]
enum Test {
diff --git a/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr b/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
index 2204dca..d4f8193 100644
--- a/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
+++ b/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
@@ -1,5 +1,5 @@
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:37:9
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:36:9
|
LL | ref foo @ [.., ref mut bar] => (),
| -------^^^^^^^^-----------^
@@ -8,7 +8,7 @@
| immutable borrow, by `foo`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:121:9
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:120:9
|
LL | ref foo @ Some(box ref mut s) => (),
| -------^^^^^^^^^^^^---------^
@@ -17,7 +17,7 @@
| immutable borrow, by `foo`, occurs here
error[E0382]: borrow of moved value: `x`
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:19:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:18:5
|
LL | fn bindings_after_at_slice_patterns_move_binding(x: [String; 4]) {
| - move occurs because `x` has type `[String; 4]`, which does not implement the `Copy` trait
@@ -29,7 +29,7 @@
| ^^ value borrowed here after move
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:29:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:28:5
|
LL | ref mut foo @ [.., _] => Some(foo),
| --------------------- mutable borrow occurs here
@@ -41,7 +41,7 @@
| - mutable borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:51:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:50:5
|
LL | [ref foo @ .., ref bar] => Some(foo),
| ------------ immutable borrow occurs here
@@ -53,7 +53,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:63:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:62:5
|
LL | ref foo @ [.., ref bar] => Some(foo),
| ----------------------- immutable borrow occurs here
@@ -65,7 +65,7 @@
| - immutable borrow later used here
error[E0382]: borrow of moved value: `x`
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:77:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:76:5
|
LL | fn bindings_after_at_or_patterns_move(x: Option<Test>) {
| - move occurs because `x` has type `Option<Test>`, which does not implement the `Copy` trait
@@ -80,7 +80,7 @@
| ^^ value borrowed here after move
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:87:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:86:5
|
LL | ref foo @ Some(Test::Foo | Test::Bar) => Some(foo),
| ------------------------------------- immutable borrow occurs here
@@ -92,7 +92,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:99:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:98:5
|
LL | ref mut foo @ Some(Test::Foo | Test::Bar) => Some(foo),
| ----------------------------------------- mutable borrow occurs here
@@ -104,7 +104,7 @@
| - mutable borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:113:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:112:5
|
LL | ref foo @ Some(box ref s) => Some(foo),
| ------------------------- immutable borrow occurs here
@@ -116,7 +116,7 @@
| - immutable borrow later used here
error[E0382]: borrow of moved value: `x`
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:135:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:134:5
|
LL | fn bindings_after_at_slice_patterns_or_patterns_moves(x: [Option<Test>; 4]) {
| - move occurs because `x` has type `[Option<Test>; 4]`, which does not implement the `Copy` trait
@@ -131,7 +131,7 @@
| ^^ value borrowed here after move
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:145:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:144:5
|
LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(a),
| ------------------------------------------------- immutable borrow occurs here
@@ -143,7 +143,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:157:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:156:5
|
LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(b),
| ---------- immutable borrow occurs here
@@ -155,7 +155,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:171:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:170:5
|
LL | [_, ref a @ Some(box ref b), ..] => Some(a),
| ----------------------- immutable borrow occurs here
@@ -167,7 +167,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:187:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:186:5
|
LL | [_, ref a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
| ------------------------------------------- immutable borrow occurs here
@@ -179,7 +179,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:201:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:200:5
|
LL | [_, ref mut a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
| ----------------------------------------------- mutable borrow occurs here
@@ -191,7 +191,7 @@
| - mutable borrow later used here
error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
- --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:215:5
+ --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:214:5
|
LL | ref a @ [_, ref b @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
| ------------------------------------------------------------ immutable borrow occurs here
diff --git a/src/test/ui/borrowck/borrowck-anon-fields-variant.rs b/src/test/ui/borrowck/borrowck-anon-fields-variant.rs
index cecc278..6e63de9 100644
--- a/src/test/ui/borrowck/borrowck-anon-fields-variant.rs
+++ b/src/test/ui/borrowck/borrowck-anon-fields-variant.rs
@@ -14,8 +14,8 @@
// also used for the discriminant of `Foo`, which it would be if `a` was a
// reference.
let b = match y {
- Foo::Y(_, ref mut b) => b,
//~^ ERROR cannot use `y`
+ Foo::Y(_, ref mut b) => b,
Foo::X => panic!()
};
@@ -32,8 +32,9 @@
};
let b = match y {
- Foo::Y(ref mut b, _) => b, //~ ERROR cannot use `y`
- //~| ERROR cannot borrow `y.0` as mutable
+ //~^ ERROR cannot use `y`
+ Foo::Y(ref mut b, _) => b,
+ //~^ ERROR cannot borrow `y.0` as mutable
Foo::X => panic!()
};
diff --git a/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr b/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr
index 2caeed1..98f6f00 100644
--- a/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr
+++ b/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr
@@ -1,29 +1,29 @@
error[E0503]: cannot use `y` because it was mutably borrowed
- --> $DIR/borrowck-anon-fields-variant.rs:17:7
+ --> $DIR/borrowck-anon-fields-variant.rs:16:19
|
LL | Foo::Y(ref mut a, _) => a,
| --------- borrow of `y.0` occurs here
...
-LL | Foo::Y(_, ref mut b) => b,
- | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
+LL | let b = match y {
+ | ^ use of borrowed `y.0`
...
LL | *a += 1;
| ------- borrow later used here
error[E0503]: cannot use `y` because it was mutably borrowed
- --> $DIR/borrowck-anon-fields-variant.rs:35:7
+ --> $DIR/borrowck-anon-fields-variant.rs:34:19
|
LL | Foo::Y(ref mut a, _) => a,
| --------- borrow of `y.0` occurs here
...
-LL | Foo::Y(ref mut b, _) => b,
- | ^^^^^^^^^^^^^^^^^^^^ use of borrowed `y.0`
+LL | let b = match y {
+ | ^ use of borrowed `y.0`
...
LL | *a += 1;
| ------- borrow later used here
error[E0499]: cannot borrow `y.0` as mutable more than once at a time
- --> $DIR/borrowck-anon-fields-variant.rs:35:14
+ --> $DIR/borrowck-anon-fields-variant.rs:36:14
|
LL | Foo::Y(ref mut a, _) => a,
| --------- first mutable borrow occurs here
diff --git a/src/test/ui/borrowck/borrowck-asm.rs b/src/test/ui/borrowck/borrowck-asm.rs
index a3f6452..0d202c1 100644
--- a/src/test/ui/borrowck/borrowck-asm.rs
+++ b/src/test/ui/borrowck/borrowck-asm.rs
@@ -8,6 +8,7 @@
// ignore-sparc64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[cfg(any(target_arch = "x86",
target_arch = "x86_64",
diff --git a/src/test/ui/borrowck/borrowck-asm.stderr b/src/test/ui/borrowck/borrowck-asm.stderr
index 74cf5a5..ff5847d 100644
--- a/src/test/ui/borrowck/borrowck-asm.stderr
+++ b/src/test/ui/borrowck/borrowck-asm.stderr
@@ -1,5 +1,5 @@
error[E0382]: use of moved value: `x`
- --> $DIR/borrowck-asm.rs:25:17
+ --> $DIR/borrowck-asm.rs:26:17
|
LL | let x = &mut 0isize;
| - move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait
@@ -11,7 +11,7 @@
| ^ value used here after move
error[E0503]: cannot use `x` because it was mutably borrowed
- --> $DIR/borrowck-asm.rs:32:37
+ --> $DIR/borrowck-asm.rs:33:37
|
LL | let y = &mut x;
| ------ borrow of `x` occurs here
@@ -23,7 +23,7 @@
| - borrow later used here
error[E0384]: cannot assign twice to immutable variable `x`
- --> $DIR/borrowck-asm.rs:40:36
+ --> $DIR/borrowck-asm.rs:41:36
|
LL | let x = 3;
| -
@@ -35,7 +35,7 @@
| ^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `x`
- --> $DIR/borrowck-asm.rs:54:36
+ --> $DIR/borrowck-asm.rs:55:36
|
LL | let x = 3;
| -
@@ -47,13 +47,13 @@
| ^ cannot assign twice to immutable variable
error[E0381]: use of possibly-uninitialized variable: `x`
- --> $DIR/borrowck-asm.rs:61:37
+ --> $DIR/borrowck-asm.rs:62:37
|
LL | llvm_asm!("nop" : "=*r"(x));
| ^ use of possibly-uninitialized `x`
error[E0506]: cannot assign to `x` because it is borrowed
- --> $DIR/borrowck-asm.rs:69:36
+ --> $DIR/borrowck-asm.rs:70:36
|
LL | let y = &*x;
| --- borrow of `x` occurs here
@@ -65,7 +65,7 @@
| - borrow later used here
error[E0382]: use of moved value: `x`
- --> $DIR/borrowck-asm.rs:77:45
+ --> $DIR/borrowck-asm.rs:78:45
|
LL | let x = &mut 2;
| - move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait
diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.rs b/src/test/ui/borrowck/borrowck-describe-lvalue.rs
index 0e6c063..cdcff69 100644
--- a/src/test/ui/borrowck/borrowck-describe-lvalue.rs
+++ b/src/test/ui/borrowck/borrowck-describe-lvalue.rs
@@ -164,9 +164,9 @@
let mut e = E::A(3);
let x = &mut e;
match e {
+ //~^ ERROR cannot use `e` because it was mutably borrowed
E::A(ref ax) =>
//~^ ERROR cannot borrow `e.0` as immutable because it is also borrowed as mutable
- //~| ERROR cannot use `e` because it was mutably borrowed
println!("e.ax: {:?}", ax),
E::B { x: ref bx } =>
//~^ ERROR cannot borrow `e.x` as immutable because it is also borrowed as mutable
diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
index 0f2ebbc..4b9c5a2 100644
--- a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
+++ b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
@@ -238,23 +238,22 @@
| - borrow later used here
error[E0503]: cannot use `e` because it was mutably borrowed
- --> $DIR/borrowck-describe-lvalue.rs:167:13
+ --> $DIR/borrowck-describe-lvalue.rs:166:15
|
LL | let x = &mut e;
| ------ borrow of `e` occurs here
LL | match e {
-LL | E::A(ref ax) =>
- | ^^^^^^^^^^^^ use of borrowed `e`
+ | ^ use of borrowed `e`
...
LL | drop(x);
| - borrow later used here
error[E0502]: cannot borrow `e.0` as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-describe-lvalue.rs:167:18
+ --> $DIR/borrowck-describe-lvalue.rs:168:18
|
LL | let x = &mut e;
| ------ mutable borrow occurs here
-LL | match e {
+...
LL | E::A(ref ax) =>
| ^^^^^^ immutable borrow occurs here
...
diff --git a/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr b/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr
index 3195120..acf6b37 100644
--- a/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr
+++ b/src/test/ui/borrowck/borrowck-escaping-closure-error-1.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
LL | spawn(move || books.push(4));
- | ^^^^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr b/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr
index 3227aa9b..8140425 100644
--- a/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr
+++ b/src/test/ui/borrowck/borrowck-escaping-closure-error-2.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
LL | Box::new(move || books.push(4))
- | ^^^^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-match-already-borrowed.rs b/src/test/ui/borrowck/borrowck-match-already-borrowed.rs
index c766e6c..a925cbb 100644
--- a/src/test/ui/borrowck/borrowck-match-already-borrowed.rs
+++ b/src/test/ui/borrowck/borrowck-match-already-borrowed.rs
@@ -6,8 +6,8 @@
fn match_enum() {
let mut foo = Foo::B;
let p = &mut foo;
- let _ = match foo {
- Foo::B => 1, //~ ERROR [E0503]
+ let _ = match foo { //~ ERROR [E0503]
+ Foo::B => 1,
_ => 2,
Foo::A(x) => x //~ ERROR [E0503]
};
diff --git a/src/test/ui/borrowck/borrowck-match-already-borrowed.stderr b/src/test/ui/borrowck/borrowck-match-already-borrowed.stderr
index 286a925..39047be 100644
--- a/src/test/ui/borrowck/borrowck-match-already-borrowed.stderr
+++ b/src/test/ui/borrowck/borrowck-match-already-borrowed.stderr
@@ -1,11 +1,10 @@
error[E0503]: cannot use `foo` because it was mutably borrowed
- --> $DIR/borrowck-match-already-borrowed.rs:10:9
+ --> $DIR/borrowck-match-already-borrowed.rs:9:19
|
LL | let p = &mut foo;
| -------- borrow of `foo` occurs here
LL | let _ = match foo {
-LL | Foo::B => 1,
- | ^^^^^^ use of borrowed `foo`
+ | ^^^ use of borrowed `foo`
...
LL | drop(p);
| - borrow later used here
diff --git a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr
index a345c12..a865812 100644
--- a/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-of-vec-tail.stderr
@@ -12,8 +12,8 @@
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the `&`
|
-LL | [Foo { string: a },
-LL | Foo { string: b }] => {
+LL ~ [Foo { string: a },
+LL ~ Foo { string: b }] => {
|
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-unboxed-closures.stderr b/src/test/ui/borrowck/borrowck-unboxed-closures.stderr
index bc17219..d46ef12 100644
--- a/src/test/ui/borrowck/borrowck-unboxed-closures.stderr
+++ b/src/test/ui/borrowck/borrowck-unboxed-closures.stderr
@@ -34,7 +34,7 @@
help: consider further restricting this bound
|
LL | fn c<F:FnOnce(isize, isize) -> isize + Copy>(f: F) {
- | ^^^^^^
+ | ++++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
index b4b3bc1..36f8f5c 100644
--- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
+++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
@@ -36,12 +36,12 @@
|
help: consider removing the `&mut`
|
-LL | [_a,
-LL |
-LL |
-LL |
-LL | ..
-LL | ] => {
+LL ~ [_a,
+LL +
+LL +
+LL +
+LL + ..
+LL ~ ] => {
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
@@ -68,9 +68,9 @@
|
help: consider removing the `&mut`
|
-LL | [
-LL |
-LL | _b] => {}
+LL ~ [
+LL +
+LL ~ _b] => {}
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
diff --git a/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.rs b/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.rs
index 71f1f15..4109c10 100644
--- a/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.rs
+++ b/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.rs
@@ -10,11 +10,11 @@
fn main() {
let b = &mut true;
match b {
+ //~^ ERROR use of moved value: `b` [E0382]
&mut false => {},
_ if { (|| { let bar = b; *bar = false; })();
false } => { },
&mut true => { println!("You might think we should get here"); },
- //~^ ERROR use of moved value: `b` [E0382]
_ => panic!("surely we could never get here, since rustc warns it is unreachable."),
}
}
diff --git a/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.stderr b/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.stderr
index 51f9b46..9be1a92 100644
--- a/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.stderr
+++ b/src/test/ui/borrowck/issue-27282-move-match-input-into-guard.stderr
@@ -1,16 +1,15 @@
error[E0382]: use of moved value: `b`
- --> $DIR/issue-27282-move-match-input-into-guard.rs:16:14
+ --> $DIR/issue-27282-move-match-input-into-guard.rs:12:5
|
LL | let b = &mut true;
| - move occurs because `b` has type `&mut bool`, which does not implement the `Copy` trait
+LL | match b {
+ | ^^^^^^^ value used here after move
...
LL | _ if { (|| { let bar = b; *bar = false; })();
| -- - variable moved due to use in closure
| |
| value moved into closure here
-LL | false } => { },
-LL | &mut true => { println!("You might think we should get here"); },
- | ^^^^ value used here after move
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/issue-33819.rs b/src/test/ui/borrowck/issue-33819.rs
index b73e859..fff5015 100644
--- a/src/test/ui/borrowck/issue-33819.rs
+++ b/src/test/ui/borrowck/issue-33819.rs
@@ -3,6 +3,7 @@
match op {
Some(ref v) => { let a = &mut v; },
//~^ ERROR cannot borrow `v` as mutable, as it is not declared as mutable
+ //~| HELP try removing `&mut` here
None => {},
}
}
diff --git a/src/test/ui/borrowck/issue-33819.stderr b/src/test/ui/borrowck/issue-33819.stderr
index 8bc2d82..f77fdbf 100644
--- a/src/test/ui/borrowck/issue-33819.stderr
+++ b/src/test/ui/borrowck/issue-33819.stderr
@@ -5,7 +5,7 @@
| ^^^^^^
| |
| cannot borrow as mutable
- | try removing `&mut` here
+ | help: try removing `&mut` here
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/issue-41962.stderr b/src/test/ui/borrowck/issue-41962.stderr
index dd3090b..b20cc6d8 100644
--- a/src/test/ui/borrowck/issue-41962.stderr
+++ b/src/test/ui/borrowck/issue-41962.stderr
@@ -8,7 +8,7 @@
help: borrow this field in the pattern to avoid moving `maybe.0`
|
LL | if let Some(ref thing) = maybe {
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/issue-64453.rs b/src/test/ui/borrowck/issue-64453.rs
index 3e803f3..9e70a84 100644
--- a/src/test/ui/borrowck/issue-64453.rs
+++ b/src/test/ui/borrowck/issue-64453.rs
@@ -3,7 +3,7 @@
static settings_dir: String = format!("");
//~^ ERROR calls in statics are limited to constant functions
-//~| ERROR calls in statics are limited to constant functions
+//~| ERROR is not yet stable as a const
fn from_string(_: String) -> Value {
Value
diff --git a/src/test/ui/borrowck/issue-64453.stderr b/src/test/ui/borrowck/issue-64453.stderr
index bd8270e..14e1667 100644
--- a/src/test/ui/borrowck/issue-64453.stderr
+++ b/src/test/ui/borrowck/issue-64453.stderr
@@ -1,15 +1,10 @@
-error[E0507]: cannot move out of static item `settings_dir`
- --> $DIR/issue-64453.rs:14:37
- |
-LL | let settings_data = from_string(settings_dir);
- | ^^^^^^^^^^^^ move occurs because `settings_dir` has type `String`, which does not implement the `Copy` trait
-
-error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
+error: `Arguments::<'a>::new_v1` is not yet stable as a const fn
--> $DIR/issue-64453.rs:4:31
|
LL | static settings_dir: String = format!("");
| ^^^^^^^^^^^
|
+ = help: add `#![feature(const_fmt_arguments_new)]` to the crate attributes to enable
= note: this error originates in the macro `$crate::__export::format_args` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
@@ -20,6 +15,12 @@
|
= note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
+error[E0507]: cannot move out of static item `settings_dir`
+ --> $DIR/issue-64453.rs:14:37
+ |
+LL | let settings_data = from_string(settings_dir);
+ | ^^^^^^^^^^^^ move occurs because `settings_dir` has type `String`, which does not implement the `Copy` trait
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0015, E0507.
diff --git a/src/test/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr b/src/test/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr
index 0d506a0..4bd0667 100644
--- a/src/test/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr
+++ b/src/test/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr
@@ -26,7 +26,7 @@
help: add missing generic argument
|
LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_, T> {
- | ^^^
+ | +++
error[E0515]: cannot return value referencing temporary value
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:19:5
diff --git a/src/test/ui/borrowck/issue-85765.rs b/src/test/ui/borrowck/issue-85765.rs
index 1a5f743..2b1ab2f 100644
--- a/src/test/ui/borrowck/issue-85765.rs
+++ b/src/test/ui/borrowck/issue-85765.rs
@@ -12,4 +12,18 @@
*r = 0;
//~^ ERROR cannot assign to `*r`, which is behind a `&` reference
//~| NOTE `r` is a `&` reference, so the data it refers to cannot be written
+
+ #[rustfmt::skip]
+ let x: &usize = &mut{0};
+ //~^ HELP consider changing this to be a mutable reference
+ *x = 1;
+ //~^ ERROR cannot assign to `*x`, which is behind a `&` reference
+ //~| NOTE `x` is a `&` reference, so the data it refers to cannot be written
+
+ #[rustfmt::skip]
+ let y: &usize = &mut(0);
+ //~^ HELP consider changing this to be a mutable reference
+ *y = 1;
+ //~^ ERROR cannot assign to `*y`, which is behind a `&` reference
+ //~| NOTE `y` is a `&` reference, so the data it refers to cannot be written
}
diff --git a/src/test/ui/borrowck/issue-85765.stderr b/src/test/ui/borrowck/issue-85765.stderr
index 4da4c8f..af83c6e 100644
--- a/src/test/ui/borrowck/issue-85765.stderr
+++ b/src/test/ui/borrowck/issue-85765.stderr
@@ -16,7 +16,25 @@
LL | *r = 0;
| ^^^^^^ `r` is a `&` reference, so the data it refers to cannot be written
-error: aborting due to 2 previous errors
+error[E0594]: cannot assign to `*x`, which is behind a `&` reference
+ --> $DIR/issue-85765.rs:19:5
+ |
+LL | let x: &usize = &mut{0};
+ | - help: consider changing this to be a mutable reference: `&mut usize`
+LL |
+LL | *x = 1;
+ | ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
+
+error[E0594]: cannot assign to `*y`, which is behind a `&` reference
+ --> $DIR/issue-85765.rs:26:5
+ |
+LL | let y: &usize = &mut(0);
+ | - help: consider changing this to be a mutable reference: `&mut usize`
+LL |
+LL | *y = 1;
+ | ^^^^^^ `y` is a `&` reference, so the data it refers to cannot be written
+
+error: aborting due to 4 previous errors
Some errors have detailed explanations: E0594, E0596.
For more information about an error, try `rustc --explain E0594`.
diff --git a/src/test/ui/borrowck/move-error-snippets.stderr b/src/test/ui/borrowck/move-error-snippets.stderr
index 7821dc0..e7ecd00 100644
--- a/src/test/ui/borrowck/move-error-snippets.stderr
+++ b/src/test/ui/borrowck/move-error-snippets.stderr
@@ -6,7 +6,7 @@
| |
| move occurs because `D` has type `A`, which does not implement the `Copy` trait
| help: consider borrowing here: `&$c`
- |
+ |
::: $DIR/move-error-snippets.rs:21:1
|
LL | sss!();
diff --git a/src/test/ui/borrowck/move-in-pattern-mut-in-loop.stderr b/src/test/ui/borrowck/move-in-pattern-mut-in-loop.stderr
index 9373e4d..c6931ba 100644
--- a/src/test/ui/borrowck/move-in-pattern-mut-in-loop.stderr
+++ b/src/test/ui/borrowck/move-in-pattern-mut-in-loop.stderr
@@ -8,7 +8,7 @@
help: borrow this field in the pattern to avoid moving `opt.0`
|
LL | if let Some(ref mut _x) = opt {}
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/move-in-pattern-mut.stderr b/src/test/ui/borrowck/move-in-pattern-mut.stderr
index 17bc549..2bf34b3 100644
--- a/src/test/ui/borrowck/move-in-pattern-mut.stderr
+++ b/src/test/ui/borrowck/move-in-pattern-mut.stderr
@@ -11,7 +11,7 @@
help: borrow this field in the pattern to avoid moving `s.0`
|
LL | if let Some(ref mut x) = s {
- | ^^^
+ | +++
error[E0382]: use of partially moved value: `e`
--> $DIR/move-in-pattern-mut.rs:22:9
@@ -26,7 +26,7 @@
help: borrow this field in the pattern to avoid moving `e.s`
|
LL | let E::V { s: ref mut x } = e;
- | ^^^
+ | +++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/borrowck/move-in-pattern.stderr b/src/test/ui/borrowck/move-in-pattern.stderr
index 21ba92f..6b84c00 100644
--- a/src/test/ui/borrowck/move-in-pattern.stderr
+++ b/src/test/ui/borrowck/move-in-pattern.stderr
@@ -11,7 +11,7 @@
help: borrow this field in the pattern to avoid moving `s.0`
|
LL | if let Some(ref x) = s {
- | ^^^
+ | +++
error[E0382]: use of partially moved value: `e`
--> $DIR/move-in-pattern.rs:23:9
@@ -26,7 +26,7 @@
help: borrow this field in the pattern to avoid moving `e.s`
|
LL | let E::V { s: ref x } = e;
- | ^^^
+ | +++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/borrowck/mut-borrow-in-loop-2.stderr b/src/test/ui/borrowck/mut-borrow-in-loop-2.stderr
index fa1b741..8b05b23 100644
--- a/src/test/ui/borrowck/mut-borrow-in-loop-2.stderr
+++ b/src/test/ui/borrowck/mut-borrow-in-loop-2.stderr
@@ -10,7 +10,7 @@
help: consider creating a fresh reborrow of `value` here
|
LL | Other::handle(&mut *value);
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs b/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs
index 59b541a..7cdb16b 100644
--- a/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs
+++ b/src/test/ui/borrowck/mut-borrow-of-mut-ref.rs
@@ -2,10 +2,36 @@
#![crate_type = "rlib"]
pub fn f(b: &mut i32) {
- g(&mut b);
+ //~^ NOTE the binding is already a mutable borrow
+ //~| NOTE the binding is already a mutable borrow
+ h(&mut b);
//~^ ERROR cannot borrow
+ //~| NOTE cannot borrow as mutable
+ //~| HELP try removing `&mut` here
g(&mut &mut b);
//~^ ERROR cannot borrow
+ //~| NOTE cannot borrow as mutable
+ //~| HELP try removing `&mut` here
}
-pub fn g(_: &mut i32) {}
+pub fn g(b: &mut i32) { //~ NOTE the binding is already a mutable borrow
+ h(&mut &mut b);
+ //~^ ERROR cannot borrow
+ //~| NOTE cannot borrow as mutable
+ //~| HELP try removing `&mut` here
+}
+
+pub fn h(_: &mut i32) {}
+
+trait Foo {
+ fn bar(&mut self);
+}
+
+impl Foo for &mut String {
+ fn bar(&mut self) {}
+}
+
+pub fn baz(f: &mut String) { //~ HELP consider making the binding mutable
+ f.bar(); //~ ERROR cannot borrow `f` as mutable, as it is not declared as mutable
+ //~^ NOTE cannot borrow as mutable
+}
diff --git a/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr b/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr
index 8710f20..e4c51bb 100644
--- a/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr
+++ b/src/test/ui/borrowck/mut-borrow-of-mut-ref.stderr
@@ -1,21 +1,65 @@
error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
- --> $DIR/mut-borrow-of-mut-ref.rs:5:7
+ --> $DIR/mut-borrow-of-mut-ref.rs:7:7
|
-LL | g(&mut b);
- | ^^^^^^
- | |
- | cannot borrow as mutable
- | try removing `&mut` here
+LL | h(&mut b);
+ | ^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/mut-borrow-of-mut-ref.rs:4:13
+ |
+LL | pub fn f(b: &mut i32) {
+ | ^^^^^^^^
+help: try removing `&mut` here
+ |
+LL - h(&mut b);
+LL + h(b);
+ |
error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
- --> $DIR/mut-borrow-of-mut-ref.rs:7:12
+ --> $DIR/mut-borrow-of-mut-ref.rs:11:12
|
LL | g(&mut &mut b);
- | ^^^^^^
- | |
- | cannot borrow as mutable
- | try removing `&mut` here
+ | ^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/mut-borrow-of-mut-ref.rs:4:13
+ |
+LL | pub fn f(b: &mut i32) {
+ | ^^^^^^^^
+help: try removing `&mut` here
+ |
+LL - g(&mut &mut b);
+LL + g(&mut b);
+ |
-error: aborting due to 2 previous errors
+error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable
+ --> $DIR/mut-borrow-of-mut-ref.rs:18:12
+ |
+LL | h(&mut &mut b);
+ | ^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/mut-borrow-of-mut-ref.rs:17:13
+ |
+LL | pub fn g(b: &mut i32) {
+ | ^^^^^^^^
+help: try removing `&mut` here
+ |
+LL - h(&mut &mut b);
+LL + h(&mut b);
+ |
+
+error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
+ --> $DIR/mut-borrow-of-mut-ref.rs:35:5
+ |
+LL | f.bar();
+ | ^ cannot borrow as mutable
+ |
+help: consider making the binding mutable
+ |
+LL | pub fn baz(mut f: &mut String) {
+ | +++
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0596`.
diff --git a/src/test/ui/bound-suggestions.stderr b/src/test/ui/bound-suggestions.stderr
index 78f6259..04f233a 100644
--- a/src/test/ui/bound-suggestions.stderr
+++ b/src/test/ui/bound-suggestions.stderr
@@ -8,7 +8,7 @@
help: consider further restricting this bound
|
LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:15:22
@@ -20,7 +20,7 @@
help: consider restricting type parameter `T`
|
LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:21:22
@@ -32,7 +32,7 @@
help: consider further restricting this bound
|
LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `Y` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:27:30
@@ -44,7 +44,7 @@
help: consider further restricting type parameter `Y`
|
LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:33:22
@@ -56,7 +56,7 @@
help: consider further restricting this bound
|
LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:39:22
@@ -68,87 +68,87 @@
help: consider further restricting type parameter `X`
|
LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: std::fmt::Debug {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:44:46
|
LL | const SIZE: usize = core::mem::size_of::<Self>();
| ^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
- |
+ | ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
|
LL | trait Foo<T>: Sized {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:49:46
|
LL | const SIZE: usize = core::mem::size_of::<Self>();
| ^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
- |
+ | ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
|
LL | trait Bar: std::fmt::Display + Sized {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:54:46
|
LL | const SIZE: usize = core::mem::size_of::<Self>();
| ^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
- |
+ | ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
|
LL | trait Baz: Sized where Self: std::fmt::Display {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:59:46
|
LL | const SIZE: usize = core::mem::size_of::<Self>();
| ^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
- |
+ | ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
|
LL | trait Qux<T>: Sized where Self: std::fmt::Display {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:64:46
|
LL | const SIZE: usize = core::mem::size_of::<Self>();
| ^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
- |
+ | ^ required by this bound in `std::mem::size_of`
help: consider further restricting `Self`
|
LL | trait Bat<T>: std::fmt::Display + Sized {
- | ^^^^^^^
+ | +++++++
error: aborting due to 11 previous errors
diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr
index 7ff986e..492316f 100644
--- a/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr
+++ b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr
@@ -1,32 +1,36 @@
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/builtin-superkinds-double-superkind.rs:6:24
|
-LL | trait Foo : Send+Sync { }
- | ---- required by this bound in `Foo`
-LL |
LL | impl <T: Sync+'static> Foo for (T,) { }
| ^^^ `T` cannot be sent between threads safely
|
= note: required because it appears within the type `(T,)`
+note: required by a bound in `Foo`
+ --> $DIR/builtin-superkinds-double-superkind.rs:4:13
+ |
+LL | trait Foo : Send+Sync { }
+ | ^^^^ required by this bound in `Foo`
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for (T,) { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/builtin-superkinds-double-superkind.rs:9:16
|
-LL | trait Foo : Send+Sync { }
- | ---- required by this bound in `Foo`
-...
LL | impl <T: Send> Foo for (T,T) { }
| ^^^ `T` cannot be shared between threads safely
|
= note: required because it appears within the type `(T, T)`
+note: required by a bound in `Foo`
+ --> $DIR/builtin-superkinds-double-superkind.rs:4:18
+ |
+LL | trait Foo : Send+Sync { }
+ | ^^^^ required by this bound in `Foo`
help: consider further restricting this bound
|
LL | impl <T: Send + std::marker::Sync> Foo for (T,T) { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr
index 0d1d747..a46e4b23 100644
--- a/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr
+++ b/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr
@@ -3,21 +3,21 @@
|
LL | impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely
- |
- ::: $DIR/auxiliary/trait_superkinds_in_metadata.rs:7:58
- |
-LL | pub trait RequiresRequiresShareAndSend : RequiresShare + Send { }
- | ---- required by this bound in `RequiresRequiresShareAndSend`
|
note: required because it appears within the type `X<T>`
--> $DIR/builtin-superkinds-in-metadata.rs:9:8
|
LL | struct X<T>(T);
| ^
+note: required by a bound in `RequiresRequiresShareAndSend`
+ --> $DIR/auxiliary/trait_superkinds_in_metadata.rs:7:58
+ |
+LL | pub trait RequiresRequiresShareAndSend : RequiresShare + Send { }
+ | ^^^^ required by this bound in `RequiresRequiresShareAndSend`
help: consider further restricting this bound
|
LL | impl <T:Sync+'static + std::marker::Send> RequiresRequiresShareAndSend for X<T> { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-simple.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-simple.stderr
index 0abe205..9db9cbf 100644
--- a/src/test/ui/builtin-superkinds/builtin-superkinds-simple.stderr
+++ b/src/test/ui/builtin-superkinds/builtin-superkinds-simple.stderr
@@ -1,13 +1,15 @@
error[E0277]: `Rc<i8>` cannot be sent between threads safely
--> $DIR/builtin-superkinds-simple.rs:6:6
|
-LL | trait Foo : Send { }
- | ---- required by this bound in `Foo`
-LL |
LL | impl Foo for std::rc::Rc<i8> { }
| ^^^ `Rc<i8>` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Rc<i8>`
+note: required by a bound in `Foo`
+ --> $DIR/builtin-superkinds-simple.rs:4:13
+ |
+LL | trait Foo : Send { }
+ | ^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr
index ad80b3f..3ec0b90 100644
--- a/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr
+++ b/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr
@@ -1,16 +1,18 @@
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/builtin-superkinds-typaram-not-send.rs:5:24
|
-LL | trait Foo : Send { }
- | ---- required by this bound in `Foo`
-LL |
LL | impl <T: Sync+'static> Foo for T { }
| ^^^ `T` cannot be sent between threads safely
|
+note: required by a bound in `Foo`
+ --> $DIR/builtin-superkinds-typaram-not-send.rs:3:13
+ |
+LL | trait Foo : Send { }
+ | ^^^^ required by this bound in `Foo`
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for T { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/c-variadic/issue-86053-1.stderr b/src/test/ui/c-variadic/issue-86053-1.stderr
index ec7ee74..7930681 100644
--- a/src/test/ui/c-variadic/issue-86053-1.stderr
+++ b/src/test/ui/c-variadic/issue-86053-1.stderr
@@ -63,7 +63,7 @@
|
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
| ^
- |
+ |
::: $SRC_DIR/core/src/ops/function.rs:LL:COL
|
LL | pub trait Fn<Args>: FnMut<Args> {
@@ -72,11 +72,11 @@
help: a trait with a similar name exists
|
LL | self , ... , self , self , ... ) where Fn : FnOnce ( & 'a & 'b usize ) {
- | ^^
+ | ~~
help: you might be missing a type parameter
|
LL | fn ordering4 < 'a , 'b, F > ( a : , self , self , self ,
- | ^^^
+ | +++
error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references
--> $DIR/issue-86053-1.rs:11:52
diff --git a/src/test/ui/c-variadic/variadic-ffi-6.stderr b/src/test/ui/c-variadic/variadic-ffi-6.stderr
index 4626a4b..bb15cc0 100644
--- a/src/test/ui/c-variadic/variadic-ffi-6.stderr
+++ b/src/test/ui/c-variadic/variadic-ffi-6.stderr
@@ -8,7 +8,7 @@
help: consider using the `'static` lifetime
|
LL | ) -> &'static usize {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/cast/issue-84213.stderr b/src/test/ui/cast/issue-84213.stderr
index 90cfa26..025970e 100644
--- a/src/test/ui/cast/issue-84213.stderr
+++ b/src/test/ui/cast/issue-84213.stderr
@@ -7,7 +7,7 @@
help: consider borrowing the value
|
LL | let _pointer_to_something = &something as *const Something;
- | ^
+ | +
error[E0605]: non-primitive cast: `Something` as `*mut Something`
--> $DIR/issue-84213.rs:14:37
@@ -18,7 +18,7 @@
help: consider borrowing the value
|
LL | let _mut_pointer_to_something = &mut something as *mut Something;
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/cast/issue-85586.rs b/src/test/ui/cast/issue-85586.rs
new file mode 100644
index 0000000..7881658
--- /dev/null
+++ b/src/test/ui/cast/issue-85586.rs
@@ -0,0 +1,10 @@
+// Check that errors for unresolved types in cast expressions are reported
+// for the offending subexpression, not the whole cast expression.
+
+#![allow(unused_variables)]
+
+fn main() {
+ let a = [1, 2, 3].iter().sum();
+ let b = (a + 1) as usize;
+ //~^ ERROR: type annotations needed [E0282]
+}
diff --git a/src/test/ui/cast/issue-85586.stderr b/src/test/ui/cast/issue-85586.stderr
new file mode 100644
index 0000000..271885a
--- /dev/null
+++ b/src/test/ui/cast/issue-85586.stderr
@@ -0,0 +1,11 @@
+error[E0282]: type annotations needed
+ --> $DIR/issue-85586.rs:8:13
+ |
+LL | let b = (a + 1) as usize;
+ | ^^^^^^^ cannot infer type
+ |
+ = note: type must be known at this point
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/chalkify/chalk_initial_program.stderr b/src/test/ui/chalkify/chalk_initial_program.stderr
index f2e13a6..f8b792a 100644
--- a/src/test/ui/chalkify/chalk_initial_program.stderr
+++ b/src/test/ui/chalkify/chalk_initial_program.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `f32: Foo` is not satisfied
--> $DIR/chalk_initial_program.rs:15:13
|
-LL | fn gimme<F: Foo>() { }
- | --- required by this bound in `gimme`
-...
LL | gimme::<f32>();
| ^^^ the trait `Foo` is not implemented for `f32`
+ |
+note: required by a bound in `gimme`
+ --> $DIR/chalk_initial_program.rs:9:13
+ |
+LL | fn gimme<F: Foo>() { }
+ | ^^^ required by this bound in `gimme`
error: aborting due to previous error
diff --git a/src/test/ui/chalkify/generic_impls.stderr b/src/test/ui/chalkify/generic_impls.stderr
index a6f5d1a..0c7fcd0 100644
--- a/src/test/ui/chalkify/generic_impls.stderr
+++ b/src/test/ui/chalkify/generic_impls.stderr
@@ -1,26 +1,30 @@
error[E0277]: the trait bound `(Option<T>, f32): Foo` is not satisfied
--> $DIR/generic_impls.rs:12:13
|
-LL | fn gimme<F: Foo>() { }
- | --- required by this bound in `gimme`
-...
LL | gimme::<(Option<T>, f32)>();
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(Option<T>, f32)`
|
= help: the following implementations were found:
<(T, u32) as Foo>
+note: required by a bound in `gimme`
+ --> $DIR/generic_impls.rs:7:13
+ |
+LL | fn gimme<F: Foo>() { }
+ | ^^^ required by this bound in `gimme`
error[E0277]: the trait bound `(i32, f32): Foo` is not satisfied
--> $DIR/generic_impls.rs:17:13
|
-LL | fn gimme<F: Foo>() { }
- | --- required by this bound in `gimme`
-...
LL | gimme::<(i32, f32)>();
| ^^^^^^^^^^ the trait `Foo` is not implemented for `(i32, f32)`
|
= help: the following implementations were found:
<(T, u32) as Foo>
+note: required by a bound in `gimme`
+ --> $DIR/generic_impls.rs:7:13
+ |
+LL | fn gimme<F: Foo>() { }
+ | ^^^ required by this bound in `gimme`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/chalkify/impl_wf.stderr b/src/test/ui/chalkify/impl_wf.stderr
index 24c7f0d..95e3207 100644
--- a/src/test/ui/chalkify/impl_wf.stderr
+++ b/src/test/ui/chalkify/impl_wf.stderr
@@ -1,22 +1,27 @@
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/impl_wf.rs:11:6
|
-LL | trait Foo: Sized { }
- | ----- required by this bound in `Foo`
-...
LL | impl Foo for str { }
| ^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
+note: required by a bound in `Foo`
+ --> $DIR/impl_wf.rs:3:12
+ |
+LL | trait Foo: Sized { }
+ | ^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `f32: Foo` is not satisfied
--> $DIR/impl_wf.rs:22:6
|
-LL | trait Baz<U: ?Sized> where U: Foo { }
- | --- required by this bound in `Baz`
-...
LL | impl Baz<f32> for f32 { }
| ^^^^^^^^ the trait `Foo` is not implemented for `f32`
+ |
+note: required by a bound in `Baz`
+ --> $DIR/impl_wf.rs:18:31
+ |
+LL | trait Baz<U: ?Sized> where U: Foo { }
+ | ^^^ required by this bound in `Baz`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/chalkify/impl_wf_2.stderr b/src/test/ui/chalkify/impl_wf_2.stderr
index 1da2144..0aac962 100644
--- a/src/test/ui/chalkify/impl_wf_2.stderr
+++ b/src/test/ui/chalkify/impl_wf_2.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `f32: Foo` is not satisfied
--> $DIR/impl_wf_2.rs:25:5
|
-LL | type Item: Foo;
- | --- required by this bound in `Bar::Item`
-...
LL | type Item = f32;
| ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `f32`
+ |
+note: required by a bound in `Bar::Item`
+ --> $DIR/impl_wf_2.rs:8:16
+ |
+LL | type Item: Foo;
+ | ^^^ required by this bound in `Bar::Item`
error: aborting due to previous error
diff --git a/src/test/ui/chalkify/type_inference.stderr b/src/test/ui/chalkify/type_inference.stderr
index 91c46b9..a4a480a 100644
--- a/src/test/ui/chalkify/type_inference.stderr
+++ b/src/test/ui/chalkify/type_inference.stderr
@@ -1,15 +1,17 @@
error[E0277]: the trait bound `{float}: Bar` is not satisfied
--> $DIR/type_inference.rs:27:14
|
-LL | fn only_bar<T: Bar>(_x: T) { }
- | --- required by this bound in `only_bar`
-...
LL | only_bar(x);
| ^ the trait `Bar` is not implemented for `{float}`
|
= help: the following implementations were found:
<i32 as Bar>
<u32 as Bar>
+note: required by a bound in `only_bar`
+ --> $DIR/type_inference.rs:12:16
+ |
+LL | fn only_bar<T: Bar>(_x: T) { }
+ | ^^^ required by this bound in `only_bar`
error: aborting due to previous error
diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr
index 64a0b52..768dc8e 100644
--- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr
+++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr
@@ -21,23 +21,33 @@
|
= help: consider replacing `'x` with `'static`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/expect-fn-supply-fn.rs:32:49
|
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r> fn(&'r u32)`
+ found fn pointer `fn(&u32)`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/expect-fn-supply-fn.rs:39:50
|
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected fn pointer `fn(&'x u32)`
+ found fn pointer `for<'r> fn(&'r u32)`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/expect-fn-supply-fn.rs:48:50
|
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected fn pointer `fn(&u32)`
+ found fn pointer `for<'r> fn(&'r u32)`
error: aborting due to 5 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr b/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr
index 93b42a5..ba4c9b6 100644
--- a/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr
+++ b/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr
@@ -1,15 +1,18 @@
error[E0631]: type mismatch in closure arguments
--> $DIR/expect-infer-var-appearing-twice.rs:14:5
|
-LL | fn with_closure<F, A>(_: F)
- | ------------ required by a bound in this
-LL | where F: FnOnce(A, A)
- | ------------ required by this bound in `with_closure`
-...
LL | with_closure(|x: u32, y: i32| {
| ^^^^^^^^^^^^ ---------------- found signature of `fn(u32, i32) -> _`
| |
| expected signature of `fn(_, _) -> _`
+ |
+note: required by a bound in `with_closure`
+ --> $DIR/expect-infer-var-appearing-twice.rs:2:14
+ |
+LL | fn with_closure<F, A>(_: F)
+ | ------------ required by a bound in this
+LL | where F: FnOnce(A, A)
+ | ^^^^^^^^^^^^ required by this bound in `with_closure`
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr
index 29bd4b2..bb00465 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/borrowck/borrowck-4.stderr
@@ -15,7 +15,7 @@
help: to force the closure to take ownership of `p` (and any other referenced variables), use the `move` keyword
|
LL | let mut c = move || {
- | ^^^^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-87378.rs b/src/test/ui/closures/2229_closure_analysis/issue-87378.rs
new file mode 100644
index 0000000..75901a57
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-87378.rs
@@ -0,0 +1,26 @@
+#![feature(rustc_attrs)]
+
+// edition:2021
+
+// Test that any precise capture on a union is truncated because it's unsafe to do so.
+
+union Union {
+ value: u64,
+}
+
+fn main() {
+ let u = Union { value: 42 };
+
+ let c = #[rustc_capture_analysis]
+ //~^ ERROR: attributes on expressions are experimental
+ //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
+ || {
+ //~^ ERROR: First Pass analysis includes:
+ //~| ERROR: Min Capture analysis includes:
+ unsafe { u.value }
+ //~^ NOTE: Capturing u[(0, 0)] -> ImmBorrow
+ //~| NOTE: Min Capture u[] -> ImmBorrow
+ };
+
+ c();
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-87378.stderr b/src/test/ui/closures/2229_closure_analysis/issue-87378.stderr
new file mode 100644
index 0000000..16c3f7c
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-87378.stderr
@@ -0,0 +1,48 @@
+error[E0658]: attributes on expressions are experimental
+ --> $DIR/issue-87378.rs:14:13
+ |
+LL | let c = #[rustc_capture_analysis]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+ = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+
+error: First Pass analysis includes:
+ --> $DIR/issue-87378.rs:17:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | unsafe { u.value }
+LL | |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Capturing u[(0, 0)] -> ImmBorrow
+ --> $DIR/issue-87378.rs:20:17
+ |
+LL | unsafe { u.value }
+ | ^^^^^^^
+
+error: Min Capture analysis includes:
+ --> $DIR/issue-87378.rs:17:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | unsafe { u.value }
+LL | |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Min Capture u[] -> ImmBorrow
+ --> $DIR/issue-87378.rs:20:17
+ |
+LL | unsafe { u.value }
+ | ^^^^^^^
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-87987.rs b/src/test/ui/closures/2229_closure_analysis/issue-87987.rs
new file mode 100644
index 0000000..d4f243e
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-87987.rs
@@ -0,0 +1,30 @@
+// run-pass
+// edition:2021
+
+struct Props {
+ field_1: u32, //~ WARNING: field is never read: `field_1`
+ field_2: u32, //~ WARNING: field is never read: `field_2`
+}
+
+fn main() {
+ // Test 1
+ let props_2 = Props {
+ field_1: 1,
+ field_2: 1,
+ };
+
+ let _ = || {
+ let _: Props = props_2;
+ };
+
+ // Test 2
+ let mut arr = [1, 3, 4, 5];
+
+ let mref = &mut arr;
+
+ let _c = || match arr {
+ [_, _, _, _] => println!("A")
+ };
+
+ println!("{:#?}", mref);
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-87987.stderr b/src/test/ui/closures/2229_closure_analysis/issue-87987.stderr
new file mode 100644
index 0000000..5828295
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-87987.stderr
@@ -0,0 +1,16 @@
+warning: field is never read: `field_1`
+ --> $DIR/issue-87987.rs:5:5
+ |
+LL | field_1: u32,
+ | ^^^^^^^^^^^^
+ |
+ = note: `#[warn(dead_code)]` on by default
+
+warning: field is never read: `field_2`
+ --> $DIR/issue-87987.rs:6:5
+ |
+LL | field_2: u32,
+ | ^^^^^^^^^^^^
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-88118-2.rs b/src/test/ui/closures/2229_closure_analysis/issue-88118-2.rs
new file mode 100644
index 0000000..0cfb1a5
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-88118-2.rs
@@ -0,0 +1,24 @@
+// edition:2021
+// run-pass
+#![feature(if_let_guard)]
+#[allow(unused_must_use)]
+#[allow(dead_code)]
+
+fn print_error_count(registry: &Registry) {
+ |x: &Registry| {
+ match &x {
+ Registry if let _ = registry.try_find_description() => { }
+ //~^ WARNING: irrefutable `if let` guard pattern
+ _ => {}
+ }
+ };
+}
+
+struct Registry;
+impl Registry {
+ pub fn try_find_description(&self) {
+ unimplemented!()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr b/src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr
new file mode 100644
index 0000000..1568902
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr
@@ -0,0 +1,12 @@
+warning: irrefutable `if let` guard pattern
+ --> $DIR/issue-88118-2.rs:10:29
+ |
+LL | Registry if let _ = registry.try_find_description() => { }
+ | ^
+ |
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
+ = note: this pattern will always match, so the guard is useless
+ = help: consider removing the guard and adding a `let` inside the match arm
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-88476.rs b/src/test/ui/closures/2229_closure_analysis/issue-88476.rs
new file mode 100644
index 0000000..f5906d3
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-88476.rs
@@ -0,0 +1,62 @@
+// edition:2021
+
+#![feature(rustc_attrs)]
+
+// Test that we can't move out of struct that impls `Drop`.
+
+
+use std::rc::Rc;
+
+// Test that we restrict precision when moving not-`Copy` types, if any of the parent paths
+// implement `Drop`. This is to ensure that we don't move out of a type that implements Drop.
+pub fn test1() {
+ struct Foo(Rc<i32>);
+
+ impl Drop for Foo {
+ fn drop(self: &mut Foo) {}
+ }
+
+ let f = Foo(Rc::new(1));
+ let x = #[rustc_capture_analysis] move || {
+ //~^ ERROR: attributes on expressions are experimental
+ //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
+ //~| ERROR: First Pass analysis includes:
+ //~| ERROR: Min Capture analysis includes:
+ println!("{:?}", f.0);
+ //~^ NOTE: Capturing f[(0, 0)] -> ImmBorrow
+ //~| NOTE: Min Capture f[] -> ByValue
+ };
+
+ x();
+}
+
+// Test that we don't restrict precision when moving `Copy` types(i.e. when copying),
+// even if any of the parent paths implement `Drop`.
+fn test2() {
+ struct Character {
+ hp: u32,
+ name: String,
+ }
+
+ impl Drop for Character {
+ fn drop(&mut self) {}
+ }
+
+ let character = Character { hp: 100, name: format!("A") };
+
+ let c = #[rustc_capture_analysis] move || {
+ //~^ ERROR: attributes on expressions are experimental
+ //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
+ //~| ERROR: First Pass analysis includes:
+ //~| ERROR: Min Capture analysis includes:
+ println!("{}", character.hp)
+ //~^ NOTE: Capturing character[(0, 0)] -> ImmBorrow
+ //~| NOTE: Min Capture character[(0, 0)] -> ByValue
+ };
+
+ c();
+
+ println!("{}", character.name);
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-88476.stderr b/src/test/ui/closures/2229_closure_analysis/issue-88476.stderr
new file mode 100644
index 0000000..c7c9ecb
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-88476.stderr
@@ -0,0 +1,97 @@
+error[E0658]: attributes on expressions are experimental
+ --> $DIR/issue-88476.rs:20:13
+ |
+LL | let x = #[rustc_capture_analysis] move || {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+ = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+
+error[E0658]: attributes on expressions are experimental
+ --> $DIR/issue-88476.rs:47:13
+ |
+LL | let c = #[rustc_capture_analysis] move || {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+ = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+
+error: First Pass analysis includes:
+ --> $DIR/issue-88476.rs:20:39
+ |
+LL | let x = #[rustc_capture_analysis] move || {
+ | _______________________________________^
+LL | |
+LL | |
+LL | |
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Capturing f[(0, 0)] -> ImmBorrow
+ --> $DIR/issue-88476.rs:25:26
+ |
+LL | println!("{:?}", f.0);
+ | ^^^
+
+error: Min Capture analysis includes:
+ --> $DIR/issue-88476.rs:20:39
+ |
+LL | let x = #[rustc_capture_analysis] move || {
+ | _______________________________________^
+LL | |
+LL | |
+LL | |
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Min Capture f[] -> ByValue
+ --> $DIR/issue-88476.rs:25:26
+ |
+LL | println!("{:?}", f.0);
+ | ^^^
+
+error: First Pass analysis includes:
+ --> $DIR/issue-88476.rs:47:39
+ |
+LL | let c = #[rustc_capture_analysis] move || {
+ | _______________________________________^
+LL | |
+LL | |
+LL | |
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Capturing character[(0, 0)] -> ImmBorrow
+ --> $DIR/issue-88476.rs:52:24
+ |
+LL | println!("{}", character.hp)
+ | ^^^^^^^^^^^^
+
+error: Min Capture analysis includes:
+ --> $DIR/issue-88476.rs:47:39
+ |
+LL | let c = #[rustc_capture_analysis] move || {
+ | _______________________________________^
+LL | |
+LL | |
+LL | |
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Min Capture character[(0, 0)] -> ByValue
+ --> $DIR/issue-88476.rs:52:24
+ |
+LL | println!("{}", character.hp)
+ | ^^^^^^^^^^^^
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-89606.rs b/src/test/ui/closures/2229_closure_analysis/issue-89606.rs
new file mode 100644
index 0000000..1bb6aa4
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue-89606.rs
@@ -0,0 +1,40 @@
+// Regression test for #89606. Used to ICE.
+//
+// check-pass
+// revisions: twenty_eighteen twenty_twentyone
+// [twenty_eighteen]compile-flags: --edition 2018
+// [twenty_twentyone]compile-flags: --edition 2021
+
+struct S<'a>(Option<&'a mut i32>);
+
+fn by_ref(s: &mut S<'_>) {
+ (|| {
+ let S(_o) = s;
+ s.0 = None;
+ })();
+}
+
+fn by_value(s: S<'_>) {
+ (|| {
+ let S(ref _o) = s;
+ let _g = s.0;
+ })();
+}
+
+struct V<'a>((Option<&'a mut i32>,));
+
+fn nested(v: &mut V<'_>) {
+ (|| {
+ let V((_o,)) = v;
+ v.0 = (None, );
+ })();
+}
+
+fn main() {
+ let mut s = S(None);
+ by_ref(&mut s);
+ by_value(s);
+
+ let mut v = V((None, ));
+ nested(&mut v);
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/issue_88118.rs b/src/test/ui/closures/2229_closure_analysis/issue_88118.rs
new file mode 100644
index 0000000..453b7e0
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/issue_88118.rs
@@ -0,0 +1,15 @@
+// Regression test for #88118. Used to ICE.
+//
+// check-pass
+
+#![allow(incomplete_features)]
+#![feature(capture_disjoint_fields)]
+
+fn foo<MsU>(handler: impl FnOnce() -> MsU + Clone + 'static) {
+ Box::new(move |value| {
+ (|_| handler.clone()())(value);
+ None
+ }) as Box<dyn Fn(i32) -> Option<i32>>;
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/match/auxiliary/match_non_exhaustive_lib.rs b/src/test/ui/closures/2229_closure_analysis/match/auxiliary/match_non_exhaustive_lib.rs
new file mode 100644
index 0000000..4060c40
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/auxiliary/match_non_exhaustive_lib.rs
@@ -0,0 +1,10 @@
+#[non_exhaustive]
+pub enum E1 {}
+
+#[non_exhaustive]
+pub enum E2 { A, B }
+
+#[non_exhaustive]
+pub enum E3 { C }
+
+pub enum E4 { D }
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-87097.rs b/src/test/ui/closures/2229_closure_analysis/match/issue-87097.rs
similarity index 100%
rename from src/test/ui/closures/2229_closure_analysis/issue-87097.rs
rename to src/test/ui/closures/2229_closure_analysis/match/issue-87097.rs
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-87097.stderr b/src/test/ui/closures/2229_closure_analysis/match/issue-87097.stderr
similarity index 100%
rename from src/test/ui/closures/2229_closure_analysis/issue-87097.stderr
rename to src/test/ui/closures/2229_closure_analysis/match/issue-87097.stderr
diff --git a/src/test/ui/closures/2229_closure_analysis/match/issue-87426.rs b/src/test/ui/closures/2229_closure_analysis/match/issue-87426.rs
new file mode 100644
index 0000000..7450697
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/issue-87426.rs
@@ -0,0 +1,14 @@
+// run-pass
+// edition:2021
+
+pub fn foo() {
+ let ref_x_ck = 123;
+ let _y = || match ref_x_ck {
+ 2_000_000..=3_999_999 => { println!("A")}
+ _ => { println!("B")}
+ };
+}
+
+fn main() {
+ foo();
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/match/issue-87988.rs b/src/test/ui/closures/2229_closure_analysis/match/issue-87988.rs
new file mode 100644
index 0000000..27e7fab
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/issue-87988.rs
@@ -0,0 +1,19 @@
+// run-pass
+// edition:2021
+
+const LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: i32 = 0x01;
+const LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: i32 = 0x02;
+
+pub fn hotplug_callback(event: i32) {
+ let _ = || {
+ match event {
+ LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED => (),
+ LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT => (),
+ _ => (),
+ };
+ };
+}
+
+fn main() {
+ hotplug_callback(1);
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/match/issue-88331.rs b/src/test/ui/closures/2229_closure_analysis/match/issue-88331.rs
new file mode 100644
index 0000000..0a6d71c
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/issue-88331.rs
@@ -0,0 +1,33 @@
+// edition:2021
+
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct Opcode(pub u8);
+
+impl Opcode {
+ pub const OP1: Opcode = Opcode(0x1);
+}
+
+pub fn example1(msg_type: Opcode) -> impl FnMut(&[u8]) {
+ move |i| match msg_type {
+ //~^ ERROR: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered
+ Opcode::OP1 => unimplemented!(),
+ }
+}
+
+#[derive(Copy, Clone, PartialEq, Eq)]
+pub struct Opcode2(Opcode);
+
+impl Opcode2 {
+ pub const OP2: Opcode2 = Opcode2(Opcode(0x1));
+}
+
+
+pub fn example2(msg_type: Opcode2) -> impl FnMut(&[u8]) {
+
+ move |i| match msg_type {
+ //~^ ERROR: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered
+ Opcode2::OP2=> unimplemented!(),
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/match/issue-88331.stderr b/src/test/ui/closures/2229_closure_analysis/match/issue-88331.stderr
new file mode 100644
index 0000000..f02d234
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/issue-88331.stderr
@@ -0,0 +1,27 @@
+error[E0004]: non-exhaustive patterns: `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered
+ --> $DIR/issue-88331.rs:11:20
+ |
+LL | pub struct Opcode(pub u8);
+ | -------------------------- `Opcode` defined here
+...
+LL | move |i| match msg_type {
+ | ^^^^^^^^ patterns `Opcode(0_u8)` and `Opcode(2_u8..=u8::MAX)` not covered
+ |
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
+ = note: the matched value is of type `Opcode`
+
+error[E0004]: non-exhaustive patterns: `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered
+ --> $DIR/issue-88331.rs:27:20
+ |
+LL | pub struct Opcode2(Opcode);
+ | --------------------------- `Opcode2` defined here
+...
+LL | move |i| match msg_type {
+ | ^^^^^^^^ patterns `Opcode2(Opcode(0_u8))` and `Opcode2(Opcode(2_u8..=u8::MAX))` not covered
+ |
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
+ = note: the matched value is of type `Opcode2`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0004`.
diff --git a/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_1.rs b/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_1.rs
new file mode 100644
index 0000000..914ebbe
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_1.rs
@@ -0,0 +1,44 @@
+// run-pass
+// edition:2021
+
+const PATTERN_REF: &str = "Hello World";
+const NUMBER: i32 = 30;
+const NUMBER_POINTER: *const i32 = &NUMBER;
+
+pub fn edge_case_ref(event: &str) {
+ let _ = || {
+ match event {
+ PATTERN_REF => (),
+ _ => (),
+ };
+ };
+}
+
+pub fn edge_case_str(event: String) {
+ let _ = || {
+ match event.as_str() {
+ "hello" => (),
+ _ => (),
+ };
+ };
+}
+
+pub fn edge_case_raw_ptr(event: *const i32) {
+ let _ = || {
+ match event {
+ NUMBER_POINTER => (),
+ _ => (),
+ };
+ };
+}
+
+pub fn edge_case_char(event: char) {
+ let _ = || {
+ match event {
+ 'a' => (),
+ _ => (),
+ };
+ };
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_2.rs b/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_2.rs
new file mode 100644
index 0000000..ae724f9
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_2.rs
@@ -0,0 +1,37 @@
+// edition:2021
+
+enum SingleVariant {
+ A
+}
+
+struct TestStruct {
+ x: i32,
+ y: i32,
+ z: i32,
+}
+
+fn edge_case_if() {
+ let sv = SingleVariant::A;
+ let condition = true;
+ // sv should not be captured as it is a SingleVariant
+ let _a = || {
+ match sv {
+ SingleVariant::A if condition => (),
+ _ => ()
+ }
+ };
+ let mut mut_sv = sv;
+ _a();
+
+ // ts should be captured
+ let ts = TestStruct { x: 1, y: 1, z: 1 };
+ let _b = || { match ts {
+ TestStruct{ x: 1, .. } => (),
+ _ => ()
+ }};
+ let mut mut_ts = ts;
+ //~^ ERROR: cannot move out of `ts` because it is borrowed
+ _b();
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_2.stderr b/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_2.stderr
new file mode 100644
index 0000000..1e42d73
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/match-edge-cases_2.stderr
@@ -0,0 +1,17 @@
+error[E0505]: cannot move out of `ts` because it is borrowed
+ --> $DIR/match-edge-cases_2.rs:32:22
+ |
+LL | let _b = || { match ts {
+ | -- -- borrow occurs due to use in closure
+ | |
+ | borrow of `ts` occurs here
+...
+LL | let mut mut_ts = ts;
+ | ^^ move out of `ts` occurs here
+LL |
+LL | _b();
+ | -- borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0505`.
diff --git a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
new file mode 100644
index 0000000..318673e
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
@@ -0,0 +1,54 @@
+// edition:2021
+
+// aux-build:match_non_exhaustive_lib.rs
+
+/* The error message for non-exhaustive matches on non-local enums
+ * marked as non-exhaustive should mention the fact that the enum
+ * is marked as non-exhaustive (issue #85227).
+ */
+
+// Ignore non_exhaustive in the same crate
+#[non_exhaustive]
+enum L1 { A, B }
+enum L2 { C }
+
+extern crate match_non_exhaustive_lib;
+use match_non_exhaustive_lib::{E1, E2, E3, E4};
+
+fn foo() -> (L1, L2) {todo!()}
+fn bar() -> (E1, E2, E3, E4) {todo!()}
+
+fn main() {
+ let (l1, l2) = foo();
+ // No error for enums defined in this crate
+ let _a = || { match l1 { L1::A => (), L1::B => () } };
+ // (except if the match is already non-exhaustive)
+ let _b = || { match l1 { L1::A => () } };
+ //~^ ERROR: non-exhaustive patterns: `B` not covered [E0004]
+
+ // l2 should not be captured as it is a non-exhaustive SingleVariant
+ // defined in this crate
+ let _c = || { match l2 { L2::C => (), _ => () } };
+ let mut mut_l2 = l2;
+ _c();
+
+ // E1 is not visibly uninhabited from here
+ let (e1, e2, e3, e4) = bar();
+ let _d = || { match e1 {} };
+ //~^ ERROR: non-exhaustive patterns: type `E1` is non-empty [E0004]
+ let _e = || { match e2 { E2::A => (), E2::B => () } };
+ //~^ ERROR: non-exhaustive patterns: `_` not covered [E0004]
+ let _f = || { match e2 { E2::A => (), E2::B => (), _ => () } };
+
+ // e3 should be captured as it is a non-exhaustive SingleVariant
+ // defined in another crate
+ let _g = || { match e3 { E3::C => (), _ => () } };
+ let mut mut_e3 = e3;
+ //~^ ERROR: cannot move out of `e3` because it is borrowed
+ _g();
+
+ // e4 should not be captured as it is a SingleVariant
+ let _h = || { match e4 { E4::D => (), _ => () } };
+ let mut mut_e4 = e4;
+ _h();
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
new file mode 100644
index 0000000..91ffe1a
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
@@ -0,0 +1,50 @@
+error[E0004]: non-exhaustive patterns: `B` not covered
+ --> $DIR/non-exhaustive-match.rs:26:25
+ |
+LL | enum L1 { A, B }
+ | ----------------
+ | | |
+ | | not covered
+ | `L1` defined here
+...
+LL | let _b = || { match l1 { L1::A => () } };
+ | ^^ pattern `B` not covered
+ |
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
+ = note: the matched value is of type `L1`
+
+error[E0004]: non-exhaustive patterns: type `E1` is non-empty
+ --> $DIR/non-exhaustive-match.rs:37:25
+ |
+LL | let _d = || { match e1 {} };
+ | ^^
+ |
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
+ = note: the matched value is of type `E1`, which is marked as non-exhaustive
+
+error[E0004]: non-exhaustive patterns: `_` not covered
+ --> $DIR/non-exhaustive-match.rs:39:25
+ |
+LL | let _e = || { match e2 { E2::A => (), E2::B => () } };
+ | ^^ pattern `_` not covered
+ |
+ = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
+ = note: the matched value is of type `E2`, which is marked as non-exhaustive
+
+error[E0505]: cannot move out of `e3` because it is borrowed
+ --> $DIR/non-exhaustive-match.rs:46:22
+ |
+LL | let _g = || { match e3 { E3::C => (), _ => () } };
+ | -- -- borrow occurs due to use in closure
+ | |
+ | borrow of `e3` occurs here
+LL | let mut mut_e3 = e3;
+ | ^^ move out of `e3` occurs here
+LL |
+LL | _g();
+ | -- borrow later used here
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0004, E0505.
+For more information about an error, try `rustc --explain E0004`.
diff --git a/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.rs b/src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs
similarity index 100%
rename from src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.rs
rename to src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs
diff --git a/src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.stderr b/src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
similarity index 100%
rename from src/test/ui/closures/2229_closure_analysis/pattern-matching-should-fail.stderr
rename to src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
diff --git a/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.rs b/src/test/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs
similarity index 100%
rename from src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.rs
rename to src/test/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.rs
diff --git a/src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.stderr b/src/test/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.stderr
similarity index 100%
rename from src/test/ui/closures/2229_closure_analysis/patterns-capture-analysis.stderr
rename to src/test/ui/closures/2229_closure_analysis/match/patterns-capture-analysis.stderr
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed
index e2b7b8f..b0fc512 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed
@@ -4,6 +4,14 @@
use std::thread;
+#[derive(Debug)]
+struct Foo(i32);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
/* Test Send Trait Migration */
struct SendPointer(*mut i32);
unsafe impl Send for SendPointer {}
@@ -13,11 +21,11 @@
let fptr = SendPointer(&mut f as *mut i32);
thread::spawn(move || { let _ = &fptr; unsafe {
//~^ ERROR: `Send` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Send` as `fptr` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr.0` does not implement `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr.0` does not implement `Send`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `fptr` to be fully captured
*fptr.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0`
} });
}
@@ -33,35 +41,36 @@
let fptr = SyncPointer(f);
thread::spawn(move || { let _ = &fptr; unsafe {
//~^ ERROR: `Sync`, `Send` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure would no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `fptr` to be fully captured
*fptr.0.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0`
} });
}
/* Test Clone Trait Migration */
-struct S(String);
+struct S(Foo);
struct T(i32);
struct U(S, T);
impl Clone for U {
fn clone(&self) -> Self {
- U(S(String::from("Hello World")), T(0))
+ U(S(Foo(0)), T(0))
}
}
fn test_clone_trait() {
- let f = U(S(String::from("Hello World")), T(0));
- let c = || { let _ = &f;
+ let f = U(S(Foo(0)), T(0));
+ let c = || {
+ let _ = &f;
//~^ ERROR: `Clone` trait implementation for closure and drop order
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f.1` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f.1` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f` to be fully captured
let f_1 = f.1;
- //~^ NOTE: in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1`
println!("{:?}", f_1.0);
};
@@ -69,7 +78,7 @@
c_clone();
}
-//~^ NOTE: in Rust 2018, `f` would be dropped here, but in Rust 2021, only `f.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure
fn main() {
test_send_trait();
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs
index 6c56ca2..2bcf9a7 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.rs
@@ -4,6 +4,14 @@
use std::thread;
+#[derive(Debug)]
+struct Foo(i32);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
/* Test Send Trait Migration */
struct SendPointer(*mut i32);
unsafe impl Send for SendPointer {}
@@ -13,11 +21,11 @@
let fptr = SendPointer(&mut f as *mut i32);
thread::spawn(move || unsafe {
//~^ ERROR: `Send` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Send` as `fptr` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr.0` does not implement `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr.0` does not implement `Send`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `fptr` to be fully captured
*fptr.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0`
});
}
@@ -33,35 +41,35 @@
let fptr = SyncPointer(f);
thread::spawn(move || unsafe {
//~^ ERROR: `Sync`, `Send` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure would no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `fptr` to be fully captured
*fptr.0.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0`
});
}
/* Test Clone Trait Migration */
-struct S(String);
+struct S(Foo);
struct T(i32);
struct U(S, T);
impl Clone for U {
fn clone(&self) -> Self {
- U(S(String::from("Hello World")), T(0))
+ U(S(Foo(0)), T(0))
}
}
fn test_clone_trait() {
- let f = U(S(String::from("Hello World")), T(0));
+ let f = U(S(Foo(0)), T(0));
let c = || {
//~^ ERROR: `Clone` trait implementation for closure and drop order
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f.1` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f.1` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f` to be fully captured
let f_1 = f.1;
- //~^ NOTE: in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1`
println!("{:?}", f_1.0);
};
@@ -69,7 +77,7 @@
c_clone();
}
-//~^ NOTE: in Rust 2018, `f` would be dropped here, but in Rust 2021, only `f.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure
fn main() {
test_send_trait();
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
index 9c954b1..8d2d355 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
@@ -1,11 +1,11 @@
error: changes to closure capture in Rust 2021 will affect `Send` trait implementation for closure
- --> $DIR/auto_traits.rs:14:19
+ --> $DIR/auto_traits.rs:22:19
|
LL | thread::spawn(move || unsafe {
- | ^^^^^^^^^^^^^^ in Rust 2018, this closure would implement `Send` as `fptr` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr.0` does not implement `Send`
+ | ^^^^^^^^^^^^^^ in Rust 2018, this closure implements `Send` as `fptr` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr.0` does not implement `Send`
...
LL | *fptr.0 = 20;
- | ------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0`
+ | ------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0`
|
note: the lint level is defined here
--> $DIR/auto_traits.rs:2:9
@@ -15,7 +15,7 @@
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr` to be fully captured
|
-LL | thread::spawn(move || { let _ = &fptr; unsafe {
+LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
LL |
LL |
LL |
@@ -24,18 +24,18 @@
...
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
- --> $DIR/auto_traits.rs:34:19
+ --> $DIR/auto_traits.rs:42:19
|
LL | thread::spawn(move || unsafe {
- | ^^^^^^^^^^^^^^ in Rust 2018, this closure would implement `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure would no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
+ | ^^^^^^^^^^^^^^ in Rust 2018, this closure implements `Sync`, `Send` as `fptr` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr.0.0` does not implement `Sync`, `Send`
...
LL | *fptr.0.0 = 20;
- | --------- in Rust 2018, closure captures all of `fptr`, but in Rust 2021, it only captures `fptr.0.0`
+ | --------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0.0`
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr` to be fully captured
|
-LL | thread::spawn(move || { let _ = &fptr; unsafe {
+LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
LL |
LL |
LL |
@@ -44,27 +44,23 @@
...
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
- --> $DIR/auto_traits.rs:58:13
+ --> $DIR/auto_traits.rs:66:13
|
LL | let c = || {
- | ^^ in Rust 2018, this closure would implement `Clone` as `f` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f.1` does not implement `Clone`
+ | ^^ in Rust 2018, this closure implements `Clone` as `f` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f.1` does not implement `Clone`
...
LL | let f_1 = f.1;
- | --- in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.1`
+ | --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.1`
...
LL | }
- | - in Rust 2018, `f` would be dropped here, but in Rust 2021, only `f.1` would be dropped here alongside the closure
+ | - in Rust 2018, `f` is dropped here, but in Rust 2021, only `f.1` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f` to be fully captured
|
-LL | let c = || { let _ = &f;
-LL |
-LL |
-LL |
-LL |
-LL | let f_1 = f.1;
- ...
+LL ~ let c = || {
+LL + let _ = &f;
+ |
error: aborting due to 3 previous errors
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.fixed
new file mode 100644
index 0000000..9a6db58
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.fixed
@@ -0,0 +1,33 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_compatibility)]
+
+#[derive(Debug)]
+struct Foo(i32);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
+macro_rules! m {
+ (@ $body:expr) => {{
+ let f = || $body;
+ //~^ WARNING: drop order
+ f();
+ }};
+ ($body:block) => {{
+ m!(@ $body);
+ }};
+}
+
+fn main() {
+ let a = (Foo(0), Foo(1));
+ m!({
+ let _ = &a;
+ //~^ HELP: add a dummy
+ let x = a.0;
+ println!("{:?}", x);
+ });
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs
new file mode 100644
index 0000000..08cc24b
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.rs
@@ -0,0 +1,32 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_compatibility)]
+
+#[derive(Debug)]
+struct Foo(i32);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
+macro_rules! m {
+ (@ $body:expr) => {{
+ let f = || $body;
+ //~^ WARNING: drop order
+ f();
+ }};
+ ($body:block) => {{
+ m!(@ $body);
+ }};
+}
+
+fn main() {
+ let a = (Foo(0), Foo(1));
+ m!({
+ //~^ HELP: add a dummy
+ let x = a.0;
+ println!("{:?}", x);
+ });
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr
new file mode 100644
index 0000000..a2a9da5
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr
@@ -0,0 +1,37 @@
+warning: changes to closure capture in Rust 2021 will affect drop order
+ --> $DIR/closure-body-macro-fragment.rs:16:17
+ |
+LL | let f = || $body;
+ | _________________^
+LL | |
+LL | | f();
+LL | | }};
+ | | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure
+LL | | ($body:block) => {{
+LL | | m!(@ $body);
+ | |__________________^
+...
+LL | / m!({
+LL | |
+LL | | let x = a.0;
+ | | --- in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0`
+LL | | println!("{:?}", x);
+LL | | });
+ | |_______- in this macro invocation
+ |
+note: the lint level is defined here
+ --> $DIR/closure-body-macro-fragment.rs:4:9
+ |
+LL | #![warn(rust_2021_compatibility)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ = note: `#[warn(rust_2021_incompatible_closure_captures)]` implied by `#[warn(rust_2021_compatibility)]`
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
+ = note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: add a dummy let to cause `a` to be fully captured
+ |
+LL ~ m!({
+LL + let _ = &a;
+ |
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.fixed
index e836f27..2652bf5 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.fixed
@@ -1,162 +1,38 @@
+// run-pass
// run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
-//~^ NOTE: the lint level is defined here
+#![allow(unused)]
-// Test cases for types that implement a insignificant drop (stlib defined)
+// Test cases for types that implement an insignificant drop (stlib defined)
-// `t` needs Drop because one of its elements needs drop,
-// therefore precise capture might affect drop ordering
-fn test1_all_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let t2 = (String::new(), String::new());
+macro_rules! test_insig_dtor_for_type {
+ ($t: ty, $disambiguator: ident) => {
+ mod $disambiguator {
+ use std::collections::*;
+ use std::rc::Rc;
+ use std::sync::Mutex;
- let c = || { let _ = (&t, &t1, &t2);
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
+ fn test_for_type(t: $t) {
+ let tup = (Mutex::new(0), t);
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
- let _t2 = t2.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t2`, but in Rust 2021, it only captures `t2.0`
+ let _c = || tup.0;
+ }
+ }
};
-
- c();
}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
-//~| in Rust 2018, `t2` would be dropped here, but in Rust 2021, only `t2.0` would be dropped here alongside the closure
-// String implements drop and therefore should be migrated.
-// But in this test cases, `t2` is completely captured and when it is dropped won't be affected
-fn test2_only_precise_paths_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let t2 = (String::new(), String::new());
+test_insig_dtor_for_type!(i32, prim_i32);
+test_insig_dtor_for_type!(Vec<i32>, vec_i32);
+test_insig_dtor_for_type!(String, string);
+test_insig_dtor_for_type!(Vec<String>, vec_string);
+test_insig_dtor_for_type!(HashMap<String, String>, hash_map);
+test_insig_dtor_for_type!(BTreeMap<String, i32>, btree_map);
+test_insig_dtor_for_type!(LinkedList<String>, linked_list);
+test_insig_dtor_for_type!(Rc<i32>, rc_i32);
+test_insig_dtor_for_type!(Rc<String>, rc_string);
+test_insig_dtor_for_type!(std::vec::IntoIter<String>, vec_into_iter);
+test_insig_dtor_for_type!(btree_map::IntoIter<String, String>, btree_map_into_iter);
+test_insig_dtor_for_type!(std::array::IntoIter<String, 5>, array_into_iter);
- let c = || { let _ = (&t, &t1);
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t`, `t1` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
- let _t2 = t2;
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
-
-// If a variable would've not been captured by value then it would've not been
-// dropped with the closure and therefore doesn't need migration.
-fn test3_only_by_value_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let c = || { let _ = &t;
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- println!("{}", t1.1);
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-// Copy types get copied into the closure instead of move. Therefore we don't need to
-// migrate then as their drop order isn't tied to the closure.
-fn test4_only_non_copy_types_need_migration() {
- let t = (String::new(), String::new());
-
- // `t1` is Copy because all of its elements are Copy
- let t1 = (0i32, 0i32);
-
- let c = || { let _ = &t;
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _t1 = t1.0;
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-fn test5_only_drop_types_need_migration() {
- struct S(i32, i32);
-
- let t = (String::new(), String::new());
-
- // `s` doesn't implement Drop or any elements within it, and doesn't need migration
- let s = S(0i32, 0i32);
-
- let c = || { let _ = &t;
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _s = s.0;
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-// Since we are using a move closure here, both `t` and `t1` get moved
-// even though they are being used by ref inside the closure.
-fn test6_move_closures_non_copy_types_might_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let c = move || { let _ = (&t1, &t);
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t1`, `t` to be fully captured
- println!("{} {}", t1.1, t.1);
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
- //~| NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.1`
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
-//~| in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.1` would be dropped here alongside the closure
-
-// Test migration analysis in case of Drop + Non Drop aggregates.
-// Note we need migration here only because the non-copy (because Drop type) is captured,
-// otherwise we won't need to, since we can get away with just by ref capture in that case.
-fn test7_drop_non_drop_aggregate_need_migration() {
- let t = (String::new(), String::new(), 0i32);
-
- let c = || { let _ = &t;
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-fn main() {
- test1_all_need_migration();
- test2_only_precise_paths_need_migration();
- test3_only_by_value_need_migration();
- test4_only_non_copy_types_need_migration();
- test5_only_drop_types_need_migration();
- test6_move_closures_non_copy_types_might_need_migration();
- test7_drop_non_drop_aggregate_need_migration();
-}
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.rs b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.rs
index fbf9b98..2652bf5 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.rs
@@ -1,162 +1,38 @@
+// run-pass
// run-rustfix
#![deny(rust_2021_incompatible_closure_captures)]
-//~^ NOTE: the lint level is defined here
+#![allow(unused)]
-// Test cases for types that implement a insignificant drop (stlib defined)
+// Test cases for types that implement an insignificant drop (stlib defined)
-// `t` needs Drop because one of its elements needs drop,
-// therefore precise capture might affect drop ordering
-fn test1_all_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let t2 = (String::new(), String::new());
+macro_rules! test_insig_dtor_for_type {
+ ($t: ty, $disambiguator: ident) => {
+ mod $disambiguator {
+ use std::collections::*;
+ use std::rc::Rc;
+ use std::sync::Mutex;
- let c = || {
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
+ fn test_for_type(t: $t) {
+ let tup = (Mutex::new(0), t);
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
- let _t2 = t2.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t2`, but in Rust 2021, it only captures `t2.0`
+ let _c = || tup.0;
+ }
+ }
};
-
- c();
}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
-//~| in Rust 2018, `t2` would be dropped here, but in Rust 2021, only `t2.0` would be dropped here alongside the closure
-// String implements drop and therefore should be migrated.
-// But in this test cases, `t2` is completely captured and when it is dropped won't be affected
-fn test2_only_precise_paths_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let t2 = (String::new(), String::new());
+test_insig_dtor_for_type!(i32, prim_i32);
+test_insig_dtor_for_type!(Vec<i32>, vec_i32);
+test_insig_dtor_for_type!(String, string);
+test_insig_dtor_for_type!(Vec<String>, vec_string);
+test_insig_dtor_for_type!(HashMap<String, String>, hash_map);
+test_insig_dtor_for_type!(BTreeMap<String, i32>, btree_map);
+test_insig_dtor_for_type!(LinkedList<String>, linked_list);
+test_insig_dtor_for_type!(Rc<i32>, rc_i32);
+test_insig_dtor_for_type!(Rc<String>, rc_string);
+test_insig_dtor_for_type!(std::vec::IntoIter<String>, vec_into_iter);
+test_insig_dtor_for_type!(btree_map::IntoIter<String, String>, btree_map_into_iter);
+test_insig_dtor_for_type!(std::array::IntoIter<String, 5>, array_into_iter);
- let c = || {
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t`, `t1` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
- let _t2 = t2;
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
-
-// If a variable would've not been captured by value then it would've not been
-// dropped with the closure and therefore doesn't need migration.
-fn test3_only_by_value_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let c = || {
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- println!("{}", t1.1);
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-// Copy types get copied into the closure instead of move. Therefore we don't need to
-// migrate then as their drop order isn't tied to the closure.
-fn test4_only_non_copy_types_need_migration() {
- let t = (String::new(), String::new());
-
- // `t1` is Copy because all of its elements are Copy
- let t1 = (0i32, 0i32);
-
- let c = || {
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _t1 = t1.0;
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-fn test5_only_drop_types_need_migration() {
- struct S(i32, i32);
-
- let t = (String::new(), String::new());
-
- // `s` doesn't implement Drop or any elements within it, and doesn't need migration
- let s = S(0i32, 0i32);
-
- let c = || {
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- let _s = s.0;
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-// Since we are using a move closure here, both `t` and `t1` get moved
-// even though they are being used by ref inside the closure.
-fn test6_move_closures_non_copy_types_might_need_migration() {
- let t = (String::new(), String::new());
- let t1 = (String::new(), String::new());
- let c = move || {
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t1`, `t` to be fully captured
- println!("{} {}", t1.1, t.1);
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
- //~| NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.1`
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
-//~| in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.1` would be dropped here alongside the closure
-
-// Test migration analysis in case of Drop + Non Drop aggregates.
-// Note we need migration here only because the non-copy (because Drop type) is captured,
-// otherwise we won't need to, since we can get away with just by ref capture in that case.
-fn test7_drop_non_drop_aggregate_need_migration() {
- let t = (String::new(), String::new(), 0i32);
-
- let c = || {
- //~^ ERROR: drop order
- //~| NOTE: for more information, see
- //~| HELP: add a dummy let to cause `t` to be fully captured
- let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
- };
-
- c();
-}
-//~^ in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-
-fn main() {
- test1_all_need_migration();
- test2_only_precise_paths_need_migration();
- test3_only_by_value_need_migration();
- test4_only_non_copy_types_need_migration();
- test5_only_drop_types_need_migration();
- test6_move_closures_non_copy_types_might_need_migration();
- test7_drop_non_drop_aggregate_need_migration();
-}
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr
deleted file mode 100644
index e9e4794..0000000
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop.stderr
+++ /dev/null
@@ -1,189 +0,0 @@
-error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop.rs:15:13
- |
-LL | let c = || {
- | ^^
-...
-LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
-LL |
-LL | let _t1 = t1.0;
- | ---- in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
-LL |
-LL | let _t2 = t2.0;
- | ---- in Rust 2018, closure captures all of `t2`, but in Rust 2021, it only captures `t2.0`
-...
-LL | }
- | -
- | |
- | in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- | in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
- | in Rust 2018, `t2` would be dropped here, but in Rust 2021, only `t2.0` would be dropped here alongside the closure
- |
-note: the lint level is defined here
- --> $DIR/insignificant_drop.rs:3:9
- |
-LL | #![deny(rust_2021_incompatible_closure_captures)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
-help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
- |
-LL | let c = || { let _ = (&t, &t1, &t2);
-LL |
-LL |
-LL |
-LL |
-LL | let _t = t.0;
- ...
-
-error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop.rs:41:13
- |
-LL | let c = || {
- | ^^
-...
-LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
-LL |
-LL | let _t1 = t1.0;
- | ---- in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
-...
-LL | }
- | -
- | |
- | in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- | in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
- |
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
-help: add a dummy let to cause `t`, `t1` to be fully captured
- |
-LL | let c = || { let _ = (&t, &t1);
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
-
-error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop.rs:62:13
- |
-LL | let c = || {
- | ^^
-...
-LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
-...
-LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- |
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
-help: add a dummy let to cause `t` to be fully captured
- |
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
-
-error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop.rs:83:13
- |
-LL | let c = || {
- | ^^
-...
-LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
-...
-LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- |
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
-help: add a dummy let to cause `t` to be fully captured
- |
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
-
-error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop.rs:104:13
- |
-LL | let c = || {
- | ^^
-...
-LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
-...
-LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- |
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
-help: add a dummy let to cause `t` to be fully captured
- |
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
-
-error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop.rs:122:13
- |
-LL | let c = move || {
- | ^^^^^^^
-...
-LL | println!("{} {}", t1.1, t.1);
- | ---- --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
- | |
- | in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.1`
-...
-LL | }
- | -
- | |
- | in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.1` would be dropped here alongside the closure
- | in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
- |
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
-help: add a dummy let to cause `t1`, `t` to be fully captured
- |
-LL | let c = move || { let _ = (&t1, &t);
-LL |
-LL |
-LL |
-LL | println!("{} {}", t1.1, t.1);
-LL |
- ...
-
-error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop.rs:142:13
- |
-LL | let c = || {
- | ^^
-...
-LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
-...
-LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- |
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
-help: add a dummy let to cause `t` to be fully captured
- |
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
-
-error: aborting due to 7 previous errors
-
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed
index 4626c04..d985e3b 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.fixed
@@ -5,13 +5,15 @@
#![feature(rustc_attrs)]
#![allow(unused)]
+use std::sync::Mutex;
+
+ #[rustc_insignificant_dtor]
struct InsignificantDropPoint {
x: i32,
- y: i32,
+ y: Mutex<i32>,
}
impl Drop for InsignificantDropPoint {
- #[rustc_insignificant_dtor]
fn drop(&mut self) {}
}
@@ -21,30 +23,31 @@
fn drop(&mut self) {}
}
+#[rustc_insignificant_dtor]
struct GenericStruct<T>(T, T);
-struct Wrapper<T>(GenericStruct<T>, i32);
-
impl<T> Drop for GenericStruct<T> {
- #[rustc_insignificant_dtor]
fn drop(&mut self) {}
}
+struct Wrapper<T>(GenericStruct<T>, i32);
+
// `SigDrop` implements drop and therefore needs to be migrated.
fn significant_drop_needs_migration() {
let t = (SigDrop {}, SigDrop {});
- let c = || { let _ = &t;
+ let c = || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// Even if a type implements an insignificant drop, if it's
// elements have a significant drop then the overall type is
@@ -54,17 +57,18 @@
let t = Wrapper(GenericStruct(SigDrop {}, SigDrop {}), 5);
// move is used to force i32 to be copied instead of being a ref
- let c = move || { let _ = &t;
+ let c = move || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.1;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
fn main() {
significant_drop_needs_migration();
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs
index ebcf155..f95d34e 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.rs
@@ -5,13 +5,15 @@
#![feature(rustc_attrs)]
#![allow(unused)]
+use std::sync::Mutex;
+
+ #[rustc_insignificant_dtor]
struct InsignificantDropPoint {
x: i32,
- y: i32,
+ y: Mutex<i32>,
}
impl Drop for InsignificantDropPoint {
- #[rustc_insignificant_dtor]
fn drop(&mut self) {}
}
@@ -21,15 +23,15 @@
fn drop(&mut self) {}
}
+#[rustc_insignificant_dtor]
struct GenericStruct<T>(T, T);
-struct Wrapper<T>(GenericStruct<T>, i32);
-
impl<T> Drop for GenericStruct<T> {
- #[rustc_insignificant_dtor]
fn drop(&mut self) {}
}
+struct Wrapper<T>(GenericStruct<T>, i32);
+
// `SigDrop` implements drop and therefore needs to be migrated.
fn significant_drop_needs_migration() {
let t = (SigDrop {}, SigDrop {});
@@ -39,12 +41,12 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// Even if a type implements an insignificant drop, if it's
// elements have a significant drop then the overall type is
@@ -59,12 +61,12 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.1;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
fn main() {
significant_drop_needs_migration();
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr
index 1e97ca3..832a817 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr
@@ -1,14 +1,14 @@
error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop_attr_migrations.rs:37:13
+ --> $DIR/insignificant_drop_attr_migrations.rs:39:13
|
LL | let c = || {
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
note: the lint level is defined here
--> $DIR/insignificant_drop_attr_migrations.rs:3:9
@@ -18,36 +18,28 @@
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &t;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
- --> $DIR/insignificant_drop_attr_migrations.rs:57:13
+ --> $DIR/insignificant_drop_attr_migrations.rs:59:13
|
LL | let c = move || {
| ^^^^^^^
...
LL | let _t = t.1;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = move || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.1;
-LL |
- ...
+LL ~ let c = move || {
+LL + let _ = &t;
+ |
error: aborting due to 2 previous errors
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_no_migrations.rs b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_no_migrations.rs
index a527bf4..3f184a6 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_no_migrations.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_no_migrations.rs
@@ -3,6 +3,7 @@
#![deny(rust_2021_incompatible_closure_captures)]
#![feature(rustc_attrs)]
#![allow(unused)]
+#[rustc_insignificant_dtor]
struct InsignificantDropPoint {
x: i32,
@@ -10,7 +11,6 @@
}
impl Drop for InsignificantDropPoint {
- #[rustc_insignificant_dtor]
fn drop(&mut self) {}
}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr
index 7e5da94..41b675f 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr
@@ -1,11 +1,8 @@
warning: irrefutable `if let` pattern
- --> $DIR/issue-78720.rs:6:5
+ --> $DIR/issue-78720.rs:6:8
|
-LL | / if let a = "" {
-LL | |
-LL | | drop(|_: ()| drop(a));
-LL | | }
- | |_____^
+LL | if let a = "" {
+ | ^^^^^^^^^^
|
= note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this pattern will always match, so the `if let` is useless
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/macro.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/macro.fixed
new file mode 100644
index 0000000..31fe494
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/macro.fixed
@@ -0,0 +1,25 @@
+// run-rustfix
+
+// See https://github.com/rust-lang/rust/issues/87955
+
+#![deny(rust_2021_incompatible_closure_captures)]
+//~^ NOTE: the lint level is defined here
+
+
+#[derive(Debug)]
+struct Foo(i32);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
+fn main() {
+ let a = (Foo(0), Foo(1));
+ let _ = || { let _ = &a; dbg!(a.0) };
+ //~^ ERROR: drop order
+ //~| NOTE: will only capture `a.0`
+ //~| NOTE: for more information, see
+ //~| HELP: add a dummy let to cause `a` to be fully captured
+}
+//~^ NOTE: dropped here
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/macro.rs b/src/test/ui/closures/2229_closure_analysis/migrations/macro.rs
new file mode 100644
index 0000000..0f0c497
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/macro.rs
@@ -0,0 +1,25 @@
+// run-rustfix
+
+// See https://github.com/rust-lang/rust/issues/87955
+
+#![deny(rust_2021_incompatible_closure_captures)]
+//~^ NOTE: the lint level is defined here
+
+
+#[derive(Debug)]
+struct Foo(i32);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
+fn main() {
+ let a = (Foo(0), Foo(1));
+ let _ = || dbg!(a.0);
+ //~^ ERROR: drop order
+ //~| NOTE: will only capture `a.0`
+ //~| NOTE: for more information, see
+ //~| HELP: add a dummy let to cause `a` to be fully captured
+}
+//~^ NOTE: dropped here
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr
new file mode 100644
index 0000000..5046a4b
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr
@@ -0,0 +1,24 @@
+error: changes to closure capture in Rust 2021 will affect drop order
+ --> $DIR/macro.rs:19:13
+ |
+LL | let _ = || dbg!(a.0);
+ | ^^^^^^^^---^
+ | |
+ | in Rust 2018, this closure captures all of `a`, but in Rust 2021, it will only capture `a.0`
+...
+LL | }
+ | - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure
+ |
+note: the lint level is defined here
+ --> $DIR/macro.rs:5:9
+ |
+LL | #![deny(rust_2021_incompatible_closure_captures)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
+help: add a dummy let to cause `a` to be fully captured
+ |
+LL | let _ = || { let _ = &a; dbg!(a.0) };
+ | +++++++++++++ +
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed
index f3c15a2..ce8b607 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.fixed
@@ -16,29 +16,30 @@
fn closure_contains_block() {
let t = (Foo(0), Foo(0));
- let c = || { let _ = &t;
+ let c = || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
fn closure_doesnt_contain_block() {
let t = (Foo(0), Foo(0));
let c = || { let _ = &t; t.0 };
//~^ ERROR: drop order
- //~| NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
fn main() {
closure_contains_block();
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs
index 50936d1..2237beb 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.rs
@@ -21,24 +21,24 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
fn closure_doesnt_contain_block() {
let t = (Foo(0), Foo(0));
let c = || t.0;
//~^ ERROR: drop order
- //~| NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
fn main() {
closure_contains_block();
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr
index f8f72d1..3589a61 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr
@@ -5,10 +5,10 @@
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
note: the lint level is defined here
--> $DIR/migrations_rustfix.rs:2:9
@@ -18,13 +18,9 @@
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &t;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/migrations_rustfix.rs:33:13
@@ -32,16 +28,16 @@
LL | let c = || t.0;
| ^^^---
| |
- | in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t; t.0 };
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed
index f248040..a565215 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed
@@ -17,13 +17,14 @@
F: FnOnce(),
{
let f = panic::AssertUnwindSafe(f);
- let result = panic::catch_unwind(move || { let _ = &f;
+ let result = panic::catch_unwind(move || {
+ let _ = &f;
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure would no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
+ //~| NOTE: in Rust 2018, this closure implements `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f` to be fully captured
f.0()
- //~^ NOTE: in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0`
});
if let Ok(..) = result {
panic!("diverging function returned");
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs
index 6a6a51c..d9acde0 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs
@@ -19,11 +19,11 @@
let f = panic::AssertUnwindSafe(f);
let result = panic::catch_unwind(move || {
//~^ ERROR: `UnwindSafe`, `RefUnwindSafe` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure would no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
+ //~| NOTE: in Rust 2018, this closure implements `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f` to be fully captured
f.0()
- //~^ NOTE: in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0`
});
if let Ok(..) = result {
panic!("diverging function returned");
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
index 6ee0d0d..10816b7 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
@@ -2,10 +2,10 @@
--> $DIR/mir_calls_to_shims.rs:20:38
|
LL | let result = panic::catch_unwind(move || {
- | ^^^^^^^ in Rust 2018, this closure would implement `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure would no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
+ | ^^^^^^^ in Rust 2018, this closure implements `UnwindSafe`, `RefUnwindSafe` as `f` implements `UnwindSafe`, `RefUnwindSafe`, but in Rust 2021, this closure will no longer implement `UnwindSafe`, `RefUnwindSafe` as `f.0` does not implement `UnwindSafe`, `RefUnwindSafe`
...
LL | f.0()
- | --- in Rust 2018, closure captures all of `f`, but in Rust 2021, it only captures `f.0`
+ | --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0`
|
note: the lint level is defined here
--> $DIR/mir_calls_to_shims.rs:3:9
@@ -15,13 +15,9 @@
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f` to be fully captured
|
-LL | let result = panic::catch_unwind(move || { let _ = &f;
-LL |
-LL |
-LL |
-LL |
-LL | f.0()
- ...
+LL ~ let result = panic::catch_unwind(move || {
+LL + let _ = &f;
+ |
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed
index 98f578a..11218ef 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed
@@ -4,7 +4,22 @@
use std::thread;
-struct S(String);
+#[derive(Debug)]
+struct Foo(String);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
+impl Foo {
+ fn from(s: &str) -> Self {
+ Self(String::from(s))
+ }
+}
+
+
+struct S(Foo);
#[derive(Clone)]
struct T(i32);
@@ -13,39 +28,41 @@
impl Clone for U {
fn clone(&self) -> Self {
- U(S(String::from("Hello World")), T(0))
+ U(S(Foo::from("Hello World")), T(0))
}
}
fn test_multi_issues() {
- let f1 = U(S(String::from("foo")), T(0));
- let f2 = U(S(String::from("bar")), T(0));
- let c = || { let _ = (&f1, &f2);
+ let f1 = U(S(Foo::from("foo")), T(0));
+ let f2 = U(S(Foo::from("bar")), T(0));
+ let c = || {
+ let _ = (&f1, &f2);
//~^ ERROR: `Clone` trait implementation for closure and drop order
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1`, `f2` to be fully captured
let _f_1 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_2 = f2.1;
- //~^ NOTE: in Rust 2018, closure captures all of `f2`, but in Rust 2021, it only captures `f2.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1`
};
let c_clone = c.clone();
c_clone();
}
-//~^ NOTE: in Rust 2018, `f2` would be dropped here, but in Rust 2021, only `f2.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure
fn test_capturing_all_disjoint_fields_individually() {
- let f1 = U(S(String::from("foo")), T(0));
- let c = || { let _ = &f1;
+ let f1 = U(S(Foo::from("foo")), T(0));
+ let c = || {
+ let _ = &f1;
//~^ ERROR: `Clone` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1` to be fully captured
let _f_1 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_2 = f1.1;
};
@@ -58,22 +75,23 @@
impl Clone for U1 {
fn clone(&self) -> Self {
- U1(S(String::from("foo")), T(0), S(String::from("bar")))
+ U1(S(Foo::from("foo")), T(0), S(Foo::from("bar")))
}
}
fn test_capturing_several_disjoint_fields_individually_1() {
- let f1 = U1(S(String::from("foo")), T(0), S(String::from("bar")));
- let c = || { let _ = &f1;
+ let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar")));
+ let c = || {
+ let _ = &f1;
//~^ ERROR: `Clone` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.2` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.2` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1` to be fully captured
let _f_0 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_2 = f1.2;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.2`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2`
};
let c_clone = c.clone();
@@ -82,24 +100,25 @@
}
fn test_capturing_several_disjoint_fields_individually_2() {
- let f1 = U1(S(String::from("foo")), T(0), S(String::from("bar")));
- let c = || { let _ = &f1;
+ let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar")));
+ let c = || {
+ let _ = &f1;
//~^ ERROR: `Clone` trait implementation for closure and drop order
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1` to be fully captured
let _f_0 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_1 = f1.1;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1`
};
let c_clone = c.clone();
c_clone();
}
-//~^ NOTE: in Rust 2018, `f1` would be dropped here, but in Rust 2021, only `f1.1` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `f1` would be dropped here, but in Rust 2021, only `f1.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure
struct SendPointer(*mut i32);
unsafe impl Send for SendPointer {}
@@ -118,14 +137,14 @@
let fptr2 = SendPointer(&mut f2 as *mut i32);
thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
//~^ ERROR: `Sync`, `Send` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure would no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
- //~| NOTE: in Rust 2018, this closure would implement `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr2.0` does not implement `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr2.0` does not implement `Send`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
*fptr1.0.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr1`, but in Rust 2021, it only captures `fptr1.0.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0`
*fptr2.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr2`, but in Rust 2021, it only captures `fptr2.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0`
} });
}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs
index 1577b91..02f2faa 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs
@@ -4,7 +4,22 @@
use std::thread;
-struct S(String);
+#[derive(Debug)]
+struct Foo(String);
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("{:?} dropped", self.0);
+ }
+}
+
+impl Foo {
+ fn from(s: &str) -> Self {
+ Self(String::from(s))
+ }
+}
+
+
+struct S(Foo);
#[derive(Clone)]
struct T(i32);
@@ -13,39 +28,39 @@
impl Clone for U {
fn clone(&self) -> Self {
- U(S(String::from("Hello World")), T(0))
+ U(S(Foo::from("Hello World")), T(0))
}
}
fn test_multi_issues() {
- let f1 = U(S(String::from("foo")), T(0));
- let f2 = U(S(String::from("bar")), T(0));
+ let f1 = U(S(Foo::from("foo")), T(0));
+ let f2 = U(S(Foo::from("bar")), T(0));
let c = || {
//~^ ERROR: `Clone` trait implementation for closure and drop order
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1`, `f2` to be fully captured
let _f_1 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_2 = f2.1;
- //~^ NOTE: in Rust 2018, closure captures all of `f2`, but in Rust 2021, it only captures `f2.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1`
};
let c_clone = c.clone();
c_clone();
}
-//~^ NOTE: in Rust 2018, `f2` would be dropped here, but in Rust 2021, only `f2.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure
fn test_capturing_all_disjoint_fields_individually() {
- let f1 = U(S(String::from("foo")), T(0));
+ let f1 = U(S(Foo::from("foo")), T(0));
let c = || {
//~^ ERROR: `Clone` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1` to be fully captured
let _f_1 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_2 = f1.1;
};
@@ -58,22 +73,22 @@
impl Clone for U1 {
fn clone(&self) -> Self {
- U1(S(String::from("foo")), T(0), S(String::from("bar")))
+ U1(S(Foo::from("foo")), T(0), S(Foo::from("bar")))
}
}
fn test_capturing_several_disjoint_fields_individually_1() {
- let f1 = U1(S(String::from("foo")), T(0), S(String::from("bar")));
+ let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar")));
let c = || {
//~^ ERROR: `Clone` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.2` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.2` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1` to be fully captured
let _f_0 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_2 = f1.2;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.2`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2`
};
let c_clone = c.clone();
@@ -82,24 +97,24 @@
}
fn test_capturing_several_disjoint_fields_individually_2() {
- let f1 = U1(S(String::from("foo")), T(0), S(String::from("bar")));
+ let f1 = U1(S(Foo::from("foo")), T(0), S(Foo::from("bar")));
let c = || {
//~^ ERROR: `Clone` trait implementation for closure and drop order
- //~| NOTE: in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ //~| NOTE: in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `f1` to be fully captured
let _f_0 = f1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
let _f_1 = f1.1;
- //~^ NOTE: in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1`
};
let c_clone = c.clone();
c_clone();
}
-//~^ NOTE: in Rust 2018, `f1` would be dropped here, but in Rust 2021, only `f1.1` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `f1` would be dropped here, but in Rust 2021, only `f1.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure
struct SendPointer(*mut i32);
unsafe impl Send for SendPointer {}
@@ -118,14 +133,14 @@
let fptr2 = SendPointer(&mut f2 as *mut i32);
thread::spawn(move || unsafe {
//~^ ERROR: `Sync`, `Send` trait implementation for closure
- //~| NOTE: in Rust 2018, this closure would implement `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure would no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
- //~| NOTE: in Rust 2018, this closure would implement `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr2.0` does not implement `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
+ //~| NOTE: in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr2.0` does not implement `Send`
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
*fptr1.0.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr1`, but in Rust 2021, it only captures `fptr1.0.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0`
*fptr2.0 = 20;
- //~^ NOTE: in Rust 2018, closure captures all of `fptr2`, but in Rust 2021, it only captures `fptr2.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0`
});
}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
index 8a42683..d425db5 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
@@ -1,17 +1,17 @@
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
- --> $DIR/multi_diagnostics.rs:23:13
+ --> $DIR/multi_diagnostics.rs:38:13
|
LL | let c = || {
- | ^^ in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
...
LL | let _f_1 = f1.0;
- | ---- in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
LL |
LL | let _f_2 = f2.1;
- | ---- in Rust 2018, closure captures all of `f2`, but in Rust 2021, it only captures `f2.1`
+ | ---- in Rust 2018, this closure captures all of `f2`, but in Rust 2021, it will only capture `f2.1`
...
LL | }
- | - in Rust 2018, `f2` would be dropped here, but in Rust 2021, only `f2.1` would be dropped here alongside the closure
+ | - in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure
|
note: the lint level is defined here
--> $DIR/multi_diagnostics.rs:2:9
@@ -21,108 +21,92 @@
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1`, `f2` to be fully captured
|
-LL | let c = || { let _ = (&f1, &f2);
-LL |
-LL |
-LL |
-LL |
-LL | let _f_1 = f1.0;
- ...
+LL ~ let c = || {
+LL + let _ = (&f1, &f2);
+ |
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
- --> $DIR/multi_diagnostics.rs:42:13
+ --> $DIR/multi_diagnostics.rs:57:13
|
LL | let c = || {
- | ^^ in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
...
LL | let _f_1 = f1.0;
- | ---- in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1` to be fully captured
|
-LL | let c = || { let _ = &f1;
-LL |
-LL |
-LL |
-LL |
-LL | let _f_1 = f1.0;
- ...
+LL ~ let c = || {
+LL + let _ = &f1;
+ |
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
- --> $DIR/multi_diagnostics.rs:67:13
+ --> $DIR/multi_diagnostics.rs:82:13
|
LL | let c = || {
| ^^
| |
- | in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
- | in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.2` does not implement `Clone`
+ | in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
+ | in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.2` does not implement `Clone`
...
LL | let _f_0 = f1.0;
- | ---- in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
LL |
LL | let _f_2 = f1.2;
- | ---- in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.2`
+ | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.2`
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1` to be fully captured
|
-LL | let c = || { let _ = &f1;
-LL |
-LL |
-LL |
-LL |
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &f1;
+ |
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
- --> $DIR/multi_diagnostics.rs:86:13
+ --> $DIR/multi_diagnostics.rs:101:13
|
LL | let c = || {
- | ^^ in Rust 2018, this closure would implement `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure would no longer implement `Clone` as `f1.0` does not implement `Clone`
+ | ^^ in Rust 2018, this closure implements `Clone` as `f1` implements `Clone`, but in Rust 2021, this closure will no longer implement `Clone` as `f1.0` does not implement `Clone`
...
LL | let _f_0 = f1.0;
- | ---- in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.0`
+ | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.0`
LL |
LL | let _f_1 = f1.1;
- | ---- in Rust 2018, closure captures all of `f1`, but in Rust 2021, it only captures `f1.1`
+ | ---- in Rust 2018, this closure captures all of `f1`, but in Rust 2021, it will only capture `f1.1`
...
LL | }
| -
| |
- | in Rust 2018, `f1` would be dropped here, but in Rust 2021, only `f1.0` would be dropped here alongside the closure
- | in Rust 2018, `f1` would be dropped here, but in Rust 2021, only `f1.1` would be dropped here alongside the closure
+ | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.0` will be dropped here as part of the closure
+ | in Rust 2018, `f1` is dropped here, but in Rust 2021, only `f1.1` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1` to be fully captured
|
-LL | let c = || { let _ = &f1;
-LL |
-LL |
-LL |
-LL |
-LL | let _f_0 = f1.0;
- ...
+LL ~ let c = || {
+LL + let _ = &f1;
+ |
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
- --> $DIR/multi_diagnostics.rs:119:19
+ --> $DIR/multi_diagnostics.rs:134:19
|
LL | thread::spawn(move || unsafe {
| ^^^^^^^^^^^^^^
| |
- | in Rust 2018, this closure would implement `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure would no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
- | in Rust 2018, this closure would implement `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure would no longer implement `Send` as `fptr2.0` does not implement `Send`
+ | in Rust 2018, this closure implements `Sync`, `Send` as `fptr1` implements `Sync`, `Send`, but in Rust 2021, this closure will no longer implement `Sync`, `Send` as `fptr1.0.0` does not implement `Sync`, `Send`
+ | in Rust 2018, this closure implements `Send` as `fptr2` implements `Send`, but in Rust 2021, this closure will no longer implement `Send` as `fptr2.0` does not implement `Send`
...
LL | *fptr1.0.0 = 20;
- | ---------- in Rust 2018, closure captures all of `fptr1`, but in Rust 2021, it only captures `fptr1.0.0`
+ | ---------- in Rust 2018, this closure captures all of `fptr1`, but in Rust 2021, it will only capture `fptr1.0.0`
LL |
LL | *fptr2.0 = 20;
- | -------- in Rust 2018, closure captures all of `fptr2`, but in Rust 2021, it only captures `fptr2.0`
+ | -------- in Rust 2018, this closure captures all of `fptr2`, but in Rust 2021, it will only capture `fptr2.0`
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
|
-LL | thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
+LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
LL |
LL |
LL |
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/precise.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/precise.fixed
index 226172f..7892a72 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/precise.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/precise.fixed
@@ -17,18 +17,19 @@
fn test_precise_analysis_drop_paths_not_captured_by_move() {
let t = ConstainsDropField(Foo(10), Foo(20));
- let c = || { let _ = &t;
+ let c = || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
let _t = &t.1;
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
struct S;
impl Drop for S {
@@ -42,23 +43,24 @@
fn test_precise_analysis_long_path_missing() {
let u = U(T(S, S), T(S, S));
- let c = || { let _ = &u;
+ let c = || {
+ let _ = &u;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `u` to be fully captured
let _x = u.0.0;
- //~^ NOTE: in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.0`
let _x = u.0.1;
- //~^ NOTE: in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.1`
let _x = u.1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.1.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.1` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.1.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure
fn main() {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/precise.rs b/src/test/ui/closures/2229_closure_analysis/migrations/precise.rs
index 7035abe..f5e9900 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/precise.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/precise.rs
@@ -22,13 +22,13 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
let _t = &t.1;
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
struct S;
impl Drop for S {
@@ -47,18 +47,18 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `u` to be fully captured
let _x = u.0.0;
- //~^ NOTE: in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.0`
let _x = u.0.1;
- //~^ NOTE: in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.1`
let _x = u.1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.1.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.1` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.1.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure
fn main() {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr
index 5bf73cc..aa9b867 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr
@@ -5,10 +5,10 @@
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
note: the lint level is defined here
--> $DIR/precise.rs:3:9
@@ -18,13 +18,9 @@
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &t;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/precise.rs:45:13
@@ -33,31 +29,27 @@
| ^^
...
LL | let _x = u.0.0;
- | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.0`
+ | ----- in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.0`
LL |
LL | let _x = u.0.1;
- | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.0.1`
+ | ----- in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.0.1`
LL |
LL | let _x = u.1.0;
- | ----- in Rust 2018, closure captures all of `u`, but in Rust 2021, it only captures `u.1.0`
+ | ----- in Rust 2018, this closure captures all of `u`, but in Rust 2021, it will only capture `u.1.0`
...
LL | }
| -
| |
- | in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.0` would be dropped here alongside the closure
- | in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.0.1` would be dropped here alongside the closure
- | in Rust 2018, `u` would be dropped here, but in Rust 2021, only `u.1.0` would be dropped here alongside the closure
+ | in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.0` will be dropped here as part of the closure
+ | in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.0.1` will be dropped here as part of the closure
+ | in Rust 2018, `u` is dropped here, but in Rust 2021, only `u.1.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `u` to be fully captured
|
-LL | let c = || { let _ = &u;
-LL |
-LL |
-LL |
-LL | let _x = u.0.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &u;
+ |
error: aborting due to 2 previous errors
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed
index 236fdb9e..63e4000 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed
@@ -22,23 +22,24 @@
let t1 = (Foo(0), Foo(0));
let t2 = (Foo(0), Foo(0));
- let c = || { let _ = (&t, &t1, &t2);
+ let c = || {
+ let _ = (&t, &t1, &t2);
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
let _t2 = t2.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t2`, but in Rust 2021, it only captures `t2.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t2` would be dropped here, but in Rust 2021, only `t2.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure
// String implements drop and therefore should be migrated.
// But in this test cases, `t2` is completely captured and when it is dropped won't be affected
@@ -47,39 +48,41 @@
let t1 = (Foo(0), Foo(0));
let t2 = (Foo(0), Foo(0));
- let c = || { let _ = (&t, &t1);
+ let c = || {
+ let _ = (&t, &t1);
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t`, `t1` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
let _t2 = t2;
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
// If a variable would've not been captured by value then it would've not been
// dropped with the closure and therefore doesn't need migration.
fn test3_only_by_value_need_migration() {
let t = (Foo(0), Foo(0));
let t1 = (Foo(0), Foo(0));
- let c = || { let _ = &t;
+ let c = || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
println!("{:?}", t1.1);
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// The root variable might not implement drop themselves but some path starting
// at the root variable might implement Drop.
@@ -88,17 +91,18 @@
fn test4_type_contains_drop_need_migration() {
let t = ConstainsDropField(Foo(0), Foo(0));
- let c = || { let _ = &t;
+ let c = || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// Test migration analysis in case of Drop + Non Drop aggregates.
// Note we need migration here only because the non-copy (because Drop type) is captured,
@@ -106,33 +110,35 @@
fn test5_drop_non_drop_aggregate_need_migration() {
let t = (Foo(0), Foo(0), 0i32);
- let c = || { let _ = &t;
+ let c = || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// Test migration analysis in case of Significant and Insignificant Drop aggregates.
fn test6_significant_insignificant_drop_aggregate_need_migration() {
let t = (Foo(0), String::new());
- let c = || { let _ = &t;
+ let c = || {
+ let _ = &t;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.1;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
// Since we are using a move closure here, both `t` and `t1` get moved
// even though they are being used by ref inside the closure.
@@ -140,59 +146,75 @@
let t = (Foo(0), Foo(0));
let t1 = (Foo(0), Foo(0), Foo(0));
- let c = move || { let _ = (&t1, &t);
+ let c = move || {
+ let _ = (&t1, &t);
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t1`, `t` to be fully captured
println!("{:?} {:?}", t1.1, t.1);
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.1`
- //~| NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1`
+ //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure
fn test8_drop_order_and_blocks() {
{
let tuple =
- (String::from("foo"), String::from("bar"));
+ (Foo(0), Foo(1));
{
- let c = || { let _ = &tuple;
+ let c = || {
+ let _ = &tuple;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `tuple` to be fully captured
tuple.0;
- //~^ NOTE: in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
};
c();
}
- //~^ NOTE: in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure
+ //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
}
}
fn test9_drop_order_and_nested_closures() {
let tuple =
- (String::from("foo"), String::from("bar"));
+ (Foo(0), Foo(1));
let b = || {
- let c = || { let _ = &tuple;
+ let c = || {
+ let _ = &tuple;
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `tuple` to be fully captured
tuple.0;
- //~^ NOTE: in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
};
c();
};
- //~^ NOTE: in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure
+ //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
b();
}
+// Test that we migrate if drop order of Vec<T> would be affected if T is a significant drop type
+fn test10_vec_of_significant_drop_type() {
+
+ let tup = (Foo(0), vec![Foo(3)]);
+
+ let _c = || { let _ = &tup; tup.0 };
+ //~^ ERROR: drop order
+ //~| NOTE: for more information, see
+ //~| HELP: add a dummy let to cause `tup` to be fully captured
+ //~| NOTE: in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0`
+}
+//~^ NOTE: in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure
+
fn main() {
test1_all_need_migration();
test2_only_precise_paths_need_migration();
@@ -203,4 +225,5 @@
test7_move_closures_non_copy_types_might_need_migration();
test8_drop_order_and_blocks();
test9_drop_order_and_nested_closures();
+ test10_vec_of_significant_drop_type();
}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.rs b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.rs
index a57f7aa..9d9c542 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.rs
@@ -27,18 +27,18 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
let _t2 = t2.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t2`, but in Rust 2021, it only captures `t2.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t2` would be dropped here, but in Rust 2021, only `t2.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure
// String implements drop and therefore should be migrated.
// But in this test cases, `t2` is completely captured and when it is dropped won't be affected
@@ -52,16 +52,16 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t`, `t1` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
let _t1 = t1.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
let _t2 = t2;
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
// If a variable would've not been captured by value then it would've not been
// dropped with the closure and therefore doesn't need migration.
@@ -73,13 +73,13 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
println!("{:?}", t1.1);
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// The root variable might not implement drop themselves but some path starting
// at the root variable might implement Drop.
@@ -93,12 +93,12 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// Test migration analysis in case of Drop + Non Drop aggregates.
// Note we need migration here only because the non-copy (because Drop type) is captured,
@@ -111,12 +111,12 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.0;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
// Test migration analysis in case of Significant and Insignificant Drop aggregates.
fn test6_significant_insignificant_drop_aggregate_need_migration() {
@@ -127,12 +127,12 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t` to be fully captured
let _t = t.1;
- //~^ NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
// Since we are using a move closure here, both `t` and `t1` get moved
// even though they are being used by ref inside the closure.
@@ -145,54 +145,67 @@
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `t1`, `t` to be fully captured
println!("{:?} {:?}", t1.1, t.1);
- //~^ NOTE: in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.1`
- //~| NOTE: in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ //~^ NOTE: in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1`
+ //~| NOTE: in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
};
c();
}
-//~^ NOTE: in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
-//~| NOTE: in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.1` would be dropped here alongside the closure
+//~^ NOTE: in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
+//~| NOTE: in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure
fn test8_drop_order_and_blocks() {
{
let tuple =
- (String::from("foo"), String::from("bar"));
+ (Foo(0), Foo(1));
{
let c = || {
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `tuple` to be fully captured
tuple.0;
- //~^ NOTE: in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
};
c();
}
- //~^ NOTE: in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure
+ //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
}
}
fn test9_drop_order_and_nested_closures() {
let tuple =
- (String::from("foo"), String::from("bar"));
+ (Foo(0), Foo(1));
let b = || {
let c = || {
//~^ ERROR: drop order
//~| NOTE: for more information, see
//~| HELP: add a dummy let to cause `tuple` to be fully captured
tuple.0;
- //~^ NOTE: in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0`
+ //~^ NOTE: in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
};
c();
};
- //~^ NOTE: in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure
+ //~^ NOTE: in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
b();
}
+// Test that we migrate if drop order of Vec<T> would be affected if T is a significant drop type
+fn test10_vec_of_significant_drop_type() {
+
+ let tup = (Foo(0), vec![Foo(3)]);
+
+ let _c = || tup.0;
+ //~^ ERROR: drop order
+ //~| NOTE: for more information, see
+ //~| HELP: add a dummy let to cause `tup` to be fully captured
+ //~| NOTE: in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0`
+}
+//~^ NOTE: in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure
+
fn main() {
test1_all_need_migration();
test2_only_precise_paths_need_migration();
@@ -203,4 +216,5 @@
test7_move_closures_non_copy_types_might_need_migration();
test8_drop_order_and_blocks();
test9_drop_order_and_nested_closures();
+ test10_vec_of_significant_drop_type();
}
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr
index b2b9ae8..fa1f83c 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr
@@ -5,20 +5,20 @@
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
LL |
LL | let _t1 = t1.0;
- | ---- in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
+ | ---- in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
LL |
LL | let _t2 = t2.0;
- | ---- in Rust 2018, closure captures all of `t2`, but in Rust 2021, it only captures `t2.0`
+ | ---- in Rust 2018, this closure captures all of `t2`, but in Rust 2021, it will only capture `t2.0`
...
LL | }
| -
| |
- | in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- | in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
- | in Rust 2018, `t2` would be dropped here, but in Rust 2021, only `t2.0` would be dropped here alongside the closure
+ | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
+ | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
+ | in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure
|
note: the lint level is defined here
--> $DIR/significant_drop.rs:2:9
@@ -28,13 +28,9 @@
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
|
-LL | let c = || { let _ = (&t, &t1, &t2);
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = (&t, &t1, &t2);
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:50:13
@@ -43,27 +39,23 @@
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
LL |
LL | let _t1 = t1.0;
- | ---- in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.0`
+ | ---- in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.0`
...
LL | }
| -
| |
- | in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
- | in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.0` would be dropped here alongside the closure
+ | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
+ | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1` to be fully captured
|
-LL | let c = || { let _ = (&t, &t1);
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = (&t, &t1);
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:71:13
@@ -72,21 +64,17 @@
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &t;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:91:13
@@ -95,21 +83,17 @@
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &t;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:109:13
@@ -118,21 +102,17 @@
| ^^
...
LL | let _t = t.0;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.0`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.0`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.0` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &t;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:125:13
@@ -141,21 +121,17 @@
| ^^
...
LL | let _t = t.1;
- | --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ | --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
...
LL | }
- | - in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
+ | - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.1;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &t;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:143:13
@@ -164,26 +140,22 @@
| ^^^^^^^
...
LL | println!("{:?} {:?}", t1.1, t.1);
- | ---- --- in Rust 2018, closure captures all of `t`, but in Rust 2021, it only captures `t.1`
+ | ---- --- in Rust 2018, this closure captures all of `t`, but in Rust 2021, it will only capture `t.1`
| |
- | in Rust 2018, closure captures all of `t1`, but in Rust 2021, it only captures `t1.1`
+ | in Rust 2018, this closure captures all of `t1`, but in Rust 2021, it will only capture `t1.1`
...
LL | }
| -
| |
- | in Rust 2018, `t1` would be dropped here, but in Rust 2021, only `t1.1` would be dropped here alongside the closure
- | in Rust 2018, `t` would be dropped here, but in Rust 2021, only `t.1` would be dropped here alongside the closure
+ | in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.1` will be dropped here as part of the closure
+ | in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.1` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t1`, `t` to be fully captured
|
-LL | let c = move || { let _ = (&t1, &t);
-LL |
-LL |
-LL |
-LL | println!("{:?} {:?}", t1.1, t.1);
-LL |
- ...
+LL ~ let c = move || {
+LL + let _ = (&t1, &t);
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:163:21
@@ -192,21 +164,17 @@
| ^^
...
LL | tuple.0;
- | ------- in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0`
+ | ------- in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
...
LL | }
- | - in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure
+ | - in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `tuple` to be fully captured
|
-LL | let c = || { let _ = &tuple;
-LL |
-LL |
-LL |
-LL | tuple.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &tuple;
+ |
error: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/significant_drop.rs:181:17
@@ -215,21 +183,34 @@
| ^^
...
LL | tuple.0;
- | ------- in Rust 2018, closure captures all of `tuple`, but in Rust 2021, it only captures `tuple.0`
+ | ------- in Rust 2018, this closure captures all of `tuple`, but in Rust 2021, it will only capture `tuple.0`
...
LL | };
- | - in Rust 2018, `tuple` would be dropped here, but in Rust 2021, only `tuple.0` would be dropped here alongside the closure
+ | - in Rust 2018, `tuple` is dropped here, but in Rust 2021, only `tuple.0` will be dropped here as part of the closure
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `tuple` to be fully captured
|
-LL | let c = || { let _ = &tuple;
-LL |
-LL |
-LL |
-LL | tuple.0;
-LL |
- ...
+LL ~ let c = || {
+LL + let _ = &tuple;
+ |
-error: aborting due to 9 previous errors
+error: changes to closure capture in Rust 2021 will affect drop order
+ --> $DIR/significant_drop.rs:201:18
+ |
+LL | let _c = || tup.0;
+ | ^^^-----
+ | |
+ | in Rust 2018, this closure captures all of `tup`, but in Rust 2021, it will only capture `tup.0`
+...
+LL | }
+ | - in Rust 2018, `tup` is dropped here, but in Rust 2021, only `tup.0` will be dropped here as part of the closure
+ |
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
+help: add a dummy let to cause `tup` to be fully captured
+ |
+LL | let _c = || { let _ = &tup; tup.0 };
+ | +++++++++++++++ +
+
+error: aborting due to 10 previous errors
diff --git a/src/test/ui/closures/2229_closure_analysis/move_closure.rs b/src/test/ui/closures/2229_closure_analysis/move_closure.rs
index 0e7abf6..b542fa2 100644
--- a/src/test/ui/closures/2229_closure_analysis/move_closure.rs
+++ b/src/test/ui/closures/2229_closure_analysis/move_closure.rs
@@ -34,8 +34,8 @@
//~^ ERROR: First Pass analysis includes:
//~| ERROR: Min Capture analysis includes:
*ref_s += 10;
- //~^ NOTE: Capturing ref_s[Deref] -> UniqueImmBorrow
- //~| NOTE: Min Capture ref_s[Deref] -> UniqueImmBorrow
+ //~^ NOTE: Capturing ref_s[Deref] -> MutBorrow
+ //~| NOTE: Min Capture ref_s[] -> ByValue
};
c();
}
@@ -55,8 +55,8 @@
//~^ ERROR: First Pass analysis includes:
//~| ERROR: Min Capture analysis includes:
t.0.0 = "new s".into();
- //~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow
- //~| NOTE: Min Capture t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow
+ //~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> MutBorrow
+ //~| NOTE: Min Capture t[(0, 0)] -> ByValue
};
c();
@@ -79,7 +79,7 @@
//~| ERROR: Min Capture analysis includes:
let _t = t.0.0;
//~^ NOTE: Capturing t[(0, 0),Deref,(0, 0)] -> ImmBorrow
- //~| NOTE: Min Capture t[(0, 0),Deref] -> ImmBorrow
+ //~| NOTE: Min Capture t[(0, 0)] -> ByValue
};
c();
@@ -173,9 +173,9 @@
//~^ ERROR: attributes on expressions are experimental
//~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
//~| First Pass analysis includes:
- //~| NOTE: Capturing box_p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+ //~| NOTE: Capturing box_p_foo[Deref,Deref,(0, 0)] -> MutBorrow
//~| Min Capture analysis includes:
- //~| NOTE: Min Capture box_p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+ //~| NOTE: Min Capture box_p_foo[] -> ByValue
}
// Ensure that even in move closures, if the data is not owned by the root variable
@@ -190,9 +190,9 @@
//~^ ERROR: attributes on expressions are experimental
//~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
//~| First Pass analysis includes:
- //~| NOTE: Capturing p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+ //~| NOTE: Capturing p_foo[Deref,Deref,(0, 0)] -> MutBorrow
//~| Min Capture analysis includes:
- //~| NOTE: Min Capture p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+ //~| NOTE: Min Capture p_foo[] -> ByValue
}
// Test that move closures can take ownership of Copy type
diff --git a/src/test/ui/closures/2229_closure_analysis/move_closure.stderr b/src/test/ui/closures/2229_closure_analysis/move_closure.stderr
index 82ed99f..fd80e05 100644
--- a/src/test/ui/closures/2229_closure_analysis/move_closure.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/move_closure.stderr
@@ -169,7 +169,7 @@
LL | | };
| |_____^
|
-note: Capturing ref_s[Deref] -> UniqueImmBorrow
+note: Capturing ref_s[Deref] -> MutBorrow
--> $DIR/move_closure.rs:36:9
|
LL | *ref_s += 10;
@@ -187,7 +187,7 @@
LL | | };
| |_____^
|
-note: Min Capture ref_s[Deref] -> UniqueImmBorrow
+note: Min Capture ref_s[] -> ByValue
--> $DIR/move_closure.rs:36:9
|
LL | *ref_s += 10;
@@ -205,7 +205,7 @@
LL | | };
| |_____^
|
-note: Capturing t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow
+note: Capturing t[(0, 0),Deref,(0, 0)] -> MutBorrow
--> $DIR/move_closure.rs:57:9
|
LL | t.0.0 = "new s".into();
@@ -223,7 +223,7 @@
LL | | };
| |_____^
|
-note: Min Capture t[(0, 0),Deref,(0, 0)] -> UniqueImmBorrow
+note: Min Capture t[(0, 0)] -> ByValue
--> $DIR/move_closure.rs:57:9
|
LL | t.0.0 = "new s".into();
@@ -259,7 +259,7 @@
LL | | };
| |_____^
|
-note: Min Capture t[(0, 0),Deref] -> ImmBorrow
+note: Min Capture t[(0, 0)] -> ByValue
--> $DIR/move_closure.rs:80:18
|
LL | let _t = t.0.0;
@@ -415,7 +415,7 @@
LL | let c = #[rustc_capture_analysis] move || box_p_foo.x += 10;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: Capturing box_p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+note: Capturing box_p_foo[Deref,Deref,(0, 0)] -> MutBorrow
--> $DIR/move_closure.rs:172:47
|
LL | let c = #[rustc_capture_analysis] move || box_p_foo.x += 10;
@@ -427,7 +427,7 @@
LL | let c = #[rustc_capture_analysis] move || box_p_foo.x += 10;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: Min Capture box_p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+note: Min Capture box_p_foo[] -> ByValue
--> $DIR/move_closure.rs:172:47
|
LL | let c = #[rustc_capture_analysis] move || box_p_foo.x += 10;
@@ -439,7 +439,7 @@
LL | let c = #[rustc_capture_analysis] move || p_foo.x += 10;
| ^^^^^^^^^^^^^^^^^^^^^
|
-note: Capturing p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+note: Capturing p_foo[Deref,Deref,(0, 0)] -> MutBorrow
--> $DIR/move_closure.rs:189:47
|
LL | let c = #[rustc_capture_analysis] move || p_foo.x += 10;
@@ -451,7 +451,7 @@
LL | let c = #[rustc_capture_analysis] move || p_foo.x += 10;
| ^^^^^^^^^^^^^^^^^^^^^
|
-note: Min Capture p_foo[Deref,Deref,(0, 0)] -> UniqueImmBorrow
+note: Min Capture p_foo[] -> ByValue
--> $DIR/move_closure.rs:189:47
|
LL | let c = #[rustc_capture_analysis] move || p_foo.x += 10;
diff --git a/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs
new file mode 100644
index 0000000..2f8cddc
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs
@@ -0,0 +1,101 @@
+// edition:2021
+
+// Tests that in cases where we individually capture all the fields of a type,
+// we still drop them in the order they would have been dropped in the 2018 edition.
+
+// NOTE: It is *critical* that the order of the min capture NOTES in the stderr output
+// does *not* change!
+
+#![feature(rustc_attrs)]
+
+#[derive(Debug)]
+struct HasDrop;
+impl Drop for HasDrop {
+ fn drop(&mut self) {
+ println!("dropped");
+ }
+}
+
+fn test_one() {
+ let a = (HasDrop, HasDrop);
+ let b = (HasDrop, HasDrop);
+
+ let c = #[rustc_capture_analysis]
+ //~^ ERROR: attributes on expressions are experimental
+ //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
+ || {
+ //~^ ERROR: Min Capture analysis includes:
+ //~| ERROR
+ println!("{:?}", a.0);
+ //~^ NOTE: Min Capture a[(0, 0)] -> ImmBorrow
+ //~| NOTE
+ println!("{:?}", a.1);
+ //~^ NOTE: Min Capture a[(1, 0)] -> ImmBorrow
+ //~| NOTE
+
+ println!("{:?}", b.0);
+ //~^ NOTE: Min Capture b[(0, 0)] -> ImmBorrow
+ //~| NOTE
+ println!("{:?}", b.1);
+ //~^ NOTE: Min Capture b[(1, 0)] -> ImmBorrow
+ //~| NOTE
+ };
+}
+
+fn test_two() {
+ let a = (HasDrop, HasDrop);
+ let b = (HasDrop, HasDrop);
+
+ let c = #[rustc_capture_analysis]
+ //~^ ERROR: attributes on expressions are experimental
+ //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
+ || {
+ //~^ ERROR: Min Capture analysis includes:
+ //~| ERROR
+ println!("{:?}", a.1);
+ //~^ NOTE: Min Capture a[(1, 0)] -> ImmBorrow
+ //~| NOTE
+ println!("{:?}", a.0);
+ //~^ NOTE: Min Capture a[(0, 0)] -> ImmBorrow
+ //~| NOTE
+
+ println!("{:?}", b.1);
+ //~^ NOTE: Min Capture b[(1, 0)] -> ImmBorrow
+ //~| NOTE
+ println!("{:?}", b.0);
+ //~^ NOTE: Min Capture b[(0, 0)] -> ImmBorrow
+ //~| NOTE
+ };
+}
+
+fn test_three() {
+ let a = (HasDrop, HasDrop);
+ let b = (HasDrop, HasDrop);
+
+ let c = #[rustc_capture_analysis]
+ //~^ ERROR: attributes on expressions are experimental
+ //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
+ || {
+ //~^ ERROR: Min Capture analysis includes:
+ //~| ERROR
+ println!("{:?}", b.1);
+ //~^ NOTE: Min Capture b[(1, 0)] -> ImmBorrow
+ //~| NOTE
+ println!("{:?}", a.1);
+ //~^ NOTE: Min Capture a[(1, 0)] -> ImmBorrow
+ //~| NOTE
+ println!("{:?}", a.0);
+ //~^ NOTE: Min Capture a[(0, 0)] -> ImmBorrow
+ //~| NOTE
+
+ println!("{:?}", b.0);
+ //~^ NOTE: Min Capture b[(0, 0)] -> ImmBorrow
+ //~| NOTE
+ };
+}
+
+fn main() {
+ test_one();
+ test_two();
+ test_three();
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.stderr b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.stderr
new file mode 100644
index 0000000..2d1dc87
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.stderr
@@ -0,0 +1,228 @@
+error[E0658]: attributes on expressions are experimental
+ --> $DIR/preserve_field_drop_order.rs:23:13
+ |
+LL | let c = #[rustc_capture_analysis]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+ = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+
+error[E0658]: attributes on expressions are experimental
+ --> $DIR/preserve_field_drop_order.rs:49:13
+ |
+LL | let c = #[rustc_capture_analysis]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+ = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+
+error[E0658]: attributes on expressions are experimental
+ --> $DIR/preserve_field_drop_order.rs:75:13
+ |
+LL | let c = #[rustc_capture_analysis]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+ = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+
+error: First Pass analysis includes:
+ --> $DIR/preserve_field_drop_order.rs:26:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | println!("{:?}", a.0);
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Capturing a[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:29:26
+ |
+LL | println!("{:?}", a.0);
+ | ^^^
+note: Capturing a[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:32:26
+ |
+LL | println!("{:?}", a.1);
+ | ^^^
+note: Capturing b[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:36:26
+ |
+LL | println!("{:?}", b.0);
+ | ^^^
+note: Capturing b[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:39:26
+ |
+LL | println!("{:?}", b.1);
+ | ^^^
+
+error: Min Capture analysis includes:
+ --> $DIR/preserve_field_drop_order.rs:26:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | println!("{:?}", a.0);
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Min Capture a[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:29:26
+ |
+LL | println!("{:?}", a.0);
+ | ^^^
+note: Min Capture a[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:32:26
+ |
+LL | println!("{:?}", a.1);
+ | ^^^
+note: Min Capture b[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:36:26
+ |
+LL | println!("{:?}", b.0);
+ | ^^^
+note: Min Capture b[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:39:26
+ |
+LL | println!("{:?}", b.1);
+ | ^^^
+
+error: First Pass analysis includes:
+ --> $DIR/preserve_field_drop_order.rs:52:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | println!("{:?}", a.1);
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Capturing a[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:55:26
+ |
+LL | println!("{:?}", a.1);
+ | ^^^
+note: Capturing a[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:58:26
+ |
+LL | println!("{:?}", a.0);
+ | ^^^
+note: Capturing b[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:62:26
+ |
+LL | println!("{:?}", b.1);
+ | ^^^
+note: Capturing b[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:65:26
+ |
+LL | println!("{:?}", b.0);
+ | ^^^
+
+error: Min Capture analysis includes:
+ --> $DIR/preserve_field_drop_order.rs:52:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | println!("{:?}", a.1);
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Min Capture a[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:58:26
+ |
+LL | println!("{:?}", a.0);
+ | ^^^
+note: Min Capture a[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:55:26
+ |
+LL | println!("{:?}", a.1);
+ | ^^^
+note: Min Capture b[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:65:26
+ |
+LL | println!("{:?}", b.0);
+ | ^^^
+note: Min Capture b[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:62:26
+ |
+LL | println!("{:?}", b.1);
+ | ^^^
+
+error: First Pass analysis includes:
+ --> $DIR/preserve_field_drop_order.rs:78:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | println!("{:?}", b.1);
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Capturing b[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:81:26
+ |
+LL | println!("{:?}", b.1);
+ | ^^^
+note: Capturing a[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:84:26
+ |
+LL | println!("{:?}", a.1);
+ | ^^^
+note: Capturing a[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:87:26
+ |
+LL | println!("{:?}", a.0);
+ | ^^^
+note: Capturing b[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:91:26
+ |
+LL | println!("{:?}", b.0);
+ | ^^^
+
+error: Min Capture analysis includes:
+ --> $DIR/preserve_field_drop_order.rs:78:5
+ |
+LL | / || {
+LL | |
+LL | |
+LL | | println!("{:?}", b.1);
+... |
+LL | |
+LL | | };
+ | |_____^
+ |
+note: Min Capture b[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:91:26
+ |
+LL | println!("{:?}", b.0);
+ | ^^^
+note: Min Capture b[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:81:26
+ |
+LL | println!("{:?}", b.1);
+ | ^^^
+note: Min Capture a[(0, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:87:26
+ |
+LL | println!("{:?}", a.0);
+ | ^^^
+note: Min Capture a[(1, 0)] -> ImmBorrow
+ --> $DIR/preserve_field_drop_order.rs:84:26
+ |
+LL | println!("{:?}", a.1);
+ | ^^^
+
+error: aborting due to 9 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.rs b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.rs
new file mode 100644
index 0000000..1cae776
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.rs
@@ -0,0 +1,58 @@
+// run-pass
+// check-run-results
+// revisions: twenty_eighteen twenty_twentyone
+// [twenty_eighteen]compile-flags: --edition 2018
+// [twenty_twentyone]compile-flags: --edition 2021
+
+#[derive(Debug)]
+struct Dropable(&'static str);
+
+impl Drop for Dropable {
+ fn drop(&mut self) {
+ println!("Dropping {}", self.0)
+ }
+}
+
+#[derive(Debug)]
+struct A {
+ x: Dropable,
+ y: Dropable,
+}
+
+#[derive(Debug)]
+struct B {
+ c: A,
+ d: A,
+}
+
+#[derive(Debug)]
+struct R<'a> {
+ c: &'a A,
+ d: &'a A,
+}
+
+fn main() {
+ let a = A { x: Dropable("x"), y: Dropable("y") };
+
+ let c = move || println!("{:?} {:?}", a.y, a.x);
+
+ c();
+
+ let b = B {
+ c: A { x: Dropable("b.c.x"), y: Dropable("b.c.y") },
+ d: A { x: Dropable("b.d.x"), y: Dropable("b.d.y") },
+ };
+
+ let d = move || println!("{:?} {:?} {:?} {:?}", b.d.y, b.d.x, b.c.y, b.c.x);
+
+ d();
+
+ let r = R {
+ c: &A { x: Dropable("r.c.x"), y: Dropable("r.c.y") },
+ d: &A { x: Dropable("r.d.x"), y: Dropable("r.d.y") },
+ };
+
+ let e = move || println!("{:?} {:?} {:?} {:?}", r.d.y, r.d.x, r.c.y, r.c.x);
+
+ e();
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.twenty_eighteen.run.stdout b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.twenty_eighteen.run.stdout
new file mode 100644
index 0000000..557d047
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.twenty_eighteen.run.stdout
@@ -0,0 +1,13 @@
+Dropable("y") Dropable("x")
+Dropable("b.d.y") Dropable("b.d.x") Dropable("b.c.y") Dropable("b.c.x")
+Dropable("r.d.y") Dropable("r.d.x") Dropable("r.c.y") Dropable("r.c.x")
+Dropping r.d.x
+Dropping r.d.y
+Dropping r.c.x
+Dropping r.c.y
+Dropping b.c.x
+Dropping b.c.y
+Dropping b.d.x
+Dropping b.d.y
+Dropping x
+Dropping y
diff --git a/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.twenty_twentyone.run.stdout b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.twenty_twentyone.run.stdout
new file mode 100644
index 0000000..557d047
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order2.twenty_twentyone.run.stdout
@@ -0,0 +1,13 @@
+Dropable("y") Dropable("x")
+Dropable("b.d.y") Dropable("b.d.x") Dropable("b.c.y") Dropable("b.c.x")
+Dropable("r.d.y") Dropable("r.d.x") Dropable("r.c.y") Dropable("r.c.x")
+Dropping r.d.x
+Dropping r.d.y
+Dropping r.c.x
+Dropping r.c.y
+Dropping b.c.x
+Dropping b.c.y
+Dropping b.d.x
+Dropping b.d.y
+Dropping x
+Dropping y
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs
index 07adbee..dacc2c6 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.rs
@@ -43,7 +43,6 @@
fn test4() {
let t = (String::from("Hello"), String::from("World"));
- //~^ WARN unused variable: `t`
let c = || {
let (_, _) = t;
@@ -81,9 +80,7 @@
fn test8() {
let x = 0;
- //~^ WARN unused variable: `x`
let tup = (1, 2);
- //~^ WARN unused variable: `tup`
let p = Point { x: 10, y: 20 };
let c = || {
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr
index 6523f2b..7706f68 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure_patterns.stderr
@@ -29,29 +29,11 @@
LL | let (_, t2) = t;
| ^^ help: if this is intentional, prefix it with an underscore: `_t2`
-warning: unused variable: `t`
- --> $DIR/destructure_patterns.rs:45:9
- |
-LL | let t = (String::from("Hello"), String::from("World"));
- | ^ help: if this is intentional, prefix it with an underscore: `_t`
-
warning: unused variable: `x`
- --> $DIR/destructure_patterns.rs:91:21
+ --> $DIR/destructure_patterns.rs:88:21
|
LL | let Point { x, y } = p;
| ^ help: try ignoring the field: `x: _`
-warning: unused variable: `x`
- --> $DIR/destructure_patterns.rs:83:9
- |
-LL | let x = 0;
- | ^ help: if this is intentional, prefix it with an underscore: `_x`
-
-warning: unused variable: `tup`
- --> $DIR/destructure_patterns.rs:85:9
- |
-LL | let tup = (1, 2);
- | ^^^ help: if this is intentional, prefix it with an underscore: `_tup`
-
-warning: 8 warnings emitted
+warning: 5 warnings emitted
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/issue-87378.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-87378.rs
new file mode 100644
index 0000000..c64475f
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-87378.rs
@@ -0,0 +1,16 @@
+// edition:2021
+// check-pass
+
+union Union {
+ value: u64,
+}
+
+fn main() {
+ let u = Union { value: 42 };
+
+ let c = || {
+ unsafe { u.value }
+ };
+
+ c();
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88372.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88372.rs
new file mode 100644
index 0000000..25fbb6c
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88372.rs
@@ -0,0 +1,19 @@
+// edition:2021
+// run-pass
+
+
+fn solve<F>(validate: F) -> Option<u64>
+where
+ F: Fn(&mut [i8; 1]),
+{
+ let mut position: [i8; 1] = [1];
+ Some(0).map(|_| {
+ validate(&mut position);
+ let [_x] = position;
+ 0
+ })
+}
+
+fn main() {
+ solve(|_| ());
+}
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88431.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88431.rs
new file mode 100644
index 0000000..9996205
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88431.rs
@@ -0,0 +1,59 @@
+// edition:2021
+// check-pass
+
+use std::collections::HashMap;
+use std::future::Future;
+use std::pin::Pin;
+
+pub struct GameMode {}
+
+struct GameStateManager<'a> {
+ gamestate_stack: Vec<Box<dyn GameState<'a> + 'a>>,
+}
+
+pub trait GameState<'a> {}
+
+async fn construct_gamestate_replay<'a>(
+ _gamemode: &GameMode,
+ _factory: &mut GameStateManager<'a>,
+) -> Box<dyn GameState<'a> + 'a> {
+ unimplemented!()
+}
+
+type FutureGameState<'a, 'b> = Pin<Box<dyn Future<Output = Box<dyn GameState<'a> + 'a>> + 'b>>;
+
+struct MenuOption<'a> {
+ command: Box<dyn for<'b> Fn(&'b mut GameStateManager<'a>) -> FutureGameState<'a, 'b> + 'a>,
+}
+
+impl<'a> MenuOption<'a> {
+ fn new(
+ _command: impl for<'b> Fn(&'b mut GameStateManager<'a>) -> FutureGameState<'a, 'b> + 'a,
+ ) -> Self {
+ unimplemented!()
+ }
+}
+
+struct MenuState<'a> {
+ options: Vec<MenuOption<'a>>,
+}
+
+impl<'a> GameState<'a> for MenuState<'a> {}
+
+pub async fn get_replay_menu<'a>(
+ gamemodes: &'a HashMap<&str, GameMode>,
+) -> Box<dyn GameState<'a> + 'a> {
+ let recordings: Vec<String> = vec![];
+ let _ = recordings
+ .into_iter()
+ .map(|entry| {
+ MenuOption::new(move |f| {
+ Box::pin(construct_gamestate_replay(&gamemodes[entry.as_str()], f))
+ })
+ })
+ .collect::<Vec<_>>();
+
+ todo!()
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88476.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88476.rs
new file mode 100644
index 0000000..f44c2af
--- /dev/null
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/issue-88476.rs
@@ -0,0 +1,47 @@
+// check-pass
+// edition:2021
+
+use std::rc::Rc;
+
+// Test that we restrict precision when moving not-`Copy` types, if any of the parent paths
+// implement `Drop`. This is to ensure that we don't move out of a type that implements Drop.
+pub fn test1() {
+ struct Foo(Rc<i32>);
+
+ impl Drop for Foo {
+ fn drop(self: &mut Foo) {}
+ }
+
+ let f = Foo(Rc::new(1));
+ let x = move || {
+ println!("{:?}", f.0);
+ };
+
+ x();
+}
+
+
+// Test that we don't restrict precision when moving `Copy` types(i.e. when copying),
+// even if any of the parent paths implement `Drop`.
+pub fn test2() {
+ struct Character {
+ hp: u32,
+ name: String,
+ }
+
+ impl Drop for Character {
+ fn drop(&mut self) {}
+ }
+
+ let character = Character { hp: 100, name: format!("A") };
+
+ let c = move || {
+ println!("{}", character.hp)
+ };
+
+ c();
+
+ println!("{}", character.name);
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs
index e1b61e8..f76965b 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/move_closure.rs
@@ -56,28 +56,6 @@
c();
}
-struct A<'a>(&'a mut String, &'a mut String);
-// Test that reborrowing works as expected for move closures
-// by attempting a disjoint capture through a reference.
-fn disjoint_via_ref() {
- let mut x = String::new();
- let mut y = String::new();
-
- let mut a = A(&mut x, &mut y);
- let a = &mut a;
-
- let mut c1 = move || {
- a.0.truncate(0);
- };
-
- let mut c2 = move || {
- a.1.truncate(0);
- };
-
- c1();
- c2();
-}
-
// Test that even if a path is moved into the closure, the closure is not FnOnce
// if the path is not moved by the closure call.
fn data_moved_but_not_fn_once() {
@@ -109,7 +87,6 @@
no_ref();
no_ref_nested();
- disjoint_via_ref();
data_moved_but_not_fn_once();
returned_closure_owns_copy_type_data();
diff --git a/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr b/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr
index 273eae9..bf6ec5c 100644
--- a/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr
+++ b/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr
@@ -1,16 +1,18 @@
error[E0277]: `F` cannot be sent between threads safely
--> $DIR/closure-bounds-cant-promote-superkind-in-struct.rs:5:22
|
-LL | struct X<F> where F: FnOnce() + 'static + Send {
- | ---- required by this bound in `X`
-...
LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static {
| ^^^^ `F` cannot be sent between threads safely
|
+note: required by a bound in `X`
+ --> $DIR/closure-bounds-cant-promote-superkind-in-struct.rs:1:43
+ |
+LL | struct X<F> where F: FnOnce() + 'static + Send {
+ | ^^^^ required by this bound in `X`
help: consider further restricting this bound
|
LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static + std::marker::Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr
index 1b0e090..e7d9664e 100644
--- a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr
+++ b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr
@@ -27,7 +27,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | bar(move || {
- | ^^^^^^^
+ | ++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/closures/closure-bounds-subtype.stderr b/src/test/ui/closures/closure-bounds-subtype.stderr
index 7df29d5..bfea497 100644
--- a/src/test/ui/closures/closure-bounds-subtype.stderr
+++ b/src/test/ui/closures/closure-bounds-subtype.stderr
@@ -1,16 +1,18 @@
error[E0277]: `F` cannot be shared between threads safely
--> $DIR/closure-bounds-subtype.rs:13:22
|
-LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
- | ---- required by this bound in `take_const_owned`
-...
LL | take_const_owned(f);
| ^ `F` cannot be shared between threads safely
|
+note: required by a bound in `take_const_owned`
+ --> $DIR/closure-bounds-subtype.rs:4:50
+ |
+LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
+ | ^^^^ required by this bound in `take_const_owned`
help: consider further restricting this bound
|
LL | fn give_owned<F>(f: F) where F: FnOnce() + Send + std::marker::Sync {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.polonius.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.polonius.stderr
new file mode 100644
index 0000000..8846cce
--- /dev/null
+++ b/src/test/ui/closures/closure-expected-type/expect-region-supply-region-2.polonius.stderr
@@ -0,0 +1,37 @@
+error: lifetime may not live long enough
+ --> $DIR/expect-region-supply-region-2.rs:14:30
+ |
+LL | fn expect_bound_supply_named<'x>() {
+ | -- lifetime `'x` defined here
+...
+LL | closure_expecting_bound(|x: &'x u32| {
+ | ^ - let's call the lifetime of this reference `'1`
+ | |
+ | requires that `'1` must outlive `'x`
+
+error[E0521]: borrowed data escapes outside of closure
+ --> $DIR/expect-region-supply-region-2.rs:20:9
+ |
+LL | let mut f: Option<&u32> = None;
+ | ----- `f` declared here, outside of the closure body
+...
+LL | closure_expecting_bound(|x: &'x u32| {
+ | - `x` is a reference that is only valid in the closure body
+...
+LL | f = Some(x);
+ | ^^^^^^^^^^^ `x` escapes the closure body here
+
+error: lifetime may not live long enough
+ --> $DIR/expect-region-supply-region-2.rs:14:30
+ |
+LL | fn expect_bound_supply_named<'x>() {
+ | -- lifetime `'x` defined here
+...
+LL | closure_expecting_bound(|x: &'x u32| {
+ | ^ requires that `'x` must outlive `'static`
+ |
+ = help: consider replacing `'x` with `'static`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/closures/closure-expected-type/expect-region-supply-region.polonius.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.polonius.stderr
deleted file mode 100644
index df60416..0000000
--- a/src/test/ui/closures/closure-expected-type/expect-region-supply-region.polonius.stderr
+++ /dev/null
@@ -1,56 +0,0 @@
-error[E0521]: borrowed data escapes outside of closure
- --> $DIR/expect-region-supply-region.rs:18:9
- |
-LL | let mut f: Option<&u32> = None;
- | ----- `f` declared here, outside of the closure body
-LL | closure_expecting_bound(|x| {
- | - `x` is a reference that is only valid in the closure body
-LL | f = Some(x);
- | ^^^^^^^^^^^ `x` escapes the closure body here
-
-error[E0521]: borrowed data escapes outside of closure
- --> $DIR/expect-region-supply-region.rs:28:9
- |
-LL | let mut f: Option<&u32> = None;
- | ----- `f` declared here, outside of the closure body
-LL | closure_expecting_bound(|x: &u32| {
- | - `x` is a reference that is only valid in the closure body
-LL | f = Some(x);
- | ^^^^^^^^^^^ `x` escapes the closure body here
-
-error: lifetime may not live long enough
- --> $DIR/expect-region-supply-region.rs:37:30
- |
-LL | fn expect_bound_supply_named<'x>() {
- | -- lifetime `'x` defined here
-...
-LL | closure_expecting_bound(|x: &'x u32| {
- | ^ - let's call the lifetime of this reference `'1`
- | |
- | requires that `'1` must outlive `'x`
-
-error[E0521]: borrowed data escapes outside of closure
- --> $DIR/expect-region-supply-region.rs:42:9
- |
-LL | let mut f: Option<&u32> = None;
- | ----- `f` declared here, outside of the closure body
-...
-LL | closure_expecting_bound(|x: &'x u32| {
- | - `x` is a reference that is only valid in the closure body
-...
-LL | f = Some(x);
- | ^^^^^^^^^^^ `x` escapes the closure body here
-
-error: lifetime may not live long enough
- --> $DIR/expect-region-supply-region.rs:37:30
- |
-LL | fn expect_bound_supply_named<'x>() {
- | -- lifetime `'x` defined here
-...
-LL | closure_expecting_bound(|x: &'x u32| {
- | ^ requires that `'x` must outlive `'static`
- |
- = help: consider replacing `'x` with `'static`
-
-error: aborting due to 5 previous errors
-
diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr
index da5e25c..618c9a1 100644
--- a/src/test/ui/closures/closure-move-sync.stderr
+++ b/src/test/ui/closures/closure-move-sync.stderr
@@ -3,30 +3,30 @@
|
LL | let t = thread::spawn(|| {
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
- |
- ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL
- |
-LL | F: Send + 'static,
- | ---- required by this bound in `spawn`
|
= help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
= note: required because of the requirements on the impl of `Send` for `&std::sync::mpsc::Receiver<()>`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:6:27: 9:6]`
+note: required by a bound in `spawn`
+ --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
+ |
+LL | F: Send + 'static,
+ | ^^^^ required by this bound in `spawn`
error[E0277]: `Sender<()>` cannot be shared between threads safely
--> $DIR/closure-move-sync.rs:18:5
|
LL | thread::spawn(|| tx.send(()).unwrap());
| ^^^^^^^^^^^^^ `Sender<()>` cannot be shared between threads safely
- |
- ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL
- |
-LL | F: Send + 'static,
- | ---- required by this bound in `spawn`
|
= help: the trait `Sync` is not implemented for `Sender<()>`
= note: required because of the requirements on the impl of `Send` for `&Sender<()>`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:18:19: 18:42]`
+note: required by a bound in `spawn`
+ --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
+ |
+LL | F: Send + 'static,
+ | ^^^^ required by this bound in `spawn`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/closures/issue-41366.rs b/src/test/ui/closures/issue-41366.rs
index 909c33f..acc1c6a 100644
--- a/src/test/ui/closures/issue-41366.rs
+++ b/src/test/ui/closures/issue-41366.rs
@@ -1,3 +1,5 @@
+// check-pass
+
trait T<'x> {
type V;
}
@@ -8,6 +10,4 @@
fn main() {
(&|_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
- //~^ ERROR: type mismatch in closure arguments
- //~| ERROR: size for values of type `<u32 as T<'_>>::V` cannot be known at compilation time
}
diff --git a/src/test/ui/closures/issue-41366.stderr b/src/test/ui/closures/issue-41366.stderr
deleted file mode 100644
index ffe0bce..0000000
--- a/src/test/ui/closures/issue-41366.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error[E0631]: type mismatch in closure arguments
- --> $DIR/issue-41366.rs:10:5
- |
-LL | (&|_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
- | ^^------^
- | | |
- | | found signature of `fn(u16) -> _`
- | expected signature of `for<'x> fn(<u32 as T<'x>>::V) -> _`
- |
- = note: required for the cast to the object type `dyn for<'x> Fn(<u32 as T<'x>>::V)`
-
-error[E0277]: the size for values of type `<u32 as T<'_>>::V` cannot be known at compilation time
- --> $DIR/issue-41366.rs:10:8
- |
-LL | (&|_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
- | ^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `<u32 as T<'_>>::V`
- = help: unsized fn params are gated as an unstable feature
-help: consider further restricting the associated type
- |
-LL | fn main() where <u32 as T<'_>>::V: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: function arguments must have a statically known size, borrowed types always have a known size
- |
-LL | (&|&_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
- | ^
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0277, E0631.
-For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/closures/issue-67123.stderr b/src/test/ui/closures/issue-67123.stderr
index 5a6dfb2..7877c73 100644
--- a/src/test/ui/closures/issue-67123.stderr
+++ b/src/test/ui/closures/issue-67123.stderr
@@ -10,7 +10,7 @@
help: consider restricting type parameter `T`
|
LL | fn foo<T: Copy>(t: T) {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/closures/issue-87461.rs b/src/test/ui/closures/issue-87461.rs
new file mode 100644
index 0000000..0151080
--- /dev/null
+++ b/src/test/ui/closures/issue-87461.rs
@@ -0,0 +1,29 @@
+// Regression test for #87461.
+
+// edition:2021
+
+async fn func() -> Result<u16, u64> {
+ let _ = async {
+ Err(42u64)
+ }.await?;
+
+ Ok(())
+ //~^ ERROR: mismatched types [E0308]
+}
+
+async fn func2() -> Result<u16, u64> {
+ Err(42u64)?;
+
+ Ok(())
+ //~^ ERROR: mismatched types [E0308]
+}
+
+fn main() {
+ || -> Result<u16, u64> {
+ if true {
+ return Err(42u64);
+ }
+ Ok(())
+ //~^ ERROR: mismatched types [E0308]
+ };
+}
diff --git a/src/test/ui/closures/issue-87461.stderr b/src/test/ui/closures/issue-87461.stderr
new file mode 100644
index 0000000..a3cff2c
--- /dev/null
+++ b/src/test/ui/closures/issue-87461.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-87461.rs:10:8
+ |
+LL | Ok(())
+ | ^^ expected `u16`, found `()`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-87461.rs:17:8
+ |
+LL | Ok(())
+ | ^^ expected `u16`, found `()`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-87461.rs:26:12
+ |
+LL | Ok(())
+ | ^^ expected `u16`, found `()`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/closures/issue-87814-1.rs b/src/test/ui/closures/issue-87814-1.rs
new file mode 100644
index 0000000..5cf01dd
--- /dev/null
+++ b/src/test/ui/closures/issue-87814-1.rs
@@ -0,0 +1,8 @@
+// check-pass
+fn main() {
+ let mut schema_all = vec![];
+ (0..42).for_each(|_x| match Err(()) as Result<(), _> {
+ Ok(()) => schema_all.push(()),
+ Err(_) => (),
+ });
+}
diff --git a/src/test/ui/closures/issue-87814-2.rs b/src/test/ui/closures/issue-87814-2.rs
new file mode 100644
index 0000000..7a5facd
--- /dev/null
+++ b/src/test/ui/closures/issue-87814-2.rs
@@ -0,0 +1,11 @@
+// check-pass
+#![feature(try_reserve)]
+
+fn main() {
+ let mut schema_all: (Vec<String>, Vec<String>) = (vec![], vec![]);
+
+ let _c = || match schema_all.0.try_reserve(1) as Result<(), _> {
+ Ok(()) => (),
+ Err(_) => (),
+ };
+}
diff --git a/src/test/ui/closures/print/closure-print-generic-2.stderr b/src/test/ui/closures/print/closure-print-generic-2.stderr
index f7cfbd2..9c75d5a 100644
--- a/src/test/ui/closures/print/closure-print-generic-2.stderr
+++ b/src/test/ui/closures/print/closure-print-generic-2.stderr
@@ -13,7 +13,7 @@
help: use parentheses to call this closure
|
LL | let c1: () = c();
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr
index 7fd9292..d947900 100644
--- a/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr
+++ b/src/test/ui/closures/print/closure-print-generic-trim-off-verbose-2.stderr
@@ -13,7 +13,7 @@
help: use parentheses to call this closure
|
LL | let c1 : () = c();
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr b/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr
index 680f6ff..880e38d 100644
--- a/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr
+++ b/src/test/ui/closures/print/closure-print-generic-verbose-2.stderr
@@ -13,7 +13,7 @@
help: use parentheses to call this closure
|
LL | let c1 : () = c();
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
index f3edf1c..97f3c75 100644
--- a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
+++ b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
@@ -14,7 +14,7 @@
LL | trait Trait<T> { type Assoc; }
| ^^^^^^^^^^^^^^
|
- = note: ...which again requires building specialization graph of trait `Trait`, completing the cycle
+ = note: ...which immediately requires building specialization graph of trait `Trait` again
note: cycle used when coherence checking all impls of trait `Trait`
--> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1
|
diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr
index 51f6faa..9efb5dc 100644
--- a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr
+++ b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr
@@ -8,6 +8,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
|
= note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `i32` in future versions
+ = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `i32` in future versions
error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr b/src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr
index 93a06fc..cf842b1 100644
--- a/src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr
+++ b/src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `&dyn Trait: Trait` is not satisfied
--> $DIR/coherence-unsafe-trait-object-impl.rs:15:13
|
-LL | fn takes_t<S: Trait>(s: S) {
- | ----- required by this bound in `takes_t`
-...
LL | takes_t(t);
| ^ the trait `Trait` is not implemented for `&dyn Trait`
+ |
+note: required by a bound in `takes_t`
+ --> $DIR/coherence-unsafe-trait-object-impl.rs:10:15
+ |
+LL | fn takes_t<S: Trait>(s: S) {
+ | ^^^^^ required by this bound in `takes_t`
error: aborting due to previous error
diff --git a/src/test/ui/coherence/issue-85026.rs b/src/test/ui/coherence/issue-85026.rs
new file mode 100644
index 0000000..8b11654
--- /dev/null
+++ b/src/test/ui/coherence/issue-85026.rs
@@ -0,0 +1,10 @@
+#![feature(auto_traits)]
+auto trait AutoTrait {}
+
+// You cannot impl your own `dyn AutoTrait`.
+impl dyn AutoTrait {} //~ERROR E0785
+
+// You cannot impl someone else's `dyn AutoTrait`
+impl dyn Unpin {} //~ERROR E0785
+
+fn main() {}
diff --git a/src/test/ui/coherence/issue-85026.stderr b/src/test/ui/coherence/issue-85026.stderr
new file mode 100644
index 0000000..a5da19b
--- /dev/null
+++ b/src/test/ui/coherence/issue-85026.stderr
@@ -0,0 +1,19 @@
+error[E0785]: cannot define inherent `impl` for a dyn auto trait
+ --> $DIR/issue-85026.rs:5:6
+ |
+LL | impl dyn AutoTrait {}
+ | ^^^^^^^^^^^^^ impl requires at least one non-auto trait
+ |
+ = note: define and implement a new trait or type instead
+
+error[E0785]: cannot define inherent `impl` for a dyn auto trait
+ --> $DIR/issue-85026.rs:8:6
+ |
+LL | impl dyn Unpin {}
+ | ^^^^^^^^^ impl requires at least one non-auto trait
+ |
+ = note: define and implement a new trait or type instead
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0785`.
diff --git a/src/test/ui/collections-const-new.rs b/src/test/ui/collections-const-new.rs
deleted file mode 100644
index 978f25f..0000000
--- a/src/test/ui/collections-const-new.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// check-pass
-
-// Test several functions can be used for constants
-// 1. Vec::new()
-// 2. String::new()
-// 3. BTreeMap::new()
-// 4. BTreeSet::new()
-
-#![feature(const_btree_new)]
-
-const MY_VEC: Vec<usize> = Vec::new();
-
-const MY_STRING: String = String::new();
-
-use std::collections::{BTreeMap, BTreeSet};
-const MY_BTREEMAP: BTreeMap<u32, u32> = BTreeMap::new();
-
-const MY_BTREESET: BTreeSet<u32> = BTreeSet::new();
-
-fn main() {}
diff --git a/src/test/ui/command/command-create-pidfd.rs b/src/test/ui/command/command-create-pidfd.rs
new file mode 100644
index 0000000..4df443c
--- /dev/null
+++ b/src/test/ui/command/command-create-pidfd.rs
@@ -0,0 +1,56 @@
+// run-pass
+// only-linux - pidfds are a linux-specific concept
+
+#![feature(linux_pidfd)]
+#![feature(rustc_private)]
+
+extern crate libc;
+
+use std::io::Error;
+use std::os::linux::process::{ChildExt, CommandExt};
+use std::process::Command;
+
+fn has_clone3() -> bool {
+ let res = unsafe { libc::syscall(libc::SYS_clone3, 0, 0) };
+ let err = (res == -1)
+ .then(|| Error::last_os_error())
+ .expect("probe syscall should not succeed");
+
+ // If the `clone3` syscall is not implemented in the current kernel version it should return an
+ // `ENOSYS` error. Docker also blocks the whole syscall inside unprivileged containers, and
+ // returns `EPERM` (instead of `ENOSYS`) when a program tries to invoke the syscall. Because of
+ // that we need to check for *both* `ENOSYS` and `EPERM`.
+ //
+ // Note that Docker's behavior is breaking other projects (notably glibc), so they're planning
+ // to update their filtering to return `ENOSYS` in a future release:
+ //
+ // https://github.com/moby/moby/issues/42680
+ //
+ err.raw_os_error() != Some(libc::ENOSYS) && err.raw_os_error() != Some(libc::EPERM)
+}
+
+fn main() {
+ // pidfds require the clone3 syscall
+ if !has_clone3() {
+ return;
+ }
+
+ // We don't assert the precise value, since the standard library
+ // might have opened other file descriptors before our code runs.
+ let _ = Command::new("echo")
+ .create_pidfd(true)
+ .spawn()
+ .unwrap()
+ .pidfd().expect("failed to obtain pidfd");
+
+ let _ = Command::new("echo")
+ .create_pidfd(false)
+ .spawn()
+ .unwrap()
+ .pidfd().expect_err("pidfd should not have been created when create_pid(false) is set");
+
+ let _ = Command::new("echo")
+ .spawn()
+ .unwrap()
+ .pidfd().expect_err("pidfd should not have been created");
+}
diff --git a/src/test/ui/command/command-pre-exec.rs b/src/test/ui/command/command-pre-exec.rs
index 61914e2..10a8b19 100644
--- a/src/test/ui/command/command-pre-exec.rs
+++ b/src/test/ui/command/command-pre-exec.rs
@@ -8,8 +8,6 @@
// ignore-sgx no processes
#![feature(process_exec, rustc_private)]
-extern crate libc;
-
use std::env;
use std::io::Error;
use std::os::unix::process::CommandExt;
@@ -17,6 +15,23 @@
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
+#[cfg(not(target_os = "linux"))]
+fn getpid() -> u32 {
+ use std::process;
+ process::id()
+}
+
+/// We need to directly use the getpid syscall instead of using `process::id()`
+/// because the libc wrapper might return incorrect values after a process was
+/// forked.
+#[cfg(target_os = "linux")]
+fn getpid() -> u32 {
+ extern crate libc;
+ unsafe {
+ libc::syscall(libc::SYS_getpid) as _
+ }
+}
+
fn main() {
if let Some(arg) = env::args().nth(1) {
match &arg[..] {
@@ -68,14 +83,12 @@
};
assert_eq!(output.raw_os_error(), Some(102));
- let pid = unsafe { libc::getpid() };
- assert!(pid >= 0);
+ let pid = getpid();
let output = unsafe {
Command::new(&me)
.arg("empty")
.pre_exec(move || {
- let child = libc::getpid();
- assert!(child >= 0);
+ let child = getpid();
assert!(pid != child);
Ok(())
})
diff --git a/src/test/ui/compare-method/bad-self-type.stderr b/src/test/ui/compare-method/bad-self-type.stderr
index 76f91fb..737a5ae 100644
--- a/src/test/ui/compare-method/bad-self-type.stderr
+++ b/src/test/ui/compare-method/bad-self-type.stderr
@@ -39,7 +39,7 @@
help: change the output type to match the trait
|
LL | fn bar(self) -> Option<()> {}
- | ^^^^^^^^^^^^^
+ | +++++++++++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.rs b/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.rs
index 4c96d6e..2600ec7 100644
--- a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.rs
+++ b/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.rs
@@ -4,10 +4,10 @@
#![deny(unused)]
-#[cfg_attr(FALSE,)] //~ ERROR unused attribute
+#[cfg_attr(FALSE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
fn _f() {}
-#[cfg_attr(TRUE,)] //~ ERROR unused attribute
+#[cfg_attr(TRUE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes
fn _g() {}
fn main() {}
diff --git a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr b/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr
index 67cb653..87b6988 100644
--- a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr
+++ b/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr
@@ -1,4 +1,4 @@
-error: unused attribute
+error: `#[cfg_attr]` does not expand to any attributes
--> $DIR/cfg-attr-empty-is-unused.rs:7:1
|
LL | #[cfg_attr(FALSE,)]
@@ -11,7 +11,7 @@
| ^^^^^^
= note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]`
-error: unused attribute
+error: `#[cfg_attr]` does not expand to any attributes
--> $DIR/cfg-attr-empty-is-unused.rs:10:1
|
LL | #[cfg_attr(TRUE,)]
diff --git a/src/test/ui/conditional-compilation/cfg-attr-parse.stderr b/src/test/ui/conditional-compilation/cfg-attr-parse.stderr
index 3a590d3..8084a62 100644
--- a/src/test/ui/conditional-compilation/cfg-attr-parse.stderr
+++ b/src/test/ui/conditional-compilation/cfg-attr-parse.stderr
@@ -51,7 +51,7 @@
help: the delimiters should be `(` and `)`
|
LL | #[cfg_attr(all(),,)]
- | ^ ^
+ | ~ ~
error: expected identifier, found `,`
--> $DIR/cfg-attr-parse.rs:44:18
@@ -71,7 +71,7 @@
help: the delimiters should be `(` and `)`
|
LL | #[cfg_attr(all(),,)]
- | ^ ^
+ | ~ ~
error: expected identifier, found `,`
--> $DIR/cfg-attr-parse.rs:50:18
diff --git a/src/test/ui/confuse-field-and-method/issue-18343.stderr b/src/test/ui/confuse-field-and-method/issue-18343.stderr
index fe6b129..2f67c11 100644
--- a/src/test/ui/confuse-field-and-method/issue-18343.stderr
+++ b/src/test/ui/confuse-field-and-method/issue-18343.stderr
@@ -10,7 +10,7 @@
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o.closure)();
- | ^ ^
+ | + +
error: aborting due to previous error
diff --git a/src/test/ui/confuse-field-and-method/issue-2392.stderr b/src/test/ui/confuse-field-and-method/issue-2392.stderr
index 0480958..a37e132 100644
--- a/src/test/ui/confuse-field-and-method/issue-2392.stderr
+++ b/src/test/ui/confuse-field-and-method/issue-2392.stderr
@@ -10,7 +10,7 @@
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o_closure.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
--> $DIR/issue-2392.rs:38:15
@@ -35,7 +35,7 @@
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o_func.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
--> $DIR/issue-2392.rs:45:14
@@ -49,7 +49,7 @@
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
LL | (boxed_fn.boxed_closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
--> $DIR/issue-2392.rs:48:19
@@ -63,7 +63,7 @@
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
LL | (boxed_closure.boxed_closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `closure` found for struct `Obj` in the current scope
--> $DIR/issue-2392.rs:53:12
@@ -77,7 +77,7 @@
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (w.wrap.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
--> $DIR/issue-2392.rs:55:12
@@ -102,7 +102,7 @@
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (check_expression().closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `f1` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:64:31
@@ -116,7 +116,7 @@
help: to call the function stored in `f1`, surround the field access with parentheses
|
LL | ((*self.container).f1)(1);
- | ^ ^
+ | + +
error[E0599]: no method named `f2` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:65:31
@@ -130,7 +130,7 @@
help: to call the function stored in `f2`, surround the field access with parentheses
|
LL | ((*self.container).f2)(1);
- | ^ ^
+ | + +
error[E0599]: no method named `f3` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:66:31
@@ -144,7 +144,7 @@
help: to call the function stored in `f3`, surround the field access with parentheses
|
LL | ((*self.container).f3)(1);
- | ^ ^
+ | + +
error: aborting due to 11 previous errors
diff --git a/src/test/ui/confuse-field-and-method/issue-32128.stderr b/src/test/ui/confuse-field-and-method/issue-32128.stderr
index a8d97bd..50c6fe1 100644
--- a/src/test/ui/confuse-field-and-method/issue-32128.stderr
+++ b/src/test/ui/confuse-field-and-method/issue-32128.stderr
@@ -10,7 +10,7 @@
help: to call the function stored in `example`, surround the field access with parentheses
|
LL | (demo.example)(1);
- | ^ ^
+ | + +
error: aborting due to previous error
diff --git a/src/test/ui/confuse-field-and-method/issue-33784.stderr b/src/test/ui/confuse-field-and-method/issue-33784.stderr
index c109896..7c2e6b0 100644
--- a/src/test/ui/confuse-field-and-method/issue-33784.stderr
+++ b/src/test/ui/confuse-field-and-method/issue-33784.stderr
@@ -7,7 +7,7 @@
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (p.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `fn_ptr` found for reference `&&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope
--> $DIR/issue-33784.rs:29:7
@@ -18,7 +18,7 @@
help: to call the function stored in `fn_ptr`, surround the field access with parentheses
|
LL | (q.fn_ptr)();
- | ^ ^
+ | + +
error[E0599]: no method named `c_fn_ptr` found for reference `&D` in the current scope
--> $DIR/issue-33784.rs:32:7
@@ -29,7 +29,7 @@
help: to call the function stored in `c_fn_ptr`, surround the field access with parentheses
|
LL | (s.c_fn_ptr)();
- | ^ ^
+ | + +
error: aborting due to 3 previous errors
diff --git a/src/test/ui/const-generics/apit-with-const-param.rs b/src/test/ui/const-generics/apit-with-const-param.rs
index 3bc6214..2a04dc3 100644
--- a/src/test/ui/const-generics/apit-with-const-param.rs
+++ b/src/test/ui/const-generics/apit-with-const-param.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
trait Trait {}
diff --git a/src/test/ui/const-generics/argument_order.full.stderr b/src/test/ui/const-generics/argument_order.full.stderr
index e533d4f..9762748 100644
--- a/src/test/ui/const-generics/argument_order.full.stderr
+++ b/src/test/ui/const-generics/argument_order.full.stderr
@@ -1,11 +1,11 @@
error: lifetime parameters must be declared prior to const parameters
- --> $DIR/argument_order.rs:11:32
+ --> $DIR/argument_order.rs:10:32
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
| -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, const N: usize, T, const M: usize, U>`
error[E0747]: lifetime provided when a type was expected
- --> $DIR/argument_order.rs:19:23
+ --> $DIR/argument_order.rs:18:23
|
LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
| ^^^^^^^
diff --git a/src/test/ui/const-generics/argument_order.min.stderr b/src/test/ui/const-generics/argument_order.min.stderr
index f23bc6d..afd9ed1 100644
--- a/src/test/ui/const-generics/argument_order.min.stderr
+++ b/src/test/ui/const-generics/argument_order.min.stderr
@@ -1,23 +1,23 @@
error: type parameters must be declared prior to const parameters
- --> $DIR/argument_order.rs:5:28
+ --> $DIR/argument_order.rs:4:28
|
LL | struct Bad<const N: usize, T> {
| -----------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const N: usize>`
error: lifetime parameters must be declared prior to const parameters
- --> $DIR/argument_order.rs:11:32
+ --> $DIR/argument_order.rs:10:32
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
| -----------------^^-----^^-------------------- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
error: type parameters must be declared prior to const parameters
- --> $DIR/argument_order.rs:11:36
+ --> $DIR/argument_order.rs:10:36
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
| ---------------------^----------------------^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T, U, const N: usize, const M: usize>`
error[E0747]: lifetime provided when a type was expected
- --> $DIR/argument_order.rs:19:23
+ --> $DIR/argument_order.rs:18:23
|
LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
| ^^^^^^^
diff --git a/src/test/ui/const-generics/argument_order.rs b/src/test/ui/const-generics/argument_order.rs
index 95eaeea..97dd0f1 100644
--- a/src/test/ui/const-generics/argument_order.rs
+++ b/src/test/ui/const-generics/argument_order.rs
@@ -1,6 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+#![cfg_attr(full, feature(const_generics_defaults))]
struct Bad<const N: usize, T> {
//[min]~^ ERROR type parameters must be declared prior to const parameters
diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr
deleted file mode 100644
index 0fb23e4..0000000
--- a/src/test/ui/const-generics/array-size-in-generic-struct-param.full.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/array-size-in-generic-struct-param.rs:8:38
- |
-LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
- | ^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/array-size-in-generic-struct-param.rs:19:10
- |
-LL | arr: [u8; CFG.arr_size],
- | ^^^^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr
deleted file mode 100644
index 8f6e568..0000000
--- a/src/test/ui/const-generics/array-size-in-generic-struct-param.min.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/array-size-in-generic-struct-param.rs:8:48
- |
-LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/array-size-in-generic-struct-param.rs:19:15
- |
-LL | arr: [u8; CFG.arr_size],
- | ^^^ cannot perform const operation using `CFG`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `CFG`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: `Config` is forbidden as the type of a const generic parameter
- --> $DIR/array-size-in-generic-struct-param.rs:17:21
- |
-LL | struct B<const CFG: Config> {
- | ^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/const-generics/array-size-in-generic-struct-param.rs b/src/test/ui/const-generics/array-size-in-generic-struct-param.rs
deleted file mode 100644
index cd0a974..0000000
--- a/src/test/ui/const-generics/array-size-in-generic-struct-param.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Tests that array sizes that depend on const-params are checked using `ConstEvaluatable`.
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-#[allow(dead_code)]
-struct ArithArrayLen<const N: usize>([u32; 0 + N]);
-//[full]~^ ERROR constant expression depends on a generic parameter
-//[min]~^^ ERROR generic parameters may not be used in const operations
-
-#[derive(PartialEq, Eq)]
-struct Config {
- arr_size: usize,
-}
-
-struct B<const CFG: Config> {
- //[min]~^ ERROR `Config` is forbidden
- arr: [u8; CFG.arr_size],
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used in const operations
-}
-
-const C: Config = Config { arr_size: 5 };
-
-fn main() {
- let b = B::<C> { arr: [1, 2, 3, 4, 5] };
- assert_eq!(b.arr.len(), 5);
-}
diff --git a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs
index 732a187..a712f69 100644
--- a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs
+++ b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs
@@ -1,7 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
#![allow(dead_code)]
diff --git a/src/test/ui/const-generics/associated-type-bound-fail.full.stderr b/src/test/ui/const-generics/associated-type-bound-fail.full.stderr
deleted file mode 100644
index 6644e74..0000000
--- a/src/test/ui/const-generics/associated-type-bound-fail.full.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `u16: Bar<N>` is not satisfied
- --> $DIR/associated-type-bound-fail.rs:13:5
- |
-LL | type Assoc: Bar<N>;
- | ------ required by this bound in `Foo::Assoc`
-...
-LL | type Assoc = u16;
- | ^^^^^^^^^^^^^^^^^ the trait `Bar<N>` is not implemented for `u16`
- |
- = help: the following implementations were found:
- <u16 as Bar<3_usize>>
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/associated-type-bound-fail.min.stderr b/src/test/ui/const-generics/associated-type-bound-fail.min.stderr
deleted file mode 100644
index 6644e74..0000000
--- a/src/test/ui/const-generics/associated-type-bound-fail.min.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `u16: Bar<N>` is not satisfied
- --> $DIR/associated-type-bound-fail.rs:13:5
- |
-LL | type Assoc: Bar<N>;
- | ------ required by this bound in `Foo::Assoc`
-...
-LL | type Assoc = u16;
- | ^^^^^^^^^^^^^^^^^ the trait `Bar<N>` is not implemented for `u16`
- |
- = help: the following implementations were found:
- <u16 as Bar<3_usize>>
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/associated-type-bound-fail.rs b/src/test/ui/const-generics/associated-type-bound-fail.rs
index 83b2670..937b8bc 100644
--- a/src/test/ui/const-generics/associated-type-bound-fail.rs
+++ b/src/test/ui/const-generics/associated-type-bound-fail.rs
@@ -1,7 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
trait Bar<const N: usize> {}
trait Foo<const N: usize> {
diff --git a/src/test/ui/const-generics/associated-type-bound-fail.stderr b/src/test/ui/const-generics/associated-type-bound-fail.stderr
new file mode 100644
index 0000000..60e624f
--- /dev/null
+++ b/src/test/ui/const-generics/associated-type-bound-fail.stderr
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `u16: Bar<N>` is not satisfied
+ --> $DIR/associated-type-bound-fail.rs:9:5
+ |
+LL | type Assoc = u16;
+ | ^^^^^^^^^^^^^^^^^ the trait `Bar<N>` is not implemented for `u16`
+ |
+ = help: the following implementations were found:
+ <u16 as Bar<3_usize>>
+note: required by a bound in `Foo::Assoc`
+ --> $DIR/associated-type-bound-fail.rs:4:17
+ |
+LL | type Assoc: Bar<N>;
+ | ^^^^^^ required by this bound in `Foo::Assoc`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/associated-type-bound.rs b/src/test/ui/const-generics/associated-type-bound.rs
index 02f7739..3044736 100644
--- a/src/test/ui/const-generics/associated-type-bound.rs
+++ b/src/test/ui/const-generics/associated-type-bound.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
trait Bar<const N: usize> {}
trait Foo<const N: usize> {
diff --git a/src/test/ui/const-generics/auxiliary/const_generic_lib.rs b/src/test/ui/const-generics/auxiliary/const_generic_lib.rs
index 8d4cd9c..922f92d 100644
--- a/src/test/ui/const-generics/auxiliary/const_generic_lib.rs
+++ b/src/test/ui/const-generics/auxiliary/const_generic_lib.rs
@@ -1,6 +1,3 @@
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
pub struct Struct<const N: usize>(pub [u8; N]);
pub type Alias = Struct<2>;
diff --git a/src/test/ui/const-generics/auxiliary/crayte.rs b/src/test/ui/const-generics/auxiliary/crayte.rs
index d9baab9..19a8bb0 100644
--- a/src/test/ui/const-generics/auxiliary/crayte.rs
+++ b/src/test/ui/const-generics/auxiliary/crayte.rs
@@ -1,6 +1,4 @@
// edition:2018
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
pub trait Foo<const N: usize> {}
struct Local;
diff --git a/src/test/ui/const-generics/auxiliary/generics_of_parent.rs b/src/test/ui/const-generics/auxiliary/generics_of_parent.rs
new file mode 100644
index 0000000..5c2b1f4
--- /dev/null
+++ b/src/test/ui/const-generics/auxiliary/generics_of_parent.rs
@@ -0,0 +1,23 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// library portion of regression test for #87674
+pub struct Foo<const N: usize>([(); N + 1])
+where
+ [(); N + 1]: ;
+
+// library portion of regression test for #87603
+pub struct S<T: Copy + Default, const N: usize>
+where
+ [T; N * 2]: Sized,
+{
+ pub s: [T; N * 2],
+}
+impl<T: Default + Copy, const N: usize> S<T, N>
+where
+ [T; N * 2]: Sized,
+{
+ pub fn test() -> Self {
+ S { s: [T::default(); N * 2] }
+ }
+}
diff --git a/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs b/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs
new file mode 100644
index 0000000..cd5b816
--- /dev/null
+++ b/src/test/ui/const-generics/auxiliary/generics_of_parent_impl_trait.rs
@@ -0,0 +1,8 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// library portion of testing that `impl Trait<{ expr }>` doesnt
+// ice because of a `DefKind::TyParam` parent
+pub fn foo<const N: usize>(foo: impl Into<[(); N + 1]>) {
+ foo.into();
+}
diff --git a/src/test/ui/lazy_normalization_consts/trait-resolution-breakage.rs b/src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs
similarity index 100%
rename from src/test/ui/lazy_normalization_consts/trait-resolution-breakage.rs
rename to src/test/ui/const-generics/backcompat/trait-resolution-breakage.rs
diff --git a/src/test/ui/lazy_normalization_consts/unevaluated-consts.rs b/src/test/ui/const-generics/backcompat/unevaluated-consts.rs
similarity index 100%
rename from src/test/ui/lazy_normalization_consts/unevaluated-consts.rs
rename to src/test/ui/const-generics/backcompat/unevaluated-consts.rs
diff --git a/src/test/ui/const-generics/broken-mir-1.rs b/src/test/ui/const-generics/broken-mir-1.rs
index 34255fa..6b6140e 100644
--- a/src/test/ui/const-generics/broken-mir-1.rs
+++ b/src/test/ui/const-generics/broken-mir-1.rs
@@ -1,9 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
pub trait Foo {
fn foo(&self);
}
diff --git a/src/test/ui/const-generics/broken-mir-2.rs b/src/test/ui/const-generics/broken-mir-2.rs
index ac358b0..f9e0315 100644
--- a/src/test/ui/const-generics/broken-mir-2.rs
+++ b/src/test/ui/const-generics/broken-mir-2.rs
@@ -1,9 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
use std::fmt::Debug;
#[derive(Debug)]
diff --git a/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs b/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs
index 44aef85..a6e7674 100644
--- a/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs
+++ b/src/test/ui/const-generics/cannot-infer-type-for-const-param.rs
@@ -1,7 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
// This test confirms that the types can be inferred correctly for this example with const
// generics. Previously this would ICE, and more recently error.
diff --git a/src/test/ui/const-generics/closing-args-token.full.stderr b/src/test/ui/const-generics/closing-args-token.full.stderr
deleted file mode 100644
index 7737705..0000000
--- a/src/test/ui/const-generics/closing-args-token.full.stderr
+++ /dev/null
@@ -1,52 +0,0 @@
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/closing-args-token.rs:10:9
- |
-LL | S::<5 + 2 >> 7>;
- | ^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | S::<{ 5 + 2 } >> 7>;
- | ^ ^
-
-error: comparison operators cannot be chained
- --> $DIR/closing-args-token.rs:10:16
- |
-LL | S::<5 + 2 >> 7>;
- | ^ ^
- |
-help: split the comparison into two
- |
-LL | S::<5 + 2 >> 7 && 7>;
- | ^^^^
-
-error: comparison operators cannot be chained
- --> $DIR/closing-args-token.rs:16:20
- |
-LL | S::<{ 5 + 2 } >> 7>;
- | ^ ^
- |
-help: split the comparison into two
- |
-LL | S::<{ 5 + 2 } >> 7 && 7>;
- | ^^^^
-
-error: expected expression, found `;`
- --> $DIR/closing-args-token.rs:21:16
- |
-LL | T::<0 >= 3>;
- | ^ expected expression
-
-error: comparison operators cannot be chained
- --> $DIR/closing-args-token.rs:27:12
- |
-LL | T::<x >>= 2 > 0>;
- | ^^ ^
- |
-help: split the comparison into two
- |
-LL | T::<x >>= 2 && 2 > 0>;
- | ^^^^
-
-error: aborting due to 5 previous errors
-
diff --git a/src/test/ui/const-generics/closing-args-token.min.stderr b/src/test/ui/const-generics/closing-args-token.min.stderr
deleted file mode 100644
index 7737705..0000000
--- a/src/test/ui/const-generics/closing-args-token.min.stderr
+++ /dev/null
@@ -1,52 +0,0 @@
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/closing-args-token.rs:10:9
- |
-LL | S::<5 + 2 >> 7>;
- | ^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | S::<{ 5 + 2 } >> 7>;
- | ^ ^
-
-error: comparison operators cannot be chained
- --> $DIR/closing-args-token.rs:10:16
- |
-LL | S::<5 + 2 >> 7>;
- | ^ ^
- |
-help: split the comparison into two
- |
-LL | S::<5 + 2 >> 7 && 7>;
- | ^^^^
-
-error: comparison operators cannot be chained
- --> $DIR/closing-args-token.rs:16:20
- |
-LL | S::<{ 5 + 2 } >> 7>;
- | ^ ^
- |
-help: split the comparison into two
- |
-LL | S::<{ 5 + 2 } >> 7 && 7>;
- | ^^^^
-
-error: expected expression, found `;`
- --> $DIR/closing-args-token.rs:21:16
- |
-LL | T::<0 >= 3>;
- | ^ expected expression
-
-error: comparison operators cannot be chained
- --> $DIR/closing-args-token.rs:27:12
- |
-LL | T::<x >>= 2 > 0>;
- | ^^ ^
- |
-help: split the comparison into two
- |
-LL | T::<x >>= 2 && 2 > 0>;
- | ^^^^
-
-error: aborting due to 5 previous errors
-
diff --git a/src/test/ui/const-generics/closing-args-token.rs b/src/test/ui/const-generics/closing-args-token.rs
deleted file mode 100644
index a9b552e..0000000
--- a/src/test/ui/const-generics/closing-args-token.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-struct S<const X: u32>;
-struct T<const X: bool>;
-
-fn bad_args_1() {
- S::<5 + 2 >> 7>;
- //~^ ERROR expressions must be enclosed in braces to be used as const generic arguments
- //~| ERROR comparison operators cannot be chained
-}
-
-fn bad_args_2() {
- S::<{ 5 + 2 } >> 7>;
- //~^ ERROR comparison operators cannot be chained
-}
-
-fn bad_args_3() {
- T::<0 >= 3>;
- //~^ ERROR expected expression, found `;`
-}
-
-fn bad_args_4() {
- let mut x = 0;
- T::<x >>= 2 > 0>;
- //~^ ERROR comparison operators cannot be chained
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/coerce_unsized_array.rs b/src/test/ui/const-generics/coerce_unsized_array.rs
index 8e20df2..ffd5eb9 100644
--- a/src/test/ui/const-generics/coerce_unsized_array.rs
+++ b/src/test/ui/const-generics/coerce_unsized_array.rs
@@ -1,9 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
fn foo<const N: usize>(v: &[u8; N]) -> &[u8] {
v
}
diff --git a/src/test/ui/const-generics/concrete-const-as-fn-arg.rs b/src/test/ui/const-generics/concrete-const-as-fn-arg.rs
index 8c31c86..372f043 100644
--- a/src/test/ui/const-generics/concrete-const-as-fn-arg.rs
+++ b/src/test/ui/const-generics/concrete-const-as-fn-arg.rs
@@ -1,9 +1,5 @@
// Test that a concrete const type i.e. A<2>, can be used as an argument type in a function
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
struct A<const N: usize>; // ok
diff --git a/src/test/ui/const-generics/concrete-const-impl-method.rs b/src/test/ui/const-generics/concrete-const-impl-method.rs
index 3d3bd26..53c9c0e 100644
--- a/src/test/ui/const-generics/concrete-const-impl-method.rs
+++ b/src/test/ui/const-generics/concrete-const-impl-method.rs
@@ -1,10 +1,6 @@
// Test that a method/associated non-method within an impl block of a concrete const type i.e. A<2>,
// is callable.
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
pub struct A<const N: u32>;
diff --git a/src/test/ui/const-generics/condition-in-trait-const-arg.rs b/src/test/ui/const-generics/condition-in-trait-const-arg.rs
index ad40b48..6f85237 100644
--- a/src/test/ui/const-generics/condition-in-trait-const-arg.rs
+++ b/src/test/ui/const-generics/condition-in-trait-const-arg.rs
@@ -2,7 +2,7 @@
// run-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
trait IsZeroTrait<const IS_ZERO: bool>{}
diff --git a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs
index d1bffae..aa0f913 100644
--- a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs
+++ b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-1.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
// This tests that the `conservative_is_privately_uninhabited` fn doesn't cause
diff --git a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs
index 96dbac1..d086441 100644
--- a/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs
+++ b/src/test/ui/const-generics/conservative_is_privately_uninhabited_uses_correct_param_env-2.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
// This tests that the `conservative_is_privately_uninhabited` fn doesn't cause
diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr
index bfa4ba3..ac69342 100644
--- a/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr
+++ b/src/test/ui/const-generics/const-arg-in-const-arg.min.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:14:23
@@ -14,7 +14,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:24:23
@@ -23,7 +23,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:29:24
@@ -32,7 +32,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:30:24
@@ -41,7 +41,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:35:27
@@ -50,7 +50,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/const-arg-in-const-arg.rs:36:27
@@ -59,7 +59,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:15:23
@@ -67,8 +67,8 @@
LL | let _: [u8; faz::<'a>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:16:23
@@ -76,8 +76,8 @@
LL | let _: [u8; baz::<'a>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:17:23
@@ -85,8 +85,8 @@
LL | let _: [u8; faz::<'b>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:18:23
@@ -94,8 +94,8 @@
LL | let _: [u8; baz::<'b>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:25:23
@@ -103,8 +103,8 @@
LL | let _ = [0; faz::<'a>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:26:23
@@ -112,8 +112,8 @@
LL | let _ = [0; baz::<'a>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:27:23
@@ -121,8 +121,8 @@
LL | let _ = [0; faz::<'b>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:28:23
@@ -130,8 +130,8 @@
LL | let _ = [0; baz::<'b>(&())];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:31:24
@@ -139,8 +139,8 @@
LL | let _: Foo<{ faz::<'a>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:32:24
@@ -148,8 +148,8 @@
LL | let _: Foo<{ baz::<'a>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:33:24
@@ -157,8 +157,8 @@
LL | let _: Foo<{ faz::<'b>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:34:24
@@ -166,8 +166,8 @@
LL | let _: Foo<{ baz::<'b>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:37:27
@@ -175,8 +175,8 @@
LL | let _ = Foo::<{ faz::<'a>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:38:27
@@ -184,8 +184,8 @@
LL | let _ = Foo::<{ baz::<'a>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:39:27
@@ -193,8 +193,8 @@
LL | let _ = Foo::<{ faz::<'b>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/const-arg-in-const-arg.rs:40:27
@@ -202,8 +202,8 @@
LL | let _ = Foo::<{ baz::<'b>(&()) }>;
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error: aborting due to 23 previous errors
diff --git a/src/test/ui/const-generics/const-arg-in-const-arg.rs b/src/test/ui/const-generics/const-arg-in-const-arg.rs
index 8279f4a..39f0b23 100644
--- a/src/test/ui/const-generics/const-arg-in-const-arg.rs
+++ b/src/test/ui/const-generics/const-arg-in-const-arg.rs
@@ -1,5 +1,5 @@
// revisions: min
-// FIXME(const_generics): This test currently causes an ICE because
+// FIXME(generic_const_exprs): This test currently causes an ICE because
// we don't yet correctly deal with lifetimes, reenable this test once
// this is fixed.
diff --git a/src/test/ui/const-generics/const-arg-in-fn.rs b/src/test/ui/const-generics/const-arg-in-fn.rs
index 43ed12e..9b225b1 100644
--- a/src/test/ui/const-generics/const-arg-in-fn.rs
+++ b/src/test/ui/const-generics/const-arg-in-fn.rs
@@ -1,9 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
fn const_u32_identity<const X: u32>() -> u32 {
X
}
diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.full.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.full.stderr
deleted file mode 100644
index d0ea51e..0000000
--- a/src/test/ui/const-generics/const-arg-type-arg-misordered.full.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0747]: constant provided when a type was expected
- --> $DIR/const-arg-type-arg-misordered.rs:7:35
- |
-LL | fn foo<const N: usize>() -> Array<N, ()> {
- | ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr
deleted file mode 100644
index d7b7df0..0000000
--- a/src/test/ui/const-generics/const-arg-type-arg-misordered.min.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0747]: constant provided when a type was expected
- --> $DIR/const-arg-type-arg-misordered.rs:7:35
- |
-LL | fn foo<const N: usize>() -> Array<N, ()> {
- | ^
- |
- = note: type arguments must be provided before constant arguments
- = help: reorder the arguments: types, then consts: `<T, N>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs
index 5415791..8ee17e6 100644
--- a/src/test/ui/const-generics/const-arg-type-arg-misordered.rs
+++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.rs
@@ -1,7 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
type Array<T, const N: usize> = [T; N];
fn foo<const N: usize>() -> Array<N, ()> {
diff --git a/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr
new file mode 100644
index 0000000..104ee9b
--- /dev/null
+++ b/src/test/ui/const-generics/const-arg-type-arg-misordered.stderr
@@ -0,0 +1,12 @@
+error[E0747]: constant provided when a type was expected
+ --> $DIR/const-arg-type-arg-misordered.rs:3:35
+ |
+LL | fn foo<const N: usize>() -> Array<N, ()> {
+ | ^
+ |
+ = note: type arguments must be provided before constant arguments
+ = help: reorder the arguments: types, then consts: `<T, N>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr
deleted file mode 100644
index 6ef698b..0000000
--- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.full.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/const-argument-cross-crate-mismatch.rs:9:67
- |
-LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
- | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
-
-error[E0308]: mismatched types
- --> $DIR/const-argument-cross-crate-mismatch.rs:11:65
- |
-LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
- | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr
deleted file mode 100644
index 6ef698b..0000000
--- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/const-argument-cross-crate-mismatch.rs:9:67
- |
-LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
- | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
-
-error[E0308]: mismatched types
- --> $DIR/const-argument-cross-crate-mismatch.rs:11:65
- |
-LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
- | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs
index a8f533e..d863d09 100644
--- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs
+++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.rs
@@ -1,7 +1,4 @@
// aux-build:const_generic_lib.rs
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
extern crate const_generic_lib;
diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr
new file mode 100644
index 0000000..aefd514
--- /dev/null
+++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr
@@ -0,0 +1,15 @@
+error[E0308]: mismatched types
+ --> $DIR/const-argument-cross-crate-mismatch.rs:6:67
+ |
+LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
+ | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
+
+error[E0308]: mismatched types
+ --> $DIR/const-argument-cross-crate-mismatch.rs:8:65
+ |
+LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
+ | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/const-argument-if-length.full.stderr b/src/test/ui/const-generics/const-argument-if-length.full.stderr
index c6088e6..8c5c3b1 100644
--- a/src/test/ui/const-generics/const-argument-if-length.full.stderr
+++ b/src/test/ui/const-generics/const-argument-if-length.full.stderr
@@ -1,18 +1,5 @@
error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/const-argument-if-length.rs:7:28
- |
-LL | pub const fn is_zst<T: ?Sized>() -> usize {
- | - this type parameter needs to be `std::marker::Sized`
-LL | if std::mem::size_of::<T>() == 0 {
- | ^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
-LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
-
-error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/const-argument-if-length.rs:16:12
+ --> $DIR/const-argument-if-length.rs:15:12
|
LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
@@ -21,14 +8,27 @@
|
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - pub struct AtLeastByte<T: ?Sized> {
+LL + pub struct AtLeastByte<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
+
+error: unconstrained generic constant
+ --> $DIR/const-argument-if-length.rs:17:10
+ |
+LL | pad: [u8; is_zst::<T>()],
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); is_zst::<T>()]:`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/const-argument-if-length.min.stderr b/src/test/ui/const-generics/const-argument-if-length.min.stderr
index bc06e8d..b123036 100644
--- a/src/test/ui/const-generics/const-argument-if-length.min.stderr
+++ b/src/test/ui/const-generics/const-argument-if-length.min.stderr
@@ -1,14 +1,14 @@
error: generic parameters may not be used in const operations
- --> $DIR/const-argument-if-length.rs:18:24
+ --> $DIR/const-argument-if-length.rs:17:24
|
LL | pad: [u8; is_zst::<T>()],
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/const-argument-if-length.rs:16:12
+ --> $DIR/const-argument-if-length.rs:15:12
|
LL | pub struct AtLeastByte<T: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
@@ -17,14 +17,19 @@
|
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - pub struct AtLeastByte<T: ?Sized> {
+LL + pub struct AtLeastByte<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/const-argument-if-length.rs b/src/test/ui/const-generics/const-argument-if-length.rs
index 67ed85f..db1eafc 100644
--- a/src/test/ui/const-generics/const-argument-if-length.rs
+++ b/src/test/ui/const-generics/const-argument-if-length.rs
@@ -1,11 +1,10 @@
// revisions: full min
+#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
pub const fn is_zst<T: ?Sized>() -> usize {
if std::mem::size_of::<T>() == 0 {
- //[full]~^ ERROR the size for values of type `T` cannot be known at compilation time
1
} else {
0
@@ -17,6 +16,7 @@
//~^ ERROR the size for values of type `T` cannot be known at compilation time
pad: [u8; is_zst::<T>()],
//[min]~^ ERROR generic parameters may not be used in const operations
+ //[full]~^^ ERROR unconstrained generic constant
}
fn main() {}
diff --git a/src/test/ui/const-generics/const-argument-non-static-lifetime.rs b/src/test/ui/const-generics/const-argument-non-static-lifetime.rs
index dc34621..2aca7bd 100644
--- a/src/test/ui/const-generics/const-argument-non-static-lifetime.rs
+++ b/src/test/ui/const-generics/const-argument-non-static-lifetime.rs
@@ -2,7 +2,7 @@
// revisions: full
// FIXME(#75323) Omitted min revision for now due to ICE.
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
#![allow(dead_code)]
diff --git a/src/test/ui/const-generics/const-expression-parameter.full.stderr b/src/test/ui/const-generics/const-expression-parameter.full.stderr
deleted file mode 100644
index 93c5173..0000000
--- a/src/test/ui/const-generics/const-expression-parameter.full.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/const-expression-parameter.rs:15:20
- |
-LL | i32_identity::<1 + 2>();
- | ^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | i32_identity::<{ 1 + 2 }>();
- | ^ ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/const-expression-parameter.min.stderr b/src/test/ui/const-generics/const-expression-parameter.min.stderr
deleted file mode 100644
index 93c5173..0000000
--- a/src/test/ui/const-generics/const-expression-parameter.min.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/const-expression-parameter.rs:15:20
- |
-LL | i32_identity::<1 + 2>();
- | ^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | i32_identity::<{ 1 + 2 }>();
- | ^ ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/const-expression-parameter.rs b/src/test/ui/const-generics/const-expression-parameter.rs
deleted file mode 100644
index cb609a5..0000000
--- a/src/test/ui/const-generics/const-expression-parameter.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-fn i32_identity<const X: i32>() -> i32 {
- 5
-}
-
-fn foo_a() {
- i32_identity::<-1>(); // ok
-}
-
-fn foo_b() {
- i32_identity::<1 + 2>(); //~ ERROR expressions must be enclosed in braces
-}
-
-fn foo_c() {
- i32_identity::< -1 >(); // ok
-}
-
-fn main() {
- i32_identity::<5>(); // ok
-}
diff --git a/src/test/ui/const-generics/const-fn-with-const-param.rs b/src/test/ui/const-generics/const-fn-with-const-param.rs
index 5c1ee4e..161bfaa 100644
--- a/src/test/ui/const-generics/const-fn-with-const-param.rs
+++ b/src/test/ui/const-generics/const-fn-with-const-param.rs
@@ -1,9 +1,5 @@
// Checks that `const fn` with const params can be used.
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
const fn const_u32_identity<const X: u32>() -> u32 {
X
diff --git a/src/test/ui/const-generics/const-generic-array-wrapper.rs b/src/test/ui/const-generics/const-generic-array-wrapper.rs
deleted file mode 100644
index 224fc79..0000000
--- a/src/test/ui/const-generics/const-generic-array-wrapper.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-struct Foo<T, const N: usize>([T; N]);
-
-impl<T, const N: usize> Foo<T, N> {
- fn foo(&self) -> usize {
- N
- }
-}
-
-fn main() {
- let foo = Foo([0u32; 21]);
- assert_eq!(foo.0, [0u32; 21]);
- assert_eq!(foo.foo(), 21);
-}
diff --git a/src/test/ui/const-generics/const-generic-type_name.rs b/src/test/ui/const-generics/const-generic-type_name.rs
index 95632f7..bb16be9 100644
--- a/src/test/ui/const-generics/const-generic-type_name.rs
+++ b/src/test/ui/const-generics/const-generic-type_name.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
#[derive(Debug)]
struct S<const N: usize>;
diff --git a/src/test/ui/const-generics/const-param-after-const-literal-arg.rs b/src/test/ui/const-generics/const-param-after-const-literal-arg.rs
index 6c2b14f..d8a0e07 100644
--- a/src/test/ui/const-generics/const-param-after-const-literal-arg.rs
+++ b/src/test/ui/const-generics/const-param-after-const-literal-arg.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
struct Foo<const A: usize, const B: usize>;
diff --git a/src/test/ui/const-generics/const-param-before-other-params.full.stderr b/src/test/ui/const-generics/const-param-before-other-params.full.stderr
index 09a4f66..982417e 100644
--- a/src/test/ui/const-generics/const-param-before-other-params.full.stderr
+++ b/src/test/ui/const-generics/const-param-before-other-params.full.stderr
@@ -1,8 +1,8 @@
error: lifetime parameters must be declared prior to const parameters
--> $DIR/const-param-before-other-params.rs:5:21
|
-LL | fn bar<const X: (), 'a>(_: &'a ()) {
- | --------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const X: ()>`
+LL | fn bar<const X: u8, 'a>(_: &'a ()) {
+ | --------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const X: u8>`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/const-param-before-other-params.min.stderr b/src/test/ui/const-generics/const-param-before-other-params.min.stderr
index a9349ce..f439cd9 100644
--- a/src/test/ui/const-generics/const-param-before-other-params.min.stderr
+++ b/src/test/ui/const-generics/const-param-before-other-params.min.stderr
@@ -1,32 +1,14 @@
error: lifetime parameters must be declared prior to const parameters
--> $DIR/const-param-before-other-params.rs:5:21
|
-LL | fn bar<const X: (), 'a>(_: &'a ()) {
- | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: ()>`
+LL | fn bar<const X: u8, 'a>(_: &'a ()) {
+ | --------------^^- help: reorder the parameters: lifetimes, then types, then consts: `<'a, const X: u8>`
error: type parameters must be declared prior to const parameters
- --> $DIR/const-param-before-other-params.rs:10:21
+ --> $DIR/const-param-before-other-params.rs:9:21
|
-LL | fn foo<const X: (), T>(_: &T) {}
- | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: ()>`
+LL | fn foo<const X: u8, T>(_: &T) {}
+ | --------------^- help: reorder the parameters: lifetimes, then types, then consts: `<T, const X: u8>`
-error: `()` is forbidden as the type of a const generic parameter
- --> $DIR/const-param-before-other-params.rs:5:17
- |
-LL | fn bar<const X: (), 'a>(_: &'a ()) {
- | ^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: `()` is forbidden as the type of a const generic parameter
- --> $DIR/const-param-before-other-params.rs:10:17
- |
-LL | fn foo<const X: (), T>(_: &T) {}
- | ^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs
index 508bb3e..0a7b57f 100644
--- a/src/test/ui/const-generics/const-param-before-other-params.rs
+++ b/src/test/ui/const-generics/const-param-before-other-params.rs
@@ -1,14 +1,12 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(const_generics_defaults))]
#![cfg_attr(full, allow(incomplete_features))]
-fn bar<const X: (), 'a>(_: &'a ()) {
+fn bar<const X: u8, 'a>(_: &'a ()) {
//~^ ERROR lifetime parameters must be declared prior to const parameters
- //[min]~^^ ERROR `()` is forbidden as the type of a const generic parameter
}
-fn foo<const X: (), T>(_: &T) {}
+fn foo<const X: u8, T>(_: &T) {}
//[min]~^ ERROR type parameters must be declared prior to const parameters
-//[min]~^^ ERROR `()` is forbidden as the type of a const generic parameter
fn main() {}
diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr b/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr
index 119f932..d6753a7 100644
--- a/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr
+++ b/src/test/ui/const-generics/const-param-elided-lifetime.full.stderr
@@ -1,29 +1,29 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:10:19
+ --> $DIR/const-param-elided-lifetime.rs:9:19
|
LL | struct A<const N: &u8>;
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:15:15
+ --> $DIR/const-param-elided-lifetime.rs:14:15
|
LL | impl<const N: &u8> A<N> {
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:18:21
+ --> $DIR/const-param-elided-lifetime.rs:17:21
|
LL | fn foo<const M: &u8>(&self) {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:23:15
+ --> $DIR/const-param-elided-lifetime.rs:22:15
|
LL | impl<const N: &u8> B for A<N> {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:27:17
+ --> $DIR/const-param-elided-lifetime.rs:26:17
|
LL | fn bar<const N: &u8>() {}
| ^ explicit lifetime name needed here
diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr b/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr
index 48d33a7..48d85e7 100644
--- a/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr
+++ b/src/test/ui/const-generics/const-param-elided-lifetime.min.stderr
@@ -1,77 +1,77 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:10:19
+ --> $DIR/const-param-elided-lifetime.rs:9:19
|
LL | struct A<const N: &u8>;
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:15:15
+ --> $DIR/const-param-elided-lifetime.rs:14:15
|
LL | impl<const N: &u8> A<N> {
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:18:21
+ --> $DIR/const-param-elided-lifetime.rs:17:21
|
LL | fn foo<const M: &u8>(&self) {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:23:15
+ --> $DIR/const-param-elided-lifetime.rs:22:15
|
LL | impl<const N: &u8> B for A<N> {}
| ^ explicit lifetime name needed here
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/const-param-elided-lifetime.rs:27:17
+ --> $DIR/const-param-elided-lifetime.rs:26:17
|
LL | fn bar<const N: &u8>() {}
| ^ explicit lifetime name needed here
error: `&'static u8` is forbidden as the type of a const generic parameter
- --> $DIR/const-param-elided-lifetime.rs:10:19
+ --> $DIR/const-param-elided-lifetime.rs:9:19
|
LL | struct A<const N: &u8>;
| ^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `&'static u8` is forbidden as the type of a const generic parameter
- --> $DIR/const-param-elided-lifetime.rs:15:15
+ --> $DIR/const-param-elided-lifetime.rs:14:15
|
LL | impl<const N: &u8> A<N> {
| ^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `&'static u8` is forbidden as the type of a const generic parameter
- --> $DIR/const-param-elided-lifetime.rs:23:15
- |
-LL | impl<const N: &u8> B for A<N> {}
- | ^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: `&'static u8` is forbidden as the type of a const generic parameter
- --> $DIR/const-param-elided-lifetime.rs:27:17
- |
-LL | fn bar<const N: &u8>() {}
- | ^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: `&'static u8` is forbidden as the type of a const generic parameter
- --> $DIR/const-param-elided-lifetime.rs:18:21
+ --> $DIR/const-param-elided-lifetime.rs:17:21
|
LL | fn foo<const M: &u8>(&self) {}
| ^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
+
+error: `&'static u8` is forbidden as the type of a const generic parameter
+ --> $DIR/const-param-elided-lifetime.rs:22:15
+ |
+LL | impl<const N: &u8> B for A<N> {}
+ | ^^^
+ |
+ = note: the only supported types are integers, `bool` and `char`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
+
+error: `&'static u8` is forbidden as the type of a const generic parameter
+ --> $DIR/const-param-elided-lifetime.rs:26:17
+ |
+LL | fn bar<const N: &u8>() {}
+ | ^^^
+ |
+ = note: the only supported types are integers, `bool` and `char`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 10 previous errors
diff --git a/src/test/ui/const-generics/const-param-elided-lifetime.rs b/src/test/ui/const-generics/const-param-elided-lifetime.rs
index 89715a7..487b82d 100644
--- a/src/test/ui/const-generics/const-param-elided-lifetime.rs
+++ b/src/test/ui/const-generics/const-param-elided-lifetime.rs
@@ -3,8 +3,7 @@
// elided lifetimes within the type of a const generic parameters to be 'static, like elided
// lifetimes within const/static items.
// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct A<const N: &u8>;
diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.full.stderr b/src/test/ui/const-generics/const-param-from-outer-fn.full.stderr
deleted file mode 100644
index c2ec735..0000000
--- a/src/test/ui/const-generics/const-param-from-outer-fn.full.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0401]: can't use generic parameters from outer function
- --> $DIR/const-param-from-outer-fn.rs:8:9
- |
-LL | fn foo<const X: u32>() {
- | - const parameter from outer function
-LL | fn bar() -> u32 {
- | --- try adding a local generic parameter in this method instead
-LL | X
- | ^ use of generic parameter from outer function
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0401`.
diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.min.stderr b/src/test/ui/const-generics/const-param-from-outer-fn.min.stderr
deleted file mode 100644
index c2ec735..0000000
--- a/src/test/ui/const-generics/const-param-from-outer-fn.min.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0401]: can't use generic parameters from outer function
- --> $DIR/const-param-from-outer-fn.rs:8:9
- |
-LL | fn foo<const X: u32>() {
- | - const parameter from outer function
-LL | fn bar() -> u32 {
- | --- try adding a local generic parameter in this method instead
-LL | X
- | ^ use of generic parameter from outer function
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0401`.
diff --git a/src/test/ui/const-generics/const-param-from-outer-fn.rs b/src/test/ui/const-generics/const-param-from-outer-fn.rs
deleted file mode 100644
index 27b9ca9..0000000
--- a/src/test/ui/const-generics/const-param-from-outer-fn.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-fn foo<const X: u32>() {
- fn bar() -> u32 {
- X //~ ERROR can't use generic parameters from outer function
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const-param-hygiene.rs b/src/test/ui/const-generics/const-param-hygiene.rs
deleted file mode 100644
index 9cafb05..0000000
--- a/src/test/ui/const-generics/const-param-hygiene.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-macro_rules! bar {
- ($($t:tt)*) => { impl<const N: usize> $($t)* };
-}
-
-macro_rules! baz {
- ($t:tt) => { fn test<const M: usize>(&self) -> usize { $t } };
-}
-
-struct Foo<const N: usize>;
-
-bar!(Foo<N> { baz!{ M } });
-
-fn main() {
- assert_eq!(Foo::<7>.test::<3>(), 3);
-}
diff --git a/src/test/ui/const-generics/const-param-in-async.rs b/src/test/ui/const-generics/const-param-in-async.rs
index 9dc9c80..f823431 100644
--- a/src/test/ui/const-generics/const-param-in-async.rs
+++ b/src/test/ui/const-generics/const-param-in-async.rs
@@ -1,8 +1,5 @@
// edition:2018
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
async fn foo<const N: usize>(arg: [u8; N]) -> usize { arg.len() }
diff --git a/src/test/ui/const-generics/const-param-in-trait.rs b/src/test/ui/const-generics/const-param-in-trait.rs
deleted file mode 100644
index 79b3ae2..0000000
--- a/src/test/ui/const-generics/const-param-in-trait.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// Check that const parameters are permitted in traits.
-// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-
-trait Trait<const T: u8> {}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const-param-shadowing.stderr b/src/test/ui/const-generics/const-param-shadowing.stderr
deleted file mode 100644
index 17ccd2f..0000000
--- a/src/test/ui/const-generics/const-param-shadowing.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0747]: type provided when a constant was expected
- --> $DIR/const-param-shadowing.rs:3:34
- |
-LL | fn test<const N: usize>() -> Foo<N> {
- | ^
- |
-help: if this generic argument was intended as a const parameter, surround it with braces
- |
-LL | fn test<const N: usize>() -> Foo<{ N }> {
- | ^ ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr b/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr
index 9804363..a7b78b8 100644
--- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr
+++ b/src/test/ui/const-generics/const-param-type-depends-on-const-param.min.stderr
@@ -17,7 +17,7 @@
| ^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `[u8; _]` is forbidden as the type of a const generic parameter
--> $DIR/const-param-type-depends-on-const-param.rs:15:35
@@ -26,7 +26,7 @@
| ^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs b/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs
index 62b146e..9d50f9a 100644
--- a/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs
+++ b/src/test/ui/const-generics/const-param-type-depends-on-const-param.rs
@@ -1,6 +1,6 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
// Currently, const parameters cannot depend on other generic parameters,
diff --git a/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs b/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs
index 910a964..71d91fd 100644
--- a/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs
+++ b/src/test/ui/const-generics/const-param-type-depends-on-type-param.rs
@@ -1,6 +1,6 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
// Currently, const parameters cannot depend on other generic parameters,
diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr
deleted file mode 100644
index 923964a..0000000
--- a/src/test/ui/const-generics/const-parameter-uppercase-lint.full.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: const parameter `x` should have an upper case name
- --> $DIR/const-parameter-uppercase-lint.rs:8:15
- |
-LL | fn noop<const x: u32>() {
- | ^ help: convert the identifier to upper case (notice the capitalization): `X`
- |
-note: the lint level is defined here
- --> $DIR/const-parameter-uppercase-lint.rs:6:9
- |
-LL | #![deny(non_upper_case_globals)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr
deleted file mode 100644
index 923964a..0000000
--- a/src/test/ui/const-generics/const-parameter-uppercase-lint.min.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: const parameter `x` should have an upper case name
- --> $DIR/const-parameter-uppercase-lint.rs:8:15
- |
-LL | fn noop<const x: u32>() {
- | ^ help: convert the identifier to upper case (notice the capitalization): `X`
- |
-note: the lint level is defined here
- --> $DIR/const-parameter-uppercase-lint.rs:6:9
- |
-LL | #![deny(non_upper_case_globals)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs
index 5d97907..b08d62c 100644
--- a/src/test/ui/const-generics/const-parameter-uppercase-lint.rs
+++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.rs
@@ -1,8 +1,3 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
#![deny(non_upper_case_globals)]
fn noop<const x: u32>() {
diff --git a/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr
new file mode 100644
index 0000000..efaa182
--- /dev/null
+++ b/src/test/ui/const-generics/const-parameter-uppercase-lint.stderr
@@ -0,0 +1,14 @@
+error: const parameter `x` should have an upper case name
+ --> $DIR/const-parameter-uppercase-lint.rs:3:15
+ |
+LL | fn noop<const x: u32>() {
+ | ^ help: convert the identifier to upper case (notice the capitalization): `X`
+ |
+note: the lint level is defined here
+ --> $DIR/const-parameter-uppercase-lint.rs:1:9
+ |
+LL | #![deny(non_upper_case_globals)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/const-types.rs b/src/test/ui/const-generics/const-types.rs
deleted file mode 100644
index fb150f8..0000000
--- a/src/test/ui/const-generics/const-types.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Check that arrays can be used with generic const and type.
-// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-#![allow(dead_code, unused_variables)]
-
-struct ConstArray<T, const LEN: usize> {
- array: [T; LEN],
-}
-
-fn main() {
- let arr = ConstArray::<i32, 8> {
- array: [0; 8],
- };
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-1.rs b/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-1.rs
deleted file mode 100644
index 744a1c4..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-1.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// check-pass
-#![feature(const_evaluatable_checked, const_generics)]
-#![allow(incomplete_features)]
-
-struct Foo<const N: u8>([u8; N as usize])
-where
- [(); N as usize]:;
-
-struct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 2) as usize]:;
-
-// unifying with subtrees
-struct Evaluatable<const N: u16>;
-fn foo<const N: u8>() where Evaluatable<{N as usize as u16 }>: {
- let _ = Foo::<N>([1; N as usize]);
-}
-
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.rs b/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.rs
deleted file mode 100644
index 5437746..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-#![feature(const_evaluatable_checked, const_generics)]
-#![allow(incomplete_features)]
-
-struct Evaluatable<const N: u128> {}
-
-struct Foo<const N: u8>([u8; N as usize])
-//~^ Error: unconstrained generic constant
-//~| help: try adding a `where` bound using this expression: `where [(); N as usize]:`
-where
- Evaluatable<{N as u128}>:;
-
-struct Foo2<const N: u8>(Evaluatable::<{N as u128}>) where Evaluatable<{N as usize as u128 }>:;
-//~^ Error: unconstrained generic constant
-//~| help: try adding a `where` bound using this expression: `where [(); {N as u128}]:`
-
-struct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 1) as usize]:;
-//~^ Error: unconstrained generic constant
-//~| help: try adding a `where` bound using this expression: `where [(); (N + 2) as usize]:`
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.rs b/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.rs
deleted file mode 100644
index 2ca06bd..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-trait Trait {}
-pub struct EvaluatableU128<const N: u128>;
-
-struct HasCastInTraitImpl<const N: usize, const M: u128>;
-impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
-
-pub fn use_trait_impl<const N: usize>()
-where
- [(); { N + 1}]:,
- EvaluatableU128<{N as u128}>:, {
- fn assert_impl<T: Trait>() {}
-
- // errors are bad but seems to be pre-existing issue #86198
- assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- //~^ Error: mismatched types
- //~^^ Error: unconstrained generic constant
- assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- //~^ Error: mismatched types
- //~^^ Error: unconstrained generic constant
- assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
- //~^ Error: mismatched types
- assert_impl::<HasCastInTraitImpl<14, 13>>();
- //~^ Error: mismatched types
-}
-pub fn use_trait_impl_2<const N: usize>()
-where
- [(); { N + 1}]:,
- EvaluatableU128<{N as _}>:, {
- fn assert_impl<T: Trait>() {}
-
- // errors are bad but seems to be pre-existing issue #86198
- assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- //~^ Error: mismatched types
- //~^^ Error: unconstrained generic constant
- assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- //~^ Error: mismatched types
- //~^^ Error: unconstrained generic constant
- assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
- //~^ Error: mismatched types
- assert_impl::<HasCastInTraitImpl<14, 13>>();
- //~^ Error: mismatched types
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.stderr b/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.stderr
deleted file mode 100644
index c5237fc..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-3.stderr
+++ /dev/null
@@ -1,139 +0,0 @@
-error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:17:5
- |
-LL | fn assert_impl<T: Trait>() {}
- | ----- required by this bound in `use_trait_impl::assert_impl`
-...
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>`
- --> $DIR/abstract-const-as-cast-3.rs:8:22
- |
-LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
- | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:17:5
- |
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }`
- |
- = note: expected type `{ N as u128 }`
- found type `{ O as u128 }`
-
-error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:20:5
- |
-LL | fn assert_impl<T: Trait>() {}
- | ----- required by this bound in `use_trait_impl::assert_impl`
-...
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>`
- --> $DIR/abstract-const-as-cast-3.rs:8:22
- |
-LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
- | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:20:5
- |
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }`
- |
- = note: expected type `{ N as _ }`
- found type `{ O as u128 }`
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:23:5
- |
-LL | assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12_u128`, found `13_u128`
- |
- = note: expected type `12_u128`
- found type `13_u128`
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:25:5
- |
-LL | assert_impl::<HasCastInTraitImpl<14, 13>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13_u128`, found `14_u128`
- |
- = note: expected type `13_u128`
- found type `14_u128`
-
-error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:35:5
- |
-LL | fn assert_impl<T: Trait>() {}
- | ----- required by this bound in `use_trait_impl_2::assert_impl`
-...
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>`
- --> $DIR/abstract-const-as-cast-3.rs:8:22
- |
-LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
- | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:35:5
- |
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }`
- |
- = note: expected type `{ N as u128 }`
- found type `{ O as u128 }`
-
-error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:38:5
- |
-LL | fn assert_impl<T: Trait>() {}
- | ----- required by this bound in `use_trait_impl_2::assert_impl`
-...
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>`
- --> $DIR/abstract-const-as-cast-3.rs:8:22
- |
-LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
- | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:38:5
- |
-LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }`
- |
- = note: expected type `{ N as _ }`
- found type `{ O as u128 }`
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:41:5
- |
-LL | assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12_u128`, found `13_u128`
- |
- = note: expected type `12_u128`
- found type `13_u128`
-
-error[E0308]: mismatched types
- --> $DIR/abstract-const-as-cast-3.rs:43:5
- |
-LL | assert_impl::<HasCastInTraitImpl<14, 13>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13_u128`, found `14_u128`
- |
- = note: expected type `13_u128`
- found type `14_u128`
-
-error: aborting due to 12 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-4.rs b/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-4.rs
deleted file mode 100644
index 0bb4fcf..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-4.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// check-pass
-#![feature(const_evaluatable_checked, const_generics)]
-#![allow(incomplete_features)]
-
-trait Trait {}
-pub struct EvaluatableU128<const N: u128>;
-
-struct HasCastInTraitImpl<const N: usize, const M: u128>;
-impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
-
-pub fn use_trait_impl<const N: usize>() where EvaluatableU128<{N as u128}>:, {
- fn assert_impl<T: Trait>() {}
-
- assert_impl::<HasCastInTraitImpl<N, { N as u128 }>>();
- assert_impl::<HasCastInTraitImpl<N, { N as _ }>>();
- assert_impl::<HasCastInTraitImpl<12, { 12 as u128 }>>();
- assert_impl::<HasCastInTraitImpl<13, 13>>();
-}
-pub fn use_trait_impl_2<const N: usize>() where EvaluatableU128<{N as _}>:, {
- fn assert_impl<T: Trait>() {}
-
- assert_impl::<HasCastInTraitImpl<N, { N as u128 }>>();
- assert_impl::<HasCastInTraitImpl<N, { N as _ }>>();
- assert_impl::<HasCastInTraitImpl<12, { 12 as u128 }>>();
- assert_impl::<HasCastInTraitImpl<13, 13>>();
-}
-
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/associated-consts.rs b/src/test/ui/const-generics/const_evaluatable_checked/associated-consts.rs
deleted file mode 100644
index 533fe55..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/associated-consts.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-pub trait BlockCipher {
- const BLOCK_SIZE: usize;
-}
-
-struct FooCipher;
-impl BlockCipher for FooCipher {
- const BLOCK_SIZE: usize = 64;
-}
-
-struct BarCipher;
-impl BlockCipher for BarCipher {
- const BLOCK_SIZE: usize = 32;
-}
-
-pub struct Block<C>(C);
-
-pub fn test<C: BlockCipher, const M: usize>()
-where
- [u8; M - C::BLOCK_SIZE]: Sized,
-{
- let _ = [0; M - C::BLOCK_SIZE];
-}
-
-fn main() {
- test::<FooCipher, 128>();
- test::<BarCipher, 64>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/auxiliary/const_evaluatable_lib.rs b/src/test/ui/const-generics/const_evaluatable_checked/auxiliary/const_evaluatable_lib.rs
deleted file mode 100644
index 9745dfe..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/auxiliary/const_evaluatable_lib.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
-where
- [u8; std::mem::size_of::<T>() - 1]: Sized,
-{
- [0; std::mem::size_of::<T>() - 1]
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/closures.rs b/src/test/ui/const-generics/const_evaluatable_checked/closures.rs
deleted file mode 100644
index 32f4359..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/closures.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
-//~^ ERROR overly complex generic constant
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate.rs b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate.rs
deleted file mode 100644
index 53b2378..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// aux-build:const_evaluatable_lib.rs
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-extern crate const_evaluatable_lib;
-
-fn user<T>() where [u8; std::mem::size_of::<T>() - 1]: Sized {
- assert_eq!(const_evaluatable_lib::test1::<T>(), [0; std::mem::size_of::<T>() - 1]);
-}
-
-fn main() {
- assert_eq!(const_evaluatable_lib::test1::<u32>(), [0; 3]);
- user::<u32>();
- user::<u64>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs
deleted file mode 100644
index e3a4d9a..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// aux-build:const_evaluatable_lib.rs
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-extern crate const_evaluatable_lib;
-
-fn user<T>() {
- let _ = const_evaluatable_lib::test1::<T>();
- //~^ ERROR unconstrained generic constant
- //~| ERROR unconstrained generic constant
- //~| ERROR unconstrained generic constant
- //~| ERROR unconstrained generic constant
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr
deleted file mode 100644
index 84b2665..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr
+++ /dev/null
@@ -1,54 +0,0 @@
-error: unconstrained generic constant
- --> $DIR/cross_crate_predicate.rs:7:13
- |
-LL | let _ = const_evaluatable_lib::test1::<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- ::: $DIR/auxiliary/const_evaluatable_lib.rs:6:10
- |
-LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
- | ---------------------------- required by this bound in `test1`
- |
- = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
-
-error: unconstrained generic constant
- --> $DIR/cross_crate_predicate.rs:7:13
- |
-LL | let _ = const_evaluatable_lib::test1::<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- ::: $DIR/auxiliary/const_evaluatable_lib.rs:4:27
- |
-LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
- | ---------------------------- required by this bound in `test1`
- |
- = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
-
-error: unconstrained generic constant
- --> $DIR/cross_crate_predicate.rs:7:13
- |
-LL | let _ = const_evaluatable_lib::test1::<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- ::: $DIR/auxiliary/const_evaluatable_lib.rs:6:10
- |
-LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
- | ---------------------------- required by this bound in `test1`
- |
- = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
-
-error: unconstrained generic constant
- --> $DIR/cross_crate_predicate.rs:7:13
- |
-LL | let _ = const_evaluatable_lib::test1::<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- ::: $DIR/auxiliary/const_evaluatable_lib.rs:4:27
- |
-LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
- | ---------------------------- required by this bound in `test1`
- |
- = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/different-fn.rs b/src/test/ui/const-generics/const_evaluatable_checked/different-fn.rs
deleted file mode 100644
index 26c4295..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/different-fn.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-use std::mem::size_of;
-use std::marker::PhantomData;
-
-struct Foo<T>(PhantomData<T>);
-
-fn test<T>() -> [u8; size_of::<T>()] {
- [0; size_of::<Foo<T>>()]
- //~^ ERROR unconstrained generic constant
- //~| ERROR mismatched types
-}
-
-fn main() {
- test::<u32>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/division.rs b/src/test/ui/const-generics/const_evaluatable_checked/division.rs
deleted file mode 100644
index 71a5f2d..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/division.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-fn with_bound<const N: usize>() where [u8; N / 2]: Sized {
- let _: [u8; N / 2] = [0; N / 2];
-}
-
-fn main() {
- with_bound::<4>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/dont-eagerly-error-in-is-const-evaluatable.rs b/src/test/ui/const-generics/const_evaluatable_checked/dont-eagerly-error-in-is-const-evaluatable.rs
deleted file mode 100644
index 92a410a..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/dont-eagerly-error-in-is-const-evaluatable.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// run-pass
-#![feature(const_generics)]
-#![feature(const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-// This test is a repro for #82279. It checks that we don't error
-// when calling is_const_evaluatable on `std::mem::size_of::<T>()`
-// when looking for candidates that may prove `T: Foo` in `foo`
-
-trait Foo {}
-
-#[allow(dead_code)]
-fn foo<T: Foo>() {}
-
-impl<T> Foo for T where [(); std::mem::size_of::<T>()]: {}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/elaborate-trait-pred.rs b/src/test/ui/const-generics/const_evaluatable_checked/elaborate-trait-pred.rs
deleted file mode 100644
index 4a4fd1e..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/elaborate-trait-pred.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// run-pass
-// Test that we use the elaborated predicates from traits
-// to satisfy const evaluatable predicates.
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-use std::mem::size_of;
-
-trait Foo: Sized
-where
- [(); size_of::<Self>()]: Sized,
-{
-}
-
-impl Foo for u64 {}
-impl Foo for u32 {}
-
-fn foo<T: Foo>() -> [u8; size_of::<T>()] {
- [0; size_of::<T>()]
-}
-
-fn main() {
- assert_eq!(foo::<u32>(), [0; 4]);
- assert_eq!(foo::<u64>(), [0; 8]);
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.rs b/src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.rs
deleted file mode 100644
index 9f457fb..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-#![crate_type = "lib"]
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-pub struct Const<const U: u8>;
-
-pub trait Trait {
- type AssocTy;
- fn assoc_fn() -> Self::AssocTy;
-}
-
-impl<const U: u8> Trait for Const<U>
-//~^ WARN private type
-//~| WARN this was previously
-//~| WARN private type
-//~| WARN this was previously
-
-where
- Const<{ my_const_fn(U) }>: ,
-{
- type AssocTy = Const<{ my_const_fn(U) }>;
- //~^ ERROR private type
- fn assoc_fn() -> Self::AssocTy {
- Const
- }
-}
-
-const fn my_const_fn(val: u8) -> u8 {
- // body of this function doesn't matter
- val
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/evaluated-to-ambig.rs b/src/test/ui/const-generics/const_evaluatable_checked/evaluated-to-ambig.rs
deleted file mode 100644
index 0f36ce3..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/evaluated-to-ambig.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// check-pass
-
-// We previously always returned ambiguity when equating generic consts, even if they
-// only contain generic parameters. This is incorrect as trying to unify `N > 1` with `M > 1`
-// should fail.
-#![allow(incomplete_features)]
-#![feature(const_generics, const_evaluatable_checked)]
-
-enum Assert<const COND: bool> {}
-trait IsTrue {}
-impl IsTrue for Assert<true> {}
-
-struct Foo<const N: usize, const M: usize>;
-trait Bar<const N: usize, const M: usize> {}
-impl<const N: usize, const M: usize> Bar<N, M> for Foo<N, M>
-where
- Assert<{ N > 1 }>: IsTrue,
- Assert<{ M > 1 }>: IsTrue,
-{
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.full.stderr b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.full.stderr
deleted file mode 100644
index d6a54ea..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/feature-gate-const_evaluatable_checked.rs:8:30
- |
-LL | fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
- | ^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr
deleted file mode 100644
index 7de4bfc..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/feature-gate-const_evaluatable_checked.rs:5:33
- |
-LL | type Arr<const N: usize> = [u8; N - 1];
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs b/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs
deleted file mode 100644
index f49ca02..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/feature-gate-const_evaluatable_checked.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-type Arr<const N: usize> = [u8; N - 1];
-//[min]~^ ERROR generic parameters may not be used in const operations
-
-fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
- //[full]~^ ERROR constant expression depends
- Default::default()
-}
-
-fn main() {
- let x = test::<33>();
- assert_eq!(x, [0; 32]);
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/fn_call.rs b/src/test/ui/const-generics/const_evaluatable_checked/fn_call.rs
deleted file mode 100644
index c182f5e..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/fn_call.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-const fn test_me<T>(a: usize, b: usize) -> usize {
- if a < b {
- std::mem::size_of::<T>()
- } else {
- usize::MAX
- }
-}
-
-fn test_simple<T>() -> [u8; std::mem::size_of::<T>()]
-where
- [u8; std::mem::size_of::<T>()]: Sized,
-{
- [0; std::mem::size_of::<T>()]
-}
-
-fn test_with_args<T, const N: usize>() -> [u8; test_me::<T>(N, N + 1) + N]
-where
- [u8; test_me::<T>(N, N + 1) + N]: Sized,
-{
- [0; test_me::<T>(N, N + 1) + N]
-}
-
-fn main() {
- assert_eq!([0; 8], test_simple::<u64>());
- assert_eq!([0; 12], test_with_args::<u64, 4>());
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs b/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs
deleted file mode 100644
index 8167d78..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-fn test<const N: usize>() -> [u8; N - 1] {
- //~^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed
- todo!()
-}
-
-fn main() {
- test::<0>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs b/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs
deleted file mode 100644
index 5c05a5a..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/from-sig.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-struct Foo<const B: bool>;
-
-fn test<const N: usize>() -> Foo<{ N > 10 }> {
- Foo
-}
-
-fn main() {
- let _: Foo<true> = test::<12>();
- let _: Foo<false> = test::<9>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs b/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs
deleted file mode 100644
index 193a365..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/impl-bounds.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// check-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-use std::mem::size_of;
-
-struct Foo<T, const N: usize>(T);
-
-impl<T> Foo<T, { size_of::<T>() }> {
- fn test() {
- let _: [u8; std::mem::size_of::<T>()];
- }
-}
-
-trait Bar<const N: usize> {
- fn test_me();
-}
-
-impl<T> Bar<{ size_of::<T>() }> for Foo<T, 3> {
- fn test_me() {
- let _: [u8; std::mem::size_of::<T>()];
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs b/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs
deleted file mode 100644
index cad06ea..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/infer-too-generic.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-use std::{mem, ptr};
-
-fn split_first<T, const N: usize>(arr: [T; N]) -> (T, [T; N - 1])
-where
- [T; N - 1]: Sized,
-{
- let arr = mem::ManuallyDrop::new(arr);
- unsafe {
- let head = ptr::read(&arr[0]);
- let tail = ptr::read(&arr[1..] as *const [T] as *const [T; N - 1]);
- (head, tail)
- }
-}
-
-fn main() {
- let arr = [0, 1, 2, 3, 4];
- let (head, tail) = split_first(arr);
- assert_eq!(head, 0);
- assert_eq!(tail, [1, 2, 3, 4]);
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/less_than.rs b/src/test/ui/const-generics/const_evaluatable_checked/less_than.rs
deleted file mode 100644
index 907ea25..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/less_than.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-struct Foo<const B: bool>;
-
-fn test<const N: usize>() -> Foo<{ N > 10 }> where Foo<{ N > 10 }>: Sized {
- Foo
-}
-
-fn main() {
- let _: Foo<true> = test::<12>();
- let _: Foo<false> = test::<9>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs b/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs
deleted file mode 100644
index a6bb392..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-// We do not yet want to support let-bindings in abstract consts,
-// so this test should keep failing for now.
-fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
- //~^ ERROR overly complex generic constant
- //~| ERROR overly complex generic constant
- Default::default()
-}
-
-fn main() {
- let x = test::<31>();
- assert_eq!(x, [0; 32]);
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-1.rs b/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-1.rs
deleted file mode 100644
index 0fe84c1..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-1.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-fn callee<const M2: usize>() -> usize
-where
- [u8; M2 + 1]: Sized,
-{
- M2
-}
-
-fn caller<const N1: usize>() -> usize
-where
- [u8; N1 + 1]: Sized,
- [u8; (N1 + 1) + 1]: Sized,
-{
- callee::<{ N1 + 1 }>()
-}
-
-fn main() {
- assert_eq!(caller::<4>(), 5);
-}
-
-// Test that the ``(N1 + 1) + 1`` bound on ``caller`` satisfies the ``M2 + 1`` bound on ``callee``
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-2.rs b/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-2.rs
deleted file mode 100644
index 4f58823..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-2.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// run-pass
-#![feature(const_evaluatable_checked, const_generics)]
-#![allow(incomplete_features)]
-
-struct Generic<const K: u64>;
-
-struct ConstU64<const K: u64>;
-
-impl<const K: u64> Generic<K>
-where
- ConstU64<{ K - 1 }>: ,
-{
- fn foo(self) -> u64 {
- K
- }
-}
-
-impl<const K: u64> Generic<K>
-where
- ConstU64<{ K - 1 }>: ,
- ConstU64<{ K + 1 }>: ,
- ConstU64<{ K + 1 - 1 }>: ,
-{
- fn bar(self) -> u64 {
- let x: Generic<{ K + 1 }> = Generic;
- x.foo()
- }
-}
-
-fn main() {
- assert_eq!((Generic::<10>).bar(), 11);
-}
-
-// Test that the ``ConstU64<{ K + 1 - 1}>`` bound on ``bar``'s impl block satisfies the
-// ``ConstU64<{K - 1}>`` bound on ``foo``'s impl block
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-1.rs b/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-1.rs
deleted file mode 100644
index 4d0b87e..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-1.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-fn zero_init<const N: usize>() -> Substs1<N>
-where
- [u8; N + 1]: ,
-{
- Substs1([0; N + 1])
-}
-struct Substs1<const N: usize>([u8; N + 1])
-where
- [(); N + 1]: ;
-
-fn substs2<const M: usize>() -> Substs1<{ M * 2 }>
-where
- [(); { M * 2 } + 1]: ,
-{
- zero_init::<{ M * 2 }>()
-}
-
-fn substs3<const L: usize>() -> Substs1<{ (L - 1) * 2 }>
-where
- [(); (L - 1) * 2 + 1]: ,
-{
- substs2::<{ L - 1 }>()
-}
-
-fn main() {
- assert_eq!(substs3::<2>().0, [0; 3]);
-}
-
-// Test that the ``{ (L - 1) * 2 + 1 }`` bound on ``substs3`` satisfies the
-// ``{ N + 1 }`` bound on ``Substs1``
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-2.rs b/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-2.rs
deleted file mode 100644
index be8219a..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/nested_uneval_unification-2.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features, unused_parens, unused_braces)]
-
-fn zero_init<const N: usize>() -> Substs1<{ (N) }>
-where
- [u8; { (N) }]: ,
-{
- Substs1([0; { (N) }])
-}
-
-struct Substs1<const N: usize>([u8; { (N) }])
-where
- [(); { (N) }]: ;
-
-fn substs2<const M: usize>() -> Substs1<{ (M) }> {
- zero_init::<{ (M) }>()
-}
-
-fn substs3<const L: usize>() -> Substs1<{ (L) }> {
- substs2::<{ (L) }>()
-}
-
-fn main() {
- assert_eq!(substs3::<2>().0, [0; 2]);
-}
-
-// Test that the implicit ``{ (L) }`` bound on ``substs3`` satisfies the
-// ``{ (N) }`` bound on ``Substs1``
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.rs b/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.rs
deleted file mode 100644
index 5be4b41..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-
-const fn bar<T: ?Sized>() -> usize { 7 }
-
-trait Foo {
- fn test(&self) -> [u8; bar::<Self>()];
-}
-
-impl Foo for () {
- fn test(&self) -> [u8; bar::<Self>()] {
- [0; bar::<Self>()]
- }
-}
-
-fn use_dyn(v: &dyn Foo) { //~ERROR the trait `Foo` cannot be made into an object
- v.test();
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.rs b/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.rs
deleted file mode 100644
index 5fbd4a5..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-#![deny(where_clauses_object_safety)]
-
-
-const fn bar<T: ?Sized>() -> usize { 7 }
-
-trait Foo {
- fn test(&self) where [u8; bar::<Self>()]: Sized;
- //~^ ERROR the trait `Foo` cannot be made into an object
- //~| WARN this was previously accepted by the compiler but is being phased out
-}
-
-impl Foo for () {
- fn test(&self) where [u8; bar::<Self>()]: Sized {}
-}
-
-fn use_dyn(v: &dyn Foo) {
- v.test();
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.rs b/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.rs
deleted file mode 100644
index 9a95908..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-trait Foo<const N: usize> {
- fn test(&self) -> [u8; N + 1];
-}
-
-impl<const N: usize> Foo<N> for () {
- fn test(&self) -> [u8; N + 1] {
- [0; N + 1]
- }
-}
-
-fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
- assert_eq!(v.test(), [0; N + 1]);
-}
-
-fn main() {
- // FIXME(const_evaluatable_checked): Improve the error message here.
- use_dyn(&());
- //~^ ERROR type annotations needed
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.stderr b/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.stderr
deleted file mode 100644
index dd2c11e..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok-infer-err.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0284]: type annotations needed: cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
- --> $DIR/object-safety-ok-infer-err.rs:20:5
- |
-LL | fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
- | ----- required by this bound in `use_dyn`
-...
-LL | use_dyn(&());
- | ^^^^^^^ cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0284`.
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok.rs b/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok.rs
deleted file mode 100644
index ae78b79..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-ok.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-trait Foo<const N: usize> {
- fn test(&self) -> [u8; N + 1];
-}
-
-impl<const N: usize> Foo<N> for () {
- fn test(&self) -> [u8; N + 1] {
- [0; N + 1]
- }
-}
-
-fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
- assert_eq!(v.test(), [0; N + 1]);
-}
-
-fn main() {
- use_dyn::<3>(&());
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr
deleted file mode 100644
index 9f3d94b..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/simple.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/simple.rs:7:53
- |
-LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/simple.rs:7:35
- |
-LL | fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple.rs b/src/test/ui/const-generics/const_evaluatable_checked/simple.rs
deleted file mode 100644
index 94ad71b..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/simple.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// [full] run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![feature(const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-fn test<const N: usize>() -> [u8; N - 1] where [u8; N - 1]: Default {
- //[min]~^ ERROR generic parameters
- //[min]~| ERROR generic parameters
- Default::default()
-}
-
-fn main() {
- let x = test::<33>();
- assert_eq!(x, [0; 32]);
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr
deleted file mode 100644
index 1f2313a..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.full.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0080]: evaluation of `test::<0_usize>::{constant#0}` failed
- --> $DIR/simple_fail.rs:10:48
- |
-LL | fn test<const N: usize>() -> Arr<N> where [u8; N - 1]: Sized {
- | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
-
-error[E0080]: evaluation of `Arr::<0_usize>::{constant#0}` failed
- --> $DIR/simple_fail.rs:6:33
- |
-LL | type Arr<const N: usize> = [u8; N - 1];
- | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr
deleted file mode 100644
index 1aa66f9..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/simple_fail.rs:6:33
- |
-LL | type Arr<const N: usize> = [u8; N - 1];
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/simple_fail.rs:10:48
- |
-LL | fn test<const N: usize>() -> Arr<N> where [u8; N - 1]: Sized {
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs b/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs
deleted file mode 100644
index f08d249..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/simple_fail.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, feature(const_evaluatable_checked))]
-#![allow(incomplete_features)]
-
-type Arr<const N: usize> = [u8; N - 1];
-//[min]~^ ERROR generic parameters may not be used in const operations
-//[full]~^^ ERROR evaluation of `Arr::<0_usize>::{constant#0}` failed
-
-fn test<const N: usize>() -> Arr<N> where [u8; N - 1]: Sized {
-//[min]~^ ERROR generic parameters may not be used in const operations
-//[full]~^^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed
- todo!()
-}
-
-fn main() {
- test::<0>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/subexprs_are_const_evalutable.rs b/src/test/ui/const-generics/const_evaluatable_checked/subexprs_are_const_evalutable.rs
deleted file mode 100644
index 11c0760..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/subexprs_are_const_evalutable.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-fn make_array<const M: usize>() -> [(); M + 1] {
- [(); M + 1]
-}
-
-fn foo<const N: usize>() -> [(); (N * 2) + 1] {
- make_array::<{ N * 2 }>()
-}
-
-fn main() {
- assert_eq!(foo::<10>(), [(); 10 * 2 + 1])
-}
-
-// Tests that N * 2 is considered const_evalutable by appearing as part of the (N * 2) + 1 const
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/ty-alias-substitution.rs b/src/test/ui/const-generics/const_evaluatable_checked/ty-alias-substitution.rs
deleted file mode 100644
index 5c768a6..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/ty-alias-substitution.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// check-pass
-// Test that we correctly substitute generic arguments for type aliases.
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-type Alias<T, const N: usize> = [T; N + 1];
-
-fn foo<const M: usize>() -> Alias<u32, M> where [u8; M + 1]: Sized {
- [0; M + 1]
-}
-
-fn main() {
- foo::<0>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unop.rs b/src/test/ui/const-generics/const_evaluatable_checked/unop.rs
deleted file mode 100644
index 8e0768b..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/unop.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// run-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-struct Foo<const B: bool>;
-
-fn test<const N: usize>() -> Foo<{ !(N > 10) }> where Foo<{ !(N > 10) }>: Sized {
- Foo
-}
-
-fn main() {
- let _: Foo<false> = test::<12>();
- let _: Foo<true> = test::<9>();
-}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unused-complex-default-expr.rs b/src/test/ui/const-generics/const_evaluatable_checked/unused-complex-default-expr.rs
deleted file mode 100644
index 21f14f5..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/unused-complex-default-expr.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-// check-pass
-#![feature(const_generics, const_evaluatable_checked, const_generics_defaults)]
-#![allow(incomplete_features)]
-struct Foo<const N: usize, const M: usize = { N + 1 }>;
-struct Bar<const N: usize>(Foo<N, 3>);
-fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unused_expr.rs b/src/test/ui/const-generics/const_evaluatable_checked/unused_expr.rs
deleted file mode 100644
index 9c603c5..0000000
--- a/src/test/ui/const-generics/const_evaluatable_checked/unused_expr.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-fn add<const N: usize>() -> [u8; { N + 1; 5 }] {
- //~^ ERROR overly complex generic constant
- todo!()
-}
-
-fn div<const N: usize>() -> [u8; { N / 1; 5 }] {
- //~^ ERROR overly complex generic constant
- todo!()
-}
-
-const fn foo(n: usize) {}
-
-fn fn_call<const N: usize>() -> [u8; { foo(N); 5 }] {
- //~^ ERROR overly complex generic constant
- todo!()
-}
-
-fn main() {
- add::<12>();
- div::<9>();
- fn_call::<14>();
-}
diff --git a/src/test/ui/const-generics/const_trait_fn-issue-88433.rs b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs
new file mode 100644
index 0000000..8724fa6
--- /dev/null
+++ b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs
@@ -0,0 +1,26 @@
+// build-pass
+
+#![feature(const_trait_impl)]
+
+trait Func<T> {
+ type Output;
+
+ fn call_once(self, arg: T) -> Self::Output;
+}
+
+
+struct Closure;
+
+impl const Func<&usize> for Closure {
+ type Output = usize;
+
+ fn call_once(self, arg: &usize) -> Self::Output {
+ *arg
+ }
+}
+
+enum Bug<T = [(); Closure.call_once(&0) ]> {
+ V(T),
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/core-types.rs b/src/test/ui/const-generics/core-types.rs
index b6fa478..91410c4 100644
--- a/src/test/ui/const-generics/core-types.rs
+++ b/src/test/ui/const-generics/core-types.rs
@@ -2,7 +2,7 @@
// run-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct A<const N: u8>;
diff --git a/src/test/ui/const-generics/cross_crate_complex.rs b/src/test/ui/const-generics/cross_crate_complex.rs
index 1d495c9..ebde155 100644
--- a/src/test/ui/const-generics/cross_crate_complex.rs
+++ b/src/test/ui/const-generics/cross_crate_complex.rs
@@ -1,10 +1,6 @@
// aux-build:crayte.rs
// edition:2018
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
extern crate crayte;
use crayte::*;
diff --git a/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs b/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs
index 6514409..5c54874 100644
--- a/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs
+++ b/src/test/ui/const-generics/defaults/auxiliary/const_defaulty.rs
@@ -1,6 +1,4 @@
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
pub struct Defaulted<const N: usize=3>;
impl Defaulted {
diff --git a/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr b/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr
index 44df2ac..aa289ec 100644
--- a/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr
+++ b/src/test/ui/const-generics/defaults/complex-generic-default-expr.min.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-generic-default-expr.rs:10:62
@@ -14,7 +14,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs b/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs
index d355800..814c996 100644
--- a/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs
+++ b/src/test/ui/const-generics/defaults/complex-generic-default-expr.rs
@@ -1,6 +1,6 @@
// revisions: full min
//[full] check-pass
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![feature(const_generics_defaults)]
#![allow(incomplete_features)]
diff --git a/src/test/ui/const-generics/defaults/complex-unord-param.rs b/src/test/ui/const-generics/defaults/complex-unord-param.rs
index d24e403..c27ed29 100644
--- a/src/test/ui/const-generics/defaults/complex-unord-param.rs
+++ b/src/test/ui/const-generics/defaults/complex-unord-param.rs
@@ -1,7 +1,7 @@
// [full] run-pass
// revisions: full min
// Checks a complicated usage of unordered params
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(const_generics_defaults))]
#![cfg_attr(full, allow(incomplete_features))]
#![allow(dead_code)]
diff --git a/src/test/ui/const-generics/defaults/const-default.rs b/src/test/ui/const-generics/defaults/const-default.rs
index 4fa21b8..e7cbf01 100644
--- a/src/test/ui/const-generics/defaults/const-default.rs
+++ b/src/test/ui/const-generics/defaults/const-default.rs
@@ -1,9 +1,5 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
-
pub struct ConstDefault<const N: usize = 3>;
diff --git a/src/test/ui/const-generics/defaults/default-annotation.rs b/src/test/ui/const-generics/defaults/default-annotation.rs
index 3febb7c..2b41dbb 100644
--- a/src/test/ui/const-generics/defaults/default-annotation.rs
+++ b/src/test/ui/const-generics/defaults/default-annotation.rs
@@ -1,19 +1,17 @@
// run-pass
#![feature(staged_api)]
-
-#![feature(const_generics)]
#![feature(const_generics_defaults)]
#![allow(incomplete_features)]
-
+// FIXME(const_generics): It seems like we aren't testing the right thing here,
+// I would assume that we want the attributes to apply to the const parameter defaults
+// themselves.
#![stable(feature = "const_default_test", since="none")]
-
#[unstable(feature = "const_default_stable", issue="none")]
pub struct ConstDefaultUnstable<const N: usize = 3>;
#[stable(feature = "const_default_unstable", since="none")]
pub struct ConstDefaultStable<const N: usize = {
- #[stable(feature = "const_default_unstable_val", since="none")]
3
}>;
diff --git a/src/test/ui/const-generics/defaults/default-on-impl.full.stderr b/src/test/ui/const-generics/defaults/default-on-impl.full.stderr
deleted file mode 100644
index c417a26..0000000
--- a/src/test/ui/const-generics/defaults/default-on-impl.full.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
- --> $DIR/default-on-impl.rs:8:12
- |
-LL | impl<const N: usize = 1> Foo<N> {}
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/defaults/default-on-impl.min.stderr b/src/test/ui/const-generics/defaults/default-on-impl.min.stderr
deleted file mode 100644
index c417a26..0000000
--- a/src/test/ui/const-generics/defaults/default-on-impl.min.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
- --> $DIR/default-on-impl.rs:8:12
- |
-LL | impl<const N: usize = 1> Foo<N> {}
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/defaults/default-on-impl.rs b/src/test/ui/const-generics/defaults/default-on-impl.rs
index 735549d..280d92f 100644
--- a/src/test/ui/const-generics/defaults/default-on-impl.rs
+++ b/src/test/ui/const-generics/defaults/default-on-impl.rs
@@ -1,7 +1,4 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
struct Foo<const N: usize>;
diff --git a/src/test/ui/const-generics/defaults/default-on-impl.stderr b/src/test/ui/const-generics/defaults/default-on-impl.stderr
new file mode 100644
index 0000000..0f85cec
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/default-on-impl.stderr
@@ -0,0 +1,8 @@
+error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ --> $DIR/default-on-impl.rs:5:12
+ |
+LL | impl<const N: usize = 1> Foo<N> {}
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/defaults/external.rs b/src/test/ui/const-generics/defaults/external.rs
index 32acf56..276e743 100644
--- a/src/test/ui/const-generics/defaults/external.rs
+++ b/src/test/ui/const-generics/defaults/external.rs
@@ -1,9 +1,6 @@
// aux-build:const_defaulty.rs
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
extern crate const_defaulty;
use const_defaulty::Defaulted;
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs
new file mode 100644
index 0000000..52cea51
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.rs
@@ -0,0 +1,14 @@
+#![feature(generic_const_exprs, const_generics_defaults)]
+#![allow(incomplete_features)]
+
+struct Foo<const N: usize, const M: usize = { N + 1 }>;
+fn no_constraining() -> Foo<10> {
+ Foo::<10, 11>
+}
+
+pub fn different_than_default() -> Foo<10> {
+ Foo::<10, 12>
+ //~^ error: mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr
new file mode 100644
index 0000000..905a285
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/generic-expr-default-concrete.rs:10:5
+ |
+LL | Foo::<10, 12>
+ | ^^^^^^^^^^^^^ expected `11_usize`, found `12_usize`
+ |
+ = note: expected type `11_usize`
+ found type `12_usize`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs
new file mode 100644
index 0000000..3a11631
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.rs
@@ -0,0 +1,16 @@
+#![feature(generic_const_exprs, const_generics_defaults)]
+#![allow(incomplete_features)]
+
+struct Foo<const N: usize, const M: usize = { N + 1 }>;
+fn should_unify<const N: usize>() -> Foo<N> where [(); { N + 1 }]: {
+ Foo::<N, { N + 1 }>
+}
+pub fn shouldnt_unify<const N: usize>() -> Foo<N>
+where
+ [(); { N + 1 }]:,
+ [(); { N + 2 }]:, {
+ Foo::<N, { N + 2 }>
+ //~^ error: mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr
new file mode 100644
index 0000000..d5a3071
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/generic-expr-default-mismatched-types.rs:12:5
+ |
+LL | Foo::<N, { N + 2 }>
+ | ^^^^^^^^^^^^^^^^^^^ expected `{ N + 1 }`, found `{ N + 2 }`
+ |
+ = note: expected type `{ N + 1 }`
+ found type `{ N + 2 }`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default.rs b/src/test/ui/const-generics/defaults/generic-expr-default.rs
new file mode 100644
index 0000000..0adbd5c
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/generic-expr-default.rs
@@ -0,0 +1,24 @@
+#![feature(generic_const_exprs, const_generics_defaults)]
+#![allow(incomplete_features)]
+
+pub struct Foo<const N: usize, const M: usize = { N + 1 }>;
+pub fn needs_evaluatable_bound<const N1: usize>() -> Foo<N1> {
+ //~^ error: unconstrained generic constant
+ loop {}
+}
+pub fn has_evaluatable_bound<const N1: usize>() -> Foo<N1> where [(); N1 + 1]: {
+ loop {}
+}
+
+type FooAlias<const N: usize, const NP: usize = { N + 1 }> = [(); NP];
+fn needs_evaluatable_bound_alias<T, const N: usize>() -> FooAlias<N>
+{
+ //~^^ error: unconstrained generic constant
+ todo!()
+}
+fn has_evaluatable_bound_alias<const N: usize>() -> FooAlias<N>
+where [(); N + 1]: {
+ todo!()
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default.stderr b/src/test/ui/const-generics/defaults/generic-expr-default.stderr
new file mode 100644
index 0000000..ada1498
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/generic-expr-default.stderr
@@ -0,0 +1,18 @@
+error: unconstrained generic constant
+ --> $DIR/generic-expr-default.rs:5:54
+ |
+LL | pub fn needs_evaluatable_bound<const N1: usize>() -> Foo<N1> {
+ | ^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); { N + 1 }]:`
+
+error: unconstrained generic constant
+ --> $DIR/generic-expr-default.rs:14:58
+ |
+LL | fn needs_evaluatable_bound_alias<T, const N: usize>() -> FooAlias<N>
+ | ^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); { N + 1 }]:`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr b/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr
index 29d835e..725cc36 100644
--- a/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr
+++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.full.stderr
@@ -1,11 +1,11 @@
error: lifetime parameters must be declared prior to const parameters
- --> $DIR/intermixed-lifetime.rs:7:28
+ --> $DIR/intermixed-lifetime.rs:5:28
|
LL | struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
| -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>`
error: lifetime parameters must be declared prior to type parameters
- --> $DIR/intermixed-lifetime.rs:10:37
+ --> $DIR/intermixed-lifetime.rs:8:37
|
LL | struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
| --------------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>`
diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr b/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr
index 29d835e..725cc36 100644
--- a/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr
+++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.min.stderr
@@ -1,11 +1,11 @@
error: lifetime parameters must be declared prior to const parameters
- --> $DIR/intermixed-lifetime.rs:7:28
+ --> $DIR/intermixed-lifetime.rs:5:28
|
LL | struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
| -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>`
error: lifetime parameters must be declared prior to type parameters
- --> $DIR/intermixed-lifetime.rs:10:37
+ --> $DIR/intermixed-lifetime.rs:8:37
|
LL | struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
| --------------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>`
diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs
index 307e3aa..cc215ab 100644
--- a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs
+++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs
@@ -1,8 +1,6 @@
// Checks that lifetimes cannot be interspersed between consts and types.
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
//~^ Error lifetime parameters must be declared prior to const parameters
diff --git a/src/test/ui/const-generics/defaults/mismatch.full.stderr b/src/test/ui/const-generics/defaults/mismatch.full.stderr
deleted file mode 100644
index 4aa8401..0000000
--- a/src/test/ui/const-generics/defaults/mismatch.full.stderr
+++ /dev/null
@@ -1,58 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:12:28
- |
-LL | let e: Example::<13> = ();
- | ------------- ^^ expected struct `Example`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:15:34
- |
-LL | let e: Example2::<u32, 13> = ();
- | ------------------- ^^ expected struct `Example2`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example2`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:18:34
- |
-LL | let e: Example3::<13, u32> = ();
- | ------------------- ^^ expected struct `Example3`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example3`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:21:28
- |
-LL | let e: Example3::<7> = ();
- | ------------- ^^ expected struct `Example3`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example3<7_usize>`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:24:28
- |
-LL | let e: Example4::<7> = ();
- | ------------- ^^ expected struct `Example4`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example4<7_usize>`
- found unit type `()`
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/defaults/mismatch.min.stderr b/src/test/ui/const-generics/defaults/mismatch.min.stderr
deleted file mode 100644
index 4aa8401..0000000
--- a/src/test/ui/const-generics/defaults/mismatch.min.stderr
+++ /dev/null
@@ -1,58 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:12:28
- |
-LL | let e: Example::<13> = ();
- | ------------- ^^ expected struct `Example`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:15:34
- |
-LL | let e: Example2::<u32, 13> = ();
- | ------------------- ^^ expected struct `Example2`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example2`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:18:34
- |
-LL | let e: Example3::<13, u32> = ();
- | ------------------- ^^ expected struct `Example3`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example3`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:21:28
- |
-LL | let e: Example3::<7> = ();
- | ------------- ^^ expected struct `Example3`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example3<7_usize>`
- found unit type `()`
-
-error[E0308]: mismatched types
- --> $DIR/mismatch.rs:24:28
- |
-LL | let e: Example4::<7> = ();
- | ------------- ^^ expected struct `Example4`, found `()`
- | |
- | expected due to this
- |
- = note: expected struct `Example4<7_usize>`
- found unit type `()`
-
-error: aborting due to 5 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/defaults/mismatch.rs b/src/test/ui/const-generics/defaults/mismatch.rs
index 9d9a879..4ae93a9 100644
--- a/src/test/ui/const-generics/defaults/mismatch.rs
+++ b/src/test/ui/const-generics/defaults/mismatch.rs
@@ -1,7 +1,4 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
pub struct Example<const N: usize=13>;
pub struct Example2<T=u32, const N: usize=13>(T);
diff --git a/src/test/ui/const-generics/defaults/mismatch.stderr b/src/test/ui/const-generics/defaults/mismatch.stderr
new file mode 100644
index 0000000..3c7f4fe
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/mismatch.stderr
@@ -0,0 +1,58 @@
+error[E0308]: mismatched types
+ --> $DIR/mismatch.rs:9:28
+ |
+LL | let e: Example::<13> = ();
+ | ------------- ^^ expected struct `Example`, found `()`
+ | |
+ | expected due to this
+ |
+ = note: expected struct `Example`
+ found unit type `()`
+
+error[E0308]: mismatched types
+ --> $DIR/mismatch.rs:12:34
+ |
+LL | let e: Example2::<u32, 13> = ();
+ | ------------------- ^^ expected struct `Example2`, found `()`
+ | |
+ | expected due to this
+ |
+ = note: expected struct `Example2`
+ found unit type `()`
+
+error[E0308]: mismatched types
+ --> $DIR/mismatch.rs:15:34
+ |
+LL | let e: Example3::<13, u32> = ();
+ | ------------------- ^^ expected struct `Example3`, found `()`
+ | |
+ | expected due to this
+ |
+ = note: expected struct `Example3`
+ found unit type `()`
+
+error[E0308]: mismatched types
+ --> $DIR/mismatch.rs:18:28
+ |
+LL | let e: Example3::<7> = ();
+ | ------------- ^^ expected struct `Example3`, found `()`
+ | |
+ | expected due to this
+ |
+ = note: expected struct `Example3<7_usize>`
+ found unit type `()`
+
+error[E0308]: mismatched types
+ --> $DIR/mismatch.rs:21:28
+ |
+LL | let e: Example4::<7> = ();
+ | ------------- ^^ expected struct `Example4`, found `()`
+ | |
+ | expected due to this
+ |
+ = note: expected struct `Example4<7_usize>`
+ found unit type `()`
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/defaults/needs-feature.min.stderr b/src/test/ui/const-generics/defaults/needs-feature.min.stderr
index a400620..158fa2e 100644
--- a/src/test/ui/const-generics/defaults/needs-feature.min.stderr
+++ b/src/test/ui/const-generics/defaults/needs-feature.min.stderr
@@ -1,5 +1,5 @@
error: type parameters must be declared prior to const parameters
- --> $DIR/needs-feature.rs:9:26
+ --> $DIR/needs-feature.rs:7:26
|
LL | struct A<const N: usize, T=u32>(T);
| -----------------^----- help: reorder the parameters: lifetimes, then types, then consts: `<T = u32, const N: usize>`
diff --git a/src/test/ui/const-generics/defaults/needs-feature.none.stderr b/src/test/ui/const-generics/defaults/needs-feature.none.stderr
deleted file mode 100644
index a400620..0000000
--- a/src/test/ui/const-generics/defaults/needs-feature.none.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: type parameters must be declared prior to const parameters
- --> $DIR/needs-feature.rs:9:26
- |
-LL | struct A<const N: usize, T=u32>(T);
- | -----------------^----- help: reorder the parameters: lifetimes, then types, then consts: `<T = u32, const N: usize>`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/defaults/needs-feature.rs b/src/test/ui/const-generics/defaults/needs-feature.rs
index b58dee0..9ba8184 100644
--- a/src/test/ui/const-generics/defaults/needs-feature.rs
+++ b/src/test/ui/const-generics/defaults/needs-feature.rs
@@ -1,10 +1,8 @@
//[full] run-pass
// Verifies that having generic parameters after constants is not permitted without the
-// `const_generics` feature.
+// `const_generics_defaults` feature.
// revisions: min full
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+#![cfg_attr(full, feature(const_generics_defaults))]
struct A<const N: usize, T=u32>(T);
//[min]~^ ERROR type parameters must be declared prior
diff --git a/src/test/ui/const-generics/defaults/simple-defaults.rs b/src/test/ui/const-generics/defaults/simple-defaults.rs
index c003cb2..bc01fe2 100644
--- a/src/test/ui/const-generics/defaults/simple-defaults.rs
+++ b/src/test/ui/const-generics/defaults/simple-defaults.rs
@@ -1,9 +1,6 @@
// run-pass
// Checks that type param defaults are allowed after const params.
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
#![allow(dead_code)]
struct FixedOutput<'a, const N: usize, T=u32> {
diff --git a/src/test/ui/const-generics/defaults/type-default-const-param-name.rs b/src/test/ui/const-generics/defaults/type-default-const-param-name.rs
index e68075e..8b35c58 100644
--- a/src/test/ui/const-generics/defaults/type-default-const-param-name.rs
+++ b/src/test/ui/const-generics/defaults/type-default-const-param-name.rs
@@ -1,8 +1,5 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
struct N;
diff --git a/src/test/ui/const-generics/defaults/wrong-order.full.stderr b/src/test/ui/const-generics/defaults/wrong-order.full.stderr
deleted file mode 100644
index eb0bcb2..0000000
--- a/src/test/ui/const-generics/defaults/wrong-order.full.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: generic parameters with a default must be trailing
- --> $DIR/wrong-order.rs:6:10
- |
-LL | struct A<T = u32, const N: usize> {
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/defaults/wrong-order.min.stderr b/src/test/ui/const-generics/defaults/wrong-order.min.stderr
deleted file mode 100644
index eb0bcb2..0000000
--- a/src/test/ui/const-generics/defaults/wrong-order.min.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: generic parameters with a default must be trailing
- --> $DIR/wrong-order.rs:6:10
- |
-LL | struct A<T = u32, const N: usize> {
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/defaults/wrong-order.rs b/src/test/ui/const-generics/defaults/wrong-order.rs
index 88e9e96..33564a4 100644
--- a/src/test/ui/const-generics/defaults/wrong-order.rs
+++ b/src/test/ui/const-generics/defaults/wrong-order.rs
@@ -1,7 +1,4 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features)]
struct A<T = u32, const N: usize> {
//~^ ERROR generic parameters with a default must be trailing
diff --git a/src/test/ui/const-generics/defaults/wrong-order.stderr b/src/test/ui/const-generics/defaults/wrong-order.stderr
new file mode 100644
index 0000000..47a2c6f
--- /dev/null
+++ b/src/test/ui/const-generics/defaults/wrong-order.stderr
@@ -0,0 +1,8 @@
+error: generic parameters with a default must be trailing
+ --> $DIR/wrong-order.rs:3:10
+ |
+LL | struct A<T = u32, const N: usize> {
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/derive-debug-array-wrapper.rs b/src/test/ui/const-generics/derive-debug-array-wrapper.rs
deleted file mode 100644
index ce1481d..0000000
--- a/src/test/ui/const-generics/derive-debug-array-wrapper.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Check that deriving debug on struct with const is permitted.
-// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-#[derive(Debug)]
-struct X<const N: usize> {
- a: [u32; N],
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/diagnostics.rs b/src/test/ui/const-generics/diagnostics.rs
deleted file mode 100644
index 1581af5..0000000
--- a/src/test/ui/const-generics/diagnostics.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-#![crate_type="lib"]
-#![feature(min_const_generics)]
-#![allow(incomplete_features)]
-
-struct A<const N: u8>;
-trait Foo {}
-impl Foo for A<N> {}
-//~^ ERROR cannot find type
-//~| unresolved item provided when a constant
-
-struct B<const N: u8>;
-impl<N> Foo for B<N> {}
-//~^ ERROR type provided when a constant
-
-struct C<const C: u8, const N: u8>;
-impl<const N: u8> Foo for C<N, T> {}
-//~^ ERROR cannot find type
-//~| unresolved item provided when a constant
diff --git a/src/test/ui/const-generics/diagnostics.stderr b/src/test/ui/const-generics/diagnostics.stderr
deleted file mode 100644
index 2e3132c..0000000
--- a/src/test/ui/const-generics/diagnostics.stderr
+++ /dev/null
@@ -1,73 +0,0 @@
-error[E0412]: cannot find type `N` in this scope
- --> $DIR/diagnostics.rs:7:16
- |
-LL | struct A<const N: u8>;
- | ---------------------- similarly named struct `A` defined here
-LL | trait Foo {}
-LL | impl Foo for A<N> {}
- | ^
- |
-help: a struct with a similar name exists
- |
-LL | impl Foo for A<A> {}
- | ^
-help: you might be missing a type parameter
- |
-LL | impl<N> Foo for A<N> {}
- | ^^^
-
-error[E0412]: cannot find type `T` in this scope
- --> $DIR/diagnostics.rs:16:32
- |
-LL | struct A<const N: u8>;
- | ---------------------- similarly named struct `A` defined here
-...
-LL | impl<const N: u8> Foo for C<N, T> {}
- | ^
- |
-help: a struct with a similar name exists
- |
-LL | impl<const N: u8> Foo for C<N, A> {}
- | ^
-help: you might be missing a type parameter
- |
-LL | impl<const N: u8, T> Foo for C<N, T> {}
- | ^^^
-
-error[E0747]: unresolved item provided when a constant was expected
- --> $DIR/diagnostics.rs:7:16
- |
-LL | impl Foo for A<N> {}
- | ^
- |
-help: if this generic argument was intended as a const parameter, surround it with braces
- |
-LL | impl Foo for A<{ N }> {}
- | ^ ^
-
-error[E0747]: type provided when a constant was expected
- --> $DIR/diagnostics.rs:12:19
- |
-LL | impl<N> Foo for B<N> {}
- | ^
- |
-help: consider changing this type parameter to be a `const` generic
- |
-LL | impl<const N: u8> Foo for B<N> {}
- | ^^^^^^^^^^^
-
-error[E0747]: unresolved item provided when a constant was expected
- --> $DIR/diagnostics.rs:16:32
- |
-LL | impl<const N: u8> Foo for C<N, T> {}
- | ^
- |
-help: if this generic argument was intended as a const parameter, surround it with braces
- |
-LL | impl<const N: u8> Foo for C<N, { T }> {}
- | ^ ^
-
-error: aborting due to 5 previous errors
-
-Some errors have detailed explanations: E0412, E0747.
-For more information about an error, try `rustc --explain E0412`.
diff --git a/src/test/ui/const-generics/different_byref.full.stderr b/src/test/ui/const-generics/different_byref.full.stderr
deleted file mode 100644
index d6b3232..0000000
--- a/src/test/ui/const-generics/different_byref.full.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/different_byref.rs:12:9
- |
-LL | x = Const::<{ [4] }> {};
- | ^^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize`
- |
- = note: expected type `[3_usize]`
- found type `[4_usize]`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/different_byref.min.stderr b/src/test/ui/const-generics/different_byref.min.stderr
deleted file mode 100644
index 93874fb..0000000
--- a/src/test/ui/const-generics/different_byref.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: `[usize; 1]` is forbidden as the type of a const generic parameter
- --> $DIR/different_byref.rs:7:23
- |
-LL | struct Const<const V: [usize; 1]> {}
- | ^^^^^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/different_byref.rs b/src/test/ui/const-generics/different_byref.rs
deleted file mode 100644
index 7977560..0000000
--- a/src/test/ui/const-generics/different_byref.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Check that different const types are different.
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-struct Const<const V: [usize; 1]> {}
-//[min]~^ ERROR `[usize; 1]` is forbidden
-
-fn main() {
- let mut x = Const::<{ [3] }> {};
- x = Const::<{ [4] }> {};
- //[full]~^ ERROR mismatched types
-}
diff --git a/src/test/ui/const-generics/different_byref_simple.full.stderr b/src/test/ui/const-generics/different_byref_simple.full.stderr
deleted file mode 100644
index 027e282..0000000
--- a/src/test/ui/const-generics/different_byref_simple.full.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/different_byref_simple.rs:11:9
- |
-LL | u = ConstUsize::<4> {};
- | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize`
- |
- = note: expected struct `ConstUsize<3_usize>`
- found struct `ConstUsize<4_usize>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/different_byref_simple.min.stderr b/src/test/ui/const-generics/different_byref_simple.min.stderr
deleted file mode 100644
index 027e282..0000000
--- a/src/test/ui/const-generics/different_byref_simple.min.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/different_byref_simple.rs:11:9
- |
-LL | u = ConstUsize::<4> {};
- | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize`
- |
- = note: expected struct `ConstUsize<3_usize>`
- found struct `ConstUsize<4_usize>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/different_byref_simple.rs b/src/test/ui/const-generics/different_byref_simple.rs
deleted file mode 100644
index b48189f..0000000
--- a/src/test/ui/const-generics/different_byref_simple.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-// Check that different const types are different.
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-struct ConstUsize<const V: usize> {}
-
-fn main() {
- let mut u = ConstUsize::<3> {};
- u = ConstUsize::<4> {};
- //~^ ERROR mismatched types
-}
diff --git a/src/test/ui/const-generics/different_generic_args.full.stderr b/src/test/ui/const-generics/different_generic_args.full.stderr
new file mode 100644
index 0000000..a2dcc03
--- /dev/null
+++ b/src/test/ui/const-generics/different_generic_args.full.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/different_generic_args.rs:11:9
+ |
+LL | u = ConstUsize::<4> {};
+ | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize`
+ |
+ = note: expected struct `ConstUsize<3_usize>`
+ found struct `ConstUsize<4_usize>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/different_generic_args.min.stderr b/src/test/ui/const-generics/different_generic_args.min.stderr
new file mode 100644
index 0000000..a2dcc03
--- /dev/null
+++ b/src/test/ui/const-generics/different_generic_args.min.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/different_generic_args.rs:11:9
+ |
+LL | u = ConstUsize::<4> {};
+ | ^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize`
+ |
+ = note: expected struct `ConstUsize<3_usize>`
+ found struct `ConstUsize<4_usize>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/different_generic_args.rs b/src/test/ui/const-generics/different_generic_args.rs
new file mode 100644
index 0000000..9ee0e07
--- /dev/null
+++ b/src/test/ui/const-generics/different_generic_args.rs
@@ -0,0 +1,13 @@
+// Check that types with different const arguments are different.
+// revisions: full min
+
+#![cfg_attr(full, feature(generic_const_exprs))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+struct ConstUsize<const V: usize> {}
+
+fn main() {
+ let mut u = ConstUsize::<3> {};
+ u = ConstUsize::<4> {};
+ //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/const-generics/different_generic_args_array.rs b/src/test/ui/const-generics/different_generic_args_array.rs
new file mode 100644
index 0000000..4d225df
--- /dev/null
+++ b/src/test/ui/const-generics/different_generic_args_array.rs
@@ -0,0 +1,11 @@
+// Check that different const types are different.
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
+
+struct Const<const V: [usize; 1]> {}
+
+fn main() {
+ let mut x = Const::<{ [3] }> {};
+ x = Const::<{ [4] }> {};
+ //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/const-generics/different_generic_args_array.stderr b/src/test/ui/const-generics/different_generic_args_array.stderr
new file mode 100644
index 0000000..c0709a9
--- /dev/null
+++ b/src/test/ui/const-generics/different_generic_args_array.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+ --> $DIR/different_generic_args_array.rs:9:9
+ |
+LL | x = Const::<{ [4] }> {};
+ | ^^^^^^^^^^^^^^^^^^^ expected `3_usize`, found `4_usize`
+ |
+ = note: expected struct `Const<[3_usize]>`
+ found struct `Const<[4_usize]>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs b/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs
index afef748..6c4ee1a 100644
--- a/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs
+++ b/src/test/ui/const-generics/dont-evaluate-array-len-on-err-1.rs
@@ -1,4 +1,4 @@
-#![feature(const_generics, const_evaluatable_checked)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
// This tests that during error handling for the "trait not implemented" error
diff --git a/src/test/ui/const-generics/dyn-supertraits.rs b/src/test/ui/const-generics/dyn-supertraits.rs
index 73ed235..3dee326 100644
--- a/src/test/ui/const-generics/dyn-supertraits.rs
+++ b/src/test/ui/const-generics/dyn-supertraits.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
trait Foo<const N: usize> {
fn myfun(&self) -> usize;
diff --git a/src/test/ui/const-generics/early/closing-args-token.rs b/src/test/ui/const-generics/early/closing-args-token.rs
new file mode 100644
index 0000000..cb4d629
--- /dev/null
+++ b/src/test/ui/const-generics/early/closing-args-token.rs
@@ -0,0 +1,26 @@
+struct S<const X: u32>;
+struct T<const X: bool>;
+
+fn bad_args_1() {
+ S::<5 + 2 >> 7>;
+ //~^ ERROR expressions must be enclosed in braces to be used as const generic arguments
+ //~| ERROR comparison operators cannot be chained
+}
+
+fn bad_args_2() {
+ S::<{ 5 + 2 } >> 7>;
+ //~^ ERROR comparison operators cannot be chained
+}
+
+fn bad_args_3() {
+ T::<0 >= 3>;
+ //~^ ERROR expected expression, found `;`
+}
+
+fn bad_args_4() {
+ let mut x = 0;
+ T::<x >>= 2 > 0>;
+ //~^ ERROR comparison operators cannot be chained
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/early/closing-args-token.stderr b/src/test/ui/const-generics/early/closing-args-token.stderr
new file mode 100644
index 0000000..58fff3a
--- /dev/null
+++ b/src/test/ui/const-generics/early/closing-args-token.stderr
@@ -0,0 +1,52 @@
+error: expressions must be enclosed in braces to be used as const generic arguments
+ --> $DIR/closing-args-token.rs:5:9
+ |
+LL | S::<5 + 2 >> 7>;
+ | ^^^^^
+ |
+help: enclose the `const` expression in braces
+ |
+LL | S::<{ 5 + 2 } >> 7>;
+ | + +
+
+error: comparison operators cannot be chained
+ --> $DIR/closing-args-token.rs:5:16
+ |
+LL | S::<5 + 2 >> 7>;
+ | ^ ^
+ |
+help: split the comparison into two
+ |
+LL | S::<5 + 2 >> 7 && 7>;
+ | ++++
+
+error: comparison operators cannot be chained
+ --> $DIR/closing-args-token.rs:11:20
+ |
+LL | S::<{ 5 + 2 } >> 7>;
+ | ^ ^
+ |
+help: split the comparison into two
+ |
+LL | S::<{ 5 + 2 } >> 7 && 7>;
+ | ++++
+
+error: expected expression, found `;`
+ --> $DIR/closing-args-token.rs:16:16
+ |
+LL | T::<0 >= 3>;
+ | ^ expected expression
+
+error: comparison operators cannot be chained
+ --> $DIR/closing-args-token.rs:22:12
+ |
+LL | T::<x >>= 2 > 0>;
+ | ^^ ^
+ |
+help: split the comparison into two
+ |
+LL | T::<x >>= 2 && 2 > 0>;
+ | ++++
+
+error: aborting due to 5 previous errors
+
diff --git a/src/test/ui/const-generics/early/const-expression-parameter.rs b/src/test/ui/const-generics/early/const-expression-parameter.rs
new file mode 100644
index 0000000..4cf7ba8
--- /dev/null
+++ b/src/test/ui/const-generics/early/const-expression-parameter.rs
@@ -0,0 +1,19 @@
+fn i32_identity<const X: i32>() -> i32 {
+ 5
+}
+
+fn foo_a() {
+ i32_identity::<-1>(); // ok
+}
+
+fn foo_b() {
+ i32_identity::<1 + 2>(); //~ ERROR expressions must be enclosed in braces
+}
+
+fn foo_c() {
+ i32_identity::< -1 >(); // ok
+}
+
+fn main() {
+ i32_identity::<5>(); // ok
+}
diff --git a/src/test/ui/const-generics/early/const-expression-parameter.stderr b/src/test/ui/const-generics/early/const-expression-parameter.stderr
new file mode 100644
index 0000000..4ce1be2
--- /dev/null
+++ b/src/test/ui/const-generics/early/const-expression-parameter.stderr
@@ -0,0 +1,13 @@
+error: expressions must be enclosed in braces to be used as const generic arguments
+ --> $DIR/const-expression-parameter.rs:10:20
+ |
+LL | i32_identity::<1 + 2>();
+ | ^^^^^
+ |
+help: enclose the `const` expression in braces
+ |
+LL | i32_identity::<{ 1 + 2 }>();
+ | + +
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/early/const-param-from-outer-fn.rs b/src/test/ui/const-generics/early/const-param-from-outer-fn.rs
new file mode 100644
index 0000000..c3b418e
--- /dev/null
+++ b/src/test/ui/const-generics/early/const-param-from-outer-fn.rs
@@ -0,0 +1,7 @@
+fn foo<const X: u32>() {
+ fn bar() -> u32 {
+ X //~ ERROR can't use generic parameters from outer function
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr
new file mode 100644
index 0000000..a9f9787
--- /dev/null
+++ b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr
@@ -0,0 +1,13 @@
+error[E0401]: can't use generic parameters from outer function
+ --> $DIR/const-param-from-outer-fn.rs:3:9
+ |
+LL | fn foo<const X: u32>() {
+ | - const parameter from outer function
+LL | fn bar() -> u32 {
+ | --- try adding a local generic parameter in this method instead
+LL | X
+ | ^ use of generic parameter from outer function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0401`.
diff --git a/src/test/ui/const-generics/early/const-param-hygiene.rs b/src/test/ui/const-generics/early/const-param-hygiene.rs
new file mode 100644
index 0000000..fd4e5b4
--- /dev/null
+++ b/src/test/ui/const-generics/early/const-param-hygiene.rs
@@ -0,0 +1,17 @@
+// run-pass
+
+macro_rules! bar {
+ ($($t:tt)*) => { impl<const N: usize> $($t)* };
+}
+
+macro_rules! baz {
+ ($t:tt) => { fn test<const M: usize>(&self) -> usize { $t } };
+}
+
+struct Foo<const N: usize>;
+
+bar!(Foo<N> { baz!{ M } });
+
+fn main() {
+ assert_eq!(Foo::<7>.test::<3>(), 3);
+}
diff --git a/src/test/ui/const-generics/const-param-shadowing.rs b/src/test/ui/const-generics/early/const-param-shadowing.rs
similarity index 100%
rename from src/test/ui/const-generics/const-param-shadowing.rs
rename to src/test/ui/const-generics/early/const-param-shadowing.rs
diff --git a/src/test/ui/const-generics/early/const-param-shadowing.stderr b/src/test/ui/const-generics/early/const-param-shadowing.stderr
new file mode 100644
index 0000000..625338b
--- /dev/null
+++ b/src/test/ui/const-generics/early/const-param-shadowing.stderr
@@ -0,0 +1,14 @@
+error[E0747]: type provided when a constant was expected
+ --> $DIR/const-param-shadowing.rs:3:34
+ |
+LL | fn test<const N: usize>() -> Foo<N> {
+ | ^
+ |
+help: if this generic argument was intended as a const parameter, surround it with braces
+ |
+LL | fn test<const N: usize>() -> Foo<{ N }> {
+ | + +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/const-generics/early/invalid-const-arguments.rs b/src/test/ui/const-generics/early/invalid-const-arguments.rs
new file mode 100644
index 0000000..6619c97
--- /dev/null
+++ b/src/test/ui/const-generics/early/invalid-const-arguments.rs
@@ -0,0 +1,16 @@
+#![crate_type="lib"]
+
+struct A<const N: u8>;
+trait Foo {}
+impl Foo for A<N> {}
+//~^ ERROR cannot find type
+//~| unresolved item provided when a constant
+
+struct B<const N: u8>;
+impl<N> Foo for B<N> {}
+//~^ ERROR type provided when a constant
+
+struct C<const C: u8, const N: u8>;
+impl<const N: u8> Foo for C<N, T> {}
+//~^ ERROR cannot find type
+//~| unresolved item provided when a constant
diff --git a/src/test/ui/const-generics/early/invalid-const-arguments.stderr b/src/test/ui/const-generics/early/invalid-const-arguments.stderr
new file mode 100644
index 0000000..b46e7e2
--- /dev/null
+++ b/src/test/ui/const-generics/early/invalid-const-arguments.stderr
@@ -0,0 +1,73 @@
+error[E0412]: cannot find type `N` in this scope
+ --> $DIR/invalid-const-arguments.rs:5:16
+ |
+LL | struct A<const N: u8>;
+ | ---------------------- similarly named struct `A` defined here
+LL | trait Foo {}
+LL | impl Foo for A<N> {}
+ | ^
+ |
+help: a struct with a similar name exists
+ |
+LL | impl Foo for A<A> {}
+ | ~
+help: you might be missing a type parameter
+ |
+LL | impl<N> Foo for A<N> {}
+ | +++
+
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/invalid-const-arguments.rs:14:32
+ |
+LL | struct A<const N: u8>;
+ | ---------------------- similarly named struct `A` defined here
+...
+LL | impl<const N: u8> Foo for C<N, T> {}
+ | ^
+ |
+help: a struct with a similar name exists
+ |
+LL | impl<const N: u8> Foo for C<N, A> {}
+ | ~
+help: you might be missing a type parameter
+ |
+LL | impl<const N: u8, T> Foo for C<N, T> {}
+ | +++
+
+error[E0747]: unresolved item provided when a constant was expected
+ --> $DIR/invalid-const-arguments.rs:5:16
+ |
+LL | impl Foo for A<N> {}
+ | ^
+ |
+help: if this generic argument was intended as a const parameter, surround it with braces
+ |
+LL | impl Foo for A<{ N }> {}
+ | + +
+
+error[E0747]: type provided when a constant was expected
+ --> $DIR/invalid-const-arguments.rs:10:19
+ |
+LL | impl<N> Foo for B<N> {}
+ | ^
+ |
+help: consider changing this type parameter to be a `const` generic
+ |
+LL | impl<const N: u8> Foo for B<N> {}
+ | ~~~~~~~~~~~
+
+error[E0747]: unresolved item provided when a constant was expected
+ --> $DIR/invalid-const-arguments.rs:14:32
+ |
+LL | impl<const N: u8> Foo for C<N, T> {}
+ | ^
+ |
+help: if this generic argument was intended as a const parameter, surround it with braces
+ |
+LL | impl<const N: u8> Foo for C<N, { T }> {}
+ | + +
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0412, E0747.
+For more information about an error, try `rustc --explain E0412`.
diff --git a/src/test/ui/const-generics/early/macro_rules-braces.rs b/src/test/ui/const-generics/early/macro_rules-braces.rs
new file mode 100644
index 0000000..0ae9146
--- /dev/null
+++ b/src/test/ui/const-generics/early/macro_rules-braces.rs
@@ -0,0 +1,73 @@
+mod m {
+ pub const P: usize = 0;
+}
+
+const Q: usize = 0;
+
+fn test<const N: usize>() {
+ struct Foo<const M: usize>;
+ macro_rules! foo {
+ ($x:expr) => {
+ [u8; $x]
+ }
+ }
+ macro_rules! bar {
+ ($x:expr) => {
+ [u8; { $x }]
+ }
+ }
+ macro_rules! baz {
+ ( $x:expr) => {
+ Foo<$x>
+ }
+ }
+ macro_rules! biz {
+ ($x:expr) => {
+ Foo<{ $x }>
+ };
+ }
+
+ let _: foo!(N);
+ let _: foo!({ N });
+ let _: foo!({{ N }}); //~ ERROR generic parameters may not
+ let _: foo!(Q);
+ let _: foo!(m::P);
+ let _: bar!(N);
+ let _: bar!({ N }); //~ ERROR generic parameters may not
+ let _: bar!(Q);
+ let _: bar!(m::P);
+ let _: baz!(N);
+ let _: baz!({ N });
+ let _: baz!({{ N }}); //~ ERROR generic parameters may not
+ let _: baz!(Q);
+ let _: baz!({ m::P });
+ let _: baz!(m::P); //~ ERROR expressions must be enclosed in braces
+ let _: biz!(N);
+ let _: biz!({ N }); //~ ERROR generic parameters may not
+ let _: biz!(Q);
+ let _: biz!(m::P);
+ let _: foo!(3);
+ let _: foo!({ 3 });
+ let _: foo!({{ 3 }});
+ let _: bar!(3);
+ let _: bar!({ 3 });
+ let _: baz!(3);
+ let _: baz!({ 3 });
+ let _: baz!({{ 3 }});
+ let _: biz!(3);
+ let _: biz!({ 3 });
+ let _: foo!(10 + 7);
+ let _: foo!({ 10 + 7 });
+ let _: foo!({{ 10 + 7 }});
+ let _: bar!(10 + 7);
+ let _: bar!({ 10 + 7 });
+ let _: baz!(10 + 7); //~ ERROR expressions must be enclosed in braces
+ let _: baz!({ 10 + 7 });
+ let _: baz!({{ 10 + 7 }});
+ let _: biz!(10 + 7);
+ let _: biz!({ 10 + 7 });
+}
+
+fn main() {
+ test::<3>();
+}
diff --git a/src/test/ui/const-generics/early/macro_rules-braces.stderr b/src/test/ui/const-generics/early/macro_rules-braces.stderr
new file mode 100644
index 0000000..49382db
--- /dev/null
+++ b/src/test/ui/const-generics/early/macro_rules-braces.stderr
@@ -0,0 +1,60 @@
+error: expressions must be enclosed in braces to be used as const generic arguments
+ --> $DIR/macro_rules-braces.rs:44:17
+ |
+LL | let _: baz!(m::P);
+ | ^^^^
+ |
+help: enclose the `const` expression in braces
+ |
+LL | let _: baz!({ m::P });
+ | + +
+
+error: expressions must be enclosed in braces to be used as const generic arguments
+ --> $DIR/macro_rules-braces.rs:64:17
+ |
+LL | let _: baz!(10 + 7);
+ | ^^^^^^
+ |
+help: enclose the `const` expression in braces
+ |
+LL | let _: baz!({ 10 + 7 });
+ | + +
+
+error: generic parameters may not be used in const operations
+ --> $DIR/macro_rules-braces.rs:32:20
+ |
+LL | let _: foo!({{ N }});
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/macro_rules-braces.rs:36:19
+ |
+LL | let _: bar!({ N });
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/macro_rules-braces.rs:41:20
+ |
+LL | let _: baz!({{ N }});
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/macro_rules-braces.rs:46:19
+ |
+LL | let _: biz!({ N });
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: aborting due to 6 previous errors
+
diff --git a/src/test/ui/const-generics/enum-variants.rs b/src/test/ui/const-generics/enum-variants.rs
new file mode 100644
index 0000000..5c6c4a8
--- /dev/null
+++ b/src/test/ui/const-generics/enum-variants.rs
@@ -0,0 +1,24 @@
+// check-pass
+enum Foo<const N: usize> {
+ Variant,
+ Variant2(),
+ Variant3{},
+}
+
+struct Bar<const N: usize>;
+struct Bar2<const N: usize>();
+struct Bar3<const N: usize> {}
+
+fn main() {
+ let _ = Foo::Variant::<1>;
+ let _ = Foo::Variant2::<1>();
+ let _ = Foo::Variant3::<1>{};
+
+ let _ = Foo::<1>::Variant;
+ let _ = Foo::<1>::Variant2();
+ let _ = Foo::<1>::Variant3{};
+
+ let _ = Bar::<1>;
+ let _ = Bar2::<1>();
+ let _ = Bar3::<1>{};
+}
diff --git a/src/test/ui/const-generics/exhaustive-value.full.stderr b/src/test/ui/const-generics/exhaustive-value.full.stderr
deleted file mode 100644
index 4e89e4a..0000000
--- a/src/test/ui/const-generics/exhaustive-value.full.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0277]: the trait bound `(): Foo<N>` is not satisfied
- --> $DIR/exhaustive-value.rs:266:5
- |
-LL | <() as Foo<N>>::test()
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Foo<N>` is not implemented for `()`
- |
- = help: the following implementations were found:
- <() as Foo<0_u8>>
- <() as Foo<100_u8>>
- <() as Foo<101_u8>>
- <() as Foo<102_u8>>
- and 252 others
-note: required by `Foo::test`
- --> $DIR/exhaustive-value.rs:6:5
- |
-LL | fn test() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/exhaustive-value.min.stderr b/src/test/ui/const-generics/exhaustive-value.min.stderr
deleted file mode 100644
index 4e89e4a..0000000
--- a/src/test/ui/const-generics/exhaustive-value.min.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0277]: the trait bound `(): Foo<N>` is not satisfied
- --> $DIR/exhaustive-value.rs:266:5
- |
-LL | <() as Foo<N>>::test()
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Foo<N>` is not implemented for `()`
- |
- = help: the following implementations were found:
- <() as Foo<0_u8>>
- <() as Foo<100_u8>>
- <() as Foo<101_u8>>
- <() as Foo<102_u8>>
- and 252 others
-note: required by `Foo::test`
- --> $DIR/exhaustive-value.rs:6:5
- |
-LL | fn test() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/exhaustive-value.rs b/src/test/ui/const-generics/exhaustive-value.rs
index 921f9a4..778d498 100644
--- a/src/test/ui/const-generics/exhaustive-value.rs
+++ b/src/test/ui/const-generics/exhaustive-value.rs
@@ -1,7 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
trait Foo<const N: u8> {
fn test() {}
}
diff --git a/src/test/ui/const-generics/exhaustive-value.stderr b/src/test/ui/const-generics/exhaustive-value.stderr
new file mode 100644
index 0000000..0c6aced
--- /dev/null
+++ b/src/test/ui/const-generics/exhaustive-value.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `(): Foo<N>` is not satisfied
+ --> $DIR/exhaustive-value.rs:262:5
+ |
+LL | <() as Foo<N>>::test()
+ | ^^^^^^^^^^^^^^^^^^^^ the trait `Foo<N>` is not implemented for `()`
+ |
+ = help: the following implementations were found:
+ <() as Foo<0_u8>>
+ <() as Foo<100_u8>>
+ <() as Foo<101_u8>>
+ <() as Foo<102_u8>>
+ and 252 others
+note: required by `Foo::test`
+ --> $DIR/exhaustive-value.rs:2:5
+ |
+LL | fn test() {}
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/fn-const-param-call.rs b/src/test/ui/const-generics/fn-const-param-call.rs
index 70a104e..dc516fb 100644
--- a/src/test/ui/const-generics/fn-const-param-call.rs
+++ b/src/test/ui/const-generics/fn-const-param-call.rs
@@ -1,7 +1,7 @@
// Check that functions cannot be used as const parameters.
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
fn function() -> u32 {
diff --git a/src/test/ui/const-generics/fn-const-param-infer.rs b/src/test/ui/const-generics/fn-const-param-infer.rs
index d090479..22f5f52 100644
--- a/src/test/ui/const-generics/fn-const-param-infer.rs
+++ b/src/test/ui/const-generics/fn-const-param-infer.rs
@@ -1,6 +1,6 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Checked<const F: fn(usize) -> bool>;
diff --git a/src/test/ui/const-generics/fn-taking-const-generic-array.rs b/src/test/ui/const-generics/fn-taking-const-generic-array.rs
deleted file mode 100644
index 58c1b95..0000000
--- a/src/test/ui/const-generics/fn-taking-const-generic-array.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-use std::fmt::Display;
-
-fn print_slice<T: Display, const N: usize>(slice: &[T; N]) {
- for x in slice.iter() {
- println!("{}", x);
- }
-}
-
-fn main() {
- print_slice(&[1, 2, 3]);
-}
diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr
deleted file mode 100644
index 5c0f175..0000000
--- a/src/test/ui/const-generics/forbid-non-structural_match-types.full.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
- --> $DIR/forbid-non-structural_match-types.rs:14:19
- |
-LL | struct D<const X: C>;
- | ^ `C` doesn't derive both `PartialEq` and `Eq`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0741`.
diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr
deleted file mode 100644
index 80eac99..0000000
--- a/src/test/ui/const-generics/forbid-non-structural_match-types.min.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error: `A` is forbidden as the type of a const generic parameter
- --> $DIR/forbid-non-structural_match-types.rs:9:19
- |
-LL | struct B<const X: A>; // ok
- | ^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: `C` is forbidden as the type of a const generic parameter
- --> $DIR/forbid-non-structural_match-types.rs:14:19
- |
-LL | struct D<const X: C>;
- | ^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
- --> $DIR/forbid-non-structural_match-types.rs:14:19
- |
-LL | struct D<const X: C>;
- | ^ `C` doesn't derive both `PartialEq` and `Eq`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0741`.
diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.rs b/src/test/ui/const-generics/forbid-non-structural_match-types.rs
index 0fdb3ed..6ae9d5c 100644
--- a/src/test/ui/const-generics/forbid-non-structural_match-types.rs
+++ b/src/test/ui/const-generics/forbid-non-structural_match-types.rs
@@ -1,17 +1,13 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
#[derive(PartialEq, Eq)]
struct A;
struct B<const X: A>; // ok
-//[min]~^ ERROR `A` is forbidden
struct C;
struct D<const X: C>; //~ ERROR `C` must be annotated with `#[derive(PartialEq, Eq)]`
-//[min]~^ ERROR `C` is forbidden
fn main() {}
diff --git a/src/test/ui/const-generics/forbid-non-structural_match-types.stderr b/src/test/ui/const-generics/forbid-non-structural_match-types.stderr
new file mode 100644
index 0000000..81b9bdf
--- /dev/null
+++ b/src/test/ui/const-generics/forbid-non-structural_match-types.stderr
@@ -0,0 +1,9 @@
+error[E0741]: `C` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
+ --> $DIR/forbid-non-structural_match-types.rs:11:19
+ |
+LL | struct D<const X: C>;
+ | ^ `C` doesn't derive both `PartialEq` and `Eq`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0741`.
diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr
deleted file mode 100644
index b827e48..0000000
--- a/src/test/ui/const-generics/foreign-item-const-parameter.full.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0044]: foreign items may not have const parameters
- --> $DIR/foreign-item-const-parameter.rs:7:5
- |
-LL | fn foo<const X: usize>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't have const parameters
- |
- = help: replace the const parameters with concrete consts
-
-error[E0044]: foreign items may not have type or const parameters
- --> $DIR/foreign-item-const-parameter.rs:9:5
- |
-LL | fn bar<T, const X: usize>(_: T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't have type or const parameters
- |
- = help: replace the type or const parameters with concrete types or consts
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0044`.
diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr
deleted file mode 100644
index b827e48..0000000
--- a/src/test/ui/const-generics/foreign-item-const-parameter.min.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0044]: foreign items may not have const parameters
- --> $DIR/foreign-item-const-parameter.rs:7:5
- |
-LL | fn foo<const X: usize>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't have const parameters
- |
- = help: replace the const parameters with concrete consts
-
-error[E0044]: foreign items may not have type or const parameters
- --> $DIR/foreign-item-const-parameter.rs:9:5
- |
-LL | fn bar<T, const X: usize>(_: T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't have type or const parameters
- |
- = help: replace the type or const parameters with concrete types or consts
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0044`.
diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.rs b/src/test/ui/const-generics/foreign-item-const-parameter.rs
index 83caa89..4fe377b 100644
--- a/src/test/ui/const-generics/foreign-item-const-parameter.rs
+++ b/src/test/ui/const-generics/foreign-item-const-parameter.rs
@@ -1,8 +1,3 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
extern "C" {
fn foo<const X: usize>(); //~ ERROR foreign items may not have const parameters
diff --git a/src/test/ui/const-generics/foreign-item-const-parameter.stderr b/src/test/ui/const-generics/foreign-item-const-parameter.stderr
new file mode 100644
index 0000000..b02db87
--- /dev/null
+++ b/src/test/ui/const-generics/foreign-item-const-parameter.stderr
@@ -0,0 +1,19 @@
+error[E0044]: foreign items may not have const parameters
+ --> $DIR/foreign-item-const-parameter.rs:2:5
+ |
+LL | fn foo<const X: usize>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't have const parameters
+ |
+ = help: replace the const parameters with concrete consts
+
+error[E0044]: foreign items may not have type or const parameters
+ --> $DIR/foreign-item-const-parameter.rs:4:5
+ |
+LL | fn bar<T, const X: usize>(_: T);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't have type or const parameters
+ |
+ = help: replace the type or const parameters with concrete types or consts
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0044`.
diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr
deleted file mode 100644
index 2d19a58..0000000
--- a/src/test/ui/const-generics/generic-function-call-in-array-length.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/generic-function-call-in-array-length.rs:8:29
- |
-LL | fn bar<const N: usize>() -> [u32; foo(N)] {
- | ^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr b/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr
deleted file mode 100644
index d7a3f04..0000000
--- a/src/test/ui/const-generics/generic-function-call-in-array-length.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/generic-function-call-in-array-length.rs:8:39
- |
-LL | fn bar<const N: usize>() -> [u32; foo(N)] {
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/generic-function-call-in-array-length.rs:11:13
- |
-LL | [0; foo(N)]
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/generic-function-call-in-array-length.rs b/src/test/ui/const-generics/generic-function-call-in-array-length.rs
deleted file mode 100644
index a6d2bbd..0000000
--- a/src/test/ui/const-generics/generic-function-call-in-array-length.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// revisions: full min
-
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
-const fn foo(n: usize) -> usize { n * 2 }
-
-fn bar<const N: usize>() -> [u32; foo(N)] {
- //[min]~^ ERROR generic parameters may not be used in const operations
- //[full]~^^ ERROR constant expression depends on a generic parameter
- [0; foo(N)]
- //[min]~^ ERROR generic parameters may not be used in const operations
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/generic-param-mismatch.full.stderr b/src/test/ui/const-generics/generic-param-mismatch.full.stderr
deleted file mode 100644
index aff8780..0000000
--- a/src/test/ui/const-generics/generic-param-mismatch.full.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/generic-param-mismatch.rs:6:5
- |
-LL | fn test<const N: usize, const M: usize>() -> [u8; M] {
- | ------- expected `[u8; M]` because of return type
-LL | [0; N]
- | ^^^^^^ expected `M`, found `N`
- |
- = note: expected array `[u8; M]`
- found array `[u8; N]`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/generic-param-mismatch.min.stderr b/src/test/ui/const-generics/generic-param-mismatch.min.stderr
deleted file mode 100644
index aff8780..0000000
--- a/src/test/ui/const-generics/generic-param-mismatch.min.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/generic-param-mismatch.rs:6:5
- |
-LL | fn test<const N: usize, const M: usize>() -> [u8; M] {
- | ------- expected `[u8; M]` because of return type
-LL | [0; N]
- | ^^^^^^ expected `M`, found `N`
- |
- = note: expected array `[u8; M]`
- found array `[u8; N]`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/generic-param-mismatch.rs b/src/test/ui/const-generics/generic-param-mismatch.rs
index 22fffe4..2e201e5 100644
--- a/src/test/ui/const-generics/generic-param-mismatch.rs
+++ b/src/test/ui/const-generics/generic-param-mismatch.rs
@@ -1,7 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
fn test<const N: usize, const M: usize>() -> [u8; M] {
[0; N] //~ ERROR mismatched types
}
diff --git a/src/test/ui/const-generics/generic-param-mismatch.stderr b/src/test/ui/const-generics/generic-param-mismatch.stderr
new file mode 100644
index 0000000..d0776d4
--- /dev/null
+++ b/src/test/ui/const-generics/generic-param-mismatch.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/generic-param-mismatch.rs:2:5
+ |
+LL | fn test<const N: usize, const M: usize>() -> [u8; M] {
+ | ------- expected `[u8; M]` because of return type
+LL | [0; N]
+ | ^^^^^^ expected `M`, found `N`
+ |
+ = note: expected array `[u8; M]`
+ found array `[u8; N]`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr
deleted file mode 100644
index c13882e..0000000
--- a/src/test/ui/const-generics/generic-sum-in-array-length.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/generic-sum-in-array-length.rs:6:45
- |
-LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
- | ^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr b/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr
deleted file mode 100644
index cff5a62..0000000
--- a/src/test/ui/const-generics/generic-sum-in-array-length.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/generic-sum-in-array-length.rs:6:53
- |
-LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
- | ^ cannot perform const operation using `A`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `A`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/generic-sum-in-array-length.rs:6:57
- |
-LL | fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
- | ^ cannot perform const operation using `B`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `B`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/generic-sum-in-array-length.rs b/src/test/ui/const-generics/generic-sum-in-array-length.rs
deleted file mode 100644
index 7ee0394..0000000
--- a/src/test/ui/const-generics/generic-sum-in-array-length.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// revisions: full min
-
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
-fn foo<const A: usize, const B: usize>(bar: [usize; A + B]) {}
-//[min]~^ ERROR generic parameters may not be used in const operations
-//[min]~| ERROR generic parameters may not be used in const operations
-//[full]~^^^ ERROR constant expression depends on a generic parameter
-
-fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs
new file mode 100644
index 0000000..06f00de
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-1.rs
@@ -0,0 +1,18 @@
+// check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Foo<const N: u8>([u8; N as usize])
+where
+ [(); N as usize]:;
+
+struct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 2) as usize]:;
+
+// unifying with subtrees
+struct Evaluatable<const N: u16>;
+fn foo<const N: u8>() where Evaluatable<{N as usize as u16 }>: {
+ let _ = Foo::<N>([1; N as usize]);
+}
+
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs
new file mode 100644
index 0000000..3b5b87b
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs
@@ -0,0 +1,20 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Evaluatable<const N: u128> {}
+
+struct Foo<const N: u8>([u8; N as usize])
+//~^ Error: unconstrained generic constant
+//~| help: try adding a `where` bound using this expression: `where [(); N as usize]:`
+where
+ Evaluatable<{N as u128}>:;
+
+struct Foo2<const N: u8>(Evaluatable::<{N as u128}>) where Evaluatable<{N as usize as u128 }>:;
+//~^ Error: unconstrained generic constant
+//~| help: try adding a `where` bound using this expression: `where [(); {N as u128}]:`
+
+struct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 1) as usize]:;
+//~^ Error: unconstrained generic constant
+//~| help: try adding a `where` bound using this expression: `where [(); (N + 2) as usize]:`
+
+fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/abstract-const-as-cast-2.stderr
rename to src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs
new file mode 100644
index 0000000..7561ae2
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.rs
@@ -0,0 +1,47 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Trait {}
+pub struct EvaluatableU128<const N: u128>;
+
+struct HasCastInTraitImpl<const N: usize, const M: u128>;
+impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
+
+pub fn use_trait_impl<const N: usize>()
+where
+ [(); { N + 1}]:,
+ EvaluatableU128<{N as u128}>:, {
+ fn assert_impl<T: Trait>() {}
+
+ // errors are bad but seems to be pre-existing issue #86198
+ assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
+ //~^ Error: mismatched types
+ //~^^ Error: unconstrained generic constant
+ assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
+ //~^ Error: mismatched types
+ //~^^ Error: unconstrained generic constant
+ assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
+ //~^ Error: mismatched types
+ assert_impl::<HasCastInTraitImpl<14, 13>>();
+ //~^ Error: mismatched types
+}
+pub fn use_trait_impl_2<const N: usize>()
+where
+ [(); { N + 1}]:,
+ EvaluatableU128<{N as _}>:, {
+ fn assert_impl<T: Trait>() {}
+
+ // errors are bad but seems to be pre-existing issue #86198
+ assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
+ //~^ Error: mismatched types
+ //~^^ Error: unconstrained generic constant
+ assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
+ //~^ Error: mismatched types
+ //~^^ Error: unconstrained generic constant
+ assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
+ //~^ Error: mismatched types
+ assert_impl::<HasCastInTraitImpl<14, 13>>();
+ //~^ Error: mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
new file mode 100644
index 0000000..f235eb4
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
@@ -0,0 +1,147 @@
+error: unconstrained generic constant
+ --> $DIR/abstract-const-as-cast-3.rs:17:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
+note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>`
+ --> $DIR/abstract-const-as-cast-3.rs:8:22
+ |
+LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
+ | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `use_trait_impl::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:14:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:17:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }`
+ |
+ = note: expected type `{ N as u128 }`
+ found type `{ O as u128 }`
+
+error: unconstrained generic constant
+ --> $DIR/abstract-const-as-cast-3.rs:20:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
+note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>`
+ --> $DIR/abstract-const-as-cast-3.rs:8:22
+ |
+LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
+ | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `use_trait_impl::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:14:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:20:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }`
+ |
+ = note: expected type `{ N as _ }`
+ found type `{ O as u128 }`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:23:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12_u128`, found `13_u128`
+ |
+ = note: expected type `12_u128`
+ found type `13_u128`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:25:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<14, 13>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13_u128`, found `14_u128`
+ |
+ = note: expected type `13_u128`
+ found type `14_u128`
+
+error: unconstrained generic constant
+ --> $DIR/abstract-const-as-cast-3.rs:35:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
+note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>`
+ --> $DIR/abstract-const-as-cast-3.rs:8:22
+ |
+LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
+ | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `use_trait_impl_2::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:32:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:35:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }`
+ |
+ = note: expected type `{ N as u128 }`
+ found type `{ O as u128 }`
+
+error: unconstrained generic constant
+ --> $DIR/abstract-const-as-cast-3.rs:38:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
+note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>`
+ --> $DIR/abstract-const-as-cast-3.rs:8:22
+ |
+LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
+ | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: required by a bound in `use_trait_impl_2::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:32:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:38:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }`
+ |
+ = note: expected type `{ N as _ }`
+ found type `{ O as u128 }`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:41:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12_u128`, found `13_u128`
+ |
+ = note: expected type `12_u128`
+ found type `13_u128`
+
+error[E0308]: mismatched types
+ --> $DIR/abstract-const-as-cast-3.rs:43:5
+ |
+LL | assert_impl::<HasCastInTraitImpl<14, 13>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13_u128`, found `14_u128`
+ |
+ = note: expected type `13_u128`
+ found type `14_u128`
+
+error: aborting due to 12 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs
new file mode 100644
index 0000000..184263f
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-4.rs
@@ -0,0 +1,29 @@
+// check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Trait {}
+pub struct EvaluatableU128<const N: u128>;
+
+struct HasCastInTraitImpl<const N: usize, const M: u128>;
+impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
+
+pub fn use_trait_impl<const N: usize>() where EvaluatableU128<{N as u128}>:, {
+ fn assert_impl<T: Trait>() {}
+
+ assert_impl::<HasCastInTraitImpl<N, { N as u128 }>>();
+ assert_impl::<HasCastInTraitImpl<N, { N as _ }>>();
+ assert_impl::<HasCastInTraitImpl<12, { 12 as u128 }>>();
+ assert_impl::<HasCastInTraitImpl<13, 13>>();
+}
+pub fn use_trait_impl_2<const N: usize>() where EvaluatableU128<{N as _}>:, {
+ fn assert_impl<T: Trait>() {}
+
+ assert_impl::<HasCastInTraitImpl<N, { N as u128 }>>();
+ assert_impl::<HasCastInTraitImpl<N, { N as _ }>>();
+ assert_impl::<HasCastInTraitImpl<12, { 12 as u128 }>>();
+ assert_impl::<HasCastInTraitImpl<13, 13>>();
+}
+
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr
new file mode 100644
index 0000000..deb6f3b
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.full.stderr
@@ -0,0 +1,18 @@
+error: unconstrained generic constant
+ --> $DIR/array-size-in-generic-struct-param.rs:8:38
+ |
+LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
+ | ^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); 0 + N]:`
+
+error: overly complex generic constant
+ --> $DIR/array-size-in-generic-struct-param.rs:19:15
+ |
+LL | arr: [u8; CFG.arr_size],
+ | ^^^^^^^^^^^^ unsupported projection
+ |
+ = help: consider moving this anonymous constant into a `const` function
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
new file mode 100644
index 0000000..18e9135
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.min.stderr
@@ -0,0 +1,29 @@
+error: generic parameters may not be used in const operations
+ --> $DIR/array-size-in-generic-struct-param.rs:8:48
+ |
+LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/array-size-in-generic-struct-param.rs:19:15
+ |
+LL | arr: [u8; CFG.arr_size],
+ | ^^^ cannot perform const operation using `CFG`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `CFG`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: `Config` is forbidden as the type of a const generic parameter
+ --> $DIR/array-size-in-generic-struct-param.rs:17:21
+ |
+LL | struct B<const CFG: Config> {
+ | ^^^^^^
+ |
+ = note: the only supported types are integers, `bool` and `char`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs
new file mode 100644
index 0000000..7d3fe41
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/array-size-in-generic-struct-param.rs
@@ -0,0 +1,29 @@
+// Tests that array sizes that depend on const-params are checked using `ConstEvaluatable`.
+// revisions: full min
+
+#![cfg_attr(full, feature(generic_const_exprs, adt_const_params))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+#[allow(dead_code)]
+struct ArithArrayLen<const N: usize>([u32; 0 + N]);
+//[full]~^ ERROR unconstrained generic constant
+//[min]~^^ ERROR generic parameters may not be used in const operations
+
+#[derive(PartialEq, Eq)]
+struct Config {
+ arr_size: usize,
+}
+
+struct B<const CFG: Config> {
+ //[min]~^ ERROR `Config` is forbidden
+ arr: [u8; CFG.arr_size],
+ //[full]~^ ERROR overly complex generic constant
+ //[min]~^^ ERROR generic parameters may not be used in const operations
+}
+
+const C: Config = Config { arr_size: 5 };
+
+fn main() {
+ let b = B::<C> { arr: [1, 2, 3, 4, 5] };
+ assert_eq!(b.arr.len(), 5);
+}
diff --git a/src/test/ui/const_evaluatable/associated-const.rs b/src/test/ui/const-generics/generic_const_exprs/associated-const.rs
similarity index 100%
rename from src/test/ui/const_evaluatable/associated-const.rs
rename to src/test/ui/const-generics/generic_const_exprs/associated-const.rs
diff --git a/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs b/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs
new file mode 100644
index 0000000..4d89f18
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/associated-consts.rs
@@ -0,0 +1,31 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+pub trait BlockCipher {
+ const BLOCK_SIZE: usize;
+}
+
+struct FooCipher;
+impl BlockCipher for FooCipher {
+ const BLOCK_SIZE: usize = 64;
+}
+
+struct BarCipher;
+impl BlockCipher for BarCipher {
+ const BLOCK_SIZE: usize = 32;
+}
+
+pub struct Block<C>(C);
+
+pub fn test<C: BlockCipher, const M: usize>()
+where
+ [u8; M - C::BLOCK_SIZE]: Sized,
+{
+ let _ = [0; M - C::BLOCK_SIZE];
+}
+
+fn main() {
+ test::<FooCipher, 128>();
+ test::<BarCipher, 64>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs b/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs
new file mode 100644
index 0000000..15d618c
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/auxiliary/const_evaluatable_lib.rs
@@ -0,0 +1,9 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
+where
+ [u8; std::mem::size_of::<T>() - 1]: Sized,
+{
+ [0; std::mem::size_of::<T>() - 1]
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/closures.rs b/src/test/ui/const-generics/generic_const_exprs/closures.rs
new file mode 100644
index 0000000..847843f
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/closures.rs
@@ -0,0 +1,6 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
+//~^ ERROR overly complex generic constant
+
+fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/closures.stderr b/src/test/ui/const-generics/generic_const_exprs/closures.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/closures.stderr
rename to src/test/ui/const-generics/generic_const_exprs/closures.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs b/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs
new file mode 100644
index 0000000..dfc69e0
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/cross_crate.rs
@@ -0,0 +1,15 @@
+// aux-build:const_evaluatable_lib.rs
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+extern crate const_evaluatable_lib;
+
+fn user<T>() where [u8; std::mem::size_of::<T>() - 1]: Sized {
+ assert_eq!(const_evaluatable_lib::test1::<T>(), [0; std::mem::size_of::<T>() - 1]);
+}
+
+fn main() {
+ assert_eq!(const_evaluatable_lib::test1::<u32>(), [0; 3]);
+ user::<u32>();
+ user::<u64>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs
new file mode 100644
index 0000000..b08fffd
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.rs
@@ -0,0 +1,14 @@
+// aux-build:const_evaluatable_lib.rs
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+extern crate const_evaluatable_lib;
+
+fn user<T>() {
+ let _ = const_evaluatable_lib::test1::<T>();
+ //~^ ERROR unconstrained generic constant
+ //~| ERROR unconstrained generic constant
+ //~| ERROR unconstrained generic constant
+ //~| ERROR unconstrained generic constant
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr
new file mode 100644
index 0000000..7b4d46b
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr
@@ -0,0 +1,54 @@
+error: unconstrained generic constant
+ --> $DIR/cross_crate_predicate.rs:7:13
+ |
+LL | let _ = const_evaluatable_lib::test1::<T>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
+note: required by a bound in `test1`
+ --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10
+ |
+LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1`
+
+error: unconstrained generic constant
+ --> $DIR/cross_crate_predicate.rs:7:13
+ |
+LL | let _ = const_evaluatable_lib::test1::<T>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
+note: required by a bound in `test1`
+ --> $DIR/auxiliary/const_evaluatable_lib.rs:4:27
+ |
+LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1`
+
+error: unconstrained generic constant
+ --> $DIR/cross_crate_predicate.rs:7:13
+ |
+LL | let _ = const_evaluatable_lib::test1::<T>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
+note: required by a bound in `test1`
+ --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10
+ |
+LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1`
+
+error: unconstrained generic constant
+ --> $DIR/cross_crate_predicate.rs:7:13
+ |
+LL | let _ = const_evaluatable_lib::test1::<T>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<T>() - 1]:`
+note: required by a bound in `test1`
+ --> $DIR/auxiliary/const_evaluatable_lib.rs:4:27
+ |
+LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1`
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/const-generics/generic_const_exprs/different-fn.rs b/src/test/ui/const-generics/generic_const_exprs/different-fn.rs
new file mode 100644
index 0000000..e8bc703
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/different-fn.rs
@@ -0,0 +1,17 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+use std::mem::size_of;
+use std::marker::PhantomData;
+
+struct Foo<T>(PhantomData<T>);
+
+fn test<T>() -> [u8; size_of::<T>()] {
+ [0; size_of::<Foo<T>>()]
+ //~^ ERROR unconstrained generic constant
+ //~| ERROR mismatched types
+}
+
+fn main() {
+ test::<u32>();
+}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/different-fn.stderr b/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/different-fn.stderr
rename to src/test/ui/const-generics/generic_const_exprs/different-fn.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/division.rs b/src/test/ui/const-generics/generic_const_exprs/division.rs
new file mode 100644
index 0000000..098fa9e
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/division.rs
@@ -0,0 +1,11 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn with_bound<const N: usize>() where [u8; N / 2]: Sized {
+ let _: [u8; N / 2] = [0; N / 2];
+}
+
+fn main() {
+ with_bound::<4>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs b/src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs
new file mode 100644
index 0000000..3543960
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/dont-eagerly-error-in-is-const-evaluatable.rs
@@ -0,0 +1,16 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// This test is a repro for #82279. It checks that we don't error
+// when calling is_const_evaluatable on `std::mem::size_of::<T>()`
+// when looking for candidates that may prove `T: Foo` in `foo`
+
+trait Foo {}
+
+#[allow(dead_code)]
+fn foo<T: Foo>() {}
+
+impl<T> Foo for T where [(); std::mem::size_of::<T>()]: {}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs b/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs
new file mode 100644
index 0000000..077f77a
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/drop_impl.rs
@@ -0,0 +1,16 @@
+//check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Foo<const N: usize>
+where
+ [(); N + 1]: ;
+
+impl<const N: usize> Drop for Foo<N>
+where
+ [(); N + 1]: ,
+{
+ fn drop(&mut self) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs b/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs
new file mode 100644
index 0000000..e411115
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/elaborate-trait-pred.rs
@@ -0,0 +1,24 @@
+// run-pass
+// Test that we use the elaborated predicates from traits
+// to satisfy const evaluatable predicates.
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+use std::mem::size_of;
+
+trait Foo: Sized
+where
+ [(); size_of::<Self>()]: Sized,
+{
+}
+
+impl Foo for u64 {}
+impl Foo for u32 {}
+
+fn foo<T: Foo>() -> [u8; size_of::<T>()] {
+ [0; size_of::<T>()]
+}
+
+fn main() {
+ assert_eq!(foo::<u32>(), [0; 4]);
+ assert_eq!(foo::<u64>(), [0; 8]);
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs
new file mode 100644
index 0000000..80d0662
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.rs
@@ -0,0 +1,31 @@
+#![crate_type = "lib"]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+pub struct Const<const U: u8>;
+
+pub trait Trait {
+ type AssocTy;
+ fn assoc_fn() -> Self::AssocTy;
+}
+
+impl<const U: u8> Trait for Const<U>
+//~^ WARN private type
+//~| WARN this was previously
+//~| WARN private type
+//~| WARN this was previously
+
+where
+ Const<{ my_const_fn(U) }>: ,
+{
+ type AssocTy = Const<{ my_const_fn(U) }>;
+ //~^ ERROR private type
+ fn assoc_fn() -> Self::AssocTy {
+ Const
+ }
+}
+
+const fn my_const_fn(val: u8) -> u8 {
+ // body of this function doesn't matter
+ val
+}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.stderr b/src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/eval-privacy.stderr
rename to src/test/ui/const-generics/generic_const_exprs/eval-privacy.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs b/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs
new file mode 100644
index 0000000..340e35e
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/evaluated-to-ambig.rs
@@ -0,0 +1,22 @@
+// check-pass
+
+// We previously always returned ambiguity when equating generic consts, even if they
+// only contain generic parameters. This is incorrect as trying to unify `N > 1` with `M > 1`
+// should fail.
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+enum Assert<const COND: bool> {}
+trait IsTrue {}
+impl IsTrue for Assert<true> {}
+
+struct Foo<const N: usize, const M: usize>;
+trait Bar<const N: usize, const M: usize> {}
+impl<const N: usize, const M: usize> Bar<N, M> for Foo<N, M>
+where
+ Assert<{ N > 1 }>: IsTrue,
+ Assert<{ M > 1 }>: IsTrue,
+{
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs
new file mode 100644
index 0000000..10ab2fd
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.rs
@@ -0,0 +1,11 @@
+type Arr<const N: usize> = [u8; N - 1];
+//~^ ERROR generic parameters may not be used in const operations
+
+fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
+ Default::default()
+}
+
+fn main() {
+ let x = test::<33>();
+ assert_eq!(x, [0; 32]);
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr
new file mode 100644
index 0000000..2d60eba
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/feature-gate-generic_const_exprs.stderr
@@ -0,0 +1,11 @@
+error: generic parameters may not be used in const operations
+ --> $DIR/feature-gate-generic_const_exprs.rs:1:33
+ |
+LL | type Arr<const N: usize> = [u8; N - 1];
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/generic_const_exprs/fn_call.rs b/src/test/ui/const-generics/generic_const_exprs/fn_call.rs
new file mode 100644
index 0000000..cbe4277
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/fn_call.rs
@@ -0,0 +1,30 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+const fn test_me<T>(a: usize, b: usize) -> usize {
+ if a < b {
+ std::mem::size_of::<T>()
+ } else {
+ usize::MAX
+ }
+}
+
+fn test_simple<T>() -> [u8; std::mem::size_of::<T>()]
+where
+ [u8; std::mem::size_of::<T>()]: Sized,
+{
+ [0; std::mem::size_of::<T>()]
+}
+
+fn test_with_args<T, const N: usize>() -> [u8; test_me::<T>(N, N + 1) + N]
+where
+ [u8; test_me::<T>(N, N + 1) + N]: Sized,
+{
+ [0; test_me::<T>(N, N + 1) + N]
+}
+
+fn main() {
+ assert_eq!([0; 8], test_simple::<u64>());
+ assert_eq!([0; 12], test_with_args::<u64, 4>());
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs
new file mode 100644
index 0000000..9095314
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.rs
@@ -0,0 +1,11 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn test<const N: usize>() -> [u8; N - 1] {
+ //~^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed
+ todo!()
+}
+
+fn main() {
+ test::<0>();
+}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr b/src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/from-sig-fail.stderr
rename to src/test/ui/const-generics/generic_const_exprs/from-sig-fail.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/from-sig.rs b/src/test/ui/const-generics/generic_const_exprs/from-sig.rs
new file mode 100644
index 0000000..28de4f8
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/from-sig.rs
@@ -0,0 +1,14 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Foo<const B: bool>;
+
+fn test<const N: usize>() -> Foo<{ N > 10 }> {
+ Foo
+}
+
+fn main() {
+ let _: Foo<true> = test::<12>();
+ let _: Foo<false> = test::<9>();
+}
diff --git a/src/test/ui/const_evaluatable/function-call.rs b/src/test/ui/const-generics/generic_const_exprs/function-call.rs
similarity index 100%
rename from src/test/ui/const_evaluatable/function-call.rs
rename to src/test/ui/const-generics/generic_const_exprs/function-call.rs
diff --git a/src/test/ui/const_evaluatable/function-call.stderr b/src/test/ui/const-generics/generic_const_exprs/function-call.stderr
similarity index 100%
rename from src/test/ui/const_evaluatable/function-call.stderr
rename to src/test/ui/const-generics/generic_const_exprs/function-call.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs b/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs
new file mode 100644
index 0000000..7120d6e
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/impl-bounds.rs
@@ -0,0 +1,25 @@
+// check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+use std::mem::size_of;
+
+struct Foo<T, const N: usize>(T);
+
+impl<T> Foo<T, { size_of::<T>() }> {
+ fn test() {
+ let _: [u8; std::mem::size_of::<T>()];
+ }
+}
+
+trait Bar<const N: usize> {
+ fn test_me();
+}
+
+impl<T> Bar<{ size_of::<T>() }> for Foo<T, 3> {
+ fn test_me() {
+ let _: [u8; std::mem::size_of::<T>()];
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs b/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs
new file mode 100644
index 0000000..b8058c2
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/infer-too-generic.rs
@@ -0,0 +1,24 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+use std::{mem, ptr};
+
+fn split_first<T, const N: usize>(arr: [T; N]) -> (T, [T; N - 1])
+where
+ [T; N - 1]: Sized,
+{
+ let arr = mem::ManuallyDrop::new(arr);
+ unsafe {
+ let head = ptr::read(&arr[0]);
+ let tail = ptr::read(&arr[1..] as *const [T] as *const [T; N - 1]);
+ (head, tail)
+ }
+}
+
+fn main() {
+ let arr = [0, 1, 2, 3, 4];
+ let (head, tail) = split_first(arr);
+ assert_eq!(head, 0);
+ assert_eq!(tail, [1, 2, 3, 4]);
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr
new file mode 100644
index 0000000..f2ae361
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr
@@ -0,0 +1,20 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-62504.rs:18:21
+ |
+LL | ArrayHolder([0; Self::SIZE])
+ | ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
+ |
+ = note: expected type `X`
+ found type `Self::SIZE`
+
+error: unconstrained generic constant
+ --> $DIR/issue-62504.rs:18:25
+ |
+LL | ArrayHolder([0; Self::SIZE])
+ | ^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); Self::SIZE]:`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/issues/issue-62504.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr
similarity index 100%
rename from src/test/ui/const-generics/issues/issue-62504.min.stderr
rename to src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs b/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs
new file mode 100644
index 0000000..a97f4b8
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.rs
@@ -0,0 +1,27 @@
+// revisions: full min
+#![allow(incomplete_features)]
+#![cfg_attr(full, feature(generic_const_exprs))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+trait HasSize {
+ const SIZE: usize;
+}
+
+impl<const X: usize> HasSize for ArrayHolder<X> {
+ const SIZE: usize = X;
+}
+
+struct ArrayHolder<const X: usize>([u32; X]);
+
+impl<const X: usize> ArrayHolder<X> {
+ pub const fn new() -> Self {
+ ArrayHolder([0; Self::SIZE])
+ //~^ ERROR mismatched types
+ //[full]~^^ ERROR unconstrained generic constant
+ //[min]~^^^ ERROR constant expression depends on a generic parameter
+ }
+}
+
+fn main() {
+ let mut array = ArrayHolder::new();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs b/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs
new file mode 100644
index 0000000..9b36699
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-69654.rs
@@ -0,0 +1,19 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Bar<T> {}
+impl<T> Bar<T> for [u8; T] {}
+//~^ ERROR expected value, found type parameter `T`
+
+struct Foo<const N: usize> {}
+impl<const N: usize> Foo<N>
+where
+ [u8; N]: Bar<[(); N]>,
+{
+ fn foo() {}
+}
+
+fn main() {
+ Foo::foo();
+ //~^ ERROR the function or associated item
+}
diff --git a/src/test/ui/const-generics/issues/issue-69654.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr
similarity index 100%
rename from src/test/ui/const-generics/issues/issue-69654.stderr
rename to src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
new file mode 100644
index 0000000..3c7a740
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
@@ -0,0 +1,65 @@
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-72787.rs:11:17
+ |
+LL | Condition<{ LHS <= RHS }>: True
+ | ^^^ cannot perform const operation using `LHS`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `LHS`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-72787.rs:11:24
+ |
+LL | Condition<{ LHS <= RHS }>: True
+ | ^^^ cannot perform const operation using `RHS`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `RHS`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-72787.rs:25:25
+ |
+LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
+ | ^ cannot perform const operation using `I`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `I`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-72787.rs:25:36
+ |
+LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
+ | ^ cannot perform const operation using `J`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `J`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error[E0283]: type annotations needed
+ --> $DIR/issue-72787.rs:21:26
+ |
+LL | IsLessOrEqual<I, 8>: True,
+ | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
+ |
+ = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
+note: required by a bound in `True`
+ --> $DIR/issue-72787.rs:8:1
+ |
+LL | pub trait True {}
+ | ^^^^^^^^^^^^^^ required by this bound in `True`
+
+error[E0283]: type annotations needed
+ --> $DIR/issue-72787.rs:21:26
+ |
+LL | IsLessOrEqual<I, 8>: True,
+ | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
+ |
+ = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
+note: required by a bound in `True`
+ --> $DIR/issue-72787.rs:8:1
+ |
+LL | pub trait True {}
+ | ^^^^^^^^^^^^^^ required by this bound in `True`
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs
new file mode 100644
index 0000000..77ad57f
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs
@@ -0,0 +1,35 @@
+// [full] check-pass
+// revisions: full min
+#![cfg_attr(full, feature(generic_const_exprs))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+pub struct IsLessOrEqual<const LHS: u32, const RHS: u32>;
+pub struct Condition<const CONDITION: bool>;
+pub trait True {}
+
+impl<const LHS: u32, const RHS: u32> True for IsLessOrEqual<LHS, RHS> where
+ Condition<{ LHS <= RHS }>: True
+//[min]~^ Error generic parameters may not be used in const operations
+//[min]~| Error generic parameters may not be used in const operations
+{
+}
+impl True for Condition<true> {}
+
+struct S<const I: u32, const J: u32>;
+impl<const I: u32, const J: u32> S<I, J>
+where
+ IsLessOrEqual<I, 8>: True,
+//[min]~^ Error type annotations needed [E0283]
+//[min]~| Error type annotations needed [E0283]
+ IsLessOrEqual<J, 8>: True,
+ IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
+//[min]~^ Error generic parameters may not be used in const operations
+//[min]~| Error generic parameters may not be used in const operations
+ // Condition<{ 8 - I <= 8 - J }>: True,
+{
+ fn print() {
+ println!("I {} J {}", I, J);
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr
new file mode 100644
index 0000000..d536f6f
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-72819-generic-in-const-eval.rs:20:12
+ |
+LL | let x: Arr<{usize::MAX}> = Arr {};
+ | ^^^^^^^^^^^^^^^^^ expected `false`, found `true`
+ |
+ = note: expected type `false`
+ found type `true`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-72819-generic-in-const-eval.rs:20:32
+ |
+LL | let x: Arr<{usize::MAX}> = Arr {};
+ | ^^^ expected `false`, found `true`
+ |
+ = note: expected type `false`
+ found type `true`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr
new file mode 100644
index 0000000..4267141
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.min.stderr
@@ -0,0 +1,11 @@
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-72819-generic-in-const-eval.rs:8:17
+ |
+LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs
new file mode 100644
index 0000000..7a5aa9e
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.rs
@@ -0,0 +1,23 @@
+// Regression test for #72819: ICE due to failure in resolving the const generic in `Arr`'s type
+// bounds.
+// revisions: full min
+#![cfg_attr(full, feature(generic_const_exprs))]
+#![cfg_attr(full, allow(incomplete_features))]
+
+struct Arr<const N: usize>
+where Assert::<{N < usize::MAX / 2}>: IsTrue,
+//[min]~^ ERROR generic parameters may not be used in const operations
+{
+}
+
+enum Assert<const CHECK: bool> {}
+
+trait IsTrue {}
+
+impl IsTrue for Assert<true> {}
+
+fn main() {
+ let x: Arr<{usize::MAX}> = Arr {};
+ //[full]~^ ERROR mismatched types
+ //[full]~| ERROR mismatched types
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs
new file mode 100644
index 0000000..d1ab1be
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-73899.rs
@@ -0,0 +1,20 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Foo {}
+
+impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
+
+trait FooImpl<const IS_ZERO: bool> {}
+
+impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
+
+impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
+
+fn foo<T: Foo>(_v: T) {}
+
+fn main() {
+ foo([]);
+ foo([()]);
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs b/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs
new file mode 100644
index 0000000..cd1f7a9
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-74634.rs
@@ -0,0 +1,28 @@
+// check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait If<const COND: bool> {}
+impl If<true> for () {}
+
+trait IsZero<const N: u8> {
+ type Answer;
+}
+
+struct True;
+struct False;
+
+impl<const N: u8> IsZero<N> for ()
+where (): If<{N == 0}> {
+ type Answer = True;
+}
+
+trait Foobar<const N: u8> {}
+
+impl<const N: u8> Foobar<N> for ()
+where (): IsZero<N, Answer = True> {}
+
+impl<const N: u8> Foobar<N> for ()
+where (): IsZero<N, Answer = False> {}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs
new file mode 100644
index 0000000..faa8b3d
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-76595.rs
@@ -0,0 +1,17 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Bool<const B: bool>;
+
+trait True {}
+
+impl True for Bool<true> {}
+
+fn test<T, const P: usize>() where Bool<{core::mem::size_of::<T>() > 4}>: True {
+ todo!()
+}
+
+fn main() {
+ test::<2>();
+ //~^ ERROR this function takes 2 generic arguments
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr
new file mode 100644
index 0000000..3b69a40
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-76595.stderr
@@ -0,0 +1,21 @@
+error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
+ --> $DIR/issue-76595.rs:15:5
+ |
+LL | test::<2>();
+ | ^^^^ - supplied 1 generic argument
+ | |
+ | expected 2 generic arguments
+ |
+note: function defined here, with 2 generic parameters: `T`, `P`
+ --> $DIR/issue-76595.rs:10:4
+ |
+LL | fn test<T, const P: usize>() where Bool<{core::mem::size_of::<T>() > 4}>: True {
+ | ^^^^ - -
+help: add missing generic argument
+ |
+LL | test::<2, P>();
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs
new file mode 100644
index 0000000..2fa9a71
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.rs
@@ -0,0 +1,21 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// This test is a minimized reproduction for #79518 where
+// during error handling for the type mismatch we would try
+// to evaluate std::mem::size_of::<Self::Assoc> causing an ICE
+
+trait Foo {
+ type Assoc: PartialEq;
+ const AssocInstance: Self::Assoc;
+
+ fn foo()
+ where
+ [(); std::mem::size_of::<Self::Assoc>()]: ,
+ {
+ Self::AssocInstance == [(); std::mem::size_of::<Self::Assoc>()];
+ //~^ Error: mismatched types
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr
similarity index 100%
rename from src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.stderr
rename to src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs b/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs
new file mode 100644
index 0000000..77d3c98
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-80561-incorrect-param-env.rs
@@ -0,0 +1,24 @@
+// check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// This tests that the correct `param_env` is used so that
+// attempting to normalize `Self::N` does not cause an ICE.
+
+pub struct Foo<const N: usize>;
+
+impl<const N: usize> Foo<N> {
+ pub fn foo() {}
+}
+
+pub trait Bar {
+ const N: usize;
+ fn bar()
+ where
+ [(); Self::N]: ,
+ {
+ Foo::<{ Self::N }>::foo();
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs b/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs
new file mode 100644
index 0000000..275f699
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.rs
@@ -0,0 +1,32 @@
+// check-fail
+
+// This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+use std::fmt::Debug;
+use std::marker::PhantomData;
+use std::mem::size_of;
+
+struct Inline<T>
+where
+ [u8; size_of::<T>() + 1]: ,
+{
+ _phantom: PhantomData<T>,
+ buf: [u8; size_of::<T>() + 1],
+}
+
+impl<T> Inline<T>
+where
+ [u8; size_of::<T>() + 1]: ,
+{
+ pub fn new(val: T) -> Inline<T> {
+ todo!()
+ }
+}
+
+fn main() {
+ let dst = Inline::<dyn Debug>::new(0); //~ ERROR
+ //~^ ERROR
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr
new file mode 100644
index 0000000..56cb11b
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr
@@ -0,0 +1,72 @@
+error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+LL | intrinsics::size_of::<T>()
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | size_of called on unsized type `dyn Debug`
+ | inside `std::mem::size_of::<dyn Debug>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+ ::: $DIR/issue-80742.rs:22:10
+ |
+LL | [u8; size_of::<T>() + 1]: ,
+ | -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:22:10
+
+error[E0599]: the function or associated item `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied
+ --> $DIR/issue-80742.rs:30:36
+ |
+LL | / struct Inline<T>
+LL | | where
+LL | | [u8; size_of::<T>() + 1]: ,
+LL | | {
+LL | | _phantom: PhantomData<T>,
+LL | | buf: [u8; size_of::<T>() + 1],
+LL | | }
+ | |_- function or associated item `new` not found for this
+...
+LL | let dst = Inline::<dyn Debug>::new(0);
+ | ^^^ function or associated item cannot be called on `Inline<dyn Debug>` due to unsatisfied trait bounds
+ |
+ ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
+ |
+LL | pub trait Debug {
+ | --------------- doesn't satisfy `dyn Debug: Sized`
+ |
+ = note: the following trait bounds were not satisfied:
+ `dyn Debug: Sized`
+
+error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+LL | intrinsics::size_of::<T>()
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | size_of called on unsized type `dyn Debug`
+ | inside `std::mem::size_of::<dyn Debug>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+ ::: $DIR/issue-80742.rs:14:10
+ |
+LL | [u8; size_of::<T>() + 1]: ,
+ | -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:14:10
+
+error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
+ --> $DIR/issue-80742.rs:30:15
+ |
+LL | let dst = Inline::<dyn Debug>::new(0);
+ | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `dyn Debug`
+note: required by a bound in `Inline`
+ --> $DIR/issue-80742.rs:12:15
+ |
+LL | struct Inline<T>
+ | ^ required by this bound in `Inline`
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | struct Inline<T: ?Sized>
+ | ++++++++
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0080, E0277, E0599.
+For more information about an error, try `rustc --explain E0080`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs b/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs
new file mode 100644
index 0000000..fac811d
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-83765.rs
@@ -0,0 +1,38 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait TensorDimension {
+ const DIM: usize;
+}
+
+trait TensorSize: TensorDimension {
+ fn size(&self) -> [usize; Self::DIM];
+}
+
+trait Broadcastable: TensorSize + Sized {
+ type Element;
+ fn lazy_updim<const NEWDIM: usize>(&self, size: [usize; NEWDIM]) {}
+}
+
+struct BMap<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> {
+ reference: &'a T,
+ closure: F,
+}
+
+impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorDimension
+ for BMap<'a, R, T, F, DIM>
+{
+ const DIM: usize = DIM;
+}
+impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSize
+ for BMap<'a, R, T, F, DIM>
+{
+ fn size(&self) -> [usize; DIM] {
+ //~^ ERROR: method not compatible with trait [E0308]
+ self.reference.size()
+ //~^ ERROR: unconstrained generic constant
+ //~| ERROR: mismatched types
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-83765.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr
similarity index 100%
rename from src/test/ui/const-generics/issues/issue-83765.stderr
rename to src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs b/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs
new file mode 100644
index 0000000..fb2e559
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-84408.rs
@@ -0,0 +1,38 @@
+// Regression test for #84408.
+// check-pass
+
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Melon<const X: usize> {
+ fn new(arr: [i32; X]) -> Self;
+ fn change<T: Melon<X>>(self) -> T;
+}
+
+struct Foo([i32; 5]);
+struct Bar<const A: usize, const B: usize>([i32; A + B])
+where
+ [(); A + B]: ;
+
+impl Melon<5> for Foo {
+ fn new(arr: [i32; 5]) -> Self {
+ Foo(arr)
+ }
+ fn change<T: Melon<5>>(self) -> T {
+ T::new(self.0)
+ }
+}
+
+impl<const A: usize, const B: usize> Melon<{ A + B }> for Bar<A, B>
+where
+ [(); A + B]: ,
+{
+ fn new(arr: [i32; A + B]) -> Self {
+ Bar(arr)
+ }
+ fn change<T: Melon<{ A + B }>>(self) -> T {
+ T::new(self.0)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs
new file mode 100644
index 0000000..771e68b
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.rs
@@ -0,0 +1,31 @@
+#![feature(const_fn_trait_bound, generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait _Contains<T> {
+ const does_contain: bool;
+}
+
+trait Contains<T, const Satisfied: bool> {}
+
+trait Delegates<T> {}
+
+impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
+
+const fn contains<A, B>() -> bool
+where
+ A: _Contains<B>,
+{
+ A::does_contain
+}
+
+impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
+
+fn writes_to_path<C>(cap: &C) {
+ writes_to_specific_path(&cap);
+ //~^ ERROR: the trait bound `(): _Contains<&C>` is not satisfied [E0277]
+ //~| ERROR: unconstrained generic constant
+}
+
+fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
new file mode 100644
index 0000000..e51db35
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
@@ -0,0 +1,48 @@
+error[E0277]: the trait bound `(): _Contains<&C>` is not satisfied
+ --> $DIR/issue-85848.rs:24:5
+ |
+LL | writes_to_specific_path(&cap);
+ | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `_Contains<&C>` is not implemented for `()`
+ |
+note: required because of the requirements on the impl of `Contains<(), true>` for `&C`
+ --> $DIR/issue-85848.rs:21:12
+ |
+LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
+note: required because of the requirements on the impl of `Delegates<()>` for `&C`
+ --> $DIR/issue-85848.rs:12:12
+ |
+LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
+ | ^^^^^^^^^^^^ ^
+note: required by a bound in `writes_to_specific_path`
+ --> $DIR/issue-85848.rs:29:31
+ |
+LL | fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {}
+ | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path`
+
+error: unconstrained generic constant
+ --> $DIR/issue-85848.rs:24:5
+ |
+LL | writes_to_specific_path(&cap);
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); { contains::<T, U>() }]:`
+note: required because of the requirements on the impl of `Contains<(), true>` for `&C`
+ --> $DIR/issue-85848.rs:21:12
+ |
+LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
+note: required because of the requirements on the impl of `Delegates<()>` for `&C`
+ --> $DIR/issue-85848.rs:12:12
+ |
+LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
+ | ^^^^^^^^^^^^ ^
+note: required by a bound in `writes_to_specific_path`
+ --> $DIR/issue-85848.rs:29:31
+ |
+LL | fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {}
+ | ^^^^^^^^^^^^^ required by this bound in `writes_to_specific_path`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/less_than.rs b/src/test/ui/const-generics/generic_const_exprs/less_than.rs
new file mode 100644
index 0000000..2e9af1b
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/less_than.rs
@@ -0,0 +1,14 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Foo<const B: bool>;
+
+fn test<const N: usize>() -> Foo<{ N > 10 }> where Foo<{ N > 10 }>: Sized {
+ Foo
+}
+
+fn main() {
+ let _: Foo<true> = test::<12>();
+ let _: Foo<false> = test::<9>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs b/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs
new file mode 100644
index 0000000..cd5d76d
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/let-bindings.rs
@@ -0,0 +1,15 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+// We do not yet want to support let-bindings in abstract consts,
+// so this test should keep failing for now.
+fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
+ //~^ ERROR overly complex generic constant
+ //~| ERROR overly complex generic constant
+ Default::default()
+}
+
+fn main() {
+ let x = test::<31>();
+ assert_eq!(x, [0; 32]);
+}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr b/src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/let-bindings.stderr
rename to src/test/ui/const-generics/generic_const_exprs/let-bindings.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs
new file mode 100644
index 0000000..2bd3c80
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.rs
@@ -0,0 +1,14 @@
+#![crate_type = "lib"]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+const fn complex_maths<T>(n : usize) -> usize {
+ 2 * n + 1
+}
+
+struct Example<T, const N: usize> {
+ a: [f32; N],
+ b: [f32; complex_maths::<T>(N)],
+ //~^ ERROR unconstrained
+ c: T,
+}
diff --git a/src/test/ui/const_evaluatable/needs_where_clause.stderr b/src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr
similarity index 100%
rename from src/test/ui/const_evaluatable/needs_where_clause.stderr
rename to src/test/ui/const-generics/generic_const_exprs/needs_where_clause.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs
new file mode 100644
index 0000000..7e50228
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs
@@ -0,0 +1,24 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn callee<const M2: usize>() -> usize
+where
+ [u8; M2 + 1]: Sized,
+{
+ M2
+}
+
+fn caller<const N1: usize>() -> usize
+where
+ [u8; N1 + 1]: Sized,
+ [u8; (N1 + 1) + 1]: Sized,
+{
+ callee::<{ N1 + 1 }>()
+}
+
+fn main() {
+ assert_eq!(caller::<4>(), 5);
+}
+
+// Test that the ``(N1 + 1) + 1`` bound on ``caller`` satisfies the ``M2 + 1`` bound on ``callee``
diff --git a/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs
new file mode 100644
index 0000000..769e3ae
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-2.rs
@@ -0,0 +1,35 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Generic<const K: u64>;
+
+struct ConstU64<const K: u64>;
+
+impl<const K: u64> Generic<K>
+where
+ ConstU64<{ K - 1 }>: ,
+{
+ fn foo(self) -> u64 {
+ K
+ }
+}
+
+impl<const K: u64> Generic<K>
+where
+ ConstU64<{ K - 1 }>: ,
+ ConstU64<{ K + 1 }>: ,
+ ConstU64<{ K + 1 - 1 }>: ,
+{
+ fn bar(self) -> u64 {
+ let x: Generic<{ K + 1 }> = Generic;
+ x.foo()
+ }
+}
+
+fn main() {
+ assert_eq!((Generic::<10>).bar(), 11);
+}
+
+// Test that the ``ConstU64<{ K + 1 - 1}>`` bound on ``bar``'s impl block satisfies the
+// ``ConstU64<{K - 1}>`` bound on ``foo``'s impl block
diff --git a/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs
new file mode 100644
index 0000000..316887e
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-1.rs
@@ -0,0 +1,34 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn zero_init<const N: usize>() -> Substs1<N>
+where
+ [u8; N + 1]: ,
+{
+ Substs1([0; N + 1])
+}
+struct Substs1<const N: usize>([u8; N + 1])
+where
+ [(); N + 1]: ;
+
+fn substs2<const M: usize>() -> Substs1<{ M * 2 }>
+where
+ [(); { M * 2 } + 1]: ,
+{
+ zero_init::<{ M * 2 }>()
+}
+
+fn substs3<const L: usize>() -> Substs1<{ (L - 1) * 2 }>
+where
+ [(); (L - 1) * 2 + 1]: ,
+{
+ substs2::<{ L - 1 }>()
+}
+
+fn main() {
+ assert_eq!(substs3::<2>().0, [0; 3]);
+}
+
+// Test that the ``{ (L - 1) * 2 + 1 }`` bound on ``substs3`` satisfies the
+// ``{ N + 1 }`` bound on ``Substs1``
diff --git a/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs
new file mode 100644
index 0000000..d45a646
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/nested_uneval_unification-2.rs
@@ -0,0 +1,29 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features, unused_parens, unused_braces)]
+
+fn zero_init<const N: usize>() -> Substs1<{ (N) }>
+where
+ [u8; { (N) }]: ,
+{
+ Substs1([0; { (N) }])
+}
+
+struct Substs1<const N: usize>([u8; { (N) }])
+where
+ [(); { (N) }]: ;
+
+fn substs2<const M: usize>() -> Substs1<{ (M) }> {
+ zero_init::<{ (M) }>()
+}
+
+fn substs3<const L: usize>() -> Substs1<{ (L) }> {
+ substs2::<{ (L) }>()
+}
+
+fn main() {
+ assert_eq!(substs3::<2>().0, [0; 2]);
+}
+
+// Test that the implicit ``{ (L) }`` bound on ``substs3`` satisfies the
+// ``{ (N) }`` bound on ``Substs1``
diff --git a/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs
new file mode 100644
index 0000000..9c5de03
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.rs
@@ -0,0 +1,29 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features, unused)]
+
+const fn complex_maths(n : usize) -> usize {
+ 2 * n + 1
+}
+
+pub struct Example<const N: usize> {
+ a: [f32; N],
+ b: [f32; complex_maths(N)],
+ //~^ ERROR unconstrained generic
+}
+
+impl<const N: usize> Example<N> {
+ pub fn new() -> Self {
+ Self {
+ a: [0.; N],
+ b: [0.; complex_maths(N)],
+ }
+ }
+}
+
+impl Example<2> {
+ pub fn sum(&self) -> f32 {
+ self.a.iter().sum::<f32>() + self.b.iter().sum::<f32>()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/const_evaluatable/no_where_clause.stderr b/src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr
similarity index 100%
rename from src/test/ui/const_evaluatable/no_where_clause.stderr
rename to src/test/ui/const-generics/generic_const_exprs/no_where_clause.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs
new file mode 100644
index 0000000..24d333a
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.rs
@@ -0,0 +1,21 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+
+const fn bar<T: ?Sized>() -> usize { 7 }
+
+trait Foo {
+ fn test(&self) -> [u8; bar::<Self>()];
+}
+
+impl Foo for () {
+ fn test(&self) -> [u8; bar::<Self>()] {
+ [0; bar::<Self>()]
+ }
+}
+
+fn use_dyn(v: &dyn Foo) { //~ERROR the trait `Foo` cannot be made into an object
+ v.test();
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-ret.stderr
rename to src/test/ui/const-generics/generic_const_exprs/object-safety-err-ret.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs
new file mode 100644
index 0000000..42c1cc5
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.rs
@@ -0,0 +1,22 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+#![deny(where_clauses_object_safety)]
+
+
+const fn bar<T: ?Sized>() -> usize { 7 }
+
+trait Foo {
+ fn test(&self) where [u8; bar::<Self>()]: Sized;
+ //~^ ERROR the trait `Foo` cannot be made into an object
+ //~| WARN this was previously accepted by the compiler but is being phased out
+}
+
+impl Foo for () {
+ fn test(&self) where [u8; bar::<Self>()]: Sized {}
+}
+
+fn use_dyn(v: &dyn Foo) {
+ v.test();
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/object-safety-err-where-bounds.stderr
rename to src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr
diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs
new file mode 100644
index 0000000..c6c196d
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.rs
@@ -0,0 +1,22 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Foo<const N: usize> {
+ fn test(&self) -> [u8; N + 1];
+}
+
+impl<const N: usize> Foo<N> for () {
+ fn test(&self) -> [u8; N + 1] {
+ [0; N + 1]
+ }
+}
+
+fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
+ assert_eq!(v.test(), [0; N + 1]);
+}
+
+fn main() {
+ // FIXME(generic_const_exprs): Improve the error message here.
+ use_dyn(&());
+ //~^ ERROR type annotations needed
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr
new file mode 100644
index 0000000..ce75314
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok-infer-err.stderr
@@ -0,0 +1,15 @@
+error[E0284]: type annotations needed: cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
+ --> $DIR/object-safety-ok-infer-err.rs:20:5
+ |
+LL | use_dyn(&());
+ | ^^^^^^^ cannot satisfy `the constant `use_dyn::<{_: usize}>::{constant#0}` can be evaluated`
+ |
+note: required by a bound in `use_dyn`
+ --> $DIR/object-safety-ok-infer-err.rs:14:55
+ |
+LL | fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
+ | ^^^^^ required by this bound in `use_dyn`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0284`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs
new file mode 100644
index 0000000..f4c89f6
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-ok.rs
@@ -0,0 +1,21 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Foo<const N: usize> {
+ fn test(&self) -> [u8; N + 1];
+}
+
+impl<const N: usize> Foo<N> for () {
+ fn test(&self) -> [u8; N + 1] {
+ [0; N + 1]
+ }
+}
+
+fn use_dyn<const N: usize>(v: &dyn Foo<N>) where [u8; N + 1]: Sized {
+ assert_eq!(v.test(), [0; N + 1]);
+}
+
+fn main() {
+ use_dyn::<3>(&());
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs b/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs
new file mode 100644
index 0000000..c47a350
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/simple_fail.rs
@@ -0,0 +1,14 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+type Arr<const N: usize> = [u8; N - 1];
+//~^ ERROR evaluation of `Arr::<0_usize>::{constant#0}` failed
+
+fn test<const N: usize>() -> Arr<N> where [u8; N - 1]: Sized {
+//~^ ERROR evaluation of `test::<0_usize>::{constant#0}` failed
+ todo!()
+}
+
+fn main() {
+ test::<0>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr b/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr
new file mode 100644
index 0000000..99fc92f
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/simple_fail.stderr
@@ -0,0 +1,15 @@
+error[E0080]: evaluation of `test::<0_usize>::{constant#0}` failed
+ --> $DIR/simple_fail.rs:7:48
+ |
+LL | fn test<const N: usize>() -> Arr<N> where [u8; N - 1]: Sized {
+ | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
+
+error[E0080]: evaluation of `Arr::<0_usize>::{constant#0}` failed
+ --> $DIR/simple_fail.rs:4:33
+ |
+LL | type Arr<const N: usize> = [u8; N - 1];
+ | ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs b/src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs
new file mode 100644
index 0000000..d6574a3
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/subexprs_are_const_evalutable.rs
@@ -0,0 +1,17 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn make_array<const M: usize>() -> [(); M + 1] {
+ [(); M + 1]
+}
+
+fn foo<const N: usize>() -> [(); (N * 2) + 1] {
+ make_array::<{ N * 2 }>()
+}
+
+fn main() {
+ assert_eq!(foo::<10>(), [(); 10 * 2 + 1])
+}
+
+// Tests that N * 2 is considered const_evalutable by appearing as part of the (N * 2) + 1 const
diff --git a/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs b/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs
new file mode 100644
index 0000000..d058b36
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/ty-alias-substitution.rs
@@ -0,0 +1,14 @@
+// check-pass
+// Test that we correctly substitute generic arguments for type aliases.
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+type Alias<T, const N: usize> = [T; N + 1];
+
+fn foo<const M: usize>() -> Alias<u32, M> where [u8; M + 1]: Sized {
+ [0; M + 1]
+}
+
+fn main() {
+ foo::<0>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/unop.rs b/src/test/ui/const-generics/generic_const_exprs/unop.rs
new file mode 100644
index 0000000..c12fef0
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/unop.rs
@@ -0,0 +1,14 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Foo<const B: bool>;
+
+fn test<const N: usize>() -> Foo<{ !(N > 10) }> where Foo<{ !(N > 10) }>: Sized {
+ Foo
+}
+
+fn main() {
+ let _: Foo<false> = test::<12>();
+ let _: Foo<true> = test::<9>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs b/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs
new file mode 100644
index 0000000..67fefd0
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/unused-complex-default-expr.rs
@@ -0,0 +1,6 @@
+// check-pass
+#![feature(generic_const_exprs, const_generics_defaults)]
+#![allow(incomplete_features)]
+struct Foo<const N: usize, const M: usize = { N + 1 }>;
+struct Bar<const N: usize>(Foo<N, 3>);
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs b/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs
new file mode 100644
index 0000000..c1bf19e
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/unused_expr.rs
@@ -0,0 +1,25 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+fn add<const N: usize>() -> [u8; { N + 1; 5 }] {
+ //~^ ERROR overly complex generic constant
+ todo!()
+}
+
+fn div<const N: usize>() -> [u8; { N / 1; 5 }] {
+ //~^ ERROR overly complex generic constant
+ todo!()
+}
+
+const fn foo(n: usize) {}
+
+fn fn_call<const N: usize>() -> [u8; { foo(N); 5 }] {
+ //~^ ERROR overly complex generic constant
+ todo!()
+}
+
+fn main() {
+ add::<12>();
+ div::<9>();
+ fn_call::<14>();
+}
diff --git a/src/test/ui/const-generics/const_evaluatable_checked/unused_expr.stderr b/src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr
similarity index 100%
rename from src/test/ui/const-generics/const_evaluatable_checked/unused_expr.stderr
rename to src/test/ui/const-generics/generic_const_exprs/unused_expr.stderr
diff --git a/src/test/ui/const-generics/impl-const-generic-struct.rs b/src/test/ui/const-generics/impl-const-generic-struct.rs
index 1aa2269..7eb2c6a 100644
--- a/src/test/ui/const-generics/impl-const-generic-struct.rs
+++ b/src/test/ui/const-generics/impl-const-generic-struct.rs
@@ -1,9 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct S<const X: u32>;
impl<const X: u32> S<X> {
diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr
deleted file mode 100644
index ebc8f45..0000000
--- a/src/test/ui/const-generics/impl-trait-with-const-arguments.full.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
- --> $DIR/impl-trait-with-const-arguments.rs:23:20
- |
-LL | assert_eq!(f::<4usize>(Usizable), 20usize);
- | ^^^^^^ explicit generic argument not allowed
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0632`.
diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr
deleted file mode 100644
index ebc8f45..0000000
--- a/src/test/ui/const-generics/impl-trait-with-const-arguments.min.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
- --> $DIR/impl-trait-with-const-arguments.rs:23:20
- |
-LL | assert_eq!(f::<4usize>(Usizable), 20usize);
- | ^^^^^^ explicit generic argument not allowed
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0632`.
diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.rs b/src/test/ui/const-generics/impl-trait-with-const-arguments.rs
index 2e6e49b..24ba393 100644
--- a/src/test/ui/const-generics/impl-trait-with-const-arguments.rs
+++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.rs
@@ -1,8 +1,3 @@
-// revisions: full min
-
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
trait Usizer {
fn m(self) -> usize;
}
diff --git a/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr
new file mode 100644
index 0000000..6268a56
--- /dev/null
+++ b/src/test/ui/const-generics/impl-trait-with-const-arguments.stderr
@@ -0,0 +1,9 @@
+error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
+ --> $DIR/impl-trait-with-const-arguments.rs:18:20
+ |
+LL | assert_eq!(f::<4usize>(Usizable), 20usize);
+ | ^^^^^^ explicit generic argument not allowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0632`.
diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr
deleted file mode 100644
index 9deda56..0000000
--- a/src/test/ui/const-generics/incorrect-number-of-const-args.full.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
- --> $DIR/incorrect-number-of-const-args.rs:11:5
- |
-LL | foo::<0>();
- | ^^^ - supplied 1 generic argument
- | |
- | expected 2 generic arguments
- |
-note: function defined here, with 2 generic parameters: `X`, `Y`
- --> $DIR/incorrect-number-of-const-args.rs:6:4
- |
-LL | fn foo<const X: usize, const Y: usize>() -> usize {
- | ^^^ - -
-help: add missing generic argument
- |
-LL | foo::<0, Y>();
- | ^^^
-
-error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied
- --> $DIR/incorrect-number-of-const-args.rs:14:5
- |
-LL | foo::<0, 0, 0>();
- | ^^^ - help: remove this generic argument
- | |
- | expected 2 generic arguments
- |
-note: function defined here, with 2 generic parameters: `X`, `Y`
- --> $DIR/incorrect-number-of-const-args.rs:6:4
- |
-LL | fn foo<const X: usize, const Y: usize>() -> usize {
- | ^^^ - -
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr
deleted file mode 100644
index 9deda56..0000000
--- a/src/test/ui/const-generics/incorrect-number-of-const-args.min.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
- --> $DIR/incorrect-number-of-const-args.rs:11:5
- |
-LL | foo::<0>();
- | ^^^ - supplied 1 generic argument
- | |
- | expected 2 generic arguments
- |
-note: function defined here, with 2 generic parameters: `X`, `Y`
- --> $DIR/incorrect-number-of-const-args.rs:6:4
- |
-LL | fn foo<const X: usize, const Y: usize>() -> usize {
- | ^^^ - -
-help: add missing generic argument
- |
-LL | foo::<0, Y>();
- | ^^^
-
-error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied
- --> $DIR/incorrect-number-of-const-args.rs:14:5
- |
-LL | foo::<0, 0, 0>();
- | ^^^ - help: remove this generic argument
- | |
- | expected 2 generic arguments
- |
-note: function defined here, with 2 generic parameters: `X`, `Y`
- --> $DIR/incorrect-number-of-const-args.rs:6:4
- |
-LL | fn foo<const X: usize, const Y: usize>() -> usize {
- | ^^^ - -
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.rs b/src/test/ui/const-generics/incorrect-number-of-const-args.rs
index 305559d..de2d126 100644
--- a/src/test/ui/const-generics/incorrect-number-of-const-args.rs
+++ b/src/test/ui/const-generics/incorrect-number-of-const-args.rs
@@ -1,8 +1,3 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
fn foo<const X: usize, const Y: usize>() -> usize {
0
}
diff --git a/src/test/ui/const-generics/incorrect-number-of-const-args.stderr b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr
new file mode 100644
index 0000000..bf873da
--- /dev/null
+++ b/src/test/ui/const-generics/incorrect-number-of-const-args.stderr
@@ -0,0 +1,35 @@
+error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
+ --> $DIR/incorrect-number-of-const-args.rs:6:5
+ |
+LL | foo::<0>();
+ | ^^^ - supplied 1 generic argument
+ | |
+ | expected 2 generic arguments
+ |
+note: function defined here, with 2 generic parameters: `X`, `Y`
+ --> $DIR/incorrect-number-of-const-args.rs:1:4
+ |
+LL | fn foo<const X: usize, const Y: usize>() -> usize {
+ | ^^^ - -
+help: add missing generic argument
+ |
+LL | foo::<0, Y>();
+ | +++
+
+error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied
+ --> $DIR/incorrect-number-of-const-args.rs:9:5
+ |
+LL | foo::<0, 0, 0>();
+ | ^^^ - help: remove this generic argument
+ | |
+ | expected 2 generic arguments
+ |
+note: function defined here, with 2 generic parameters: `X`, `Y`
+ --> $DIR/incorrect-number-of-const-args.rs:1:4
+ |
+LL | fn foo<const X: usize, const Y: usize>() -> usize {
+ | ^^^ - -
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr
deleted file mode 100644
index e85bf88..0000000
--- a/src/test/ui/const-generics/infer/cannot-infer-const-args.full.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/cannot-infer-const-args.rs:11:5
- |
-LL | foo();
- | ^^^ cannot infer the value of const parameter `X` declared on the function `foo`
- |
-help: consider specifying the const argument
- |
-LL | foo::<X>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr
deleted file mode 100644
index e85bf88..0000000
--- a/src/test/ui/const-generics/infer/cannot-infer-const-args.min.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/cannot-infer-const-args.rs:11:5
- |
-LL | foo();
- | ^^^ cannot infer the value of const parameter `X` declared on the function `foo`
- |
-help: consider specifying the const argument
- |
-LL | foo::<X>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.rs b/src/test/ui/const-generics/infer/cannot-infer-const-args.rs
index cc52892..f85a729 100644
--- a/src/test/ui/const-generics/infer/cannot-infer-const-args.rs
+++ b/src/test/ui/const-generics/infer/cannot-infer-const-args.rs
@@ -1,8 +1,3 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
fn foo<const X: usize>() -> usize {
0
}
diff --git a/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr b/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr
new file mode 100644
index 0000000..828f497
--- /dev/null
+++ b/src/test/ui/const-generics/infer/cannot-infer-const-args.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+ --> $DIR/cannot-infer-const-args.rs:6:5
+ |
+LL | foo();
+ | ^^^ cannot infer the value of const parameter `X` declared on the function `foo`
+ |
+help: consider specifying the const argument
+ |
+LL | foo::<X>();
+ | ~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/issue-77092.stderr b/src/test/ui/const-generics/infer/issue-77092.stderr
index 5857a42..a625ed2 100644
--- a/src/test/ui/const-generics/infer/issue-77092.stderr
+++ b/src/test/ui/const-generics/infer/issue-77092.stderr
@@ -7,7 +7,7 @@
help: consider specifying the const argument
|
LL | println!("{:?}", take_array_from_mut::<N>(&mut arr, i));
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/infer/method-chain.full.stderr b/src/test/ui/const-generics/infer/method-chain.full.stderr
deleted file mode 100644
index f6d9c4a..0000000
--- a/src/test/ui/const-generics/infer/method-chain.full.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/method-chain.rs:20:33
- |
-LL | Foo.bar().bar().bar().bar().baz();
- | ^^^ cannot infer the value of const parameter `N` declared on the associated function `baz`
- |
-help: consider specifying the const argument
- |
-LL | Foo.bar().bar().bar().bar().baz::<N>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/method-chain.min.stderr b/src/test/ui/const-generics/infer/method-chain.min.stderr
deleted file mode 100644
index f6d9c4a..0000000
--- a/src/test/ui/const-generics/infer/method-chain.min.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/method-chain.rs:20:33
- |
-LL | Foo.bar().bar().bar().bar().baz();
- | ^^^ cannot infer the value of const parameter `N` declared on the associated function `baz`
- |
-help: consider specifying the const argument
- |
-LL | Foo.bar().bar().bar().bar().baz::<N>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/method-chain.rs b/src/test/ui/const-generics/infer/method-chain.rs
index 8ac6a7d6..0c5eed4 100644
--- a/src/test/ui/const-generics/infer/method-chain.rs
+++ b/src/test/ui/const-generics/infer/method-chain.rs
@@ -1,8 +1,3 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct Foo;
impl Foo {
diff --git a/src/test/ui/const-generics/infer/method-chain.stderr b/src/test/ui/const-generics/infer/method-chain.stderr
new file mode 100644
index 0000000..53d92e5
--- /dev/null
+++ b/src/test/ui/const-generics/infer/method-chain.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+ --> $DIR/method-chain.rs:15:33
+ |
+LL | Foo.bar().bar().bar().bar().baz();
+ | ^^^ cannot infer the value of const parameter `N` declared on the associated function `baz`
+ |
+help: consider specifying the const argument
+ |
+LL | Foo.bar().bar().bar().bar().baz::<N>();
+ | ~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.full.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.full.stderr
deleted file mode 100644
index cc6c9a4..0000000
--- a/src/test/ui/const-generics/infer/one-param-uninferred.full.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/one-param-uninferred.rs:15:23
- |
-LL | let _: [u8; 17] = foo();
- | ^^^ cannot infer the value of const parameter `M` declared on the function `foo`
- |
-help: consider specifying the const argument
- |
-LL | let _: [u8; 17] = foo::<M>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.min.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.min.stderr
deleted file mode 100644
index cc6c9a4..0000000
--- a/src/test/ui/const-generics/infer/one-param-uninferred.min.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/one-param-uninferred.rs:15:23
- |
-LL | let _: [u8; 17] = foo();
- | ^^^ cannot infer the value of const parameter `M` declared on the function `foo`
- |
-help: consider specifying the const argument
- |
-LL | let _: [u8; 17] = foo::<M>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.rs b/src/test/ui/const-generics/infer/one-param-uninferred.rs
index 0e94713..d601865 100644
--- a/src/test/ui/const-generics/infer/one-param-uninferred.rs
+++ b/src/test/ui/const-generics/infer/one-param-uninferred.rs
@@ -1,10 +1,4 @@
// Test that we emit an error if we cannot properly infer a constant.
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(min, feature(min_const_generics))]
-
fn foo<const N: usize, const M: usize>() -> [u8; N] {
todo!()
}
diff --git a/src/test/ui/const-generics/infer/one-param-uninferred.stderr b/src/test/ui/const-generics/infer/one-param-uninferred.stderr
new file mode 100644
index 0000000..acf5917
--- /dev/null
+++ b/src/test/ui/const-generics/infer/one-param-uninferred.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+ --> $DIR/one-param-uninferred.rs:9:23
+ |
+LL | let _: [u8; 17] = foo();
+ | ^^^ cannot infer the value of const parameter `M` declared on the function `foo`
+ |
+help: consider specifying the const argument
+ |
+LL | let _: [u8; 17] = foo::<M>();
+ | ~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/uninferred-consts.full.stderr b/src/test/ui/const-generics/infer/uninferred-consts.full.stderr
deleted file mode 100644
index 254a28f..0000000
--- a/src/test/ui/const-generics/infer/uninferred-consts.full.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/uninferred-consts.rs:13:9
- |
-LL | Foo.foo();
- | ^^^ cannot infer the value of const parameter `A` declared on the associated function `foo`
- |
-help: consider specifying the const argument
- |
-LL | Foo.foo::<A>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/uninferred-consts.min.stderr b/src/test/ui/const-generics/infer/uninferred-consts.min.stderr
deleted file mode 100644
index 254a28f..0000000
--- a/src/test/ui/const-generics/infer/uninferred-consts.min.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0282]: type annotations needed
- --> $DIR/uninferred-consts.rs:13:9
- |
-LL | Foo.foo();
- | ^^^ cannot infer the value of const parameter `A` declared on the associated function `foo`
- |
-help: consider specifying the const argument
- |
-LL | Foo.foo::<A>();
- | ^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer/uninferred-consts.rs b/src/test/ui/const-generics/infer/uninferred-consts.rs
index bcd9aad..657f4b5 100644
--- a/src/test/ui/const-generics/infer/uninferred-consts.rs
+++ b/src/test/ui/const-generics/infer/uninferred-consts.rs
@@ -1,8 +1,4 @@
// Test that we emit an error if we cannot properly infer a constant.
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
// taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893
struct Foo;
diff --git a/src/test/ui/const-generics/infer/uninferred-consts.stderr b/src/test/ui/const-generics/infer/uninferred-consts.stderr
new file mode 100644
index 0000000..a6c79fc
--- /dev/null
+++ b/src/test/ui/const-generics/infer/uninferred-consts.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+ --> $DIR/uninferred-consts.rs:9:9
+ |
+LL | Foo.foo();
+ | ^^^ cannot infer the value of const parameter `A` declared on the associated function `foo`
+ |
+help: consider specifying the const argument
+ |
+LL | Foo.foo::<A>();
+ | ~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/const-generics/infer_arg_from_pat.rs b/src/test/ui/const-generics/infer_arg_from_pat.rs
index 5e2a3ea..10317a1 100644
--- a/src/test/ui/const-generics/infer_arg_from_pat.rs
+++ b/src/test/ui/const-generics/infer_arg_from_pat.rs
@@ -1,10 +1,6 @@
// run-pass
//
// see issue #70529
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
struct A<const N: usize> {
arr: [u8; N],
diff --git a/src/test/ui/const-generics/infer_arr_len_from_pat.rs b/src/test/ui/const-generics/infer_arr_len_from_pat.rs
index 0273383..40f6f5b 100644
--- a/src/test/ui/const-generics/infer_arr_len_from_pat.rs
+++ b/src/test/ui/const-generics/infer_arr_len_from_pat.rs
@@ -1,10 +1,6 @@
// check-pass
//
// see issue #70529
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
fn as_chunks<const N: usize>() -> [u8; N] {
loop {}
diff --git a/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs b/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs
index 96e5976..2b8731b 100644
--- a/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs
+++ b/src/test/ui/const-generics/integer-literal-generic-arg-in-where-clause.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
fn takes_closure_of_array_3<F>(f: F) where F: Fn([i32; 3]) {
f([1, 2, 3]);
diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr
deleted file mode 100644
index 3e90dbe..0000000
--- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/intrinsics-type_name-as-const-argument.rs:14:8
- |
-LL | T: Trait<{std::intrinsics::type_name::<T>()}>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr
index 8701d54..b8a1027 100644
--- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr
+++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.min.stderr
@@ -1,20 +1,20 @@
error: generic parameters may not be used in const operations
- --> $DIR/intrinsics-type_name-as-const-argument.rs:14:44
+ --> $DIR/intrinsics-type_name-as-const-argument.rs:15:44
|
LL | T: Trait<{std::intrinsics::type_name::<T>()}>
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: `&'static str` is forbidden as the type of a const generic parameter
- --> $DIR/intrinsics-type_name-as-const-argument.rs:9:22
+ --> $DIR/intrinsics-type_name-as-const-argument.rs:10:22
|
LL | trait Trait<const S: &'static str> {}
| ^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs
index f24dd42..147a00c 100644
--- a/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs
+++ b/src/test/ui/const-generics/intrinsics-type_name-as-const-argument.rs
@@ -1,7 +1,8 @@
+// [full] check-pass
// revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params, generic_const_exprs))]
#![feature(core_intrinsics)]
#![feature(const_type_name)]
@@ -13,7 +14,6 @@
where
T: Trait<{std::intrinsics::type_name::<T>()}>
//[min]~^ ERROR generic parameters may not be used in const operations
- //[full]~^^ ERROR constant expression depends on a generic parameter
{
t: T
}
diff --git a/src/test/ui/const-generics/invalid-enum.rs b/src/test/ui/const-generics/invalid-enum.rs
index 32939dc..bc3c092 100644
--- a/src/test/ui/const-generics/invalid-enum.rs
+++ b/src/test/ui/const-generics/invalid-enum.rs
@@ -1,4 +1,4 @@
-#![feature(const_generics)]
+#![feature(adt_const_params, const_generics_defaults)]
#![allow(incomplete_features)]
#[derive(PartialEq, Eq)]
diff --git a/src/test/ui/const-generics/invalid-enum.stderr b/src/test/ui/const-generics/invalid-enum.stderr
index cfbc61f..0d3643f 100644
--- a/src/test/ui/const-generics/invalid-enum.stderr
+++ b/src/test/ui/const-generics/invalid-enum.stderr
@@ -34,7 +34,7 @@
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | let _: Example<{ CompileFlag::A }, _> = Example { x: 0 };
- | ^ ^
+ | + +
error[E0747]: type provided when a constant was expected
--> $DIR/invalid-enum.rs:33:18
@@ -45,7 +45,7 @@
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | let _: Example<{ Example::ASSOC_FLAG }, _> = Example { x: 0 };
- | ^ ^
+ | + +
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/invalid-enum.rs:21:12
@@ -56,7 +56,7 @@
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | test_1::<{ CompileFlag::A }>();
- | ^ ^
+ | + +
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/invalid-enum.rs:25:15
@@ -67,7 +67,7 @@
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | test_2::<_, { CompileFlag::A }>(0);
- | ^ ^
+ | + +
error: aborting due to 7 previous errors
diff --git a/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs b/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs
index f59eb60..6a10ee2 100644
--- a/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs
+++ b/src/test/ui/const-generics/issues/auxiliary/const_generic_issues_lib.rs
@@ -1,5 +1,5 @@
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
// All of these three items must be in `lib2` to reproduce the error
@@ -10,6 +10,6 @@
pub struct GenericType<const B: i8>;
// Removing the braces around `42` resolves the crash
-impl TypeFn for GenericType<{ 42 }> {
+impl TypeFn for GenericType<{ 40 + 2 }> {
type Output = ();
}
diff --git a/src/test/ui/const-generics/issues/auxiliary/impl-const.rs b/src/test/ui/const-generics/issues/auxiliary/impl-const.rs
index 4a6b578..de3a408 100644
--- a/src/test/ui/const-generics/issues/auxiliary/impl-const.rs
+++ b/src/test/ui/const-generics/issues/auxiliary/impl-const.rs
@@ -1,5 +1,4 @@
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+#![feature(generic_const_exprs)]
pub struct Num<const N: usize>;
diff --git a/src/test/ui/const-generics/issues/issue-56445-1.full.stderr b/src/test/ui/const-generics/issues/issue-56445-1.full.stderr
index 8416d64..179643a 100644
--- a/src/test/ui/const-generics/issues/issue-56445-1.full.stderr
+++ b/src/test/ui/const-generics/issues/issue-56445-1.full.stderr
@@ -1,20 +1,11 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-56445-1.rs:3:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
error[E0771]: use of non-static lifetime `'a` in const generic
- --> $DIR/issue-56445-1.rs:8:26
+ --> $DIR/issue-56445-1.rs:9:26
|
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
| ^^
|
= note: for more information, see issue #74052 <https://github.com/rust-lang/rust/issues/74052>
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0771`.
diff --git a/src/test/ui/const-generics/issues/issue-56445-1.min.stderr b/src/test/ui/const-generics/issues/issue-56445-1.min.stderr
index f7056f2..179643a 100644
--- a/src/test/ui/const-generics/issues/issue-56445-1.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-56445-1.min.stderr
@@ -1,5 +1,5 @@
error[E0771]: use of non-static lifetime `'a` in const generic
- --> $DIR/issue-56445-1.rs:8:26
+ --> $DIR/issue-56445-1.rs:9:26
|
LL | struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
| ^^
diff --git a/src/test/ui/const-generics/issues/issue-56445-1.rs b/src/test/ui/const-generics/issues/issue-56445-1.rs
index bc9e1de..aeef778 100644
--- a/src/test/ui/const-generics/issues/issue-56445-1.rs
+++ b/src/test/ui/const-generics/issues/issue-56445-1.rs
@@ -1,6 +1,7 @@
// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995.
// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
+#![cfg_attr(full, feature(adt_const_params))]
+#![cfg_attr(full, allow(incomplete_features))]
#![crate_type = "lib"]
use std::marker::PhantomData;
diff --git a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr b/src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr
deleted file mode 100644
index c03b725..0000000
--- a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-60818-struct-constructors.rs:3:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs b/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs
index 6e64c78..0066490 100644
--- a/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs
+++ b/src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs
@@ -1,6 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
struct Generic<const V: usize>;
diff --git a/src/test/ui/const-generics/issues/issue-61336-1.full.stderr b/src/test/ui/const-generics/issues/issue-61336-1.full.stderr
deleted file mode 100644
index f18728e..0000000
--- a/src/test/ui/const-generics/issues/issue-61336-1.full.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61336-1.rs:3:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/const-generics/issues/issue-61336-1.rs b/src/test/ui/const-generics/issues/issue-61336-1.rs
index c93b296d..beb37e6 100644
--- a/src/test/ui/const-generics/issues/issue-61336-1.rs
+++ b/src/test/ui/const-generics/issues/issue-61336-1.rs
@@ -1,7 +1,4 @@
// build-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
-
fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
[x; N]
}
diff --git a/src/test/ui/const-generics/issues/issue-61336-2.full.stderr b/src/test/ui/const-generics/issues/issue-61336-2.full.stderr
deleted file mode 100644
index ef0cafc..0000000
--- a/src/test/ui/const-generics/issues/issue-61336-2.full.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61336-2.rs:2:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-61336-2.rs:9:5
- |
-LL | [x; { N }]
- | ^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
- = note: the `Copy` trait is required because the repeated element will be copied
-help: consider restricting type parameter `T`
- |
-LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-61336-2.min.stderr b/src/test/ui/const-generics/issues/issue-61336-2.min.stderr
deleted file mode 100644
index e5fe505..0000000
--- a/src/test/ui/const-generics/issues/issue-61336-2.min.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-61336-2.rs:9:5
- |
-LL | [x; { N }]
- | ^^^^^^^^^^ the trait `Copy` is not implemented for `T`
- |
- = note: the `Copy` trait is required because the repeated element will be copied
-help: consider restricting type parameter `T`
- |
-LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-61336-2.rs b/src/test/ui/const-generics/issues/issue-61336-2.rs
index a1cf641..b7cd29f 100644
--- a/src/test/ui/const-generics/issues/issue-61336-2.rs
+++ b/src/test/ui/const-generics/issues/issue-61336-2.rs
@@ -1,6 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
-
fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
[x; { N }]
}
diff --git a/src/test/ui/const-generics/issues/issue-61336-2.stderr b/src/test/ui/const-generics/issues/issue-61336-2.stderr
new file mode 100644
index 0000000..48aaaf5
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-61336-2.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `T: Copy` is not satisfied
+ --> $DIR/issue-61336-2.rs:6:5
+ |
+LL | [x; { N }]
+ | ^^^^^^^^^^ the trait `Copy` is not implemented for `T`
+ |
+ = note: the `Copy` trait is required because the repeated element will be copied
+help: consider restricting type parameter `T`
+ |
+LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
+ | +++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-61336.full.stderr b/src/test/ui/const-generics/issues/issue-61336.full.stderr
deleted file mode 100644
index fcfd393..0000000
--- a/src/test/ui/const-generics/issues/issue-61336.full.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61336.rs:2:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-61336.rs:9:5
- |
-LL | [x; N]
- | ^^^^^^ the trait `Copy` is not implemented for `T`
- |
- = note: the `Copy` trait is required because the repeated element will be copied
-help: consider restricting type parameter `T`
- |
-LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-61336.min.stderr b/src/test/ui/const-generics/issues/issue-61336.min.stderr
deleted file mode 100644
index 9158031..0000000
--- a/src/test/ui/const-generics/issues/issue-61336.min.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-61336.rs:9:5
- |
-LL | [x; N]
- | ^^^^^^ the trait `Copy` is not implemented for `T`
- |
- = note: the `Copy` trait is required because the repeated element will be copied
-help: consider restricting type parameter `T`
- |
-LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-61336.rs b/src/test/ui/const-generics/issues/issue-61336.rs
index c0106ee..80be1d8 100644
--- a/src/test/ui/const-generics/issues/issue-61336.rs
+++ b/src/test/ui/const-generics/issues/issue-61336.rs
@@ -1,6 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
-
fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
[x; N]
}
diff --git a/src/test/ui/const-generics/issues/issue-61336.stderr b/src/test/ui/const-generics/issues/issue-61336.stderr
index 1be907b..665a1a6 100644
--- a/src/test/ui/const-generics/issues/issue-61336.stderr
+++ b/src/test/ui/const-generics/issues/issue-61336.stderr
@@ -1,14 +1,5 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61336.rs:1:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-61336.rs:9:5
+ --> $DIR/issue-61336.rs:6:5
|
LL | [x; N]
| ^^^^^^ the trait `Copy` is not implemented for `T`
@@ -16,9 +7,9 @@
= note: the `Copy` trait is required because the repeated element will be copied
help: consider restricting type parameter `T`
|
-LL | fn g<T: Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^
+LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
+ | +++++++++++++++++++
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-61422.full.stderr b/src/test/ui/const-generics/issues/issue-61422.full.stderr
deleted file mode 100644
index ac6c378..0000000
--- a/src/test/ui/const-generics/issues/issue-61422.full.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61422.rs:3:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/const-generics/issues/issue-61422.rs b/src/test/ui/const-generics/issues/issue-61422.rs
index 421f696..0b9cf40 100644
--- a/src/test/ui/const-generics/issues/issue-61422.rs
+++ b/src/test/ui/const-generics/issues/issue-61422.rs
@@ -1,7 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
-
use std::mem;
// Neither of the uninits below are currently accepted as not UB, however,
diff --git a/src/test/ui/const-generics/issues/issue-61432.full.stderr b/src/test/ui/const-generics/issues/issue-61432.full.stderr
deleted file mode 100644
index 82b36de..0000000
--- a/src/test/ui/const-generics/issues/issue-61432.full.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61432.rs:3:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/const-generics/issues/issue-61432.rs b/src/test/ui/const-generics/issues/issue-61432.rs
index 97ab07d..6192af8 100644
--- a/src/test/ui/const-generics/issues/issue-61432.rs
+++ b/src/test/ui/const-generics/issues/issue-61432.rs
@@ -1,13 +1,6 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
fn promote<const N: i32>() {
- // works:
- //
- // let n = N;
- // let _ = &n;
-
let _ = &N;
}
diff --git a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr
deleted file mode 100644
index 56deec1..0000000
--- a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.full.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-61522-array-len-succ.rs:6:40
- |
-LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
- | ^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-61522-array-len-succ.rs:11:24
- |
-LL | fn inner(&self) -> &[u8; COUNT + 1] {
- | ^^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr
deleted file mode 100644
index 36a0a37a..0000000
--- a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-61522-array-len-succ.rs:6:45
- |
-LL | pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
- | ^^^^^ cannot perform const operation using `COUNT`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `COUNT`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/issue-61522-array-len-succ.rs:11:30
- |
-LL | fn inner(&self) -> &[u8; COUNT + 1] {
- | ^^^^^ cannot perform const operation using `COUNT`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `COUNT`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs b/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs
deleted file mode 100644
index d4a948b..0000000
--- a/src/test/ui/const-generics/issues/issue-61522-array-len-succ.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
-//[full]~^ ERROR constant expression depends on a generic parameter
-//[min]~^^ ERROR generic parameters may not be used
-
-impl<const COUNT: usize> MyArray<COUNT> {
- fn inner(&self) -> &[u8; COUNT + 1] {
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used
- &self.0
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-61747.full.stderr b/src/test/ui/const-generics/issues/issue-61747.full.stderr
deleted file mode 100644
index b7f6634..0000000
--- a/src/test/ui/const-generics/issues/issue-61747.full.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61747.rs:2:27
- |
-LL | #![cfg_attr(full, feature(const_generics))]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-61747.rs:7:23
- |
-LL | fn successor() -> Const<{C + 1}> {
- | ^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/const-generics/issues/issue-61747.min.stderr b/src/test/ui/const-generics/issues/issue-61747.min.stderr
deleted file mode 100644
index b85533c..0000000
--- a/src/test/ui/const-generics/issues/issue-61747.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-61747.rs:7:30
- |
-LL | fn successor() -> Const<{C + 1}> {
- | ^ cannot perform const operation using `C`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `C`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-61747.rs b/src/test/ui/const-generics/issues/issue-61747.rs
deleted file mode 100644
index 3aa2e6a..0000000
--- a/src/test/ui/const-generics/issues/issue-61747.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))] //[full]~WARN the feature `const_generics` is incomplete
-
-struct Const<const N: usize>;
-
-impl<const C: usize> Const<{C}> {
- fn successor() -> Const<{C + 1}> {
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used
- Const
- }
-}
-
-fn main() {
- let _x: Const::<2> = Const::<1>::successor();
-}
diff --git a/src/test/ui/const-generics/issues/issue-61935.full.stderr b/src/test/ui/const-generics/issues/issue-61935.full.stderr
deleted file mode 100644
index b970f4e..0000000
--- a/src/test/ui/const-generics/issues/issue-61935.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-61935.rs:9:14
- |
-LL | Self:FooImpl<{N==0}>
- | ^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-61935.min.stderr b/src/test/ui/const-generics/issues/issue-61935.min.stderr
deleted file mode 100644
index 9382dca3..0000000
--- a/src/test/ui/const-generics/issues/issue-61935.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-61935.rs:9:23
- |
-LL | Self:FooImpl<{N==0}>
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-61935.rs b/src/test/ui/const-generics/issues/issue-61935.rs
deleted file mode 100644
index ed861c6..0000000
--- a/src/test/ui/const-generics/issues/issue-61935.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-trait Foo {}
-
-impl<const N: usize> Foo for [(); N]
- where
- Self:FooImpl<{N==0}>
-//[full]~^ERROR constant expression depends on a generic parameter
-//[min]~^^ERROR generic parameters may not be used in const operations
-{}
-
-trait FooImpl<const IS_ZERO: bool>{}
-
-impl FooImpl<true> for [(); 0] {}
-
-impl<const N:usize> FooImpl<false> for [();N] {}
-
-fn foo(_: impl Foo) {}
-
-fn main() {
- foo([]);
- foo([()]);
-}
diff --git a/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs b/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs
index 1a0e46e..fa76aea 100644
--- a/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs
+++ b/src/test/ui/const-generics/issues/issue-62187-encountered-polymorphic-const.rs
@@ -1,9 +1,4 @@
// run-pass
-
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
pub trait BitLen: Sized {
const BIT_LEN: usize;
}
diff --git a/src/test/ui/const-generics/issues/issue-62220.full.stderr b/src/test/ui/const-generics/issues/issue-62220.full.stderr
deleted file mode 100644
index 373360c..0000000
--- a/src/test/ui/const-generics/issues/issue-62220.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-62220.rs:12:27
- |
-LL | pub fn trunc(self) -> (TruncatedVector<T, { N }>, T) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-62220.min.stderr b/src/test/ui/const-generics/issues/issue-62220.min.stderr
deleted file mode 100644
index 72311d0..0000000
--- a/src/test/ui/const-generics/issues/issue-62220.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-62220.rs:7:59
- |
-LL | pub type TruncatedVector<T, const N: usize> = Vector<T, { N - 1 }>;
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-62220.rs b/src/test/ui/const-generics/issues/issue-62220.rs
deleted file mode 100644
index c26784c..0000000
--- a/src/test/ui/const-generics/issues/issue-62220.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-pub struct Vector<T, const N: usize>([T; N]);
-
-pub type TruncatedVector<T, const N: usize> = Vector<T, { N - 1 }>;
-//[min]~^ ERROR generic parameters may not be used in const operations
-
-impl<T, const N: usize> Vector<T, { N }> {
- /// Drop the last component and return the vector with one fewer dimension.
- pub fn trunc(self) -> (TruncatedVector<T, { N }>, T) {
- //[full]~^ ERROR constant expression depends on a generic parameter
- unimplemented!()
- }
-}
-
-fn vec4<T>(a: T, b: T, c: T, d: T) -> Vector<T, 4> {
- Vector([a, b, c, d])
-}
-
-fn main() {
- let (_xyz, _w): (TruncatedVector<u32, 4>, u32) = vec4(0u32, 1, 2, 3).trunc();
-}
diff --git a/src/test/ui/const-generics/issues/issue-62456.full.stderr b/src/test/ui/const-generics/issues/issue-62456.full.stderr
deleted file mode 100644
index 833e70c..0000000
--- a/src/test/ui/const-generics/issues/issue-62456.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-62456.rs:6:20
- |
-LL | let _ = [0u64; N + 1];
- | ^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-62456.min.stderr b/src/test/ui/const-generics/issues/issue-62456.min.stderr
deleted file mode 100644
index 920318f..0000000
--- a/src/test/ui/const-generics/issues/issue-62456.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-62456.rs:6:20
- |
-LL | let _ = [0u64; N + 1];
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-62456.rs b/src/test/ui/const-generics/issues/issue-62456.rs
deleted file mode 100644
index e24cf36..0000000
--- a/src/test/ui/const-generics/issues/issue-62456.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-fn foo<const N: usize>() {
- let _ = [0u64; N + 1];
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used in const operations
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-62504.full.stderr b/src/test/ui/const-generics/issues/issue-62504.full.stderr
deleted file mode 100644
index efbcdc3..0000000
--- a/src/test/ui/const-generics/issues/issue-62504.full.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/issue-62504.rs:18:21
- |
-LL | ArrayHolder([0; Self::SIZE])
- | ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
- |
- = note: expected type `X`
- found type `Self::SIZE`
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-62504.rs:18:25
- |
-LL | ArrayHolder([0; Self::SIZE])
- | ^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/issues/issue-62504.rs b/src/test/ui/const-generics/issues/issue-62504.rs
deleted file mode 100644
index 1b70cd1..0000000
--- a/src/test/ui/const-generics/issues/issue-62504.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-// revisions: full min
-#![allow(incomplete_features)]
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-trait HasSize {
- const SIZE: usize;
-}
-
-impl<const X: usize> HasSize for ArrayHolder<X> {
- const SIZE: usize = X;
-}
-
-struct ArrayHolder<const X: usize>([u32; X]);
-
-impl<const X: usize> ArrayHolder<X> {
- pub const fn new() -> Self {
- ArrayHolder([0; Self::SIZE])
- //~^ ERROR constant expression depends on a generic parameter
- //~| ERROR mismatched types
- }
-}
-
-fn main() {
- let mut array = ArrayHolder::new();
-}
diff --git a/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr b/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr
deleted file mode 100644
index 5c9387d..0000000
--- a/src/test/ui/const-generics/issues/issue-62579-no-match.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: `NoMatch` is forbidden as the type of a const generic parameter
- --> $DIR/issue-62579-no-match.rs:9:17
- |
-LL | fn foo<const T: NoMatch>() -> bool {
- | ^^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-62579-no-match.rs b/src/test/ui/const-generics/issues/issue-62579-no-match.rs
deleted file mode 100644
index 46813f5..0000000
--- a/src/test/ui/const-generics/issues/issue-62579-no-match.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// [full] run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-#[derive(PartialEq, Eq)]
-struct NoMatch;
-
-fn foo<const T: NoMatch>() -> bool {
- //[min]~^ ERROR `NoMatch` is forbidden as the type of a const generic parameter
- true
-}
-
-fn main() {
- foo::<{NoMatch}>();
-}
diff --git a/src/test/ui/const-generics/issues/issue-62878.full.stderr b/src/test/ui/const-generics/issues/issue-62878.full.stderr
index 6e6aa19..f074a65 100644
--- a/src/test/ui/const-generics/issues/issue-62878.full.stderr
+++ b/src/test/ui/const-generics/issues/issue-62878.full.stderr
@@ -4,21 +4,13 @@
LL | fn foo<const N: usize, const A: [u8; N]>() {}
| ^ the type must not depend on the parameter `N`
-error[E0747]: type provided when a constant was expected
- --> $DIR/issue-62878.rs:10:11
- |
-LL | foo::<_, {[1]}>();
- | ^
- |
- = help: const arguments cannot yet be inferred with `_`
-
error[E0308]: mismatched types
--> $DIR/issue-62878.rs:10:15
|
LL | foo::<_, {[1]}>();
| ^^^ expected `usize`, found array `[{integer}; 1]`
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0308, E0747, E0770.
+Some errors have detailed explanations: E0308, E0770.
For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/issues/issue-62878.min.stderr b/src/test/ui/const-generics/issues/issue-62878.min.stderr
index e4a71fe..af029a6 100644
--- a/src/test/ui/const-generics/issues/issue-62878.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-62878.min.stderr
@@ -11,7 +11,7 @@
| ^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/issues/issue-62878.rs b/src/test/ui/const-generics/issues/issue-62878.rs
index a70606c..38f5ff7 100644
--- a/src/test/ui/const-generics/issues/issue-62878.rs
+++ b/src/test/ui/const-generics/issues/issue-62878.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params, generic_arg_infer))]
#![cfg_attr(full, allow(incomplete_features))]
fn foo<const N: usize, const A: [u8; N]>() {}
@@ -8,6 +8,5 @@
fn main() {
foo::<_, {[1]}>();
- //[full]~^ ERROR type provided when a constant was expected
- //[full]~| ERROR mismatched types
+ //[full]~^ ERROR mismatched types
}
diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr
index 2fb38ad..b1141cf 100644
--- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error[E0741]: `&'static (dyn A + 'static)` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
--> $DIR/issue-63322-forbid-dyn.rs:9:18
diff --git a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs
index 334e2aa..01a6caa 100644
--- a/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs
+++ b/src/test/ui/const-generics/issues/issue-63322-forbid-dyn.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
trait A {}
diff --git a/src/test/ui/const-generics/issues/issue-64494.full.stderr b/src/test/ui/const-generics/issues/issue-64494.full.stderr
deleted file mode 100644
index abb26d6..0000000
--- a/src/test/ui/const-generics/issues/issue-64494.full.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-64494.rs:15:53
- |
-LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {}
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-64494.rs:18:53
- |
-LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/issues/issue-64494.min.stderr b/src/test/ui/const-generics/issues/issue-64494.min.stderr
deleted file mode 100644
index 846db0c..0000000
--- a/src/test/ui/const-generics/issues/issue-64494.min.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-64494.rs:15:38
- |
-LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {}
- | ^^^^^^ cannot perform const operation using `T`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/issue-64494.rs:18:38
- |
-LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
- | ^^^^^^ cannot perform const operation using `T`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error[E0119]: conflicting implementations of trait `MyTrait`
- --> $DIR/issue-64494.rs:18:1
- |
-LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {}
- | ------------------------------------ first implementation here
-...
-LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/const-generics/issues/issue-64494.rs b/src/test/ui/const-generics/issues/issue-64494.rs
deleted file mode 100644
index 96d1920..0000000
--- a/src/test/ui/const-generics/issues/issue-64494.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-trait Foo {
- const VAL: usize;
-}
-
-trait MyTrait {}
-
-trait True {}
-struct Is<const T: bool>;
-impl True for Is<{true}> {}
-
-impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {}
-//[full]~^ ERROR constant expression depends on a generic parameter
-//[min]~^^ ERROR generic parameters may not be used in const operations
-impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
-//[full]~^ ERROR constant expression depends on a generic parameter
-//[min]~^^ ERROR generic parameters may not be used in const operations
-//[min]~| ERROR conflicting implementations of trait `MyTrait`
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-64519.rs b/src/test/ui/const-generics/issues/issue-64519.rs
index 8c603b7..969289b 100644
--- a/src/test/ui/const-generics/issues/issue-64519.rs
+++ b/src/test/ui/const-generics/issues/issue-64519.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct Foo<const D: usize> {
state: Option<[u8; D]>,
}
diff --git a/src/test/ui/const-generics/issues/issue-64519.stderr b/src/test/ui/const-generics/issues/issue-64519.stderr
deleted file mode 100644
index 6552aea..0000000
--- a/src/test/ui/const-generics/issues/issue-64519.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-64519.rs:3:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/const-generics/issues/issue-66205.full.stderr b/src/test/ui/const-generics/issues/issue-66205.full.stderr
deleted file mode 100644
index 7e150f5..0000000
--- a/src/test/ui/const-generics/issues/issue-66205.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-66205.rs:7:12
- |
-LL | fact::<{ N - 1 }>();
- | ^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-66205.min.stderr b/src/test/ui/const-generics/issues/issue-66205.min.stderr
deleted file mode 100644
index b41793b..0000000
--- a/src/test/ui/const-generics/issues/issue-66205.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-66205.rs:7:14
- |
-LL | fact::<{ N - 1 }>();
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-66205.rs b/src/test/ui/const-generics/issues/issue-66205.rs
deleted file mode 100644
index 14249b6..0000000
--- a/src/test/ui/const-generics/issues/issue-66205.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-#![allow(dead_code, unconditional_recursion)]
-
-fn fact<const N: usize>() {
- fact::<{ N - 1 }>();
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used in const operations
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr
deleted file mode 100644
index e96b9e7..0000000
--- a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: `&'static str` is forbidden as the type of a const generic parameter
- --> $DIR/issue-66596-impl-trait-for-str-const-arg.rs:8:25
- |
-LL | trait Trait<const NAME: &'static str> {
- | ^^^^^^^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs
index 2a741ba..091419f 100644
--- a/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs
+++ b/src/test/ui/const-generics/issues/issue-66596-impl-trait-for-str-const-arg.rs
@@ -1,12 +1,9 @@
-//[full] check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+// check-pass
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
trait Trait<const NAME: &'static str> {
-//[min]~^ ERROR `&'static str` is forbidden
type Assoc;
}
diff --git a/src/test/ui/const-generics/issues/issue-66906.rs b/src/test/ui/const-generics/issues/issue-66906.rs
index a871b11..a0b3f91 100644
--- a/src/test/ui/const-generics/issues/issue-66906.rs
+++ b/src/test/ui/const-generics/issues/issue-66906.rs
@@ -1,7 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
pub struct Tuple;
diff --git a/src/test/ui/const-generics/issues/issue-67185-1.rs b/src/test/ui/const-generics/issues/issue-67185-1.rs
index ed35a5f..69425b2 100644
--- a/src/test/ui/const-generics/issues/issue-67185-1.rs
+++ b/src/test/ui/const-generics/issues/issue-67185-1.rs
@@ -1,7 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
trait Baz {
type Quaks;
diff --git a/src/test/ui/const-generics/issues/issue-67185-2.full.stderr b/src/test/ui/const-generics/issues/issue-67185-2.full.stderr
deleted file mode 100644
index fa9c680..0000000
--- a/src/test/ui/const-generics/issues/issue-67185-2.full.stderr
+++ /dev/null
@@ -1,103 +0,0 @@
-error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:16:1
- |
-LL | / trait Foo
-LL | |
-LL | | where
-LL | | [<u8 as Baz>::Quaks; 2]: Bar,
-LL | | <u8 as Baz>::Quaks: Bar,
-LL | | {
-LL | | }
- | |_^ the trait `Bar` is not implemented for `[u16; 3]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
- = help: see issue #48214
- = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
-
-error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:16:1
- |
-LL | / trait Foo
-LL | |
-LL | | where
-LL | | [<u8 as Baz>::Quaks; 2]: Bar,
-LL | | <u8 as Baz>::Quaks: Bar,
-LL | | {
-LL | | }
- | |_^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
- = help: see issue #48214
- = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
-
-error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:26:6
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | <u8 as Baz>::Quaks: Bar,
- | --- required by this bound in `Foo`
-...
-LL | impl Foo for FooImpl {}
- | ^^^ the trait `Bar` is not implemented for `[u16; 3]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:26:6
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | [<u8 as Baz>::Quaks; 2]: Bar,
- | --- required by this bound in `Foo`
-...
-LL | impl Foo for FooImpl {}
- | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:30:14
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | [<u8 as Baz>::Quaks; 2]: Bar,
- | --- required by this bound in `Foo`
-...
-LL | fn f(_: impl Foo) {}
- | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:30:14
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | <u8 as Baz>::Quaks: Bar,
- | --- required by this bound in `Foo`
-...
-LL | fn f(_: impl Foo) {}
- | ^^^ the trait `Bar` is not implemented for `[u16; 3]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-67185-2.min.stderr b/src/test/ui/const-generics/issues/issue-67185-2.min.stderr
deleted file mode 100644
index fa9c680..0000000
--- a/src/test/ui/const-generics/issues/issue-67185-2.min.stderr
+++ /dev/null
@@ -1,103 +0,0 @@
-error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:16:1
- |
-LL | / trait Foo
-LL | |
-LL | | where
-LL | | [<u8 as Baz>::Quaks; 2]: Bar,
-LL | | <u8 as Baz>::Quaks: Bar,
-LL | | {
-LL | | }
- | |_^ the trait `Bar` is not implemented for `[u16; 3]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
- = help: see issue #48214
- = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
-
-error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:16:1
- |
-LL | / trait Foo
-LL | |
-LL | | where
-LL | | [<u8 as Baz>::Quaks; 2]: Bar,
-LL | | <u8 as Baz>::Quaks: Bar,
-LL | | {
-LL | | }
- | |_^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
- = help: see issue #48214
- = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
-
-error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:26:6
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | <u8 as Baz>::Quaks: Bar,
- | --- required by this bound in `Foo`
-...
-LL | impl Foo for FooImpl {}
- | ^^^ the trait `Bar` is not implemented for `[u16; 3]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:26:6
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | [<u8 as Baz>::Quaks; 2]: Bar,
- | --- required by this bound in `Foo`
-...
-LL | impl Foo for FooImpl {}
- | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:30:14
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | [<u8 as Baz>::Quaks; 2]: Bar,
- | --- required by this bound in `Foo`
-...
-LL | fn f(_: impl Foo) {}
- | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
- --> $DIR/issue-67185-2.rs:30:14
- |
-LL | trait Foo
- | --- required by a bound in this
-...
-LL | <u8 as Baz>::Quaks: Bar,
- | --- required by this bound in `Foo`
-...
-LL | fn f(_: impl Foo) {}
- | ^^^ the trait `Bar` is not implemented for `[u16; 3]`
- |
- = help: the following implementations were found:
- <[[u16; 3]; 3] as Bar>
- <[u16; 4] as Bar>
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-67185-2.rs b/src/test/ui/const-generics/issues/issue-67185-2.rs
index 94a713d..c1a04e2 100644
--- a/src/test/ui/const-generics/issues/issue-67185-2.rs
+++ b/src/test/ui/const-generics/issues/issue-67185-2.rs
@@ -1,7 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
trait Baz {
type Quaks;
}
diff --git a/src/test/ui/const-generics/issues/issue-67185-2.stderr b/src/test/ui/const-generics/issues/issue-67185-2.stderr
new file mode 100644
index 0000000..7167bea
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-67185-2.stderr
@@ -0,0 +1,111 @@
+error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
+ --> $DIR/issue-67185-2.rs:12:1
+ |
+LL | / trait Foo
+LL | |
+LL | | where
+LL | | [<u8 as Baz>::Quaks; 2]: Bar,
+LL | | <u8 as Baz>::Quaks: Bar,
+LL | | {
+LL | | }
+ | |_^ the trait `Bar` is not implemented for `[u16; 3]`
+ |
+ = help: the following implementations were found:
+ <[[u16; 3]; 3] as Bar>
+ <[u16; 4] as Bar>
+ = help: see issue #48214
+ = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
+
+error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
+ --> $DIR/issue-67185-2.rs:12:1
+ |
+LL | / trait Foo
+LL | |
+LL | | where
+LL | | [<u8 as Baz>::Quaks; 2]: Bar,
+LL | | <u8 as Baz>::Quaks: Bar,
+LL | | {
+LL | | }
+ | |_^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
+ |
+ = help: the following implementations were found:
+ <[[u16; 3]; 3] as Bar>
+ <[u16; 4] as Bar>
+ = help: see issue #48214
+ = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
+
+error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
+ --> $DIR/issue-67185-2.rs:22:6
+ |
+LL | impl Foo for FooImpl {}
+ | ^^^ the trait `Bar` is not implemented for `[u16; 3]`
+ |
+ = help: the following implementations were found:
+ <[[u16; 3]; 3] as Bar>
+ <[u16; 4] as Bar>
+note: required by a bound in `Foo`
+ --> $DIR/issue-67185-2.rs:16:29
+ |
+LL | trait Foo
+ | --- required by a bound in this
+...
+LL | <u8 as Baz>::Quaks: Bar,
+ | ^^^ required by this bound in `Foo`
+
+error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
+ --> $DIR/issue-67185-2.rs:22:6
+ |
+LL | impl Foo for FooImpl {}
+ | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
+ |
+ = help: the following implementations were found:
+ <[[u16; 3]; 3] as Bar>
+ <[u16; 4] as Bar>
+note: required by a bound in `Foo`
+ --> $DIR/issue-67185-2.rs:15:34
+ |
+LL | trait Foo
+ | --- required by a bound in this
+...
+LL | [<u8 as Baz>::Quaks; 2]: Bar,
+ | ^^^ required by this bound in `Foo`
+
+error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
+ --> $DIR/issue-67185-2.rs:26:14
+ |
+LL | fn f(_: impl Foo) {}
+ | ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
+ |
+ = help: the following implementations were found:
+ <[[u16; 3]; 3] as Bar>
+ <[u16; 4] as Bar>
+note: required by a bound in `Foo`
+ --> $DIR/issue-67185-2.rs:15:34
+ |
+LL | trait Foo
+ | --- required by a bound in this
+...
+LL | [<u8 as Baz>::Quaks; 2]: Bar,
+ | ^^^ required by this bound in `Foo`
+
+error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
+ --> $DIR/issue-67185-2.rs:26:14
+ |
+LL | fn f(_: impl Foo) {}
+ | ^^^ the trait `Bar` is not implemented for `[u16; 3]`
+ |
+ = help: the following implementations were found:
+ <[[u16; 3]; 3] as Bar>
+ <[u16; 4] as Bar>
+note: required by a bound in `Foo`
+ --> $DIR/issue-67185-2.rs:16:29
+ |
+LL | trait Foo
+ | --- required by a bound in this
+...
+LL | <u8 as Baz>::Quaks: Bar,
+ | ^^^ required by this bound in `Foo`
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-67375.full.stderr b/src/test/ui/const-generics/issues/issue-67375.full.stderr
index 0fe6527..5386ef5 100644
--- a/src/test/ui/const-generics/issues/issue-67375.full.stderr
+++ b/src/test/ui/const-generics/issues/issue-67375.full.stderr
@@ -1,15 +1,15 @@
-warning: cannot use constants which depend on generic parameters in types
- --> $DIR/issue-67375.rs:8:12
+error: overly complex generic constant
+ --> $DIR/issue-67375.rs:7:17
|
LL | inner: [(); { [|_: &T| {}; 0].len() }],
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^----------^^^^^^^^^^^^
+ | |
+ | unsupported rvalue
|
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
+ = help: consider moving this anonymous constant into a `const` function
error[E0392]: parameter `T` is never used
- --> $DIR/issue-67375.rs:6:12
+ --> $DIR/issue-67375.rs:5:12
|
LL | struct Bug<T> {
| ^ unused parameter
@@ -17,6 +17,6 @@
= help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData`
= help: if you intended `T` to be a const parameter, use `const T: usize` instead
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/const-generics/issues/issue-67375.min.stderr b/src/test/ui/const-generics/issues/issue-67375.min.stderr
index be81fa9..5256d96 100644
--- a/src/test/ui/const-generics/issues/issue-67375.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-67375.min.stderr
@@ -1,14 +1,14 @@
error: generic parameters may not be used in const operations
- --> $DIR/issue-67375.rs:8:25
+ --> $DIR/issue-67375.rs:7:25
|
LL | inner: [(); { [|_: &T| {}; 0].len() }],
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `T` is never used
- --> $DIR/issue-67375.rs:6:12
+ --> $DIR/issue-67375.rs:5:12
|
LL | struct Bug<T> {
| ^ unused parameter
diff --git a/src/test/ui/const-generics/issues/issue-67375.rs b/src/test/ui/const-generics/issues/issue-67375.rs
index a8875b8..b5b842a 100644
--- a/src/test/ui/const-generics/issues/issue-67375.rs
+++ b/src/test/ui/const-generics/issues/issue-67375.rs
@@ -1,14 +1,12 @@
// revisions: full min
-
#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
struct Bug<T> {
//~^ ERROR parameter `T` is never used
inner: [(); { [|_: &T| {}; 0].len() }],
//[min]~^ ERROR generic parameters may not be used in const operations
- //[full]~^^ WARN cannot use constants which depend on generic parameters in types
- //[full]~^^^ WARN this was previously accepted by the compiler
+ //[full]~^^ ERROR overly complex generic constant
}
fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-67739.full.stderr b/src/test/ui/const-generics/issues/issue-67739.full.stderr
index dcbe5b9..f1a426c 100644
--- a/src/test/ui/const-generics/issues/issue-67739.full.stderr
+++ b/src/test/ui/const-generics/issues/issue-67739.full.stderr
@@ -1,10 +1,10 @@
-error: constant expression depends on a generic parameter
+error: unconstrained generic constant
--> $DIR/issue-67739.rs:11:15
|
LL | [0u8; mem::size_of::<Self::Associated>()];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: this may fail depending on what value the parameter takes
+ = help: try adding a `where` bound using this expression: `where [(); mem::size_of::<Self::Associated>()]:`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-67739.rs b/src/test/ui/const-generics/issues/issue-67739.rs
index e4960e5..de0eb7f 100644
--- a/src/test/ui/const-generics/issues/issue-67739.rs
+++ b/src/test/ui/const-generics/issues/issue-67739.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
use std::mem;
@@ -9,7 +9,8 @@
fn associated_size(&self) -> usize {
[0u8; mem::size_of::<Self::Associated>()];
- //~^ ERROR constant expression depends on a generic parameter
+ //[min]~^ ERROR constant expression depends on a generic parameter
+ //[full]~^^ ERROR unconstrained generic constant
0
}
}
diff --git a/src/test/ui/const-generics/issues/issue-67945-1.full.stderr b/src/test/ui/const-generics/issues/issue-67945-1.full.stderr
index 63c50b5..1edc782 100644
--- a/src/test/ui/const-generics/issues/issue-67945-1.full.stderr
+++ b/src/test/ui/const-generics/issues/issue-67945-1.full.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-67945-1.rs:13:20
+ --> $DIR/issue-67945-1.rs:10:20
|
LL | struct Bug<S> {
| - this type parameter
@@ -13,7 +13,7 @@
found union `MaybeUninit<_>`
error[E0392]: parameter `S` is never used
- --> $DIR/issue-67945-1.rs:10:12
+ --> $DIR/issue-67945-1.rs:7:12
|
LL | struct Bug<S> {
| ^ unused parameter
diff --git a/src/test/ui/const-generics/issues/issue-67945-1.min.stderr b/src/test/ui/const-generics/issues/issue-67945-1.min.stderr
index 074d36c..eee04eb 100644
--- a/src/test/ui/const-generics/issues/issue-67945-1.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-67945-1.min.stderr
@@ -1,23 +1,23 @@
error: generic parameters may not be used in const operations
- --> $DIR/issue-67945-1.rs:13:16
+ --> $DIR/issue-67945-1.rs:10:16
|
LL | let x: S = MaybeUninit::uninit();
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/issue-67945-1.rs:16:45
+ --> $DIR/issue-67945-1.rs:13:45
|
LL | let b = &*(&x as *const _ as *const S);
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `S` is never used
- --> $DIR/issue-67945-1.rs:10:12
+ --> $DIR/issue-67945-1.rs:7:12
|
LL | struct Bug<S> {
| ^ unused parameter
diff --git a/src/test/ui/const-generics/issues/issue-67945-1.rs b/src/test/ui/const-generics/issues/issue-67945-1.rs
index 84737e4..7b7e842 100644
--- a/src/test/ui/const-generics/issues/issue-67945-1.rs
+++ b/src/test/ui/const-generics/issues/issue-67945-1.rs
@@ -1,11 +1,8 @@
// revisions: full min
-
#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
-use std::marker::PhantomData;
-
-use std::mem::{self, MaybeUninit};
+use std::mem::MaybeUninit;
struct Bug<S> {
//~^ ERROR parameter `S` is never used
diff --git a/src/test/ui/const-generics/issues/issue-67945-2.full.stderr b/src/test/ui/const-generics/issues/issue-67945-2.full.stderr
index b900406..118cf44 100644
--- a/src/test/ui/const-generics/issues/issue-67945-2.full.stderr
+++ b/src/test/ui/const-generics/issues/issue-67945-2.full.stderr
@@ -1,27 +1,17 @@
-error[E0308]: mismatched types
- --> $DIR/issue-67945-2.rs:11:20
+error: overly complex generic constant
+ --> $DIR/issue-67945-2.rs:7:13
|
-LL | struct Bug<S> {
- | - this type parameter
-...
-LL | let x: S = MaybeUninit::uninit();
- | - ^^^^^^^^^^^^^^^^^^^^^ expected type parameter `S`, found union `MaybeUninit`
- | |
- | expected due to this
+LL | A: [(); {
+ | _____________^
+LL | |
+LL | | let x: Option<Box<Self>> = None;
+ | | ---- unsupported rvalue
+LL | |
+LL | | 0
+LL | | }],
+ | |_____^
|
- = note: expected type parameter `S`
- found union `MaybeUninit<_>`
+ = help: consider moving this anonymous constant into a `const` function
-error[E0392]: parameter `S` is never used
- --> $DIR/issue-67945-2.rs:8:12
- |
-LL | struct Bug<S> {
- | ^ unused parameter
- |
- = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData`
- = help: if you intended `S` to be a const parameter, use `const S: usize` instead
+error: aborting due to previous error
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0308, E0392.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/issues/issue-67945-2.min.stderr b/src/test/ui/const-generics/issues/issue-67945-2.min.stderr
index c06df79..6e07af1 100644
--- a/src/test/ui/const-generics/issues/issue-67945-2.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-67945-2.min.stderr
@@ -1,30 +1,8 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-67945-2.rs:11:16
+error: generic `Self` types are currently not permitted in anonymous constants
+ --> $DIR/issue-67945-2.rs:9:27
|
-LL | let x: S = MaybeUninit::uninit();
- | ^ cannot perform const operation using `S`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+LL | let x: Option<Box<Self>> = None;
+ | ^^^^
-error: generic parameters may not be used in const operations
- --> $DIR/issue-67945-2.rs:14:45
- |
-LL | let b = &*(&x as *const _ as *const S);
- | ^ cannot perform const operation using `S`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+error: aborting due to previous error
-error[E0392]: parameter `S` is never used
- --> $DIR/issue-67945-2.rs:8:12
- |
-LL | struct Bug<S> {
- | ^ unused parameter
- |
- = help: consider removing `S`, referring to it in a field, or using a marker such as `PhantomData`
- = help: if you intended `S` to be a const parameter, use `const S: usize` instead
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/const-generics/issues/issue-67945-2.rs b/src/test/ui/const-generics/issues/issue-67945-2.rs
index 4a46786..cbb4e14 100644
--- a/src/test/ui/const-generics/issues/issue-67945-2.rs
+++ b/src/test/ui/const-generics/issues/issue-67945-2.rs
@@ -1,20 +1,16 @@
// revisions: full min
#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
-use std::mem::MaybeUninit;
-
-struct Bug<S> {
- //~^ ERROR parameter `S` is never used
+struct Bug<S: ?Sized> {
A: [(); {
- let x: S = MaybeUninit::uninit();
- //[min]~^ ERROR generic parameters may not be used in const operations
- //[full]~^^ ERROR mismatched types
- let b = &*(&x as *const _ as *const S);
- //[min]~^ ERROR generic parameters may not be used in const operations
+ //[full]~^ ERROR overly complex generic constant
+ let x: Option<Box<Self>> = None;
+ //[min]~^ ERROR generic `Self` types are currently not permitted in anonymous constants
0
}],
+ B: S
}
fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-67945-3.full.stderr b/src/test/ui/const-generics/issues/issue-67945-3.full.stderr
deleted file mode 100644
index fa66252..0000000
--- a/src/test/ui/const-generics/issues/issue-67945-3.full.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-67945-3.rs:7:8
- |
-LL | A: [(); {
- | ________^
-LL | |
-LL | | let x: Option<Box<Self>> = None;
-LL | |
-LL | | 0
-LL | | }],
- | |______^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-67945-3.min.stderr b/src/test/ui/const-generics/issues/issue-67945-3.min.stderr
deleted file mode 100644
index 5c30429..0000000
--- a/src/test/ui/const-generics/issues/issue-67945-3.min.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: generic `Self` types are currently not permitted in anonymous constants
- --> $DIR/issue-67945-3.rs:9:27
- |
-LL | let x: Option<Box<Self>> = None;
- | ^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-67945-3.rs b/src/test/ui/const-generics/issues/issue-67945-3.rs
deleted file mode 100644
index 5bad61c..0000000
--- a/src/test/ui/const-generics/issues/issue-67945-3.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// revisions: full min
-
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
-struct Bug<S: ?Sized> {
- A: [(); {
- //[full]~^ ERROR constant expression depends on a generic parameter
- let x: Option<Box<Self>> = None;
- //[min]~^ ERROR generic `Self` types are currently not permitted in anonymous constants
- 0
- }],
- B: S
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs b/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs
index 43c3999..ad5710b 100644
--- a/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs
+++ b/src/test/ui/const-generics/issues/issue-68104-print-stack-overflow.rs
@@ -1,9 +1,7 @@
// aux-build:impl-const.rs
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
extern crate impl_const;
diff --git a/src/test/ui/const-generics/issues/issue-68366.min.stderr b/src/test/ui/const-generics/issues/issue-68366.min.stderr
index da4cbd3..9f370b0 100644
--- a/src/test/ui/const-generics/issues/issue-68366.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-68366.min.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0207]: the const parameter `N` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-68366.rs:11:13
diff --git a/src/test/ui/const-generics/issues/issue-68366.rs b/src/test/ui/const-generics/issues/issue-68366.rs
index 37afed6..4c2741a 100644
--- a/src/test/ui/const-generics/issues/issue-68366.rs
+++ b/src/test/ui/const-generics/issues/issue-68366.rs
@@ -3,7 +3,7 @@
// type.
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
struct Collatz<const N: Option<usize>>;
diff --git a/src/test/ui/const-generics/issues/issue-68596.rs b/src/test/ui/const-generics/issues/issue-68596.rs
index 0bb23be..c3c9141 100644
--- a/src/test/ui/const-generics/issues/issue-68596.rs
+++ b/src/test/ui/const-generics/issues/issue-68596.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
pub struct S(u8);
impl S {
diff --git a/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr b/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr
index 4782b1d..df04c48 100644
--- a/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-68615-adt.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-68615-adt.rs b/src/test/ui/const-generics/issues/issue-68615-adt.rs
index ddea3e8..3ef1ad4 100644
--- a/src/test/ui/const-generics/issues/issue-68615-adt.rs
+++ b/src/test/ui/const-generics/issues/issue-68615-adt.rs
@@ -1,6 +1,6 @@
// [full] check-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Const<const V: [usize; 0]> {}
diff --git a/src/test/ui/const-generics/issues/issue-68615-array.min.stderr b/src/test/ui/const-generics/issues/issue-68615-array.min.stderr
index d0c190b..1b45170 100644
--- a/src/test/ui/const-generics/issues/issue-68615-array.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-68615-array.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-68615-array.rs b/src/test/ui/const-generics/issues/issue-68615-array.rs
index 56afd9b..93477be 100644
--- a/src/test/ui/const-generics/issues/issue-68615-array.rs
+++ b/src/test/ui/const-generics/issues/issue-68615-array.rs
@@ -1,6 +1,6 @@
// [full] check-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Foo<const V: [usize; 0] > {}
diff --git a/src/test/ui/const-generics/issues/issue-68977.full.stderr b/src/test/ui/const-generics/issues/issue-68977.full.stderr
deleted file mode 100644
index 25dcd88..0000000
--- a/src/test/ui/const-generics/issues/issue-68977.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-68977.rs:34:44
- |
-LL | FxpStorageHelper<INT_BITS, FRAC_BITS>: FxpStorage,
- | ^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-68977.min.stderr b/src/test/ui/const-generics/issues/issue-68977.min.stderr
deleted file mode 100644
index 0b3d5b9..0000000
--- a/src/test/ui/const-generics/issues/issue-68977.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-68977.rs:28:17
- |
-LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>;
- | ^^^^^^^^ cannot perform const operation using `INT_BITS`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `INT_BITS`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/issue-68977.rs:28:28
- |
-LL | PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>;
- | ^^^^^^^^^ cannot perform const operation using `FRAC_BITS`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `FRAC_BITS`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/issues/issue-68977.rs b/src/test/ui/const-generics/issues/issue-68977.rs
deleted file mode 100644
index a0ffcc8..0000000
--- a/src/test/ui/const-generics/issues/issue-68977.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-struct PhantomU8<const X: u8>;
-
-trait FxpStorage {
- type SInt; // Add arithmetic traits as needed.
-}
-
-macro_rules! fxp_storage_impls {
- ($($($n:literal)|+ => $sint:ty),* $(,)?) => {
- $($(impl FxpStorage for PhantomU8<$n> {
- type SInt = $sint;
- })*)*
- }
-}
-
-fxp_storage_impls! {
- 1 => i8,
- 2 => i16,
- 3 | 4 => i32,
- 5 | 6 | 7 | 8 => i64,
- 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 => i128,
-}
-
-type FxpStorageHelper<const INT_BITS: u8, const FRAC_BITS: u8> =
- PhantomU8<{(INT_BITS + FRAC_BITS + 7) / 8}>;
- //[min]~^ ERROR generic parameters may not be used in const operations
- //[min]~| ERROR generic parameters may not be used in const operations
-
-struct Fxp<const INT_BITS: u8, const FRAC_BITS: u8>
-where
- FxpStorageHelper<INT_BITS, FRAC_BITS>: FxpStorage,
- //[full]~^ ERROR constant expression depends on a generic parameter
-{
- storage: <FxpStorageHelper<INT_BITS, FRAC_BITS> as FxpStorage>::SInt,
-}
-
-fn main() {
- Fxp::<1, 15> { storage: 0i16 };
- Fxp::<2, 15> { storage: 0i32 };
-}
diff --git a/src/test/ui/const-generics/issues/issue-69654-run-pass.rs b/src/test/ui/const-generics/issues/issue-69654-run-pass.rs
index 45318ca..63d7fde 100644
--- a/src/test/ui/const-generics/issues/issue-69654-run-pass.rs
+++ b/src/test/ui/const-generics/issues/issue-69654-run-pass.rs
@@ -1,8 +1,6 @@
-#![feature(const_generics)]
-#![allow(incomplete_features, unused_braces)]
-
+// run-pass
trait Bar<T> {}
-impl<T> Bar<T> for [u8; {7}] {}
+impl<T> Bar<T> for [u8; 7] {}
struct Foo<const N: usize> {}
impl<const N: usize> Foo<N>
@@ -14,5 +12,4 @@
fn main() {
Foo::foo();
- //~^ ERROR the function or associated item
}
diff --git a/src/test/ui/const-generics/issues/issue-69654-run-pass.stderr b/src/test/ui/const-generics/issues/issue-69654-run-pass.stderr
deleted file mode 100644
index a82a606..0000000
--- a/src/test/ui/const-generics/issues/issue-69654-run-pass.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0599]: the function or associated item `foo` exists for struct `Foo<{_: usize}>`, but its trait bounds were not satisfied
- --> $DIR/issue-69654-run-pass.rs:16:10
- |
-LL | struct Foo<const N: usize> {}
- | -------------------------- function or associated item `foo` not found for this
-...
-LL | Foo::foo();
- | ^^^ function or associated item cannot be called on `Foo<{_: usize}>` due to unsatisfied trait bounds
- |
- = note: the following trait bounds were not satisfied:
- `[u8; _]: Bar<[(); _]>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/const-generics/issues/issue-69654.rs b/src/test/ui/const-generics/issues/issue-69654.rs
deleted file mode 100644
index b1214b1..0000000
--- a/src/test/ui/const-generics/issues/issue-69654.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-#![feature(const_generics)]
-#![allow(incomplete_features)]
-
-trait Bar<T> {}
-impl<T> Bar<T> for [u8; T] {}
-//~^ ERROR expected value, found type parameter `T`
-
-struct Foo<const N: usize> {}
-impl<const N: usize> Foo<N>
-where
- [u8; N]: Bar<[(); N]>,
-{
- fn foo() {}
-}
-
-fn main() {
- Foo::foo();
- //~^ ERROR the function or associated item
-}
diff --git a/src/test/ui/const-generics/issues/issue-70125-1.rs b/src/test/ui/const-generics/issues/issue-70125-1.rs
index 5c118d2..0027cd4 100644
--- a/src/test/ui/const-generics/issues/issue-70125-1.rs
+++ b/src/test/ui/const-generics/issues/issue-70125-1.rs
@@ -1,7 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
const L: usize = 4;
diff --git a/src/test/ui/const-generics/issues/issue-70125-2.rs b/src/test/ui/const-generics/issues/issue-70125-2.rs
index f821312..cfd5e78 100644
--- a/src/test/ui/const-generics/issues/issue-70125-2.rs
+++ b/src/test/ui/const-generics/issues/issue-70125-2.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
fn main() {
<()>::foo();
}
diff --git a/src/test/ui/const-generics/issues/issue-70167.rs b/src/test/ui/const-generics/issues/issue-70167.rs
index 9e912b6..3961941 100644
--- a/src/test/ui/const-generics/issues/issue-70167.rs
+++ b/src/test/ui/const-generics/issues/issue-70167.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
pub trait Trait<const N: usize>: From<<Self as Trait<N>>::Item> {
type Item;
}
diff --git a/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs b/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs
index f055482..2ec37cc 100644
--- a/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs
+++ b/src/test/ui/const-generics/issues/issue-70180-1-stalled_on.rs
@@ -1,8 +1,4 @@
// build-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
pub fn works() {
let array/*: [_; _]*/ = default_array();
diff --git a/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs b/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs
index 21cefc0..95e5484 100644
--- a/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs
+++ b/src/test/ui/const-generics/issues/issue-70180-2-stalled_on.rs
@@ -1,8 +1,4 @@
// build-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
fn works() {
let array/*: [u8; _]*/ = default_byte_array();
diff --git a/src/test/ui/const-generics/issues/issue-70225.rs b/src/test/ui/const-generics/issues/issue-70225.rs
index 8f8d753..d458d7b 100644
--- a/src/test/ui/const-generics/issues/issue-70225.rs
+++ b/src/test/ui/const-generics/issues/issue-70225.rs
@@ -1,6 +1,4 @@
// check-pass
-#![feature(const_generics)]
-#![allow(incomplete_features)]
#![deny(dead_code)]
// We previously incorrectly linted `L` as unused here.
diff --git a/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs b/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs
index 189a325..a764882 100644
--- a/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs
+++ b/src/test/ui/const-generics/issues/issue-70273-assoc-fn.rs
@@ -1,7 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
trait T<const A: usize> {
fn f();
diff --git a/src/test/ui/const-generics/issues/issue-71169.full.stderr b/src/test/ui/const-generics/issues/issue-71169.full.stderr
index 7b1a2f9..1f5880f 100644
--- a/src/test/ui/const-generics/issues/issue-71169.full.stderr
+++ b/src/test/ui/const-generics/issues/issue-71169.full.stderr
@@ -4,14 +4,6 @@
LL | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
| ^^^ the type must not depend on the parameter `LEN`
-error: constant expression depends on a generic parameter
- --> $DIR/issue-71169.rs:10:14
- |
-LL | foo::<4, DATA>();
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0770`.
diff --git a/src/test/ui/const-generics/issues/issue-71169.min.stderr b/src/test/ui/const-generics/issues/issue-71169.min.stderr
index 1c6e08a..87ed2d4 100644
--- a/src/test/ui/const-generics/issues/issue-71169.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-71169.min.stderr
@@ -11,7 +11,7 @@
| ^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/issues/issue-71169.rs b/src/test/ui/const-generics/issues/issue-71169.rs
index a574da4..617149a 100644
--- a/src/test/ui/const-generics/issues/issue-71169.rs
+++ b/src/test/ui/const-generics/issues/issue-71169.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
@@ -8,5 +8,4 @@
fn main() {
const DATA: [u8; 4] = *b"ABCD";
foo::<4, DATA>();
- //[full]~^ ERROR constant expression depends on
}
diff --git a/src/test/ui/const-generics/issues/issue-71202.rs b/src/test/ui/const-generics/issues/issue-71202.rs
index 78dee17..57fd72b 100644
--- a/src/test/ui/const-generics/issues/issue-71202.rs
+++ b/src/test/ui/const-generics/issues/issue-71202.rs
@@ -1,6 +1,4 @@
-// check-pass
-
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features, const_evaluatable_unchecked)]
use std::marker::PhantomData;
@@ -10,7 +8,7 @@
}
impl<T: Copy> DataHolder<T> {
- const ITEM_IS_COPY: [(); 1 - {
+ const ITEM_IS_COPY: [(); 1 - { //~ ERROR unconstrained generic constant
trait NotCopy {
const VALUE: bool = false;
}
diff --git a/src/test/ui/const-generics/issues/issue-71202.stderr b/src/test/ui/const-generics/issues/issue-71202.stderr
new file mode 100644
index 0000000..2775406
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-71202.stderr
@@ -0,0 +1,33 @@
+error: unconstrained generic constant
+ --> $DIR/issue-71202.rs:11:5
+ |
+LL | / const ITEM_IS_COPY: [(); 1 - {
+LL | | trait NotCopy {
+LL | | const VALUE: bool = false;
+LL | | }
+... |
+LL | | <IsCopy<T>>::VALUE
+LL | | } as usize] = [];
+ | |_____________________^
+ |
+ = help: try adding a `where` bound using this expression: `where [(); 1 - {
+ trait NotCopy {
+ const VALUE: bool = false;
+ }
+
+ impl<__Type: ?Sized> NotCopy for __Type {}
+
+ struct IsCopy<__Type: ?Sized>(PhantomData<__Type>);
+
+ impl<__Type> IsCopy<__Type>
+ where
+ __Type: Sized + Copy,
+ {
+ const VALUE: bool = true;
+ }
+
+ <IsCopy<T>>::VALUE
+ } as usize]:`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/issues/issue-71381.rs b/src/test/ui/const-generics/issues/issue-71381.rs
index f015d69..66f819d 100644
--- a/src/test/ui/const-generics/issues/issue-71381.rs
+++ b/src/test/ui/const-generics/issues/issue-71381.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Test(*const usize);
diff --git a/src/test/ui/const-generics/issues/issue-71382.rs b/src/test/ui/const-generics/issues/issue-71382.rs
index 3a56db9..4392d72 100644
--- a/src/test/ui/const-generics/issues/issue-71382.rs
+++ b/src/test/ui/const-generics/issues/issue-71382.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Test();
diff --git a/src/test/ui/const-generics/issues/issue-71611.rs b/src/test/ui/const-generics/issues/issue-71611.rs
index 6468d0b..fbb91ca 100644
--- a/src/test/ui/const-generics/issues/issue-71611.rs
+++ b/src/test/ui/const-generics/issues/issue-71611.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
fn func<A, const F: fn(inner: A)>(outer: A) {
diff --git a/src/test/ui/const-generics/issues/issue-71986.rs b/src/test/ui/const-generics/issues/issue-71986.rs
index 6bfdba5..6f0a98e 100644
--- a/src/test/ui/const-generics/issues/issue-71986.rs
+++ b/src/test/ui/const-generics/issues/issue-71986.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
pub trait Foo<const B: bool> {}
pub fn bar<T: Foo<{ true }>>() {}
diff --git a/src/test/ui/const-generics/issues/issue-72352.rs b/src/test/ui/const-generics/issues/issue-72352.rs
index 9cd95c1..2fa1d7a 100644
--- a/src/test/ui/const-generics/issues/issue-72352.rs
+++ b/src/test/ui/const-generics/issues/issue-72352.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
use std::ffi::{CStr, CString};
diff --git a/src/test/ui/const-generics/issues/issue-72787.full.stderr b/src/test/ui/const-generics/issues/issue-72787.full.stderr
deleted file mode 100644
index fbb7ae5..0000000
--- a/src/test/ui/const-generics/issues/issue-72787.full.stderr
+++ /dev/null
@@ -1,42 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-72787.rs:10:32
- |
-LL | Condition<{ LHS <= RHS }>: True
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-72787.rs:25:42
- |
-LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-72787.rs:25:42
- |
-LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-72787.rs:25:42
- |
-LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-72787.rs:25:42
- |
-LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
- | ^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 5 previous errors
-
diff --git a/src/test/ui/const-generics/issues/issue-72787.min.stderr b/src/test/ui/const-generics/issues/issue-72787.min.stderr
deleted file mode 100644
index aadf19b..0000000
--- a/src/test/ui/const-generics/issues/issue-72787.min.stderr
+++ /dev/null
@@ -1,61 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-72787.rs:10:17
- |
-LL | Condition<{ LHS <= RHS }>: True
- | ^^^ cannot perform const operation using `LHS`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `LHS`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/issue-72787.rs:10:24
- |
-LL | Condition<{ LHS <= RHS }>: True
- | ^^^ cannot perform const operation using `RHS`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `RHS`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/issue-72787.rs:25:25
- |
-LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
- | ^ cannot perform const operation using `I`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `I`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/issue-72787.rs:25:36
- |
-LL | IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
- | ^ cannot perform const operation using `J`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `J`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error[E0283]: type annotations needed
- --> $DIR/issue-72787.rs:21:26
- |
-LL | pub trait True {}
- | -------------- required by this bound in `True`
-...
-LL | IsLessOrEqual<I, 8>: True,
- | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
- |
- = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
-
-error[E0283]: type annotations needed
- --> $DIR/issue-72787.rs:21:26
- |
-LL | pub trait True {}
- | -------------- required by this bound in `True`
-...
-LL | IsLessOrEqual<I, 8>: True,
- | ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
- |
- = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
-
-error: aborting due to 6 previous errors
-
-For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/const-generics/issues/issue-72787.rs b/src/test/ui/const-generics/issues/issue-72787.rs
deleted file mode 100644
index 16bc947..0000000
--- a/src/test/ui/const-generics/issues/issue-72787.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-pub struct IsLessOrEqual<const LHS: u32, const RHS: u32>;
-pub struct Condition<const CONDITION: bool>;
-pub trait True {}
-
-impl<const LHS: u32, const RHS: u32> True for IsLessOrEqual<LHS, RHS> where
- Condition<{ LHS <= RHS }>: True
-//[full]~^ Error constant expression depends on a generic parameter
-//[min]~^^ Error generic parameters may not be used in const operations
-//[min]~| Error generic parameters may not be used in const operations
-{
-}
-impl True for Condition<true> {}
-
-struct S<const I: u32, const J: u32>;
-impl<const I: u32, const J: u32> S<I, J>
-where
- IsLessOrEqual<I, 8>: True,
-//[min]~^ Error type annotations needed [E0283]
-//[min]~| Error type annotations needed [E0283]
- IsLessOrEqual<J, 8>: True,
- IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
-//[full]~^ constant expression depends on a generic parameter
-//[full]~| constant expression depends on a generic parameter
-//[full]~| constant expression depends on a generic parameter
-//[full]~| constant expression depends on a generic parameter
-//[min]~^^^^^ Error generic parameters may not be used in const operations
-//[min]~| Error generic parameters may not be used in const operations
- // Condition<{ 8 - I <= 8 - J }>: True,
-{
- fn print() {
- println!("I {} J {}", I, J);
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr
deleted file mode 100644
index 82f9b9d..0000000
--- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.full.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-72819-generic-in-const-eval.rs:8:39
- |
-LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
- | ^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr
deleted file mode 100644
index 6646be4..0000000
--- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.min.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-72819-generic-in-const-eval.rs:8:17
- |
-LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs b/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs
deleted file mode 100644
index f612d8b..0000000
--- a/src/test/ui/const-generics/issues/issue-72819-generic-in-const-eval.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Regression test for #72819: ICE due to failure in resolving the const generic in `Arr`'s type
-// bounds.
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-struct Arr<const N: usize>
-where Assert::<{N < usize::MAX / 2}>: IsTrue,
-//[full]~^ ERROR constant expression depends on a generic parameter
-//[min]~^^ ERROR generic parameters may not be used in const operations
-{
-}
-
-enum Assert<const CHECK: bool> {}
-
-trait IsTrue {}
-
-impl IsTrue for Assert<true> {}
-
-fn main() {
- let x: Arr<{usize::MAX}> = Arr {};
-}
diff --git a/src/test/ui/const-generics/issues/issue-73120.rs b/src/test/ui/const-generics/issues/issue-73120.rs
index c153a93..050dc9b 100644
--- a/src/test/ui/const-generics/issues/issue-73120.rs
+++ b/src/test/ui/const-generics/issues/issue-73120.rs
@@ -1,6 +1,7 @@
-// revisions: full min
// check-pass
// aux-build:const_generic_issues_lib.rs
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
extern crate const_generic_issues_lib as lib2;
fn unused_function(
_: <lib2::GenericType<42> as lib2::TypeFn>::Output
diff --git a/src/test/ui/const-generics/issues/issue-73260.rs b/src/test/ui/const-generics/issues/issue-73260.rs
index 04e4e9c..d762f9c 100644
--- a/src/test/ui/const-generics/issues/issue-73260.rs
+++ b/src/test/ui/const-generics/issues/issue-73260.rs
@@ -1,11 +1,10 @@
// compile-flags: -Zsave-analysis
-
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
struct Arr<const N: usize>
-where Assert::<{N < usize::MAX / 2}>: IsTrue, //~ ERROR constant expression
-{
-}
+where
+ Assert::<{N < usize::MAX / 2}>: IsTrue,
+{}
enum Assert<const CHECK: bool> {}
diff --git a/src/test/ui/const-generics/issues/issue-73260.stderr b/src/test/ui/const-generics/issues/issue-73260.stderr
index 6a912ff..f1fc50e 100644
--- a/src/test/ui/const-generics/issues/issue-73260.stderr
+++ b/src/test/ui/const-generics/issues/issue-73260.stderr
@@ -1,13 +1,5 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-73260.rs:6:39
- |
-LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
- | ^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
error[E0308]: mismatched types
- --> $DIR/issue-73260.rs:17:12
+ --> $DIR/issue-73260.rs:16:12
|
LL | let x: Arr<{usize::MAX}> = Arr {};
| ^^^^^^^^^^^^^^^^^ expected `false`, found `true`
@@ -16,7 +8,7 @@
found type `true`
error[E0308]: mismatched types
- --> $DIR/issue-73260.rs:17:32
+ --> $DIR/issue-73260.rs:16:32
|
LL | let x: Arr<{usize::MAX}> = Arr {};
| ^^^ expected `false`, found `true`
@@ -24,6 +16,6 @@
= note: expected type `false`
found type `true`
-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/src/test/ui/const-generics/issues/issue-73491.min.stderr b/src/test/ui/const-generics/issues/issue-73491.min.stderr
index c8f2e0d..f2b58e5 100644
--- a/src/test/ui/const-generics/issues/issue-73491.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-73491.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-73491.rs b/src/test/ui/const-generics/issues/issue-73491.rs
index c7cb92b..f15c1f2 100644
--- a/src/test/ui/const-generics/issues/issue-73491.rs
+++ b/src/test/ui/const-generics/issues/issue-73491.rs
@@ -1,6 +1,6 @@
// [full] check-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
const LEN: usize = 1024;
diff --git a/src/test/ui/const-generics/issues/issue-73508.full.stderr b/src/test/ui/const-generics/issues/issue-73508.full.stderr
deleted file mode 100644
index 81691a1..0000000
--- a/src/test/ui/const-generics/issues/issue-73508.full.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: using raw pointers as const generic parameters is forbidden
- --> $DIR/issue-73508.rs:5:33
- |
-LL | pub const fn func_name<const X: *const u32>() {}
- | ^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-73508.min.stderr b/src/test/ui/const-generics/issues/issue-73508.min.stderr
deleted file mode 100644
index 81691a1..0000000
--- a/src/test/ui/const-generics/issues/issue-73508.min.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: using raw pointers as const generic parameters is forbidden
- --> $DIR/issue-73508.rs:5:33
- |
-LL | pub const fn func_name<const X: *const u32>() {}
- | ^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-73508.rs b/src/test/ui/const-generics/issues/issue-73508.rs
deleted file mode 100644
index f02c416..0000000
--- a/src/test/ui/const-generics/issues/issue-73508.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-pub const fn func_name<const X: *const u32>() {}
-//~^ ERROR using raw pointers
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-73899.rs b/src/test/ui/const-generics/issues/issue-73899.rs
deleted file mode 100644
index 2a3a5ab..0000000
--- a/src/test/ui/const-generics/issues/issue-73899.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// run-pass
-#![feature(const_evaluatable_checked)]
-#![feature(const_generics)]
-#![allow(incomplete_features)]
-
-trait Foo {}
-
-impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-
-trait FooImpl<const IS_ZERO: bool> {}
-
-impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
-
-impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
-
-fn foo<T: Foo>(_v: T) {}
-
-fn main() {
- foo([]);
- foo([()]);
-}
diff --git a/src/test/ui/const-generics/issues/issue-74101.min.stderr b/src/test/ui/const-generics/issues/issue-74101.min.stderr
index a7f0ecf0..82ffb23 100644
--- a/src/test/ui/const-generics/issues/issue-74101.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-74101.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `[u8; _]` is forbidden as the type of a const generic parameter
--> $DIR/issue-74101.rs:9:21
@@ -14,7 +14,7 @@
| ^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/issues/issue-74101.rs b/src/test/ui/const-generics/issues/issue-74101.rs
index d4fd72e..6b606b9 100644
--- a/src/test/ui/const-generics/issues/issue-74101.rs
+++ b/src/test/ui/const-generics/issues/issue-74101.rs
@@ -1,6 +1,6 @@
// [full] check-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
fn test<const N: [u8; 1 + 2]>() {}
diff --git a/src/test/ui/const-generics/issues/issue-74255.min.stderr b/src/test/ui/const-generics/issues/issue-74255.min.stderr
index 62ad439..b462d84 100644
--- a/src/test/ui/const-generics/issues/issue-74255.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-74255.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-74255.rs b/src/test/ui/const-generics/issues/issue-74255.rs
index 75a876c..0e52392 100644
--- a/src/test/ui/const-generics/issues/issue-74255.rs
+++ b/src/test/ui/const-generics/issues/issue-74255.rs
@@ -1,6 +1,6 @@
// [full] check-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
#[derive(PartialEq, Eq)]
diff --git a/src/test/ui/const-generics/issues/issue-74634.rs b/src/test/ui/const-generics/issues/issue-74634.rs
deleted file mode 100644
index 0f23fa9..0000000
--- a/src/test/ui/const-generics/issues/issue-74634.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-#![feature(const_generics)]
-#![allow(incomplete_features)]
-
-trait If<const COND: bool> {}
-impl If<true> for () {}
-
-trait IsZero<const N: u8> {
- type Answer;
-}
-
-struct True;
-struct False;
-
-impl<const N: u8> IsZero<N> for ()
-where (): If<{N == 0}> { //~ERROR constant expression
- type Answer = True;
-}
-
-trait Foobar<const N: u8> {}
-
-impl<const N: u8> Foobar<N> for ()
-where (): IsZero<N, Answer = True> {}
-
-impl<const N: u8> Foobar<N> for ()
-where (): IsZero<N, Answer = False> {}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-74634.stderr b/src/test/ui/const-generics/issues/issue-74634.stderr
deleted file mode 100644
index 091a1ac..0000000
--- a/src/test/ui/const-generics/issues/issue-74634.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-74634.rs:15:11
- |
-LL | where (): If<{N == 0}> {
- | ^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/issues/issue-74906.rs b/src/test/ui/const-generics/issues/issue-74906.rs
index dc3c337..cc1f285 100644
--- a/src/test/ui/const-generics/issues/issue-74906.rs
+++ b/src/test/ui/const-generics/issues/issue-74906.rs
@@ -1,8 +1,6 @@
// edition:2018
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+
const SIZE: usize = 16;
diff --git a/src/test/ui/const-generics/issues/issue-74950.min.stderr b/src/test/ui/const-generics/issues/issue-74950.min.stderr
index 4e640ff..729ecc2 100644
--- a/src/test/ui/const-generics/issues/issue-74950.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-74950.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
--> $DIR/issue-74950.rs:17:23
@@ -14,7 +14,7 @@
| ^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
--> $DIR/issue-74950.rs:17:23
@@ -23,7 +23,7 @@
| ^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
--> $DIR/issue-74950.rs:17:23
@@ -32,7 +32,7 @@
| ^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `Inner` is forbidden as the type of a const generic parameter
--> $DIR/issue-74950.rs:17:23
@@ -41,7 +41,7 @@
| ^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 5 previous errors
diff --git a/src/test/ui/const-generics/issues/issue-74950.rs b/src/test/ui/const-generics/issues/issue-74950.rs
index 91e5cc7..3e1ca47 100644
--- a/src/test/ui/const-generics/issues/issue-74950.rs
+++ b/src/test/ui/const-generics/issues/issue-74950.rs
@@ -1,6 +1,6 @@
// [full] build-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
diff --git a/src/test/ui/const-generics/issues/issue-75047.min.stderr b/src/test/ui/const-generics/issues/issue-75047.min.stderr
index 3c1c3ea..7798ae7 100644
--- a/src/test/ui/const-generics/issues/issue-75047.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-75047.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-75047.rs b/src/test/ui/const-generics/issues/issue-75047.rs
index 9743774..ee3dcf9 100644
--- a/src/test/ui/const-generics/issues/issue-75047.rs
+++ b/src/test/ui/const-generics/issues/issue-75047.rs
@@ -1,6 +1,6 @@
// [full] check-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Bar<T>(T);
diff --git a/src/test/ui/const-generics/issues/issue-75299.rs b/src/test/ui/const-generics/issues/issue-75299.rs
index 9d3f25b..83ef09a 100644
--- a/src/test/ui/const-generics/issues/issue-75299.rs
+++ b/src/test/ui/const-generics/issues/issue-75299.rs
@@ -1,8 +1,5 @@
// compile-flags: -Zmir-opt-level=4
// run-pass
-
-#![feature(const_generics)]
-#![allow(incomplete_features)]
fn main() {
fn foo<const N: usize>() -> [u8; N] {
[0; N]
diff --git a/src/test/ui/const-generics/issues/issue-75763.rs b/src/test/ui/const-generics/issues/issue-75763.rs
index c311de0..214a04b 100644
--- a/src/test/ui/const-generics/issues/issue-75763.rs
+++ b/src/test/ui/const-generics/issues/issue-75763.rs
@@ -1,15 +1,15 @@
// ignore-test
// FIXME(const_generics): This test causes an ICE after reverting #76030.
-
+#![feature(adt_const_params)]
#![allow(incomplete_features)]
-#![feature(const_generics)]
+
struct Bug<const S: &'static str>;
fn main() {
let b: Bug::<{
unsafe {
- // FIXME(const_generics): Decide on how to deal with invalid values as const params.
+ // FIXME(adt_const_params): Decide on how to deal with invalid values as const params.
std::mem::transmute::<&[u8], &str>(&[0xC0, 0xC1, 0xF5])
}
}>;
diff --git a/src/test/ui/const-generics/issues/issue-76595.rs b/src/test/ui/const-generics/issues/issue-76595.rs
deleted file mode 100644
index 2d7051c..0000000
--- a/src/test/ui/const-generics/issues/issue-76595.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-struct Bool<const B: bool>;
-
-trait True {}
-
-impl True for Bool<true> {}
-
-fn test<T, const P: usize>() where Bool<{core::mem::size_of::<T>() > 4}>: True {
- todo!()
-}
-
-fn main() {
- test::<2>();
- //~^ ERROR this function takes 2 generic arguments
-}
diff --git a/src/test/ui/const-generics/issues/issue-76595.stderr b/src/test/ui/const-generics/issues/issue-76595.stderr
deleted file mode 100644
index 01a0f6b..0000000
--- a/src/test/ui/const-generics/issues/issue-76595.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
- --> $DIR/issue-76595.rs:15:5
- |
-LL | test::<2>();
- | ^^^^ - supplied 1 generic argument
- | |
- | expected 2 generic arguments
- |
-note: function defined here, with 2 generic parameters: `T`, `P`
- --> $DIR/issue-76595.rs:10:4
- |
-LL | fn test<T, const P: usize>() where Bool<{core::mem::size_of::<T>() > 4}>: True {
- | ^^^^ - -
-help: add missing generic argument
- |
-LL | test::<2, P>();
- | ^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.full.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.full.stderr
deleted file mode 100644
index 88b8ff8..0000000
--- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.full.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/issue-76701-ty-param-in-const.rs:5:21
- |
-LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-76701-ty-param-in-const.rs:11:37
- |
-LL | fn const_param<const N: usize>() -> [u8; N + 1] {
- | ^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr
deleted file mode 100644
index 32f70fa..0000000
--- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/issue-76701-ty-param-in-const.rs:5:46
- |
-LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] {
- | ^ cannot perform const operation using `T`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/issue-76701-ty-param-in-const.rs:11:42
- |
-LL | fn const_param<const N: usize>() -> [u8; N + 1] {
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs
index 9948982..2e6b022 100644
--- a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs
+++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.rs
@@ -1,16 +1,10 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] {
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used in const operations
+ //~^ ERROR generic parameters may not be used in const operations
todo!()
}
fn const_param<const N: usize>() -> [u8; N + 1] {
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used in const operations
+ //~^ ERROR generic parameters may not be used in const operations
todo!()
}
diff --git a/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr
new file mode 100644
index 0000000..3b53e18
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr
@@ -0,0 +1,20 @@
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-76701-ty-param-in-const.rs:1:46
+ |
+LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] {
+ | ^ cannot perform const operation using `T`
+ |
+ = note: type parameters may not be used in const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-76701-ty-param-in-const.rs:6:42
+ |
+LL | fn const_param<const N: usize>() -> [u8; N + 1] {
+ | ^ cannot perform const operation using `N`
+ |
+ = help: const parameters may only be used as standalone arguments, i.e. `N`
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs b/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs
deleted file mode 100644
index 8f02bfb..0000000
--- a/src/test/ui/const-generics/issues/issue-79518-default_trait_method_normalization.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-// This test is a minimized reproduction for #79518 where
-// during error handling for the type mismatch we would try
-// to evaluate std::mem::size_of::<Self::Assoc> causing an ICE
-
-trait Foo {
- type Assoc: PartialEq;
- const AssocInstance: Self::Assoc;
-
- fn foo()
- where
- [(); std::mem::size_of::<Self::Assoc>()]: ,
- {
- Self::AssocInstance == [(); std::mem::size_of::<Self::Assoc>()];
- //~^ Error: mismatched types
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-80062.stderr b/src/test/ui/const-generics/issues/issue-80062.stderr
index aad8907..754f18d 100644
--- a/src/test/ui/const-generics/issues/issue-80062.stderr
+++ b/src/test/ui/const-generics/issues/issue-80062.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-80375.stderr b/src/test/ui/const-generics/issues/issue-80375.stderr
index 9765a63..5409002 100644
--- a/src/test/ui/const-generics/issues/issue-80375.stderr
+++ b/src/test/ui/const-generics/issues/issue-80375.stderr
@@ -5,7 +5,7 @@
| ^^^^^ cannot perform const operation using `COUNT`
|
= help: const parameters may only be used as standalone arguments, i.e. `COUNT`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs b/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs
deleted file mode 100644
index a34d74b..0000000
--- a/src/test/ui/const-generics/issues/issue-80561-incorrect-param-env.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// check-pass
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-// This tests that the correct `param_env` is used so that
-// attempting to normalize `Self::N` does not cause an ICE.
-
-pub struct Foo<const N: usize>;
-
-impl<const N: usize> Foo<N> {
- pub fn foo() {}
-}
-
-pub trait Bar {
- const N: usize;
- fn bar()
- where
- [(); Self::N]: ,
- {
- Foo::<{ Self::N }>::foo();
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-83765.rs b/src/test/ui/const-generics/issues/issue-83765.rs
deleted file mode 100644
index f34badc..0000000
--- a/src/test/ui/const-generics/issues/issue-83765.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-trait TensorDimension {
- const DIM: usize;
-}
-
-trait TensorSize: TensorDimension {
- fn size(&self) -> [usize; Self::DIM];
-}
-
-trait Broadcastable: TensorSize + Sized {
- type Element;
- fn lazy_updim<const NEWDIM: usize>(&self, size: [usize; NEWDIM]) {}
-}
-
-struct BMap<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> {
- reference: &'a T,
- closure: F,
-}
-
-impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorDimension
- for BMap<'a, R, T, F, DIM>
-{
- const DIM: usize = DIM;
-}
-impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSize
- for BMap<'a, R, T, F, DIM>
-{
- fn size(&self) -> [usize; DIM] {
- //~^ ERROR: method not compatible with trait [E0308]
- self.reference.size()
- //~^ ERROR: unconstrained generic constant
- //~| ERROR: mismatched types
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-84408.rs b/src/test/ui/const-generics/issues/issue-84408.rs
deleted file mode 100644
index e1ba850..0000000
--- a/src/test/ui/const-generics/issues/issue-84408.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Regression test for #84408.
-// check-pass
-
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-trait Melon<const X: usize> {
- fn new(arr: [i32; X]) -> Self;
- fn change<T: Melon<X>>(self) -> T;
-}
-
-struct Foo([i32; 5]);
-struct Bar<const A: usize, const B: usize>([i32; A + B])
-where
- [(); A + B]: ;
-
-impl Melon<5> for Foo {
- fn new(arr: [i32; 5]) -> Self {
- Foo(arr)
- }
- fn change<T: Melon<5>>(self) -> T {
- T::new(self.0)
- }
-}
-
-impl<const A: usize, const B: usize> Melon<{ A + B }> for Bar<A, B>
-where
- [(); A + B]: ,
-{
- fn new(arr: [i32; A + B]) -> Self {
- Bar(arr)
- }
- fn change<T: Melon<{ A + B }>>(self) -> T {
- T::new(self.0)
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-85848.rs b/src/test/ui/const-generics/issues/issue-85848.rs
deleted file mode 100644
index 4787198..0000000
--- a/src/test/ui/const-generics/issues/issue-85848.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-#![feature(const_generics, const_fn_trait_bound, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-trait _Contains<T> {
- const does_contain: bool;
-}
-
-trait Contains<T, const Satisfied: bool> {}
-
-trait Delegates<T> {}
-
-impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
-
-const fn contains<A, B>() -> bool
-where
- A: _Contains<B>,
-{
- A::does_contain
-}
-
-impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
-
-fn writes_to_path<C>(cap: &C) {
- writes_to_specific_path(&cap);
- //~^ ERROR: the trait bound `(): _Contains<&C>` is not satisfied [E0277]
- //~| ERROR: unconstrained generic constant
-}
-
-fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-85848.stderr b/src/test/ui/const-generics/issues/issue-85848.stderr
deleted file mode 100644
index 5e65136..0000000
--- a/src/test/ui/const-generics/issues/issue-85848.stderr
+++ /dev/null
@@ -1,44 +0,0 @@
-error[E0277]: the trait bound `(): _Contains<&C>` is not satisfied
- --> $DIR/issue-85848.rs:24:5
- |
-LL | writes_to_specific_path(&cap);
- | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `_Contains<&C>` is not implemented for `()`
-...
-LL | fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {}
- | ------------- required by this bound in `writes_to_specific_path`
- |
-note: required because of the requirements on the impl of `Contains<(), true>` for `&C`
- --> $DIR/issue-85848.rs:21:12
- |
-LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
-note: required because of the requirements on the impl of `Delegates<()>` for `&C`
- --> $DIR/issue-85848.rs:12:12
- |
-LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
- | ^^^^^^^^^^^^ ^
-
-error: unconstrained generic constant
- --> $DIR/issue-85848.rs:24:5
- |
-LL | writes_to_specific_path(&cap);
- | ^^^^^^^^^^^^^^^^^^^^^^^
-...
-LL | fn writes_to_specific_path<C: Delegates<()>>(cap: &C) {}
- | ------------- required by this bound in `writes_to_specific_path`
- |
- = help: try adding a `where` bound using this expression: `where [(); { contains::<T, U>() }]:`
-note: required because of the requirements on the impl of `Contains<(), true>` for `&C`
- --> $DIR/issue-85848.rs:21:12
- |
-LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
-note: required because of the requirements on the impl of `Delegates<()>` for `&C`
- --> $DIR/issue-85848.rs:12:12
- |
-LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
- | ^^^^^^^^^^^^ ^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-87076.rs b/src/test/ui/const-generics/issues/issue-87076.rs
index 5dfda94..8a56767 100644
--- a/src/test/ui/const-generics/issues/issue-87076.rs
+++ b/src/test/ui/const-generics/issues/issue-87076.rs
@@ -1,6 +1,6 @@
// build-pass
-#![feature(const_generics)]
+#![feature(adt_const_params)]
#![allow(incomplete_features)]
#[derive(PartialEq, Eq)]
diff --git a/src/test/ui/const-generics/late-bound-vars/in_closure.rs b/src/test/ui/const-generics/late-bound-vars/in_closure.rs
index 0aaeaff..5294cc3 100644
--- a/src/test/ui/const-generics/late-bound-vars/in_closure.rs
+++ b/src/test/ui/const-generics/late-bound-vars/in_closure.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
const fn inner<'a>() -> usize where &'a (): Sized {
diff --git a/src/test/ui/const-generics/late-bound-vars/simple.rs b/src/test/ui/const-generics/late-bound-vars/simple.rs
index 2c411a3..6da5395 100644
--- a/src/test/ui/const-generics/late-bound-vars/simple.rs
+++ b/src/test/ui/const-generics/late-bound-vars/simple.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
const fn inner<'a>() -> usize where &'a (): Sized {
diff --git a/src/test/ui/const-generics/macro_rules-braces.full.stderr b/src/test/ui/const-generics/macro_rules-braces.full.stderr
deleted file mode 100644
index ef6e857..0000000
--- a/src/test/ui/const-generics/macro_rules-braces.full.stderr
+++ /dev/null
@@ -1,72 +0,0 @@
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/macro_rules-braces.rs:48:17
- |
-LL | let _: baz!(m::P);
- | ^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | let _: baz!({ m::P });
- | ^ ^
-
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/macro_rules-braces.rs:68:17
- |
-LL | let _: baz!(10 + 7);
- | ^^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | let _: baz!({ 10 + 7 });
- | ^ ^
-
-error: constant expression depends on a generic parameter
- --> $DIR/macro_rules-braces.rs:15:13
- |
-LL | [u8; $x]
- | ^^^^^^^^
-...
-LL | let _: foo!({{ N }});
- | ------------- in this macro invocation
- |
- = note: this may fail depending on what value the parameter takes
- = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: constant expression depends on a generic parameter
- --> $DIR/macro_rules-braces.rs:20:13
- |
-LL | [u8; { $x }]
- | ^^^^^^^^^^^^
-...
-LL | let _: bar!({ N });
- | ----------- in this macro invocation
- |
- = note: this may fail depending on what value the parameter takes
- = note: this error originates in the macro `bar` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: constant expression depends on a generic parameter
- --> $DIR/macro_rules-braces.rs:25:13
- |
-LL | Foo<$x>
- | ^^^^^^^
-...
-LL | let _: baz!({{ N }});
- | ------------- in this macro invocation
- |
- = note: this may fail depending on what value the parameter takes
- = note: this error originates in the macro `baz` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: constant expression depends on a generic parameter
- --> $DIR/macro_rules-braces.rs:30:13
- |
-LL | Foo<{ $x }>
- | ^^^^^^^^^^^
-...
-LL | let _: biz!({ N });
- | ----------- in this macro invocation
- |
- = note: this may fail depending on what value the parameter takes
- = note: this error originates in the macro `biz` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to 6 previous errors
-
diff --git a/src/test/ui/const-generics/macro_rules-braces.min.stderr b/src/test/ui/const-generics/macro_rules-braces.min.stderr
deleted file mode 100644
index 60583d4..0000000
--- a/src/test/ui/const-generics/macro_rules-braces.min.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/macro_rules-braces.rs:48:17
- |
-LL | let _: baz!(m::P);
- | ^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | let _: baz!({ m::P });
- | ^ ^
-
-error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/macro_rules-braces.rs:68:17
- |
-LL | let _: baz!(10 + 7);
- | ^^^^^^
- |
-help: enclose the `const` expression in braces
- |
-LL | let _: baz!({ 10 + 7 });
- | ^ ^
-
-error: generic parameters may not be used in const operations
- --> $DIR/macro_rules-braces.rs:36:20
- |
-LL | let _: foo!({{ N }});
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/macro_rules-braces.rs:40:19
- |
-LL | let _: bar!({ N });
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/macro_rules-braces.rs:45:20
- |
-LL | let _: baz!({{ N }});
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/macro_rules-braces.rs:50:19
- |
-LL | let _: biz!({ N });
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 6 previous errors
-
diff --git a/src/test/ui/const-generics/macro_rules-braces.rs b/src/test/ui/const-generics/macro_rules-braces.rs
deleted file mode 100644
index 605a108..0000000
--- a/src/test/ui/const-generics/macro_rules-braces.rs
+++ /dev/null
@@ -1,77 +0,0 @@
-// revisions: full min
-#![cfg_attr(full, allow(incomplete_features))]
-#![cfg_attr(full, feature(const_generics))]
-
-mod m {
- pub const P: usize = 0;
-}
-
-const Q: usize = 0;
-
-fn test<const N: usize>() {
- struct Foo<const M: usize>;
- macro_rules! foo {
- ($x:expr) => {
- [u8; $x] //[full]~ ERROR constant expression depends
- }
- }
- macro_rules! bar {
- ($x:expr) => {
- [u8; { $x }] //[full]~ ERROR constant expression depends
- }
- }
- macro_rules! baz {
- ( $x:expr) => {
- Foo<$x> //[full]~ ERROR constant expression depends
- }
- }
- macro_rules! biz {
- ($x:expr) => {
- Foo<{ $x }> //[full]~ ERROR constant expression depends
- };
- }
-
- let _: foo!(N);
- let _: foo!({ N });
- let _: foo!({{ N }}); //[min]~ ERROR generic parameters may not
- let _: foo!(Q);
- let _: foo!(m::P);
- let _: bar!(N);
- let _: bar!({ N }); //[min]~ ERROR generic parameters may not
- let _: bar!(Q);
- let _: bar!(m::P);
- let _: baz!(N);
- let _: baz!({ N });
- let _: baz!({{ N }}); //[min]~ ERROR generic parameters may not
- let _: baz!(Q);
- let _: baz!({ m::P });
- let _: baz!(m::P); //~ ERROR expressions must be enclosed in braces
- let _: biz!(N);
- let _: biz!({ N }); //[min]~ ERROR generic parameters may not
- let _: biz!(Q);
- let _: biz!(m::P);
- let _: foo!(3);
- let _: foo!({ 3 });
- let _: foo!({{ 3 }});
- let _: bar!(3);
- let _: bar!({ 3 });
- let _: baz!(3);
- let _: baz!({ 3 });
- let _: baz!({{ 3 }});
- let _: biz!(3);
- let _: biz!({ 3 });
- let _: foo!(10 + 7);
- let _: foo!({ 10 + 7 });
- let _: foo!({{ 10 + 7 }});
- let _: bar!(10 + 7);
- let _: bar!({ 10 + 7 });
- let _: baz!(10 + 7); //~ ERROR expressions must be enclosed in braces
- let _: baz!({ 10 + 7 });
- let _: baz!({{ 10 + 7 }});
- let _: biz!(10 + 7);
- let _: biz!({ 10 + 7 });
-}
-
-fn main() {
- test::<3>();
-}
diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
index 1766924..bf0d0f3 100644
--- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
+++ b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:12:40
@@ -14,7 +14,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:16:17
@@ -23,7 +23,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:21:17
@@ -32,7 +32,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:25:45
@@ -41,7 +41,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:28:47
@@ -50,7 +50,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
--> $DIR/complex-expression.rs:32:32
@@ -59,7 +59,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
warning: cannot use constants which depend on generic parameters in types
--> $DIR/complex-expression.rs:37:17
diff --git a/src/test/ui/const-generics/min_const_generics/complex-types.stderr b/src/test/ui/const-generics/min_const_generics/complex-types.stderr
index a658a7b..4ddbadb 100644
--- a/src/test/ui/const-generics/min_const_generics/complex-types.stderr
+++ b/src/test/ui/const-generics/min_const_generics/complex-types.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `()` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:6:21
@@ -14,7 +14,7 @@
| ^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `No` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:11:21
@@ -23,7 +23,7 @@
| ^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `&'static u8` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:14:21
@@ -32,7 +32,7 @@
| ^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `!` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:17:21
@@ -41,7 +41,7 @@
| ^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `()` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:20:19
@@ -50,7 +50,7 @@
| ^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `()` is forbidden as the type of a const generic parameter
--> $DIR/complex-types.rs:23:20
@@ -59,7 +59,7 @@
| ^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 7 previous errors
diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr
index beea0ac..11c3481 100644
--- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr
+++ b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces-without-turbofish.stderr
@@ -7,7 +7,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR + 3>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:9:8
@@ -18,7 +18,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR + BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:12:8
@@ -29,7 +29,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<3 + 3>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:15:8
@@ -40,7 +40,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - 3>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:18:8
@@ -51,7 +51,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:21:8
@@ -62,7 +62,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<100 - BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:8
@@ -73,7 +73,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar<i32>()>();
- | ^^
+ | ++
error: expected one of `;` or `}`, found `>`
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:19
@@ -90,7 +90,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar::<i32>()>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:31:8
@@ -101,7 +101,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar::<i32>() + BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:34:8
@@ -112,7 +112,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar::<i32>() - BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:37:8
@@ -123,7 +123,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - bar::<i32>()>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:40:8
@@ -134,7 +134,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - bar::<i32>()>();
- | ^^
+ | ++
error: aborting due to 13 previous errors
diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr
index b93bd6c..380c17c 100644
--- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr
+++ b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr
@@ -7,7 +7,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR + 3 }>();
- | ^ ^
+ | + +
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/const-expression-suggest-missing-braces.rs:19:11
@@ -18,7 +18,7 @@
help: enclose the `const` expression in braces
|
LL | foo::<{ 3 + 3 }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:22:15
@@ -29,7 +29,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - 3 }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:25:15
@@ -40,7 +40,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - BAR }>();
- | ^ ^
+ | + +
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/const-expression-suggest-missing-braces.rs:28:11
@@ -51,7 +51,7 @@
help: enclose the `const` expression in braces
|
LL | foo::<{ 100 - BAR }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:31:19
@@ -62,7 +62,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar<i32>() }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:34:21
@@ -73,7 +73,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar::<i32>() }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:37:21
@@ -84,7 +84,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar::<i32>() + BAR }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:40:21
@@ -95,7 +95,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar::<i32>() - BAR }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:43:15
@@ -106,7 +106,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - bar::<i32>() }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:46:15
@@ -117,7 +117,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - bar::<i32>() }>();
- | ^ ^
+ | + +
error[E0404]: expected trait, found constant `BAR`
--> $DIR/const-expression-suggest-missing-braces.rs:11:11
@@ -139,7 +139,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0747]: type provided when a constant was expected
--> $DIR/const-expression-suggest-missing-braces.rs:11:11
diff --git a/src/test/ui/const-generics/min_const_generics/const_default_first.rs b/src/test/ui/const-generics/min_const_generics/const_default_first.rs
index ae82c85..bba4e68 100644
--- a/src/test/ui/const-generics/min_const_generics/const_default_first.rs
+++ b/src/test/ui/const-generics/min_const_generics/const_default_first.rs
@@ -1,5 +1,4 @@
#![crate_type = "lib"]
-#![feature(const_generics)]
#![feature(const_generics_defaults)]
#![allow(incomplete_features, dead_code)]
diff --git a/src/test/ui/const-generics/min_const_generics/const_default_first.stderr b/src/test/ui/const-generics/min_const_generics/const_default_first.stderr
index f7a2e48..1a33364 100644
--- a/src/test/ui/const-generics/min_const_generics/const_default_first.stderr
+++ b/src/test/ui/const-generics/min_const_generics/const_default_first.stderr
@@ -1,5 +1,5 @@
error: generic parameters with a default must be trailing
- --> $DIR/const_default_first.rs:6:19
+ --> $DIR/const_default_first.rs:5:19
|
LL | struct Both<const N: usize=3, T> {
| ^
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
index 881f8b9..6215b7d 100644
--- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
+++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
@@ -1,5 +1,5 @@
// This test checks that non-static lifetimes are prohibited under `min_const_generics`. It
-// currently emits an error with `min_const_generics`. This will ICE under `const_generics`.
+// currently emits an error with `min_const_generics`.
fn test<const N: usize>() {}
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
index 5def54c..5f641b0 100644
--- a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
+++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
@@ -4,8 +4,8 @@
LL | test::<{ let _: &'a (); 3 },>();
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/forbid-non-static-lifetimes.rs:21:16
@@ -13,8 +13,8 @@
LL | [(); (|_: &'a u8| (), 0).1];
| ^^
|
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
- = help: add `#![feature(const_generics)]` to the crate attributes to enable
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/min_const_generics/inferred_const.rs b/src/test/ui/const-generics/min_const_generics/inferred_const.rs
index dcd069c..57d6941 100644
--- a/src/test/ui/const-generics/min_const_generics/inferred_const.rs
+++ b/src/test/ui/const-generics/min_const_generics/inferred_const.rs
@@ -1,8 +1,9 @@
-#![feature(min_const_generics)]
-fn foo<const N: usize, const K: usize>(data: [u32; N]) -> [u32; K] {
+#![feature(generic_arg_infer)]
+// run-pass
+
+fn foo<const N: usize, const K: usize>(_data: [u32; N]) -> [u32; K] {
[0; K]
}
fn main() {
- let a = foo::<_, 2>([0, 1, 2]);
- //~^ ERROR type provided when a constant was expected
+ let _a = foo::<_, 2>([0, 1, 2]);
}
diff --git a/src/test/ui/const-generics/min_const_generics/inferred_const.stderr b/src/test/ui/const-generics/min_const_generics/inferred_const.stderr
deleted file mode 100644
index e17105b..0000000
--- a/src/test/ui/const-generics/min_const_generics/inferred_const.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0747]: type provided when a constant was expected
- --> $DIR/inferred_const.rs:6:19
- |
-LL | let a = foo::<_, 2>([0, 1, 2]);
- | ^
- |
- = help: const arguments cannot yet be inferred with `_`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr
index 4fdfb5f..16a7687 100644
--- a/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr
+++ b/src/test/ui/const-generics/min_const_generics/self-ty-in-const-1.stderr
@@ -5,7 +5,7 @@
| ^^^^ cannot perform const operation using `Self`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic `Self` types are currently not permitted in anonymous constants
--> $DIR/self-ty-in-const-1.rs:12:41
diff --git a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr
index 647ef54..f306932 100644
--- a/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr
+++ b/src/test/ui/const-generics/min_const_generics/static-reference-array-const-param.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs b/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs
index 435a63a..2adfa9a 100644
--- a/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs
+++ b/src/test/ui/const-generics/min_const_generics/type_and_const_defaults.rs
@@ -1,7 +1,6 @@
// run-pass
-#![feature(const_generics)]
#![feature(const_generics_defaults)]
-#![allow(incomplete_features, dead_code)]
+#![allow(dead_code)]
struct Both<T=u32, const N: usize=3> {
arr: [T; N]
diff --git a/src/test/ui/const-generics/mut-ref-const-param-array.rs b/src/test/ui/const-generics/mut-ref-const-param-array.rs
deleted file mode 100644
index 6a5739d..0000000
--- a/src/test/ui/const-generics/mut-ref-const-param-array.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-
-use std::ops::AddAssign;
-
-fn inc<T: AddAssign + Clone, const N: usize>(v: &mut [T; N]) -> &mut [T; N] {
- for x in v.iter_mut() {
- *x += x.clone();
- }
- v
-}
-
-fn main() {
- let mut v = [1, 2, 3];
- inc(&mut v);
- assert_eq!(v, [2, 4, 6]);
-}
diff --git a/src/test/ui/const-generics/nested-type.min.stderr b/src/test/ui/const-generics/nested-type.min.stderr
index 6defd39..4f32284 100644
--- a/src/test/ui/const-generics/nested-type.min.stderr
+++ b/src/test/ui/const-generics/nested-type.min.stderr
@@ -12,7 +12,7 @@
| |__^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
--> $DIR/nested-type.rs:15:5
diff --git a/src/test/ui/const-generics/nested-type.rs b/src/test/ui/const-generics/nested-type.rs
index be8ebb7..039f996 100644
--- a/src/test/ui/const-generics/nested-type.rs
+++ b/src/test/ui/const-generics/nested-type.rs
@@ -1,6 +1,6 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Foo<const N: [u8; { //[min]~ ERROR `[u8; _]` is forbidden
diff --git a/src/test/ui/const-generics/occurs-check/bind-param.rs b/src/test/ui/const-generics/occurs-check/bind-param.rs
index 68d1865..ee42440 100644
--- a/src/test/ui/const-generics/occurs-check/bind-param.rs
+++ b/src/test/ui/const-generics/occurs-check/bind-param.rs
@@ -1,5 +1,5 @@
// build-pass
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
// This test does not use any "unevaluated" consts, so it should compile just fine.
diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs b/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs
index 3cb9b7b..e6f8e4a 100644
--- a/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs
+++ b/src/test/ui/const-generics/occurs-check/unify-fixpoint.rs
@@ -1,14 +1,8 @@
-#![feature(const_generics)] //~ WARN the feature `const_generics` is incomplete
-
-// It depends on how we normalize constants and how const equate works if this
-// compiles.
-//
-// Please ping @lcnr if the output if this test changes.
+// check-pass
+#![feature(generic_const_exprs)] //~ WARN the feature `generic_const_exprs` is incomplete
fn bind<const N: usize>(value: [u8; N + 2]) -> [u8; N * 2] {
- //~^ ERROR constant expression depends on a generic parameter
- //~| ERROR constant expression depends on a generic parameter
todo!()
}
diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr
index 671f110..f9b56bd 100644
--- a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr
+++ b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr
@@ -1,27 +1,11 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/unify-fixpoint.rs:1:12
+warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/unify-fixpoint.rs:2:12
|
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
+LL | #![feature(generic_const_exprs)]
+ | ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
-error: constant expression depends on a generic parameter
- --> $DIR/unify-fixpoint.rs:9:32
- |
-LL | fn bind<const N: usize>(value: [u8; N + 2]) -> [u8; N * 2] {
- | ^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/unify-fixpoint.rs:9:48
- |
-LL | fn bind<const N: usize>(value: [u8; N + 2]) -> [u8; N * 2] {
- | ^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors; 1 warning emitted
+warning: 1 warning emitted
diff --git a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs
index 552b1b2..c6324bc 100644
--- a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs
+++ b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.rs
@@ -1,10 +1,9 @@
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
-// This test would try to unify `N` with `N + 1` which must fail the occurs check.
+// This test would tries to unify `N` with `N + 1` which must fail the occurs check.
fn bind<const N: usize>(value: [u8; N]) -> [u8; N + 1] {
- //~^ ERROR constant expression depends on a generic parameter
todo!()
}
@@ -12,6 +11,6 @@
fn main() {
let mut arr = Default::default();
- arr = bind(arr);
+ arr = bind(arr); //~ ERROR mismatched types
sink(arr);
}
diff --git a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr
index c1ac7ee..6b8e688 100644
--- a/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr
+++ b/src/test/ui/const-generics/occurs-check/unify-n-nplusone.stderr
@@ -1,10 +1,9 @@
-error: constant expression depends on a generic parameter
- --> $DIR/unify-n-nplusone.rs:6:44
+error[E0308]: mismatched types
+ --> $DIR/unify-n-nplusone.rs:14:11
|
-LL | fn bind<const N: usize>(value: [u8; N]) -> [u8; N + 1] {
- | ^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
+LL | arr = bind(arr);
+ | ^^^^^^^^^ encountered a self-referencing constant
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-1.rs b/src/test/ui/const-generics/occurs-check/unused-substs-1.rs
index 6ded9f1..9d12250 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-1.rs
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-1.rs
@@ -1,4 +1,4 @@
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
trait Bar<const M: usize> {}
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs
index 2d00141..9a73f1a 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs
@@ -1,4 +1,4 @@
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
// The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs
index 2e306f8..0d38bd39 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs
@@ -1,4 +1,4 @@
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
// The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-3.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-3.stderr
index 2551d68..fd8f8b2 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-3.stderr
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-3.stderr
@@ -2,10 +2,9 @@
--> $DIR/unused-substs-3.rs:16:9
|
LL | t = foo;
- | ^^^
+ | ^^^- help: try using a conversion method: `.to_vec()`
| |
| cyclic type of infinite size
- | help: try using a conversion method: `foo.to_vec()`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-4.rs b/src/test/ui/const-generics/occurs-check/unused-substs-4.rs
index 9c7f5ab..03c2f54 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-4.rs
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-4.rs
@@ -1,4 +1,4 @@
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
fn bind<const N: usize>(value: [u8; N]) -> [u8; 3 + 4] {
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-5.rs b/src/test/ui/const-generics/occurs-check/unused-substs-5.rs
index e5d487d..383ab4c 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-5.rs
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-5.rs
@@ -1,4 +1,4 @@
-#![feature(const_generics, const_evaluatable_checked)]
+#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
// `N + 1` also depends on `T` here even if it doesn't use it.
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-5.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-5.stderr
index 239569d..be289f4 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-5.stderr
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-5.stderr
@@ -2,10 +2,9 @@
--> $DIR/unused-substs-5.rs:15:9
|
LL | x = q::<_, N>(x);
- | ^^^^^^^^^^^^
+ | ^^^^^^^^^^^^- help: try using a conversion method: `.to_vec()`
| |
| cyclic type of infinite size
- | help: try using a conversion method: `q::<_, N>(x).to_vec()`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr
index e8fd9e7..9f0b2ef 100644
--- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr
+++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.full.stderr
@@ -3,8 +3,6 @@
|
LL | struct Bar<T = [u8; N], const N: usize>(T);
| ^
- |
- = note: using type defaults and const parameters in the same parameter list is currently not permitted
error[E0128]: generic parameters with a default cannot use forward declared identifiers
--> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:21
diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr
index 5fa6423..17defbe 100644
--- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr
+++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.min.stderr
@@ -13,7 +13,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0128]: generic parameters with a default cannot use forward declared identifiers
--> $DIR/params-in-ct-in-ty-param-lazy-norm.rs:8:21
diff --git a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs
index 76c1b84..b24a7af 100644
--- a/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs
+++ b/src/test/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
struct Foo<T, U = [u8; std::mem::size_of::<T>()]>(T, U);
diff --git a/src/test/ui/const-generics/parent_generics_of_encoding.rs b/src/test/ui/const-generics/parent_generics_of_encoding.rs
new file mode 100644
index 0000000..b87e396
--- /dev/null
+++ b/src/test/ui/const-generics/parent_generics_of_encoding.rs
@@ -0,0 +1,25 @@
+// aux-build:generics_of_parent.rs
+// check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+extern crate generics_of_parent;
+
+use generics_of_parent::{Foo, S};
+
+fn main() {
+ // regression test for #87603
+ const N: usize = 2;
+ let x: S<u8, N> = S::test();
+}
+
+// regression test for #87674
+fn new<U>(a: U) -> U {
+ a
+}
+fn foo<const N: usize>(bar: &mut Foo<N>)
+where
+ [(); N + 1]: ,
+{
+ *bar = new(loop {});
+}
diff --git a/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs b/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs
new file mode 100644
index 0000000..ed81c01
--- /dev/null
+++ b/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.rs
@@ -0,0 +1,11 @@
+// aux-build:generics_of_parent_impl_trait.rs
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+extern crate generics_of_parent_impl_trait;
+
+fn main() {
+ // check for `impl Trait<{ const }>` which has a parent of a `DefKind::TyParam`
+ generics_of_parent_impl_trait::foo([()]);
+ //~^ error: type annotations needed:
+}
diff --git a/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr b/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr
new file mode 100644
index 0000000..9908571
--- /dev/null
+++ b/src/test/ui/const-generics/parent_generics_of_encoding_impl_trait.stderr
@@ -0,0 +1,15 @@
+error[E0284]: type annotations needed: cannot satisfy `the constant `foo::{opaque#0}::{constant#0}` can be evaluated`
+ --> $DIR/parent_generics_of_encoding_impl_trait.rs:9:5
+ |
+LL | generics_of_parent_impl_trait::foo([()]);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `the constant `foo::{opaque#0}::{constant#0}` can be evaluated`
+ |
+note: required by a bound in `foo`
+ --> $DIR/auxiliary/generics_of_parent_impl_trait.rs:6:48
+ |
+LL | pub fn foo<const N: usize>(foo: impl Into<[(); N + 1]>) {
+ | ^^^^^ required by this bound in `foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0284`.
diff --git a/src/test/ui/const-generics/raw-ptr-const-param-deref.rs b/src/test/ui/const-generics/raw-ptr-const-param-deref.rs
index ca7d33c..65595f0 100644
--- a/src/test/ui/const-generics/raw-ptr-const-param-deref.rs
+++ b/src/test/ui/const-generics/raw-ptr-const-param-deref.rs
@@ -1,7 +1,7 @@
// Checks that pointers must not be used as the type of const params.
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
const A: u32 = 3;
diff --git a/src/test/ui/const-generics/raw-ptr-const-param.rs b/src/test/ui/const-generics/raw-ptr-const-param.rs
index a04c6d5..27ef9e7 100644
--- a/src/test/ui/const-generics/raw-ptr-const-param.rs
+++ b/src/test/ui/const-generics/raw-ptr-const-param.rs
@@ -1,6 +1,6 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Const<const P: *const u32>; //~ ERROR: using raw pointers as const generic parameters
diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr b/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr
index 166a35e..fed802f 100644
--- a/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr
+++ b/src/test/ui/const-generics/slice-const-param-mismatch.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `&'static [u8]` is forbidden as the type of a const generic parameter
--> $DIR/slice-const-param-mismatch.rs:9:28
@@ -14,7 +14,7 @@
| ^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/slice-const-param-mismatch.rs b/src/test/ui/const-generics/slice-const-param-mismatch.rs
index f020e2b..7127323 100644
--- a/src/test/ui/const-generics/slice-const-param-mismatch.rs
+++ b/src/test/ui/const-generics/slice-const-param-mismatch.rs
@@ -1,6 +1,6 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
diff --git a/src/test/ui/const-generics/slice-const-param.min.stderr b/src/test/ui/const-generics/slice-const-param.min.stderr
deleted file mode 100644
index ed39a0c..0000000
--- a/src/test/ui/const-generics/slice-const-param.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: `&'static str` is forbidden as the type of a const generic parameter
- --> $DIR/slice-const-param.rs:7:40
- |
-LL | pub fn function_with_str<const STRING: &'static str>() -> &'static str {
- | ^^^^^^^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: `&'static [u8]` is forbidden as the type of a const generic parameter
- --> $DIR/slice-const-param.rs:12:41
- |
-LL | pub fn function_with_bytes<const BYTES: &'static [u8]>() -> &'static [u8] {
- | ^^^^^^^^^^^^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/slice-const-param.rs b/src/test/ui/const-generics/slice-const-param.rs
index bf1bf8a..05d21e0 100644
--- a/src/test/ui/const-generics/slice-const-param.rs
+++ b/src/test/ui/const-generics/slice-const-param.rs
@@ -1,16 +1,13 @@
-//[full] run-pass
-// revisions: min full
+// run-pass
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
pub fn function_with_str<const STRING: &'static str>() -> &'static str {
- //[min]~^ ERROR `&'static str` is forbidden
STRING
}
pub fn function_with_bytes<const BYTES: &'static [u8]>() -> &'static [u8] {
- //[min]~^ ERROR `&'static [u8]` is forbidden
BYTES
}
diff --git a/src/test/ui/const-generics/std/const-generics-range.min.stderr b/src/test/ui/const-generics/std/const-generics-range.min.stderr
index 86e6159..d4b2ad6 100644
--- a/src/test/ui/const-generics/std/const-generics-range.min.stderr
+++ b/src/test/ui/const-generics/std/const-generics-range.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeFrom<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:12:28
@@ -14,7 +14,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeFull` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:17:28
@@ -23,7 +23,7 @@
| ^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeInclusive<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:23:33
@@ -32,7 +32,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeTo<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:28:26
@@ -41,7 +41,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `RangeToInclusive<usize>` is forbidden as the type of a const generic parameter
--> $DIR/const-generics-range.rs:33:35
@@ -50,7 +50,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 6 previous errors
diff --git a/src/test/ui/const-generics/std/const-generics-range.rs b/src/test/ui/const-generics/std/const-generics-range.rs
index deaab83..46c06f3 100644
--- a/src/test/ui/const-generics/std/const-generics-range.rs
+++ b/src/test/ui/const-generics/std/const-generics-range.rs
@@ -1,6 +1,6 @@
// [full] check-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
// `Range` should be usable within const generics:
diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.full.stderr b/src/test/ui/const-generics/struct-with-invalid-const-param.full.stderr
deleted file mode 100644
index db99803..0000000
--- a/src/test/ui/const-generics/struct-with-invalid-const-param.full.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0573]: expected type, found const parameter `C`
- --> $DIR/struct-with-invalid-const-param.rs:7:23
- |
-LL | struct S<const C: u8>(C);
- | ^ not a type
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0573`.
diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.min.stderr b/src/test/ui/const-generics/struct-with-invalid-const-param.min.stderr
deleted file mode 100644
index db99803..0000000
--- a/src/test/ui/const-generics/struct-with-invalid-const-param.min.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0573]: expected type, found const parameter `C`
- --> $DIR/struct-with-invalid-const-param.rs:7:23
- |
-LL | struct S<const C: u8>(C);
- | ^ not a type
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0573`.
diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.rs b/src/test/ui/const-generics/struct-with-invalid-const-param.rs
index 32970cc..be1c4b0 100644
--- a/src/test/ui/const-generics/struct-with-invalid-const-param.rs
+++ b/src/test/ui/const-generics/struct-with-invalid-const-param.rs
@@ -1,8 +1,4 @@
// Checks that a const param cannot be stored in a struct.
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
struct S<const C: u8>(C); //~ ERROR expected type, found const parameter
diff --git a/src/test/ui/const-generics/struct-with-invalid-const-param.stderr b/src/test/ui/const-generics/struct-with-invalid-const-param.stderr
index 47617c7..67f497a 100644
--- a/src/test/ui/const-generics/struct-with-invalid-const-param.stderr
+++ b/src/test/ui/const-generics/struct-with-invalid-const-param.stderr
@@ -1,18 +1,9 @@
error[E0573]: expected type, found const parameter `C`
- --> $DIR/struct-with-invalid-const-param.rs:4:23
+ --> $DIR/struct-with-invalid-const-param.rs:3:23
|
LL | struct S<const C: u8>(C);
| ^ not a type
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/struct-with-invalid-const-param.rs:1:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0573`.
diff --git a/src/test/ui/const-generics/trait-const-args.rs b/src/test/ui/const-generics/trait-const-args.rs
index 30d05c7..2cdef3f 100644
--- a/src/test/ui/const-generics/trait-const-args.rs
+++ b/src/test/ui/const-generics/trait-const-args.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
struct Const<const N: usize>;
trait Foo<const N: usize> {}
diff --git a/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr b/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr
index f735be9..039c427 100644
--- a/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr
+++ b/src/test/ui/const-generics/transmute-const-param-static-reference.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/transmute-const-param-static-reference.rs b/src/test/ui/const-generics/transmute-const-param-static-reference.rs
index 3147d61..6b443c8 100644
--- a/src/test/ui/const-generics/transmute-const-param-static-reference.rs
+++ b/src/test/ui/const-generics/transmute-const-param-static-reference.rs
@@ -1,7 +1,7 @@
// revisions: full min
//[full] check-pass
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Const<const P: &'static ()>;
diff --git a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs b/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs
index bf855d4..926e807 100644
--- a/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs
+++ b/src/test/ui/const-generics/transparent-maybeunit-array-wrapper.rs
@@ -1,7 +1,7 @@
// run-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
use std::mem::MaybeUninit;
diff --git a/src/test/ui/const-generics/type-after-const-ok.rs b/src/test/ui/const-generics/type-after-const-ok.rs
index 920c067..68d1940 100644
--- a/src/test/ui/const-generics/type-after-const-ok.rs
+++ b/src/test/ui/const-generics/type-after-const-ok.rs
@@ -1,7 +1,7 @@
// [full] run-pass
// revisions: full min
// Verifies that having generic parameters after constants is permitted
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(const_generics_defaults))]
#![cfg_attr(full, allow(incomplete_features))]
#[allow(dead_code)]
diff --git a/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs b/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs
index cd9c3ae..5dfcbba 100644
--- a/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs
+++ b/src/test/ui/const-generics/type-dependent/auxiliary/type_dependent_lib.rs
@@ -1,6 +1,3 @@
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
pub struct Struct<const N: usize>(());
impl<const N: usize> Struct<N> {
diff --git a/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs b/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs
index 4997d49..e844148 100644
--- a/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs
+++ b/src/test/ui/const-generics/type-dependent/const-arg-in-const-arg.rs
@@ -1,6 +1,6 @@
// run-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![allow(incomplete_features)]
struct Foo;
diff --git a/src/test/ui/const-generics/type-dependent/issue-61936.rs b/src/test/ui/const-generics/type-dependent/issue-61936.rs
index 417fe25..7216b25 100644
--- a/src/test/ui/const-generics/type-dependent/issue-61936.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-61936.rs
@@ -1,7 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
trait SliceExt<T: Clone> {
fn array_windows_example<'a, const N: usize>(&'a self) -> ArrayWindowsExample<'a, T, N>;
diff --git a/src/test/ui/const-generics/type-dependent/issue-63695.rs b/src/test/ui/const-generics/type-dependent/issue-63695.rs
index 2ece25b..08b6d4b 100644
--- a/src/test/ui/const-generics/type-dependent/issue-63695.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-63695.rs
@@ -1,7 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
trait T {
fn test<const A: i32>(&self) -> i32 { A }
diff --git a/src/test/ui/const-generics/type-dependent/issue-67144-1.rs b/src/test/ui/const-generics/type-dependent/issue-67144-1.rs
index 4a2c303..27dd51d 100644
--- a/src/test/ui/const-generics/type-dependent/issue-67144-1.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-67144-1.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct X;
impl X {
diff --git a/src/test/ui/const-generics/type-dependent/issue-67144-2.rs b/src/test/ui/const-generics/type-dependent/issue-67144-2.rs
index a1163fc..b26f551 100644
--- a/src/test/ui/const-generics/type-dependent/issue-67144-2.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-67144-2.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct A<const N: usize>;
struct X;
diff --git a/src/test/ui/const-generics/type-dependent/issue-69816.rs b/src/test/ui/const-generics/type-dependent/issue-69816.rs
index 75ddd83..cbb6b39 100644
--- a/src/test/ui/const-generics/type-dependent/issue-69816.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-69816.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
trait IterExt: Sized + Iterator {
fn default_for_size<const N: usize>(self) -> [Self::Item; N]
where
diff --git a/src/test/ui/const-generics/type-dependent/issue-70217.rs b/src/test/ui/const-generics/type-dependent/issue-70217.rs
index b3585d5..933ca02 100644
--- a/src/test/ui/const-generics/type-dependent/issue-70217.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-70217.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
struct Struct<const N: usize>;
diff --git a/src/test/ui/const-generics/type-dependent/issue-70507.rs b/src/test/ui/const-generics/type-dependent/issue-70507.rs
index df7c277..c72d9fb 100644
--- a/src/test/ui/const-generics/type-dependent/issue-70507.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-70507.rs
@@ -1,7 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
trait ConstChunksExactTrait<T> {
fn const_chunks_exact<const N: usize>(&self) -> ConstChunksExact<'_, T, {N}>;
diff --git a/src/test/ui/const-generics/type-dependent/issue-70586.rs b/src/test/ui/const-generics/type-dependent/issue-70586.rs
index 5fb571f..346ac4b 100644
--- a/src/test/ui/const-generics/type-dependent/issue-70586.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-70586.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
use std::marker::PhantomData;
// This namespace is necessary for the ICE to trigger
diff --git a/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr b/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr
index f3516d1..b8fbb39 100644
--- a/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr
+++ b/src/test/ui/const-generics/type-dependent/issue-71348.min.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: `&'static str` is forbidden as the type of a const generic parameter
--> $DIR/issue-71348.rs:18:25
@@ -14,7 +14,7 @@
| ^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/type-dependent/issue-71348.rs b/src/test/ui/const-generics/type-dependent/issue-71348.rs
index 33735ef..2ef2f06 100644
--- a/src/test/ui/const-generics/type-dependent/issue-71348.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-71348.rs
@@ -1,6 +1,6 @@
// [full] run-pass
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
struct Foo {
diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.full.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.full.stderr
deleted file mode 100644
index 8ac9bab..0000000
--- a/src/test/ui/const-generics/type-dependent/issue-71382.full.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: using function pointers as const generic parameters is forbidden
- --> $DIR/issue-71382.rs:16:23
- |
-LL | fn test<const FN: fn() -> u8>(&self) -> u8 {
- | ^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.min.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.min.stderr
deleted file mode 100644
index 8ac9bab..0000000
--- a/src/test/ui/const-generics/type-dependent/issue-71382.min.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: using function pointers as const generic parameters is forbidden
- --> $DIR/issue-71382.rs:16:23
- |
-LL | fn test<const FN: fn() -> u8>(&self) -> u8 {
- | ^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.rs b/src/test/ui/const-generics/type-dependent/issue-71382.rs
index b367761..1c4073e 100644
--- a/src/test/ui/const-generics/type-dependent/issue-71382.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-71382.rs
@@ -1,7 +1,3 @@
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct Test;
fn pass() -> u8 {
diff --git a/src/test/ui/const-generics/type-dependent/issue-71382.stderr b/src/test/ui/const-generics/type-dependent/issue-71382.stderr
new file mode 100644
index 0000000..ad522ae
--- /dev/null
+++ b/src/test/ui/const-generics/type-dependent/issue-71382.stderr
@@ -0,0 +1,8 @@
+error: using function pointers as const generic parameters is forbidden
+ --> $DIR/issue-71382.rs:12:23
+ |
+LL | fn test<const FN: fn() -> u8>(&self) -> u8 {
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/const-generics/type-dependent/issue-71805.rs b/src/test/ui/const-generics/type-dependent/issue-71805.rs
index 3701e14..060b899 100644
--- a/src/test/ui/const-generics/type-dependent/issue-71805.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-71805.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
use std::mem::MaybeUninit;
trait CollectSlice<'a>: Iterator {
diff --git a/src/test/ui/const-generics/type-dependent/issue-73730.rs b/src/test/ui/const-generics/type-dependent/issue-73730.rs
index 5d7dcb9..5e1b8c63 100644
--- a/src/test/ui/const-generics/type-dependent/issue-73730.rs
+++ b/src/test/ui/const-generics/type-dependent/issue-73730.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
trait Foo<'a, A>: Iterator<Item=A> {
fn bar<const N: usize>(&mut self) -> *const [A; N];
}
diff --git a/src/test/ui/const-generics/type-dependent/non-local.rs b/src/test/ui/const-generics/type-dependent/non-local.rs
index 9e4afba..b755de3 100644
--- a/src/test/ui/const-generics/type-dependent/non-local.rs
+++ b/src/test/ui/const-generics/type-dependent/non-local.rs
@@ -1,9 +1,5 @@
// aux-build:type_dependent_lib.rs
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
extern crate type_dependent_lib;
use type_dependent_lib::*;
diff --git a/src/test/ui/const-generics/type-dependent/qpath.rs b/src/test/ui/const-generics/type-dependent/qpath.rs
index b61e970..2d678d0 100644
--- a/src/test/ui/const-generics/type-dependent/qpath.rs
+++ b/src/test/ui/const-generics/type-dependent/qpath.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct A;
impl A {
fn foo<const N: usize>() -> usize { N + 1 }
diff --git a/src/test/ui/const-generics/type-dependent/simple.rs b/src/test/ui/const-generics/type-dependent/simple.rs
index a4776a4..1b13133 100644
--- a/src/test/ui/const-generics/type-dependent/simple.rs
+++ b/src/test/ui/const-generics/type-dependent/simple.rs
@@ -1,8 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct R;
impl R {
diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr b/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr
index b942c39..02108d8 100644
--- a/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr
+++ b/src/test/ui/const-generics/type-dependent/type-mismatch.full.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/type-mismatch.rs:11:27
+ --> $DIR/type-mismatch.rs:8:27
|
LL | assert_eq!(R.method::<1u16>(), 1);
| ^^^^ expected `u8`, found `u16`
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `u16` to `u8`
|
LL | assert_eq!(R.method::<1u8>(), 1);
- | ^^^
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr b/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr
index b942c39..02108d8 100644
--- a/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr
+++ b/src/test/ui/const-generics/type-dependent/type-mismatch.min.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/type-mismatch.rs:11:27
+ --> $DIR/type-mismatch.rs:8:27
|
LL | assert_eq!(R.method::<1u16>(), 1);
| ^^^^ expected `u8`, found `u16`
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `u16` to `u8`
|
LL | assert_eq!(R.method::<1u8>(), 1);
- | ^^^
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/type-dependent/type-mismatch.rs b/src/test/ui/const-generics/type-dependent/type-mismatch.rs
index 7fba1af..3335ab8 100644
--- a/src/test/ui/const-generics/type-dependent/type-mismatch.rs
+++ b/src/test/ui/const-generics/type-dependent/type-mismatch.rs
@@ -1,7 +1,4 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
struct R;
impl R {
diff --git a/src/test/ui/const-generics/type_mismatch.stderr b/src/test/ui/const-generics/type_mismatch.stderr
index f5053e4..8d779be 100644
--- a/src/test/ui/const-generics/type_mismatch.stderr
+++ b/src/test/ui/const-generics/type_mismatch.stderr
@@ -5,12 +5,6 @@
| ^ expected `u8`, found `usize`
error[E0308]: mismatched types
- --> $DIR/type_mismatch.rs:5:31
- |
-LL | fn bar<const N: u8>() -> [u8; N] {}
- | ^ expected `usize`, found `u8`
-
-error[E0308]: mismatched types
--> $DIR/type_mismatch.rs:5:26
|
LL | fn bar<const N: u8>() -> [u8; N] {}
@@ -18,6 +12,12 @@
| |
| implicitly returns `()` as its body has no tail or `return` expression
+error[E0308]: mismatched types
+ --> $DIR/type_mismatch.rs:5:31
+ |
+LL | fn bar<const N: u8>() -> [u8; N] {}
+ | ^ expected `usize`, found `u8`
+
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/type_of_anon_const.rs b/src/test/ui/const-generics/type_of_anon_const.rs
index 9a2e9f0..fb0d688 100644
--- a/src/test/ui/const-generics/type_of_anon_const.rs
+++ b/src/test/ui/const-generics/type_of_anon_const.rs
@@ -1,9 +1,4 @@
// run-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
trait T<const A: usize> {
fn l<const N: bool>() -> usize;
fn r<const N: bool>() -> bool;
diff --git a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr
index 480ecdb..565c9ba 100644
--- a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr
+++ b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr
@@ -1,8 +1,8 @@
error[E0308]: mismatched types
--> $DIR/types-mismatch-const-args.rs:14:41
|
-LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32`
+LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32`
|
= note: expected type `2_u32`
found type `4_u32`
diff --git a/src/test/ui/const-generics/types-mismatch-const-args.min.stderr b/src/test/ui/const-generics/types-mismatch-const-args.min.stderr
index c19c8db..ec9221d 100644
--- a/src/test/ui/const-generics/types-mismatch-const-args.min.stderr
+++ b/src/test/ui/const-generics/types-mismatch-const-args.min.stderr
@@ -1,8 +1,8 @@
error[E0308]: mismatched types
--> $DIR/types-mismatch-const-args.rs:14:41
|
-LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32`
+LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData };
+ | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2_u32`, found `4_u32`
| |
| expected due to this
|
diff --git a/src/test/ui/const-generics/types-mismatch-const-args.rs b/src/test/ui/const-generics/types-mismatch-const-args.rs
index 14cef08..c2092c4 100644
--- a/src/test/ui/const-generics/types-mismatch-const-args.rs
+++ b/src/test/ui/const-generics/types-mismatch-const-args.rs
@@ -1,5 +1,5 @@
// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
// tests the diagnostic output of type mismatches for types that have const generics arguments.
@@ -11,7 +11,7 @@
}
fn a<'a, 'b>() {
- let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData };
+ let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData };
//~^ ERROR mismatched types
let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data: PhantomData };
//~^ ERROR mismatched types
diff --git a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
index 9592f26..c7270e8 100644
--- a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
+++ b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
@@ -1,7 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
use std::fmt;
diff --git a/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs b/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs
index 4bab2bb..191caa7 100644
--- a/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs
+++ b/src/test/ui/const-generics/uninferred-consts-during-codegen-2.rs
@@ -1,7 +1,4 @@
// run-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
use std::fmt;
diff --git a/src/test/ui/const-generics/unknown_adt.full.stderr b/src/test/ui/const-generics/unknown_adt.full.stderr
deleted file mode 100644
index b8b2e90..0000000
--- a/src/test/ui/const-generics/unknown_adt.full.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0412]: cannot find type `UnknownStruct` in this scope
- --> $DIR/unknown_adt.rs:7:12
- |
-LL | let _: UnknownStruct<7>;
- | ^^^^^^^^^^^^^ not found in this scope
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0412`.
diff --git a/src/test/ui/const-generics/unknown_adt.min.stderr b/src/test/ui/const-generics/unknown_adt.min.stderr
deleted file mode 100644
index b8b2e90..0000000
--- a/src/test/ui/const-generics/unknown_adt.min.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0412]: cannot find type `UnknownStruct` in this scope
- --> $DIR/unknown_adt.rs:7:12
- |
-LL | let _: UnknownStruct<7>;
- | ^^^^^^^^^^^^^ not found in this scope
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0412`.
diff --git a/src/test/ui/const-generics/unknown_adt.rs b/src/test/ui/const-generics/unknown_adt.rs
index 977f90a..8cdd28a 100644
--- a/src/test/ui/const-generics/unknown_adt.rs
+++ b/src/test/ui/const-generics/unknown_adt.rs
@@ -1,8 +1,3 @@
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
fn main() {
let _: UnknownStruct<7>;
//~^ ERROR cannot find type `UnknownStruct`
diff --git a/src/test/ui/const-generics/unknown_adt.stderr b/src/test/ui/const-generics/unknown_adt.stderr
new file mode 100644
index 0000000..0f462dd
--- /dev/null
+++ b/src/test/ui/const-generics/unknown_adt.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `UnknownStruct` in this scope
+ --> $DIR/unknown_adt.rs:2:12
+ |
+LL | let _: UnknownStruct<7>;
+ | ^^^^^^^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/src/test/ui/const-generics/unused-const-param.rs b/src/test/ui/const-generics/unused-const-param.rs
index 2918e39..c7f74cf 100644
--- a/src/test/ui/const-generics/unused-const-param.rs
+++ b/src/test/ui/const-generics/unused-const-param.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
struct A<const N: usize>; // ok
diff --git a/src/test/ui/const-generics/unused_braces.fixed b/src/test/ui/const-generics/unused_braces.fixed
index 836f26e..d080c21 100644
--- a/src/test/ui/const-generics/unused_braces.fixed
+++ b/src/test/ui/const-generics/unused_braces.fixed
@@ -1,11 +1,7 @@
// check-pass
// run-rustfix
-
-#![allow(incomplete_features)]
#![warn(unused_braces)]
-#![feature(const_generics)]
-
struct A<const N: usize>;
fn main() {
diff --git a/src/test/ui/const-generics/unused_braces.full.stderr b/src/test/ui/const-generics/unused_braces.full.stderr
deleted file mode 100644
index 8899139..0000000
--- a/src/test/ui/const-generics/unused_braces.full.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-warning: unnecessary braces around const expression
- --> $DIR/unused_braces.rs:14:14
- |
-LL | let _: A<{ 7 }>;
- | ^^^^^ help: remove these braces
- |
-note: the lint level is defined here
- --> $DIR/unused_braces.rs:7:9
- |
-LL | #![warn(unused_braces)]
- | ^^^^^^^^^^^^^
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/const-generics/unused_braces.min.stderr b/src/test/ui/const-generics/unused_braces.min.stderr
deleted file mode 100644
index 8899139..0000000
--- a/src/test/ui/const-generics/unused_braces.min.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-warning: unnecessary braces around const expression
- --> $DIR/unused_braces.rs:14:14
- |
-LL | let _: A<{ 7 }>;
- | ^^^^^ help: remove these braces
- |
-note: the lint level is defined here
- --> $DIR/unused_braces.rs:7:9
- |
-LL | #![warn(unused_braces)]
- | ^^^^^^^^^^^^^
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/const-generics/unused_braces.rs b/src/test/ui/const-generics/unused_braces.rs
index 0348bba..47f0f8c 100644
--- a/src/test/ui/const-generics/unused_braces.rs
+++ b/src/test/ui/const-generics/unused_braces.rs
@@ -1,12 +1,7 @@
// check-pass
// run-rustfix
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
#![warn(unused_braces)]
-
struct A<const N: usize>;
fn main() {
diff --git a/src/test/ui/const-generics/unused_braces.stderr b/src/test/ui/const-generics/unused_braces.stderr
new file mode 100644
index 0000000..5e1bace
--- /dev/null
+++ b/src/test/ui/const-generics/unused_braces.stderr
@@ -0,0 +1,14 @@
+warning: unnecessary braces around const expression
+ --> $DIR/unused_braces.rs:9:14
+ |
+LL | let _: A<{ 7 }>;
+ | ^^^^^ help: remove these braces
+ |
+note: the lint level is defined here
+ --> $DIR/unused_braces.rs:3:9
+ |
+LL | #![warn(unused_braces)]
+ | ^^^^^^^^^^^^^
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/const-generics/wf-misc.full.stderr b/src/test/ui/const-generics/wf-misc.full.stderr
deleted file mode 100644
index dfb593a..0000000
--- a/src/test/ui/const-generics/wf-misc.full.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: constant expression depends on a generic parameter
- --> $DIR/wf-misc.rs:8:12
- |
-LL | let _: [u8; N + 1];
- | ^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: constant expression depends on a generic parameter
- --> $DIR/wf-misc.rs:16:12
- |
-LL | let _: Const::<{N + 1}>;
- | ^^^^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/wf-misc.min.stderr b/src/test/ui/const-generics/wf-misc.min.stderr
deleted file mode 100644
index 9967a22..0000000
--- a/src/test/ui/const-generics/wf-misc.min.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/wf-misc.rs:8:17
- |
-LL | let _: [u8; N + 1];
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: generic parameters may not be used in const operations
- --> $DIR/wf-misc.rs:16:21
- |
-LL | let _: Const::<{N + 1}>;
- | ^ cannot perform const operation using `N`
- |
- = help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/const-generics/wf-misc.rs b/src/test/ui/const-generics/wf-misc.rs
deleted file mode 100644
index 8a5b6dd..0000000
--- a/src/test/ui/const-generics/wf-misc.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// Tests miscellaneous well-formedness examples.
-// revisions: full min
-
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
-pub fn arr_len<const N: usize>() {
- let _: [u8; N + 1];
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used in const operations
-}
-
-struct Const<const N: usize>;
-
-pub fn func_call<const N: usize>() {
- let _: Const::<{N + 1}>;
- //[full]~^ ERROR constant expression depends on a generic parameter
- //[min]~^^ ERROR generic parameters may not be used in const operations
-}
-
-fn main() {}
diff --git a/src/test/ui/const-generics/where-clauses.rs b/src/test/ui/const-generics/where-clauses.rs
index dc09cad..aa3ca1c 100644
--- a/src/test/ui/const-generics/where-clauses.rs
+++ b/src/test/ui/const-generics/where-clauses.rs
@@ -1,8 +1,4 @@
// check-pass
-// revisions: full min
-#![cfg_attr(full, feature(const_generics))]
-#![cfg_attr(full, allow(incomplete_features))]
-
trait Bar<const N: usize> { fn bar() {} }
trait Foo<const N: usize>: Bar<N> {}
diff --git a/src/test/ui/const-ptr/out_of_bounds_read.stderr b/src/test/ui/const-ptr/out_of_bounds_read.stderr
index 9254177..62af6a6 100644
--- a/src/test/ui/const-ptr/out_of_bounds_read.stderr
+++ b/src/test/ui/const-ptr/out_of_bounds_read.stderr
@@ -1,65 +1,50 @@
error[E0080]: evaluation of constant value failed
- --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
-LL | unsafe { copy_nonoverlapping(src, dst, count) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
- | inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
- ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
- | --------------------------------------------- inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- |
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+ | inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ |
::: $DIR/out_of_bounds_read.rs:13:33
|
LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) };
| ----------------------- inside `_READ` at $DIR/out_of_bounds_read.rs:13:33
error[E0080]: evaluation of constant value failed
- --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
-LL | unsafe { copy_nonoverlapping(src, dst, count) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
- | inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
- ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
- | --------------------------------------------- inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- |
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+ | inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ |
::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
LL | unsafe { read(self) }
| ---------- inside `ptr::const_ptr::<impl *const u32>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/out_of_bounds_read.rs:14:39
|
LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() };
| ------------------- inside `_CONST_READ` at $DIR/out_of_bounds_read.rs:14:39
error[E0080]: evaluation of constant value failed
- --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
-LL | unsafe { copy_nonoverlapping(src, dst, count) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
- | inside `copy_nonoverlapping::<u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
- ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
- | --------------------------------------------- inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- |
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds
+ | inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ |
::: $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
|
LL | unsafe { read(self) }
| ---------- inside `ptr::mut_ptr::<impl *mut u32>::read` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- |
+ |
::: $DIR/out_of_bounds_read.rs:15:37
|
LL | const _MUT_READ: u32 = unsafe { (PAST_END_PTR as *mut u32).read() };
diff --git a/src/test/ui/const_evaluatable/needs_where_clause.rs b/src/test/ui/const_evaluatable/needs_where_clause.rs
deleted file mode 100644
index 498a2ae..0000000
--- a/src/test/ui/const_evaluatable/needs_where_clause.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#![crate_type = "lib"]
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features)]
-
-const fn complex_maths<T>(n : usize) -> usize {
- 2 * n + 1
-}
-
-struct Example<T, const N: usize> {
- a: [f32; N],
- b: [f32; complex_maths::<T>(N)],
- //~^ ERROR unconstrained
- c: T,
-}
diff --git a/src/test/ui/const_evaluatable/no_where_clause.rs b/src/test/ui/const_evaluatable/no_where_clause.rs
deleted file mode 100644
index 12f4a22..0000000
--- a/src/test/ui/const_evaluatable/no_where_clause.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-#![feature(const_generics, const_evaluatable_checked)]
-#![allow(incomplete_features, unused)]
-
-const fn complex_maths(n : usize) -> usize {
- 2 * n + 1
-}
-
-pub struct Example<const N: usize> {
- a: [f32; N],
- b: [f32; complex_maths(N)],
- //~^ ERROR unconstrained generic
-}
-
-impl<const N: usize> Example<N> {
- pub fn new() -> Self {
- Self {
- a: [0.; N],
- b: [0.; complex_maths(N)],
- }
- }
-}
-
-impl Example<2> {
- pub fn sum(&self) -> f32 {
- self.a.iter().sum::<f32>() + self.b.iter().sum::<f32>()
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/constructor-lifetime-args.stderr b/src/test/ui/constructor-lifetime-args.stderr
index f33aa49..b97b6fa 100644
--- a/src/test/ui/constructor-lifetime-args.stderr
+++ b/src/test/ui/constructor-lifetime-args.stderr
@@ -14,7 +14,7 @@
help: add missing lifetime argument
|
LL | S::<'static, 'b>(&0, &0);
- | ^^^^
+ | ++++
error[E0107]: this struct takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:19:5
@@ -46,7 +46,7 @@
help: add missing lifetime argument
|
LL | E::V::<'static, 'b>(&0);
- | ^^^^
+ | ++++
error[E0107]: this enum takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:24:8
diff --git a/src/test/ui/consts/assume-type-intrinsics.stderr b/src/test/ui/consts/assume-type-intrinsics.stderr
index d46ce44..e660730 100644
--- a/src/test/ui/consts/assume-type-intrinsics.stderr
+++ b/src/test/ui/consts/assume-type-intrinsics.stderr
@@ -1,17 +1,9 @@
error: any use of this value will cause an error
- --> $SRC_DIR/core/src/mem/maybe_uninit.rs:LL:COL
- |
-LL | intrinsics::assert_inhabited::<T>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | aborted execution: attempted to instantiate uninhabited type `!`
- | inside `MaybeUninit::<!>::assume_init` at $SRC_DIR/core/src/mem/maybe_uninit.rs:LL:COL
- | inside `_BAD` at $DIR/assume-type-intrinsics.rs:11:9
- |
- ::: $DIR/assume-type-intrinsics.rs:10:5
+ --> $DIR/assume-type-intrinsics.rs:11:9
|
LL | / const _BAD: () = unsafe {
LL | | MaybeUninit::<!>::uninit().assume_init();
+ | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
LL | | };
| |______-
|
diff --git a/src/test/ui/consts/cast-discriminant-zst-enum.rs b/src/test/ui/consts/cast-discriminant-zst-enum.rs
index 66b7662..e59ae29 100644
--- a/src/test/ui/consts/cast-discriminant-zst-enum.rs
+++ b/src/test/ui/consts/cast-discriminant-zst-enum.rs
@@ -1,5 +1,5 @@
// run-pass
-// Test a ZST enum whose dicriminant is ~0i128. This caused an ICE when casting to a i32.
+// Test a ZST enum whose dicriminant is ~0i128. This caused an ICE when casting to an i32.
#![feature(bench_black_box)]
use std::hint::black_box;
diff --git a/src/test/ui/consts/const-eval/const_panic_2021.rs b/src/test/ui/consts/const-eval/const_panic_2021.rs
new file mode 100644
index 0000000..daef34c
--- /dev/null
+++ b/src/test/ui/consts/const-eval/const_panic_2021.rs
@@ -0,0 +1,27 @@
+// edition:2021
+#![feature(const_panic)]
+#![crate_type = "lib"]
+
+const A: () = std::panic!("blåhaj");
+//~^ ERROR evaluation of constant value failed
+
+const B: () = std::panic!();
+//~^ ERROR evaluation of constant value failed
+
+const C: () = std::unreachable!();
+//~^ ERROR evaluation of constant value failed
+
+const D: () = std::unimplemented!();
+//~^ ERROR evaluation of constant value failed
+
+const E: () = core::panic!("shark");
+//~^ ERROR evaluation of constant value failed
+
+const F: () = core::panic!();
+//~^ ERROR evaluation of constant value failed
+
+const G: () = core::unreachable!();
+//~^ ERROR evaluation of constant value failed
+
+const H: () = core::unimplemented!();
+//~^ ERROR evaluation of constant value failed
diff --git a/src/test/ui/consts/const-eval/const_panic_2021.stderr b/src/test/ui/consts/const-eval/const_panic_2021.stderr
new file mode 100644
index 0000000..c1bdab3
--- /dev/null
+++ b/src/test/ui/consts/const-eval/const_panic_2021.stderr
@@ -0,0 +1,67 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:5:15
+ |
+LL | const A: () = std::panic!("blåhaj");
+ | ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'blåhaj', $DIR/const_panic_2021.rs:5:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:8:15
+ |
+LL | const B: () = std::panic!();
+ | ^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic_2021.rs:8:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:11:15
+ |
+LL | const C: () = std::unreachable!();
+ | ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:11:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:14:15
+ |
+LL | const D: () = std::unimplemented!();
+ | ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_2021.rs:14:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:17:15
+ |
+LL | const E: () = core::panic!("shark");
+ | ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'shark', $DIR/const_panic_2021.rs:17:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:20:15
+ |
+LL | const F: () = core::panic!();
+ | ^^^^^^^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/const_panic_2021.rs:20:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:23:15
+ |
+LL | const G: () = core::unreachable!();
+ | ^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:23:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_panic_2021.rs:26:15
+ |
+LL | const H: () = core::unimplemented!();
+ | ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_2021.rs:26:15
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 8 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const_transmute.rs b/src/test/ui/consts/const-eval/const_transmute.rs
index f0e1d82..90a454c 100644
--- a/src/test/ui/consts/const-eval/const_transmute.rs
+++ b/src/test/ui/consts/const-eval/const_transmute.rs
@@ -1,6 +1,5 @@
// run-pass
-#![feature(const_fn_union)]
#![allow(dead_code)]
#[repr(C)]
diff --git a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs b/src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs
deleted file mode 100644
index 26162aa..0000000
--- a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-fn main() {}
-
-#[repr(C)]
-union Foo {
- u: u32,
- i: i32,
-}
-
-const unsafe fn foo(u: u32) -> i32 {
- Foo { u }.i //~ ERROR unions in const fn are unstable
-}
diff --git a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr b/src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr
deleted file mode 100644
index bc3b6aa..0000000
--- a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: unions in const fn are unstable
- --> $DIR/feature-gate-const_fn_union.rs:10:5
- |
-LL | Foo { u }.i
- | ^^^^^^^^^^^
- |
- = note: see issue #51909 <https://github.com/rust-lang/rust/issues/51909> for more information
- = help: add `#![feature(const_fn_union)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/const-eval/infinite_loop.stderr b/src/test/ui/consts/const-eval/infinite_loop.stderr
index d01376e..3b5a0f2 100644
--- a/src/test/ui/consts/const-eval/infinite_loop.stderr
+++ b/src/test/ui/consts/const-eval/infinite_loop.stderr
@@ -1,8 +1,8 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/infinite_loop.rs:7:17
+ --> $DIR/infinite_loop.rs:7:20
|
LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+ | ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
error: aborting due to previous error
diff --git a/src/test/ui/consts/const-eval/issue-49296.rs b/src/test/ui/consts/const-eval/issue-49296.rs
index baa1848..80f6bbe 100644
--- a/src/test/ui/consts/const-eval/issue-49296.rs
+++ b/src/test/ui/consts/const-eval/issue-49296.rs
@@ -1,21 +1,13 @@
// issue-49296: Unsafe shenigans in constants can result in missing errors
-#![feature(const_fn_union)]
#![feature(const_fn_trait_bound)]
-const unsafe fn transmute<T: Copy, U: Copy>(t: T) -> U {
- #[repr(C)]
- union Transmute<T: Copy, U: Copy> {
- from: T,
- to: U,
- }
-
- Transmute { from: t }.to
-}
+use std::mem::transmute;
const fn wat(x: u64) -> &'static u64 {
unsafe { transmute(&x) }
}
+
const X: u64 = *wat(42);
//~^ ERROR evaluation of constant value failed
diff --git a/src/test/ui/consts/const-eval/issue-49296.stderr b/src/test/ui/consts/const-eval/issue-49296.stderr
index 4fd8e18..bc3074b 100644
--- a/src/test/ui/consts/const-eval/issue-49296.stderr
+++ b/src/test/ui/consts/const-eval/issue-49296.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/issue-49296.rs:19:16
+ --> $DIR/issue-49296.rs:11:16
|
LL | const X: u64 = *wat(42);
| ^^^^^^^^ pointer to alloc2 was dereferenced after this allocation got freed
diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs
index 78cf253..ab0256a 100644
--- a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs
+++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs
@@ -14,5 +14,4 @@
fn main() {
let _ = PrintName::VOID;
- //~^ ERROR erroneous constant used
}
diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr
index 0856094..f1c606a 100644
--- a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr
+++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr
@@ -6,12 +6,6 @@
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0080]: erroneous constant used
- --> $DIR/panic-assoc-never-type.rs:16:13
- |
-LL | let _ = PrintName::VOID;
- | ^^^^^^^^^^^^^^^ referenced constant has errors
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/partial_ptr_overwrite.rs b/src/test/ui/consts/const-eval/partial_ptr_overwrite.rs
new file mode 100644
index 0000000..5371f9f
--- /dev/null
+++ b/src/test/ui/consts/const-eval/partial_ptr_overwrite.rs
@@ -0,0 +1,15 @@
+// Test for the behavior described in <https://github.com/rust-lang/rust/issues/87184>.
+#![feature(const_mut_refs, const_raw_ptr_deref)]
+
+const PARTIAL_OVERWRITE: () = {
+ let mut p = &42;
+ unsafe {
+ let ptr: *mut _ = &mut p;
+ *(ptr as *mut u8) = 123; //~ ERROR any use of this value
+ //~| unable to overwrite parts of a pointer
+ //~| WARN previously accepted
+ }
+ let x = *p;
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr
new file mode 100644
index 0000000..a18c7e7
--- /dev/null
+++ b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr
@@ -0,0 +1,20 @@
+error: any use of this value will cause an error
+ --> $DIR/partial_ptr_overwrite.rs:8:9
+ |
+LL | / const PARTIAL_OVERWRITE: () = {
+LL | | let mut p = &42;
+LL | | unsafe {
+LL | | let ptr: *mut _ = &mut p;
+LL | | *(ptr as *mut u8) = 123;
+ | | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
+... |
+LL | | let x = *p;
+LL | | };
+ | |__-
+ |
+ = note: `#[deny(const_err)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
index 1a99c77..1fc7af6 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
@@ -1,5 +1,3 @@
-#![feature(const_fn_union)]
-
#![allow(const_err)]
#[repr(C)]
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr b/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
index 6618f1c..c6ca30e 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
@@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promoted_const_fn_fail.rs:21:27
+ --> $DIR/promoted_const_fn_fail.rs:19:27
|
LL | let x: &'static u8 = &(bar() + 1);
| ----------- ^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
index c9e4871..c534246 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
@@ -1,5 +1,3 @@
-#![feature(const_fn_union)]
-
#![deny(const_err)]
#[repr(C)]
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
index 5f9f3bd..c6275a8 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
@@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promoted_const_fn_fail_deny_const_err.rs:22:27
+ --> $DIR/promoted_const_fn_fail_deny_const_err.rs:20:27
|
LL | let x: &'static u8 = &(bar() + 1);
| ----------- ^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
index ff90bb5..aa5ba53 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ref_to_int_match.rs:26:1
+ --> $DIR/ref_to_int_match.rs:25:1
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected initialized plain (non-pointer) bytes
@@ -10,13 +10,13 @@
}
error: could not evaluate constant pattern
- --> $DIR/ref_to_int_match.rs:8:14
+ --> $DIR/ref_to_int_match.rs:7:14
|
LL | 10..=BAR => {},
| ^^^
error: could not evaluate constant pattern
- --> $DIR/ref_to_int_match.rs:8:14
+ --> $DIR/ref_to_int_match.rs:7:14
|
LL | 10..=BAR => {},
| ^^^
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
index 499c453..525a621 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ref_to_int_match.rs:26:1
+ --> $DIR/ref_to_int_match.rs:25:1
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected initialized plain (non-pointer) bytes
@@ -10,13 +10,13 @@
}
error: could not evaluate constant pattern
- --> $DIR/ref_to_int_match.rs:8:14
+ --> $DIR/ref_to_int_match.rs:7:14
|
LL | 10..=BAR => {},
| ^^^
error: could not evaluate constant pattern
- --> $DIR/ref_to_int_match.rs:8:14
+ --> $DIR/ref_to_int_match.rs:7:14
|
LL | 10..=BAR => {},
| ^^^
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.rs b/src/test/ui/consts/const-eval/ref_to_int_match.rs
index 0741e42..b098adf 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.rs
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.rs
@@ -1,5 +1,4 @@
// stderr-per-bitwidth
-#![feature(const_fn_union)]
fn main() {
let n: Int = 40;
diff --git a/src/test/ui/consts/const-eval/unwind-abort.rs b/src/test/ui/consts/const-eval/unwind-abort.rs
index 766a0c4..89b5135 100644
--- a/src/test/ui/consts/const-eval/unwind-abort.rs
+++ b/src/test/ui/consts/const-eval/unwind-abort.rs
@@ -1,12 +1,11 @@
-#![feature(unwind_attributes, const_panic)]
+#![feature(c_unwind, const_panic, const_extern_fn)]
-#[unwind(aborts)]
-const fn foo() {
+const extern "C" fn foo() {
panic!() //~ ERROR evaluation of constant value failed
}
const _: () = foo();
-// Ensure that the CTFE engine handles calls to `#[unwind(aborts)]` gracefully
+// Ensure that the CTFE engine handles calls to `extern "C"` aborting gracefully
fn main() {
let _ = foo();
diff --git a/src/test/ui/consts/const-eval/unwind-abort.stderr b/src/test/ui/consts/const-eval/unwind-abort.stderr
index e3b871e..78ebd36 100644
--- a/src/test/ui/consts/const-eval/unwind-abort.stderr
+++ b/src/test/ui/consts/const-eval/unwind-abort.stderr
@@ -1,14 +1,14 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/unwind-abort.rs:5:5
+ --> $DIR/unwind-abort.rs:4:5
|
LL | panic!()
| ^^^^^^^^
| |
- | the evaluated program panicked at 'explicit panic', $DIR/unwind-abort.rs:5:5
+ | the evaluated program panicked at 'explicit panic', $DIR/unwind-abort.rs:4:5
| inside `foo` at $SRC_DIR/std/src/panic.rs:LL:COL
...
LL | const _: () = foo();
- | ----- inside `_` at $DIR/unwind-abort.rs:8:15
+ | ----- inside `_` at $DIR/unwind-abort.rs:7:15
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
index 0022d19..7dc1ec8 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
@@ -1,17 +1,17 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/validate_uninhabited_zsts.rs:5:14
+ --> $DIR/validate_uninhabited_zsts.rs:4:14
|
LL | unsafe { std::mem::transmute(()) }
| ^^^^^^^^^^^^^^^^^^^^^^^
| |
| transmuting to uninhabited type
- | inside `foo` at $DIR/validate_uninhabited_zsts.rs:5:14
+ | inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
...
LL | const FOO: [Empty; 3] = [foo(); 3];
- | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:14:26
+ | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:13:26
error[E0080]: it is undefined behavior to use this value
- --> $DIR/validate_uninhabited_zsts.rs:17:1
+ --> $DIR/validate_uninhabited_zsts.rs:16:1
|
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0]: encountered a value of uninhabited type Empty
@@ -20,7 +20,7 @@
= note: the raw bytes of the constant (size: 0, align: 1) {}
warning: the type `!` does not permit zero-initialization
- --> $DIR/validate_uninhabited_zsts.rs:5:14
+ --> $DIR/validate_uninhabited_zsts.rs:4:14
|
LL | unsafe { std::mem::transmute(()) }
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@
= note: the `!` type has no valid value
warning: the type `Empty` does not permit zero-initialization
- --> $DIR/validate_uninhabited_zsts.rs:17:35
+ --> $DIR/validate_uninhabited_zsts.rs:16:35
|
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
index 0022d19..7dc1ec8 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
@@ -1,17 +1,17 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/validate_uninhabited_zsts.rs:5:14
+ --> $DIR/validate_uninhabited_zsts.rs:4:14
|
LL | unsafe { std::mem::transmute(()) }
| ^^^^^^^^^^^^^^^^^^^^^^^
| |
| transmuting to uninhabited type
- | inside `foo` at $DIR/validate_uninhabited_zsts.rs:5:14
+ | inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
...
LL | const FOO: [Empty; 3] = [foo(); 3];
- | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:14:26
+ | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:13:26
error[E0080]: it is undefined behavior to use this value
- --> $DIR/validate_uninhabited_zsts.rs:17:1
+ --> $DIR/validate_uninhabited_zsts.rs:16:1
|
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0]: encountered a value of uninhabited type Empty
@@ -20,7 +20,7 @@
= note: the raw bytes of the constant (size: 0, align: 1) {}
warning: the type `!` does not permit zero-initialization
- --> $DIR/validate_uninhabited_zsts.rs:5:14
+ --> $DIR/validate_uninhabited_zsts.rs:4:14
|
LL | unsafe { std::mem::transmute(()) }
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@
= note: the `!` type has no valid value
warning: the type `Empty` does not permit zero-initialization
- --> $DIR/validate_uninhabited_zsts.rs:17:35
+ --> $DIR/validate_uninhabited_zsts.rs:16:35
|
LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
index f6b6a1f..3465048 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
@@ -1,5 +1,4 @@
// stderr-per-bitwidth
-#![feature(const_fn_transmute)]
const fn foo() -> ! {
unsafe { std::mem::transmute(()) }
diff --git a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr
index b643ecc..33014a1 100644
--- a/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr
+++ b/src/test/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.mir.stderr
@@ -1,12 +1,4 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/const-extern-fn-requires-unsafe.rs:11:5
- |
-LL | foo();
- | ^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/const-extern-fn-requires-unsafe.rs:9:17
|
LL | let a: [u8; foo()];
@@ -14,6 +6,14 @@
|
= note: consult the function's documentation for information on how to avoid undefined behavior
+error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
+ --> $DIR/const-extern-fn-requires-unsafe.rs:11:5
+ |
+LL | foo();
+ | ^^^^^ call to unsafe function
+ |
+ = note: consult the function's documentation for information on how to avoid undefined behavior
+
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/consts/const-fn-error.rs b/src/test/ui/consts/const-fn-error.rs
index b9c5a0e..948c162 100644
--- a/src/test/ui/consts/const-fn-error.rs
+++ b/src/test/ui/consts/const-fn-error.rs
@@ -7,7 +7,7 @@
//~| ERROR calls in constant functions
//~| ERROR calls in constant functions
//~| ERROR E0080
- //~| ERROR E0744
+ //~| ERROR `for` is not allowed in a `const fn`
sum += i;
}
sum
diff --git a/src/test/ui/consts/const-fn-error.stderr b/src/test/ui/consts/const-fn-error.stderr
index f5e69bb..df24585 100644
--- a/src/test/ui/consts/const-fn-error.stderr
+++ b/src/test/ui/consts/const-fn-error.stderr
@@ -1,4 +1,4 @@
-error[E0744]: `for` is not allowed in a `const fn`
+error[E0658]: `for` is not allowed in a `const fn`
--> $DIR/const-fn-error.rs:5:5
|
LL | / for i in 0..x {
@@ -9,6 +9,9 @@
LL | | sum += i;
LL | | }
| |_____^
+ |
+ = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
+ = help: add `#![feature(const_for)]` to the crate attributes to enable
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
--> $DIR/const-fn-error.rs:5:14
@@ -45,5 +48,5 @@
error: aborting due to 5 previous errors
-Some errors have detailed explanations: E0015, E0080, E0658, E0744.
+Some errors have detailed explanations: E0015, E0080, E0658.
For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/consts/const-fn-not-safe-for-const.rs b/src/test/ui/consts/const-fn-not-safe-for-const.rs
index 726d6e9..b2fe73a 100644
--- a/src/test/ui/consts/const-fn-not-safe-for-const.rs
+++ b/src/test/ui/consts/const-fn-not-safe-for-const.rs
@@ -1,10 +1,10 @@
// Test that we can't call random fns in a const fn or do other bad things.
-#![feature(const_fn_transmute)]
-
use std::mem::transmute;
-fn random() -> u32 { 0 }
+fn random() -> u32 {
+ 0
+}
const fn sub(x: &u32) -> usize {
unsafe { transmute(x) }
@@ -18,12 +18,12 @@
const fn get_Y() -> u32 {
Y
- //~^ ERROR E0013
+ //~^ ERROR E0013
}
const fn get_Y_addr() -> &'static u32 {
&Y
- //~^ ERROR E0013
+ //~^ ERROR E0013
}
const fn get() -> u32 {
diff --git a/src/test/ui/consts/const-for-feature-gate.rs b/src/test/ui/consts/const-for-feature-gate.rs
new file mode 100644
index 0000000..bec7b80
--- /dev/null
+++ b/src/test/ui/consts/const-for-feature-gate.rs
@@ -0,0 +1,8 @@
+// gate-test-const_for
+
+const _: () = {
+ for _ in 0..5 {}
+ //~^ error: `for` is not allowed in a `const`
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/const-for-feature-gate.stderr b/src/test/ui/consts/const-for-feature-gate.stderr
new file mode 100644
index 0000000..2ea377e0
--- /dev/null
+++ b/src/test/ui/consts/const-for-feature-gate.stderr
@@ -0,0 +1,12 @@
+error[E0658]: `for` is not allowed in a `const`
+ --> $DIR/const-for-feature-gate.rs:4:5
+ |
+LL | for _ in 0..5 {}
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
+ = help: add `#![feature(const_for)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/const-for.rs b/src/test/ui/consts/const-for.rs
new file mode 100644
index 0000000..5fc1ee0
--- /dev/null
+++ b/src/test/ui/consts/const-for.rs
@@ -0,0 +1,10 @@
+#![feature(const_for)]
+#![feature(const_mut_refs)]
+
+const _: () = {
+ for _ in 0..5 {}
+ //~^ error: calls in constants are limited to
+ //~| error: calls in constants are limited to
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/const-for.stderr b/src/test/ui/consts/const-for.stderr
new file mode 100644
index 0000000..a35c04b3
--- /dev/null
+++ b/src/test/ui/consts/const-for.stderr
@@ -0,0 +1,15 @@
+error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/const-for.rs:5:14
+ |
+LL | for _ in 0..5 {}
+ | ^^^^
+
+error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/const-for.rs:5:14
+ |
+LL | for _ in 0..5 {}
+ | ^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0015`.
diff --git a/src/test/ui/consts/const-match-check.eval1.stderr b/src/test/ui/consts/const-match-check.eval1.stderr
index eb6b077..4141cc4 100644
--- a/src/test/ui/consts/const-match-check.eval1.stderr
+++ b/src/test/ui/consts/const-match-check.eval1.stderr
@@ -10,7 +10,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | A = { if let 0 = 0 { /* */ } 0 },
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/consts/const-match-check.eval2.stderr b/src/test/ui/consts/const-match-check.eval2.stderr
index 756426d..af86ba0 100644
--- a/src/test/ui/consts/const-match-check.eval2.stderr
+++ b/src/test/ui/consts/const-match-check.eval2.stderr
@@ -10,7 +10,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let x: [i32; { if let 0 = 0 { /* */ } 0 }] = [];
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/consts/const-match-check.matchck.stderr b/src/test/ui/consts/const-match-check.matchck.stderr
index 84600bb..f71490e 100644
--- a/src/test/ui/consts/const-match-check.matchck.stderr
+++ b/src/test/ui/consts/const-match-check.matchck.stderr
@@ -10,7 +10,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | const X: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:8:23
@@ -24,7 +24,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | static Y: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:13:26
@@ -38,7 +38,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | const X: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:19:26
@@ -52,7 +52,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | const X: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/consts/const-needs_drop-monomorphic.rs b/src/test/ui/consts/const-needs_drop-monomorphic.rs
index 9f66e3c..7402c68 100644
--- a/src/test/ui/consts/const-needs_drop-monomorphic.rs
+++ b/src/test/ui/consts/const-needs_drop-monomorphic.rs
@@ -1,5 +1,5 @@
// Check that evaluation of needs_drop<T> fails when T is not monomorphic.
-#![feature(const_generics)]
+#![feature(generic_const_exprs)]
#![allow(const_evaluatable_unchecked)]
#![allow(incomplete_features)]
@@ -10,7 +10,7 @@
fn f<T>() {
Bool::<{ std::mem::needs_drop::<T>() }>::assert();
//~^ ERROR no function or associated item named `assert` found
- //~| ERROR constant expression depends on a generic parameter
+ //~| ERROR unconstrained generic constant
}
fn main() {
f::<u32>();
diff --git a/src/test/ui/consts/const-needs_drop-monomorphic.stderr b/src/test/ui/consts/const-needs_drop-monomorphic.stderr
index 0770d06..6e56d20 100644
--- a/src/test/ui/consts/const-needs_drop-monomorphic.stderr
+++ b/src/test/ui/consts/const-needs_drop-monomorphic.stderr
@@ -7,13 +7,13 @@
LL | Bool::<{ std::mem::needs_drop::<T>() }>::assert();
| ^^^^^^ function or associated item cannot be called on `Bool<{ std::mem::needs_drop::<T>() }>` due to unsatisfied trait bounds
-error: constant expression depends on a generic parameter
+error: unconstrained generic constant
--> $DIR/const-needs_drop-monomorphic.rs:11:5
|
LL | Bool::<{ std::mem::needs_drop::<T>() }>::assert();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: this may fail depending on what value the parameter takes
+ = help: try adding a `where` bound using this expression: `where [(); { std::mem::needs_drop::<T>() }]:`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/consts/const-size_of-cycle.stderr b/src/test/ui/consts/const-size_of-cycle.stderr
index 129457e..1067eb0 100644
--- a/src/test/ui/consts/const-size_of-cycle.stderr
+++ b/src/test/ui/consts/const-size_of-cycle.stderr
@@ -15,6 +15,7 @@
LL | bytes: [u8; std::mem::size_of::<Foo>()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires computing layout of `Foo`...
+ = note: ...which requires computing layout of `[u8; _]`...
= note: ...which requires normalizing `[u8; _]`...
= note: ...which again requires simplifying constant for the type system `Foo::bytes::{constant#0}`, completing the cycle
note: cycle used when checking that `Foo` is well-formed
diff --git a/src/test/ui/consts/const-try-feature-gate.rs b/src/test/ui/consts/const-try-feature-gate.rs
new file mode 100644
index 0000000..0839c23
--- /dev/null
+++ b/src/test/ui/consts/const-try-feature-gate.rs
@@ -0,0 +1,9 @@
+// gate-test-const_try
+
+const fn t() -> Option<()> {
+ Some(())?;
+ //~^ error: `?` is not allowed in a `const fn`
+ None
+}
+
+fn main() {}
diff --git a/src/test/ui/consts/const-try-feature-gate.stderr b/src/test/ui/consts/const-try-feature-gate.stderr
new file mode 100644
index 0000000..cd1a063
--- /dev/null
+++ b/src/test/ui/consts/const-try-feature-gate.stderr
@@ -0,0 +1,12 @@
+error[E0658]: `?` is not allowed in a `const fn`
+ --> $DIR/const-try-feature-gate.rs:4:5
+ |
+LL | Some(())?;
+ | ^^^^^^^^^
+ |
+ = note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
+ = help: add `#![feature(const_try)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/const-try.rs b/src/test/ui/consts/const-try.rs
new file mode 100644
index 0000000..e199fd9
--- /dev/null
+++ b/src/test/ui/consts/const-try.rs
@@ -0,0 +1,39 @@
+// check-pass
+
+// Demonstrates what's needed to make use of `?` in const contexts.
+
+#![crate_type = "lib"]
+#![feature(try_trait_v2)]
+#![feature(const_trait_impl)]
+#![feature(const_try)]
+
+use std::ops::{ControlFlow, FromResidual, Try};
+
+struct TryMe;
+struct Error;
+
+impl const FromResidual<Error> for TryMe {
+ fn from_residual(residual: Error) -> Self {
+ TryMe
+ }
+}
+
+impl const Try for TryMe {
+ type Output = ();
+ type Residual = Error;
+ fn from_output(output: Self::Output) -> Self {
+ TryMe
+ }
+ fn branch(self) -> ControlFlow<Self::Residual, Self::Output> {
+ ControlFlow::Break(Error)
+ }
+}
+
+const fn t() -> TryMe {
+ TryMe?;
+ TryMe
+}
+
+const _: () = {
+ t();
+};
diff --git a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr
index 10e54e0..5e706a4 100644
--- a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr
+++ b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr
@@ -1,19 +1,15 @@
error: any use of this value will cause an error
- --> $DIR/const_eval_limit_reached.rs:6:5
+ --> $DIR/const_eval_limit_reached.rs:6:11
|
-LL | / const X: usize = {
-LL | | let mut x = 0;
-LL | | while x != 1000 {
- | |_____^
-LL | ||
-LL | ||
-LL | || x += 1;
-LL | || }
- | ||_____^ exceeded interpreter step limit (see `#[const_eval_limit]`)
-LL | |
-LL | | x
-LL | | };
- | |__-
+LL | / const X: usize = {
+LL | | let mut x = 0;
+LL | | while x != 1000 {
+ | | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+LL | |
+... |
+LL | | x
+LL | | };
+ | |__-
|
= note: `#[deny(const_err)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
index ecdd0ca..65cb3d7 100644
--- a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
+++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
@@ -6,7 +6,7 @@
| |
| entering unreachable code
| inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL
- |
+ |
::: $DIR/const_unsafe_unreachable_ub.rs:7:18
|
LL | false => std::hint::unreachable_unchecked(),
diff --git a/src/test/ui/consts/control-flow/loop.stderr b/src/test/ui/consts/control-flow/loop.stderr
index 7b99fa4..5f6ad8c 100644
--- a/src/test/ui/consts/control-flow/loop.stderr
+++ b/src/test/ui/consts/control-flow/loop.stderr
@@ -1,19 +1,25 @@
-error[E0744]: `for` is not allowed in a `const`
+error[E0658]: `for` is not allowed in a `const`
--> $DIR/loop.rs:53:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^
+ |
+ = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
+ = help: add `#![feature(const_for)]` to the crate attributes to enable
-error[E0744]: `for` is not allowed in a `const`
+error[E0658]: `for` is not allowed in a `const`
--> $DIR/loop.rs:57:5
|
LL | / for i in 0..4 {
LL | | x += i;
LL | | }
| |_____^
+ |
+ = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
+ = help: add `#![feature(const_for)]` to the crate attributes to enable
error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0744`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/control-flow/try.stderr b/src/test/ui/consts/control-flow/try.stderr
index 35075a3..5aeec8f 100644
--- a/src/test/ui/consts/control-flow/try.stderr
+++ b/src/test/ui/consts/control-flow/try.stderr
@@ -1,9 +1,12 @@
-error[E0744]: `?` is not allowed in a `const fn`
+error[E0658]: `?` is not allowed in a `const fn`
--> $DIR/try.rs:6:5
|
LL | x?;
| ^^
+ |
+ = note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
+ = help: add `#![feature(const_try)]` to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0744`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/inline_asm.rs b/src/test/ui/consts/inline_asm.rs
index b8b7550..fa9542f 100644
--- a/src/test/ui/consts/inline_asm.rs
+++ b/src/test/ui/consts/inline_asm.rs
@@ -1,6 +1,6 @@
-#![feature(llvm_asm)]
+#![feature(asm)]
-const _: () = unsafe { llvm_asm!("nop") };
+const _: () = unsafe { asm!("nop") };
//~^ ERROR inline assembly
fn main() {}
diff --git a/src/test/ui/consts/inline_asm.stderr b/src/test/ui/consts/inline_asm.stderr
index 7904a35..f38044a 100644
--- a/src/test/ui/consts/inline_asm.stderr
+++ b/src/test/ui/consts/inline_asm.stderr
@@ -1,10 +1,8 @@
error[E0015]: inline assembly is not allowed in constants
--> $DIR/inline_asm.rs:3:24
|
-LL | const _: () = unsafe { llvm_asm!("nop") };
- | ^^^^^^^^^^^^^^^^
- |
- = note: this error originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL | const _: () = unsafe { asm!("nop") };
+ | ^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-37222.rs b/src/test/ui/consts/issue-37222.rs
similarity index 100%
rename from src/test/ui/issues/issue-37222.rs
rename to src/test/ui/consts/issue-37222.rs
diff --git a/src/test/ui/consts/issue-44415.stderr b/src/test/ui/consts/issue-44415.stderr
index 38841e9..9e3db5c 100644
--- a/src/test/ui/consts/issue-44415.stderr
+++ b/src/test/ui/consts/issue-44415.stderr
@@ -15,6 +15,7 @@
LL | bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
| ^^^^^^
= note: ...which requires computing layout of `Foo`...
+ = note: ...which requires computing layout of `[u8; _]`...
= note: ...which requires normalizing `[u8; _]`...
= note: ...which again requires simplifying constant for the type system `Foo::bytes::{constant#0}`, completing the cycle
note: cycle used when checking that `Foo` is well-formed
diff --git a/src/test/ui/consts/issue-66693.stderr b/src/test/ui/consts/issue-66693.stderr
index 50c95c8..3349e98 100644
--- a/src/test/ui/consts/issue-66693.stderr
+++ b/src/test/ui/consts/issue-66693.stderr
@@ -1,12 +1,4 @@
error: argument to `panic!()` in a const context must have type `&str`
- --> $DIR/issue-66693.rs:13:5
- |
-LL | panic!(&1);
- | ^^^^^^^^^^^
- |
- = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: argument to `panic!()` in a const context must have type `&str`
--> $DIR/issue-66693.rs:6:15
|
LL | const _: () = panic!(1);
@@ -22,5 +14,13 @@
|
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
+error: argument to `panic!()` in a const context must have type `&str`
+ --> $DIR/issue-66693.rs:13:5
+ |
+LL | panic!(&1);
+ | ^^^^^^^^^^^
+ |
+ = note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error: aborting due to 3 previous errors
diff --git a/src/test/ui/consts/issue-69532.rs b/src/test/ui/consts/issue-69532.rs
index 81007b1..0a89178 100644
--- a/src/test/ui/consts/issue-69532.rs
+++ b/src/test/ui/consts/issue-69532.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(const_fn_transmute)]
const fn make_nans() -> (f64, f64, f32, f32) {
let nan1: f64 = unsafe { std::mem::transmute(0x7FF0_0001_0000_0001u64) };
diff --git a/src/test/ui/consts/issue-88649.rs b/src/test/ui/consts/issue-88649.rs
new file mode 100644
index 0000000..43e562b
--- /dev/null
+++ b/src/test/ui/consts/issue-88649.rs
@@ -0,0 +1,18 @@
+// check-pass
+#![crate_type = "lib"]
+
+enum Foo {
+ Variant1(bool),
+ Variant2(bool),
+}
+
+const _: () = {
+ let mut n = 0;
+ while n < 2 {
+ match Foo::Variant1(true) {
+ Foo::Variant1(x) | Foo::Variant2(x) if x => {}
+ _ => {}
+ }
+ n += 1;
+ }
+};
diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
index 0c8af5a..719a7a9 100644
--- a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
+++ b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
@@ -8,9 +8,3 @@
//~^ dereferencing raw pointers in constant functions
fn main() {}
-
-const unsafe fn no_union() {
- union Foo { x: (), y: () }
- Foo { x: () }.y
- //~^ unions in const fn
-}
diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
index 322052c..86ff472 100644
--- a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
+++ b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
@@ -25,15 +25,6 @@
= note: see issue #51911 <https://github.com/rust-lang/rust/issues/51911> for more information
= help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
-error[E0658]: unions in const fn are unstable
- --> $DIR/min_const_fn_unsafe_bad.rs:14:5
- |
-LL | Foo { x: () }.y
- | ^^^^^^^^^^^^^^^
- |
- = note: see issue #51909 <https://github.com/rust-lang/rust/issues/51909> for more information
- = help: add `#![feature(const_fn_union)]` to the crate attributes to enable
-
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
index 64a1214..64d8540 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
@@ -65,11 +65,11 @@
| ^^^^^^^
warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:32:51
+ --> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
LL | / const U8_MUT3: &u8 = {
LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | | ^^^^^^^^^^^ constant accesses static
+ | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
LL | |
LL | |
LL | |
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
index 66fe4ec..8e793ab 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
@@ -65,11 +65,11 @@
| ^^^^^^^
warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:32:51
+ --> $DIR/const_refers_to_static_cross_crate.rs:32:20
|
LL | / const U8_MUT3: &u8 = {
LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | | ^^^^^^^^^^^ constant accesses static
+ | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
LL | |
LL | |
LL | |
diff --git a/src/test/ui/consts/miri_unleashed/drop.stderr b/src/test/ui/consts/miri_unleashed/drop.stderr
index f79dc45..36db6b7 100644
--- a/src/test/ui/consts/miri_unleashed/drop.stderr
+++ b/src/test/ui/consts/miri_unleashed/drop.stderr
@@ -6,7 +6,7 @@
| |
| calling non-const function `<Vec<i32> as Drop>::drop`
| inside `std::ptr::drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- |
+ |
::: $DIR/drop.rs:18:1
|
LL | };
diff --git a/src/test/ui/consts/miri_unleashed/inline_asm.rs b/src/test/ui/consts/miri_unleashed/inline_asm.rs
index aa9b314..b942133 100644
--- a/src/test/ui/consts/miri_unleashed/inline_asm.rs
+++ b/src/test/ui/consts/miri_unleashed/inline_asm.rs
@@ -2,6 +2,7 @@
// only-x86_64
#![feature(asm,llvm_asm)]
#![allow(const_err)]
+#![allow(deprecated)] // llvm_asm!
fn main() {}
diff --git a/src/test/ui/consts/miri_unleashed/inline_asm.stderr b/src/test/ui/consts/miri_unleashed/inline_asm.stderr
index 0bd9590..d06afa8 100644
--- a/src/test/ui/consts/miri_unleashed/inline_asm.stderr
+++ b/src/test/ui/consts/miri_unleashed/inline_asm.stderr
@@ -1,5 +1,5 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/inline_asm.rs:10:14
+ --> $DIR/inline_asm.rs:11:14
|
LL | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inline assembly is not supported
@@ -7,7 +7,7 @@
= note: this error originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: could not evaluate static initializer
- --> $DIR/inline_asm.rs:19:14
+ --> $DIR/inline_asm.rs:20:14
|
LL | unsafe { asm!("nop"); }
| ^^^^^^^^^^^^ inline assembly is not supported
@@ -15,12 +15,12 @@
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/inline_asm.rs:10:14
+ --> $DIR/inline_asm.rs:11:14
|
LL | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/inline_asm.rs:19:14
+ --> $DIR/inline_asm.rs:20:14
|
LL | unsafe { asm!("nop"); }
| ^^^^^^^^^^^^
diff --git a/src/test/ui/consts/offset_from_ub.stderr b/src/test/ui/consts/offset_from_ub.stderr
index 663bfbd..2478ff0 100644
--- a/src/test/ui/consts/offset_from_ub.stderr
+++ b/src/test/ui/consts/offset_from_ub.stderr
@@ -12,7 +12,7 @@
| |
| 0x2a is not a valid pointer
| inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_from_ub.rs:24:14
|
LL | unsafe { (42 as *const u8).offset_from(&5u8) as usize }
diff --git a/src/test/ui/consts/offset_ub.stderr b/src/test/ui/consts/offset_ub.stderr
index 66a2722..4c3f373 100644
--- a/src/test/ui/consts/offset_ub.stderr
+++ b/src/test/ui/consts/offset_ub.stderr
@@ -6,7 +6,7 @@
| |
| overflowing in-bounds pointer arithmetic
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:8:46
|
LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) };
@@ -20,7 +20,7 @@
| |
| pointer arithmetic failed: allocN has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:9:43
|
LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) };
@@ -34,7 +34,7 @@
| |
| pointer arithmetic failed: allocN has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:10:45
|
LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) };
@@ -48,7 +48,7 @@
| |
| overflowing in-bounds pointer arithmetic
| inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:12:43
|
LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) };
@@ -62,7 +62,7 @@
| |
| overflowing in-bounds pointer arithmetic
| inside `ptr::const_ptr::<impl *const u16>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:13:44
|
LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) };
@@ -76,7 +76,7 @@
| |
| overflowing in-bounds pointer arithmetic
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:14:56
|
LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) };
@@ -90,7 +90,7 @@
| |
| overflowing in-bounds pointer arithmetic
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:15:57
|
LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) };
@@ -104,7 +104,7 @@
| |
| pointer arithmetic failed: allocN has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:16:49
|
LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_offset(-2).offset(-2) };
@@ -118,7 +118,7 @@
| |
| pointer arithmetic failed: allocN has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:18:50
|
LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) };
@@ -132,7 +132,7 @@
| |
| 0x1 is not a valid pointer
| inside `ptr::mut_ptr::<impl *mut u8>::offset` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:19:42
|
LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::<u8>::dangling().as_ptr().offset(4) };
@@ -146,7 +146,7 @@
| |
| pointer arithmetic failed: 0x0 is not a valid pointer
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:22:50
|
LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::<u8>().offset(0) };
@@ -160,7 +160,7 @@
| |
| 0x7f..f is not a valid pointer
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/offset_ub.rs:25:47
|
LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) };
diff --git a/src/test/ui/consts/promote-not.rs b/src/test/ui/consts/promote-not.rs
index 20c1169..9992653 100644
--- a/src/test/ui/consts/promote-not.rs
+++ b/src/test/ui/consts/promote-not.rs
@@ -1,7 +1,6 @@
// ignore-tidy-linelength
// Test various things that we do not want to promote.
#![allow(unconditional_panic, const_err)]
-#![feature(const_fn_union)]
use std::cell::Cell;
diff --git a/src/test/ui/consts/promote-not.stderr b/src/test/ui/consts/promote-not.stderr
index 108d0da..932109b 100644
--- a/src/test/ui/consts/promote-not.stderr
+++ b/src/test/ui/consts/promote-not.stderr
@@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:9:50
+ --> $DIR/promote-not.rs:8:50
|
LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
| ----------^^^^^^^^^-
@@ -9,7 +9,7 @@
| using this value as a static requires that borrow lasts for `'static`
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:12:18
+ --> $DIR/promote-not.rs:11:18
|
LL | let x = &mut [1,2,3];
| ^^^^^^^ creates a temporary which is freed while still in use
@@ -19,7 +19,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:21:32
+ --> $DIR/promote-not.rs:20:32
|
LL | let _x: &'static () = &foo();
| ----------- ^^^^^ creates a temporary which is freed while still in use
@@ -29,7 +29,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:29:29
+ --> $DIR/promote-not.rs:28:29
|
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -39,7 +39,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:34:29
+ --> $DIR/promote-not.rs:33:29
|
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -49,7 +49,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:40:29
+ --> $DIR/promote-not.rs:39:29
|
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -59,7 +59,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:45:29
+ --> $DIR/promote-not.rs:44:29
|
LL | let _val: &'static _ = &(Cell::new(1), 2).0;
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -70,7 +70,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:46:29
+ --> $DIR/promote-not.rs:45:29
|
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -81,7 +81,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:49:29
+ --> $DIR/promote-not.rs:48:29
|
LL | let _val: &'static _ = &(1/0);
| ---------- ^^^^^ creates a temporary which is freed while still in use
@@ -92,7 +92,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:50:29
+ --> $DIR/promote-not.rs:49:29
|
LL | let _val: &'static _ = &(1/(1-1));
| ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
@@ -103,7 +103,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:51:29
+ --> $DIR/promote-not.rs:50:29
|
LL | let _val: &'static _ = &(1%0);
| ---------- ^^^^^ creates a temporary which is freed while still in use
@@ -114,7 +114,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:52:29
+ --> $DIR/promote-not.rs:51:29
|
LL | let _val: &'static _ = &(1%(1-1));
| ---------- ^^^^^^^^^ creates a temporary which is freed while still in use
@@ -125,7 +125,7 @@
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promote-not.rs:53:29
+ --> $DIR/promote-not.rs:52:29
|
LL | let _val: &'static _ = &([1,2,3][4]+1);
| ---------- ^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr
index 6ae24c1..a28ae52 100644
--- a/src/test/ui/consts/ptr_comparisons.stderr
+++ b/src/test/ui/consts/ptr_comparisons.stderr
@@ -6,7 +6,7 @@
| |
| pointer arithmetic failed: alloc3 has size $WORD, so pointer to $TWO_WORDS bytes starting at offset 0 is out-of-bounds
| inside `ptr::const_ptr::<impl *const usize>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- |
+ |
::: $DIR/ptr_comparisons.rs:61:34
|
LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
diff --git a/src/test/ui/consts/unwind-abort.rs b/src/test/ui/consts/unwind-abort.rs
index f9011f9..d9d0b91 100644
--- a/src/test/ui/consts/unwind-abort.rs
+++ b/src/test/ui/consts/unwind-abort.rs
@@ -1,10 +1,9 @@
// check-pass
-#![feature(unwind_attributes, const_panic)]
+#![feature(c_unwind, const_panic, const_extern_fn)]
-// `#[unwind(aborts)]` is okay for a `const fn`. We don't unwind in const-eval anyways.
-#[unwind(aborts)]
-const fn foo() {
+// We don't unwind in const-eval anyways.
+const extern "C" fn foo() {
panic!()
}
diff --git a/src/test/ui/crate-loading/missing-std.rs b/src/test/ui/crate-loading/missing-std.rs
index de4ccc1..1a34c21 100644
--- a/src/test/ui/crate-loading/missing-std.rs
+++ b/src/test/ui/crate-loading/missing-std.rs
@@ -1,7 +1,6 @@
// compile-flags: --target x86_64-unknown-uefi
// needs-llvm-components: x86
// rustc-env:CARGO=/usr/bin/cargo
-// rustc-env:RUSTUP_HOME=/home/bors/.rustup
#![no_core]
extern crate core;
//~^ ERROR can't find crate for `core`
diff --git a/src/test/ui/crate-loading/missing-std.stderr b/src/test/ui/crate-loading/missing-std.stderr
index e61486f..25808ef 100644
--- a/src/test/ui/crate-loading/missing-std.stderr
+++ b/src/test/ui/crate-loading/missing-std.stderr
@@ -1,5 +1,5 @@
error[E0463]: can't find crate for `core`
- --> $DIR/missing-std.rs:6:1
+ --> $DIR/missing-std.rs:5:1
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^ can't find crate
diff --git a/src/test/ui/cross/cross-file-errors/main.stderr b/src/test/ui/cross/cross-file-errors/main.stderr
index 4f015bf..ff9e872 100644
--- a/src/test/ui/cross/cross-file-errors/main.stderr
+++ b/src/test/ui/cross/cross-file-errors/main.stderr
@@ -3,7 +3,7 @@
|
LL | _
| ^
- |
+ |
::: $DIR/main.rs:5:5
|
LL | underscore!();
@@ -18,7 +18,7 @@
|
LL | _
| ^ `_` not allowed here
- |
+ |
::: $DIR/main.rs:5:5
|
LL | underscore!();
diff --git a/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr b/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr
index 58c4587..fc842fa 100644
--- a/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr
+++ b/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr
@@ -4,7 +4,7 @@
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^
|
- = note: ...which again requires computing type of `Foo::X`, completing the cycle
+ = note: ...which immediately requires computing type of `Foo::X` again
note: cycle used when collecting item types in top-level module
--> $DIR/cycle-trait-default-type-trait.rs:4:1
|
@@ -17,7 +17,7 @@
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^
|
- = note: ...which again requires computing type of `Foo::X`, completing the cycle
+ = note: ...which immediately requires computing type of `Foo::X` again
note: cycle used when collecting item types in top-level module
--> $DIR/cycle-trait-default-type-trait.rs:4:1
|
diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr
index 9d1644a..b81aeab 100644
--- a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr
+++ b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr
@@ -17,6 +17,12 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: OK
+ --> $DIR/dep-graph-struct-signature.rs:31:9
+ |
+LL | #[rustc_then_this_would_need(fn_sig)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: OK
--> $DIR/dep-graph-struct-signature.rs:35:5
|
LL | #[rustc_then_this_would_need(fn_sig)]
@@ -47,12 +53,36 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: OK
+ --> $DIR/dep-graph-struct-signature.rs:47:9
+ |
+LL | #[rustc_then_this_would_need(fn_sig)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: OK
+ --> $DIR/dep-graph-struct-signature.rs:48:9
+ |
+LL | #[rustc_then_this_would_need(typeck)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: OK
--> $DIR/dep-graph-struct-signature.rs:52:5
|
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: OK
+ --> $DIR/dep-graph-struct-signature.rs:54:9
+ |
+LL | #[rustc_then_this_would_need(fn_sig)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: OK
+ --> $DIR/dep-graph-struct-signature.rs:55:9
+ |
+LL | #[rustc_then_this_would_need(typeck)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: OK
--> $DIR/dep-graph-struct-signature.rs:60:9
|
LL | #[rustc_then_this_would_need(type_of)]
@@ -77,6 +107,12 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: no path from `WillChange` to `fn_sig`
+ --> $DIR/dep-graph-struct-signature.rs:76:9
+ |
+LL | #[rustc_then_this_would_need(fn_sig)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: no path from `WillChange` to `fn_sig`
--> $DIR/dep-graph-struct-signature.rs:80:5
|
LL | #[rustc_then_this_would_need(fn_sig)]
@@ -94,41 +130,5 @@
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: OK
- --> $DIR/dep-graph-struct-signature.rs:31:9
- |
-LL | #[rustc_then_this_would_need(fn_sig)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: no path from `WillChange` to `fn_sig`
- --> $DIR/dep-graph-struct-signature.rs:76:9
- |
-LL | #[rustc_then_this_would_need(fn_sig)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: OK
- --> $DIR/dep-graph-struct-signature.rs:47:9
- |
-LL | #[rustc_then_this_would_need(fn_sig)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: OK
- --> $DIR/dep-graph-struct-signature.rs:48:9
- |
-LL | #[rustc_then_this_would_need(typeck)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: OK
- --> $DIR/dep-graph-struct-signature.rs:54:9
- |
-LL | #[rustc_then_this_would_need(fn_sig)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: OK
- --> $DIR/dep-graph-struct-signature.rs:55:9
- |
-LL | #[rustc_then_this_would_need(typeck)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
error: aborting due to 22 previous errors
diff --git a/src/test/ui/dep-graph/dep-graph-type-alias.stderr b/src/test/ui/dep-graph/dep-graph-type-alias.stderr
index 9baaf74..e698ce8 100644
--- a/src/test/ui/dep-graph/dep-graph-type-alias.stderr
+++ b/src/test/ui/dep-graph/dep-graph-type-alias.stderr
@@ -28,6 +28,12 @@
LL | #[rustc_then_this_would_need(type_of)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: OK
+ --> $DIR/dep-graph-type-alias.rs:35:5
+ |
+LL | #[rustc_then_this_would_need(fn_sig)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
error: no path from `TypeAlias` to `type_of`
--> $DIR/dep-graph-type-alias.rs:41:1
|
@@ -35,6 +41,18 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: OK
+ --> $DIR/dep-graph-type-alias.rs:43:5
+ |
+LL | #[rustc_then_this_would_need(fn_sig)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: OK
+ --> $DIR/dep-graph-type-alias.rs:44:5
+ |
+LL | #[rustc_then_this_would_need(typeck)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: OK
--> $DIR/dep-graph-type-alias.rs:48:1
|
LL | #[rustc_then_this_would_need(type_of)]
@@ -52,23 +70,5 @@
LL | #[rustc_then_this_would_need(typeck)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: OK
- --> $DIR/dep-graph-type-alias.rs:35:5
- |
-LL | #[rustc_then_this_would_need(fn_sig)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: OK
- --> $DIR/dep-graph-type-alias.rs:43:5
- |
-LL | #[rustc_then_this_would_need(fn_sig)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: OK
- --> $DIR/dep-graph-type-alias.rs:44:5
- |
-LL | #[rustc_then_this_would_need(typeck)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
error: aborting due to 12 previous errors
diff --git a/src/test/ui/deprecation/invalid-literal.stderr b/src/test/ui/deprecation/invalid-literal.stderr
index a5088a3..f15be95 100644
--- a/src/test/ui/deprecation/invalid-literal.stderr
+++ b/src/test/ui/deprecation/invalid-literal.stderr
@@ -7,11 +7,11 @@
help: the following are the possible correct uses
|
LL | #[deprecated]
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
LL | #[deprecated(/*opt*/ since = "version", /*opt*/ note = "reason")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | #[deprecated = "reason"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr
deleted file mode 100644
index b3f7b04..0000000
--- a/src/test/ui/deref-suggestion.stderr
+++ /dev/null
@@ -1,131 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:8:9
- |
-LL | foo(s);
- | ^
- | |
- | expected struct `String`, found `&String`
- | help: try using a conversion method: `s.to_string()`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:14:10
- |
-LL | foo3(u);
- | ^
- | |
- | expected `u32`, found `&u32`
- | help: consider dereferencing the borrow: `*u`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:30:9
- |
-LL | foo(&"aaa".to_owned());
- | ^^^^^^^^^^^^^^^^^
- | |
- | expected struct `String`, found `&String`
- | help: consider removing the borrow: `"aaa".to_owned()`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:32:9
- |
-LL | foo(&mut "aaa".to_owned());
- | ^^^^^^^^^^^^^^^^^^^^^
- | |
- | expected struct `String`, found `&mut String`
- | help: consider removing the borrow: `"aaa".to_owned()`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:2:20
- |
-LL | ($x:expr) => { &$x }
- | ^^^ expected `u32`, found `&{integer}`
-...
-LL | foo3(borrow!(0));
- | ---------- in this macro invocation
- |
- = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:36:5
- |
-LL | assert_eq!(3i32, &3i32);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
- |
- = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:39:17
- |
-LL | let s = S { u };
- | ^
- | |
- | expected `&u32`, found integer
- | help: consider borrowing here: `u: &u`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:41:20
- |
-LL | let s = S { u: u };
- | ^
- | |
- | expected `&u32`, found integer
- | help: consider borrowing here: `&u`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:44:17
- |
-LL | let r = R { i };
- | ^
- | |
- | expected `u32`, found `&{integer}`
- | help: consider dereferencing the borrow: `i: *i`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:46:20
- |
-LL | let r = R { i: i };
- | ^
- | |
- | expected `u32`, found `&{integer}`
- | help: consider dereferencing the borrow: `*i`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:55:9
- |
-LL | b
- | ^
- | |
- | expected `i32`, found `&{integer}`
- | help: consider dereferencing the borrow: `*b`
-
-error[E0308]: mismatched types
- --> $DIR/deref-suggestion.rs:63:9
- |
-LL | b
- | ^
- | |
- | expected `i32`, found `&{integer}`
- | help: consider dereferencing the borrow: `*b`
-
-error[E0308]: `if` and `else` have incompatible types
- --> $DIR/deref-suggestion.rs:68:12
- |
-LL | let val = if true {
- | _______________-
-LL | | *a
- | | -- expected because of this
-LL | | } else if true {
- | |____________^
-LL | ||
-LL | || b
-LL | || } else {
-LL | || &0
-LL | || };
- | || ^
- | ||_____|
- | |______`if` and `else` have incompatible types
- | expected `i32`, found `&{integer}`
-
-error: aborting due to 13 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr
index 0a76405..277454a 100644
--- a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr
@@ -6,12 +6,12 @@
...
LL | x: Error
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub struct AssertParamIsEq<T: Eq + ?Sized> {
- | -- required by this bound in `AssertParamIsEq`
- |
+ | ^^ required by this bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-Eq-enum.stderr b/src/test/ui/derives/derives-span-Eq-enum.stderr
index c17e2c5..6a48ad2 100644
--- a/src/test/ui/derives/derives-span-Eq-enum.stderr
+++ b/src/test/ui/derives/derives-span-Eq-enum.stderr
@@ -6,12 +6,12 @@
...
LL | Error
| ^^^^^ the trait `Eq` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub struct AssertParamIsEq<T: Eq + ?Sized> {
- | -- required by this bound in `AssertParamIsEq`
- |
+ | ^^ required by this bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-Eq-struct.stderr b/src/test/ui/derives/derives-span-Eq-struct.stderr
index 7a7640b..7bf83e8 100644
--- a/src/test/ui/derives/derives-span-Eq-struct.stderr
+++ b/src/test/ui/derives/derives-span-Eq-struct.stderr
@@ -6,12 +6,12 @@
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Eq` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub struct AssertParamIsEq<T: Eq + ?Sized> {
- | -- required by this bound in `AssertParamIsEq`
- |
+ | ^^ required by this bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr
index 3593298..13e2a55 100644
--- a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr
@@ -6,12 +6,12 @@
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Eq` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub struct AssertParamIsEq<T: Eq + ?Sized> {
- | -- required by this bound in `AssertParamIsEq`
- |
+ | ^^ required by this bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
index 4616dad..47c7f1c 100644
--- a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr
@@ -6,12 +6,12 @@
...
LL | x: Error
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
+ |
+note: required by a bound in `std::hash::Hash::hash`
+ --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
LL | fn hash<H: Hasher>(&self, state: &mut H);
- | - required by this bound in `std::hash::Hash::hash`
- |
+ | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-Hash-enum.stderr b/src/test/ui/derives/derives-span-Hash-enum.stderr
index ffc7f7b..92f084b 100644
--- a/src/test/ui/derives/derives-span-Hash-enum.stderr
+++ b/src/test/ui/derives/derives-span-Hash-enum.stderr
@@ -6,12 +6,12 @@
...
LL | Error
| ^^^^^ the trait `Hash` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
+ |
+note: required by a bound in `std::hash::Hash::hash`
+ --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
LL | fn hash<H: Hasher>(&self, state: &mut H);
- | - required by this bound in `std::hash::Hash::hash`
- |
+ | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-Hash-struct.stderr b/src/test/ui/derives/derives-span-Hash-struct.stderr
index 14aebb4..c57cebe 100644
--- a/src/test/ui/derives/derives-span-Hash-struct.stderr
+++ b/src/test/ui/derives/derives-span-Hash-struct.stderr
@@ -6,12 +6,12 @@
LL | struct Struct {
LL | x: Error
| ^^^^^^^^ the trait `Hash` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
+ |
+note: required by a bound in `std::hash::Hash::hash`
+ --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
LL | fn hash<H: Hasher>(&self, state: &mut H);
- | - required by this bound in `std::hash::Hash::hash`
- |
+ | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
index 50139dc..200937f 100644
--- a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr
@@ -6,12 +6,12 @@
LL | struct Struct(
LL | Error
| ^^^^^ the trait `Hash` is not implemented for `Error`
- |
- ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
+ |
+note: required by a bound in `std::hash::Hash::hash`
+ --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
LL | fn hash<H: Hasher>(&self, state: &mut H);
- | - required by this bound in `std::hash::Hash::hash`
- |
+ | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/derives/deriving-copyclone.stderr b/src/test/ui/derives/deriving-copyclone.stderr
index 0961155..ecdbbff 100644
--- a/src/test/ui/derives/deriving-copyclone.stderr
+++ b/src/test/ui/derives/deriving-copyclone.stderr
@@ -1,9 +1,6 @@
error[E0277]: the trait bound `C: Copy` is not satisfied
--> $DIR/deriving-copyclone.rs:31:13
|
-LL | fn is_copy<T: Copy>(_: T) {}
- | ---- required by this bound in `is_copy`
-...
LL | is_copy(B { a: 1, b: C });
| ^^^^^^^^^^^^^^^^
| |
@@ -15,14 +12,16 @@
|
LL | #[derive(Copy, Clone)]
| ^^^^
+note: required by a bound in `is_copy`
+ --> $DIR/deriving-copyclone.rs:18:15
+ |
+LL | fn is_copy<T: Copy>(_: T) {}
+ | ^^^^ required by this bound in `is_copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `C: Clone` is not satisfied
--> $DIR/deriving-copyclone.rs:32:14
|
-LL | fn is_clone<T: Clone>(_: T) {}
- | ----- required by this bound in `is_clone`
-...
LL | is_clone(B { a: 1, b: C });
| ^^^^^^^^^^^^^^^^
| |
@@ -34,14 +33,16 @@
|
LL | #[derive(Copy, Clone)]
| ^^^^^
+note: required by a bound in `is_clone`
+ --> $DIR/deriving-copyclone.rs:19:16
+ |
+LL | fn is_clone<T: Clone>(_: T) {}
+ | ^^^^^ required by this bound in `is_clone`
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `D: Copy` is not satisfied
--> $DIR/deriving-copyclone.rs:35:13
|
-LL | fn is_copy<T: Copy>(_: T) {}
- | ---- required by this bound in `is_copy`
-...
LL | is_copy(B { a: 1, b: D });
| ^^^^^^^^^^^^^^^^
| |
@@ -53,6 +54,11 @@
|
LL | #[derive(Copy, Clone)]
| ^^^^
+note: required by a bound in `is_copy`
+ --> $DIR/deriving-copyclone.rs:18:15
+ |
+LL | fn is_copy<T: Copy>(_: T) {}
+ | ^^^^ required by this bound in `is_copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr
index 485a91d..bfb673f 100644
--- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr
+++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr
@@ -3,7 +3,7 @@
|
LL | #[derive(Eqr)]
| ^^^ help: a derive macro with a similar name exists: `Eq`
- |
+ |
::: $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub macro Eq($item:item) {
@@ -14,7 +14,7 @@
|
LL | #[derive(Eqr)]
| ^^^ help: a derive macro with a similar name exists: `Eq`
- |
+ |
::: $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub macro Eq($item:item) {
diff --git a/src/test/ui/issues/issue-43023.rs b/src/test/ui/derives/issue-43023.rs
similarity index 100%
rename from src/test/ui/issues/issue-43023.rs
rename to src/test/ui/derives/issue-43023.rs
diff --git a/src/test/ui/issues/issue-43023.stderr b/src/test/ui/derives/issue-43023.stderr
similarity index 100%
rename from src/test/ui/issues/issue-43023.stderr
rename to src/test/ui/derives/issue-43023.stderr
diff --git a/src/test/ui/deriving/deriving-default-enum.rs b/src/test/ui/deriving/deriving-default-enum.rs
new file mode 100644
index 0000000..931ff1a
--- /dev/null
+++ b/src/test/ui/deriving/deriving-default-enum.rs
@@ -0,0 +1,19 @@
+// run-pass
+
+#![feature(derive_default_enum)]
+
+// nb: does not impl Default
+#[derive(Debug, PartialEq)]
+struct NotDefault;
+
+#[derive(Debug, Default, PartialEq)]
+enum Foo {
+ #[default]
+ Alpha,
+ #[allow(dead_code)]
+ Beta(NotDefault),
+}
+
+fn main() {
+ assert_eq!(Foo::default(), Foo::Alpha);
+}
diff --git a/src/test/ui/deriving/deriving-with-helper.rs b/src/test/ui/deriving/deriving-with-helper.rs
index ea74a15..d8f0b27 100644
--- a/src/test/ui/deriving/deriving-with-helper.rs
+++ b/src/test/ui/deriving/deriving-with-helper.rs
@@ -5,6 +5,7 @@
#![feature(lang_items)]
#![feature(no_core)]
#![feature(rustc_attrs)]
+#![feature(derive_default_enum)]
#![no_core]
@@ -30,7 +31,7 @@
trait Sized {}
#[derive(Default)]
-struct S {
+enum S {
#[default] // OK
- field: u8,
+ Foo,
}
diff --git a/src/test/ui/destructuring-assignment/struct_destructure_fail.stderr b/src/test/ui/destructuring-assignment/struct_destructure_fail.stderr
index 8a83e14..635bd5e 100644
--- a/src/test/ui/destructuring-assignment/struct_destructure_fail.stderr
+++ b/src/test/ui/destructuring-assignment/struct_destructure_fail.stderr
@@ -33,11 +33,11 @@
help: include the missing field in the pattern
|
LL | Struct { a, b } = Struct { a: 1, b: 2 };
- | ^^^^^
+ | ~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Struct { a, .. } = Struct { a: 1, b: 2 };
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 5 previous errors
diff --git a/src/test/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr b/src/test/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr
index c270593..9aae4b0 100644
--- a/src/test/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr
+++ b/src/test/ui/destructuring-assignment/tuple_struct_destructure_fail.stderr
@@ -15,58 +15,58 @@
| previously used here
error[E0023]: this pattern has 3 fields, but the corresponding tuple struct has 2 fields
- --> $DIR/tuple_struct_destructure_fail.rs:30:5
+ --> $DIR/tuple_struct_destructure_fail.rs:30:17
|
LL | struct TupleStruct<S, T>(S, T);
- | ------------------------------- tuple struct defined here
+ | - - tuple struct has 2 fields
...
LL | TupleStruct(a, a, b) = TupleStruct(1, 2);
- | ^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 3
+ | ^ ^ ^ expected 2 fields, found 3
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
- --> $DIR/tuple_struct_destructure_fail.rs:32:5
+ --> $DIR/tuple_struct_destructure_fail.rs:32:17
|
LL | struct TupleStruct<S, T>(S, T);
- | ------------------------------- tuple struct defined here
+ | - - tuple struct has 2 fields
...
LL | TupleStruct(_) = TupleStruct(1, 2);
- | ^^^^^^^^^^^^^^ expected 2 fields, found 1
+ | ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | TupleStruct(_, _) = TupleStruct(1, 2);
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | TupleStruct(..) = TupleStruct(1, 2);
- | ^^
+ | ~~
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
- --> $DIR/tuple_struct_destructure_fail.rs:34:5
+ --> $DIR/tuple_struct_destructure_fail.rs:34:25
|
LL | SingleVariant(S, T)
- | ------------------- tuple variant defined here
+ | - - tuple variant has 2 fields
...
LL | Enum::SingleVariant(a, a, b) = Enum::SingleVariant(1, 2);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 3
+ | ^ ^ ^ expected 2 fields, found 3
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
- --> $DIR/tuple_struct_destructure_fail.rs:36:5
+ --> $DIR/tuple_struct_destructure_fail.rs:36:25
|
LL | SingleVariant(S, T)
- | ------------------- tuple variant defined here
+ | - - tuple variant has 2 fields
...
LL | Enum::SingleVariant(_) = Enum::SingleVariant(1, 2);
- | ^^^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 1
+ | ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | Enum::SingleVariant(_, _) = Enum::SingleVariant(1, 2);
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | Enum::SingleVariant(..) = Enum::SingleVariant(1, 2);
- | ^^
+ | ~~
error[E0070]: invalid left-hand side of assignment
--> $DIR/tuple_struct_destructure_fail.rs:40:12
diff --git a/src/test/ui/did_you_mean/bad-assoc-ty.stderr b/src/test/ui/did_you_mean/bad-assoc-ty.stderr
index 8db9652..0e2fdf9 100644
--- a/src/test/ui/did_you_mean/bad-assoc-ty.stderr
+++ b/src/test/ui/did_you_mean/bad-assoc-ty.stderr
@@ -133,7 +133,7 @@
help: use type parameters instead
|
LL | fn foo<X: K<T, T>, T>(x: X) {}
- | ^ ^ ^^^
+ | ~ ~ +++
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/bad-assoc-ty.rs:52:34
@@ -144,7 +144,7 @@
help: use type parameters instead
|
LL | fn bar<F, T>(_: F) where F: Fn() -> T {}
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/bad-assoc-ty.rs:55:19
@@ -155,7 +155,7 @@
help: use type parameters instead
|
LL | fn baz<F: Fn() -> T, T>(_: F) {}
- | ^^^^
+ | ~+++
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
--> $DIR/bad-assoc-ty.rs:58:33
@@ -166,7 +166,7 @@
help: use type parameters instead
|
LL | struct L<F, T>(F) where F: Fn() -> T;
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
--> $DIR/bad-assoc-ty.rs:60:30
@@ -177,7 +177,7 @@
help: use type parameters instead
|
LL | struct M<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for enums
--> $DIR/bad-assoc-ty.rs:64:28
@@ -188,7 +188,7 @@
help: use type parameters instead
|
LL | enum N<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for unions
--> $DIR/bad-assoc-ty.rs:69:29
@@ -199,7 +199,7 @@
help: use type parameters instead
|
LL | union O<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for traits
--> $DIR/bad-assoc-ty.rs:74:29
@@ -210,7 +210,7 @@
help: use type parameters instead
|
LL | trait P<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/bad-assoc-ty.rs:79:38
@@ -221,7 +221,7 @@
help: use type parameters instead
|
LL | fn foo<F, T>(_: F) where F: Fn() -> T {}
- | ^^^ ^
+ | +++ ~
error: aborting due to 28 previous errors
diff --git a/src/test/ui/did_you_mean/issue-31424.rs b/src/test/ui/did_you_mean/issue-31424.rs
index d321d64..95ccf2a 100644
--- a/src/test/ui/did_you_mean/issue-31424.rs
+++ b/src/test/ui/did_you_mean/issue-31424.rs
@@ -5,13 +5,16 @@
impl Struct {
fn foo(&mut self) {
(&mut self).bar(); //~ ERROR cannot borrow
+ //~^ HELP try removing `&mut` here
}
// In this case we could keep the suggestion, but to distinguish the
// two cases is pretty hard. It's an obscure case anyway.
fn bar(self: &mut Self) {
//~^ WARN function cannot return without recursing
+ //~^^ HELP a `loop` may express intention better if this is on purpose
(&mut self).bar(); //~ ERROR cannot borrow
+ //~^ HELP try removing `&mut` here
}
}
diff --git a/src/test/ui/did_you_mean/issue-31424.stderr b/src/test/ui/did_you_mean/issue-31424.stderr
index b9eb8dd..8861738 100644
--- a/src/test/ui/did_you_mean/issue-31424.stderr
+++ b/src/test/ui/did_you_mean/issue-31424.stderr
@@ -2,17 +2,25 @@
--> $DIR/issue-31424.rs:7:9
|
LL | (&mut self).bar();
+ | ^^^^^^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/issue-31424.rs:6:12
+ |
+LL | fn foo(&mut self) {
+ | ^^^^^^^^^
+help: try removing `&mut` here
+ --> $DIR/issue-31424.rs:7:9
+ |
+LL | (&mut self).bar();
| ^^^^^^^^^^^
- | |
- | cannot borrow as mutable
- | try removing `&mut` here
warning: function cannot return without recursing
- --> $DIR/issue-31424.rs:12:5
+ --> $DIR/issue-31424.rs:13:5
|
LL | fn bar(self: &mut Self) {
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
-LL |
+...
LL | (&mut self).bar();
| ----------------- recursive call site
|
@@ -20,13 +28,21 @@
= help: a `loop` may express intention better if this is on purpose
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-31424.rs:14:9
+ --> $DIR/issue-31424.rs:16:9
+ |
+LL | (&mut self).bar();
+ | ^^^^^^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/issue-31424.rs:13:18
+ |
+LL | fn bar(self: &mut Self) {
+ | ^^^^^^^^^
+help: try removing `&mut` here
+ --> $DIR/issue-31424.rs:16:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^
- | |
- | cannot borrow as mutable
- | try removing `&mut` here
error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/src/test/ui/did_you_mean/issue-34126.rs b/src/test/ui/did_you_mean/issue-34126.rs
index 4989577..53516f4 100644
--- a/src/test/ui/did_you_mean/issue-34126.rs
+++ b/src/test/ui/did_you_mean/issue-34126.rs
@@ -5,6 +5,7 @@
fn start(&mut self) {
self.run(&mut self); //~ ERROR cannot borrow
//~| ERROR cannot borrow
+ //~| HELP try removing `&mut` here
}
}
diff --git a/src/test/ui/did_you_mean/issue-34126.stderr b/src/test/ui/did_you_mean/issue-34126.stderr
index 0843df2..6661721 100644
--- a/src/test/ui/did_you_mean/issue-34126.stderr
+++ b/src/test/ui/did_you_mean/issue-34126.stderr
@@ -2,10 +2,18 @@
--> $DIR/issue-34126.rs:6:18
|
LL | self.run(&mut self);
- | ^^^^^^^^^
- | |
- | cannot borrow as mutable
- | try removing `&mut` here
+ | ^^^^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/issue-34126.rs:5:14
+ |
+LL | fn start(&mut self) {
+ | ^^^^^^^^^
+help: try removing `&mut` here
+ |
+LL - self.run(&mut self);
+LL + self.run(self);
+ |
error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable
--> $DIR/issue-34126.rs:6:18
diff --git a/src/test/ui/did_you_mean/issue-34337.rs b/src/test/ui/did_you_mean/issue-34337.rs
index bb69960..e89eda3 100644
--- a/src/test/ui/did_you_mean/issue-34337.rs
+++ b/src/test/ui/did_you_mean/issue-34337.rs
@@ -4,4 +4,5 @@
let mut v: Vec<String> = Vec::new();
let ref mut key = v[0];
get(&mut key); //~ ERROR cannot borrow
+ //~| HELP try removing `&mut` here
}
diff --git a/src/test/ui/did_you_mean/issue-34337.stderr b/src/test/ui/did_you_mean/issue-34337.stderr
index 81f7b6d..1f18ea8 100644
--- a/src/test/ui/did_you_mean/issue-34337.stderr
+++ b/src/test/ui/did_you_mean/issue-34337.stderr
@@ -5,7 +5,7 @@
| ^^^^^^^^
| |
| cannot borrow as mutable
- | try removing `&mut` here
+ | help: try removing `&mut` here
error: aborting due to previous error
diff --git a/src/test/ui/did_you_mean/issue-37139.rs b/src/test/ui/did_you_mean/issue-37139.rs
index 07d855d..6a19d85 100644
--- a/src/test/ui/did_you_mean/issue-37139.rs
+++ b/src/test/ui/did_you_mean/issue-37139.rs
@@ -10,6 +10,7 @@
match x {
TestEnum::Item(ref mut x) => {
test(&mut x); //~ ERROR cannot borrow `x` as mutable, as it is not declared as mutable
+ //~| HELP try removing `&mut` here
}
}
}
diff --git a/src/test/ui/did_you_mean/issue-37139.stderr b/src/test/ui/did_you_mean/issue-37139.stderr
index 163817d..dc1bdfa 100644
--- a/src/test/ui/did_you_mean/issue-37139.stderr
+++ b/src/test/ui/did_you_mean/issue-37139.stderr
@@ -5,7 +5,7 @@
| ^^^^^^
| |
| cannot borrow as mutable
- | try removing `&mut` here
+ | help: try removing `&mut` here
error: aborting due to previous error
diff --git a/src/test/ui/did_you_mean/issue-40006.stderr b/src/test/ui/did_you_mean/issue-40006.stderr
index 76e87a3..d5e16e1 100644
--- a/src/test/ui/did_you_mean/issue-40006.stderr
+++ b/src/test/ui/did_you_mean/issue-40006.stderr
@@ -82,7 +82,7 @@
help: add `fn` here to parse `hello_method` as a public method
|
LL | pub fn hello_method(&self) {
- | ^^
+ | ++
error[E0599]: no method named `hello_method` found for struct `S` in the current scope
--> $DIR/issue-40006.rs:38:7
diff --git a/src/test/ui/did_you_mean/issue-40396.stderr b/src/test/ui/did_you_mean/issue-40396.stderr
index 2c2978d..d293843 100644
--- a/src/test/ui/did_you_mean/issue-40396.stderr
+++ b/src/test/ui/did_you_mean/issue-40396.stderr
@@ -7,7 +7,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | (0..13).collect::<Vec<i32>>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/issue-40396.rs:5:8
@@ -18,7 +18,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | Vec::<i32>::new();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/issue-40396.rs:8:20
@@ -29,18 +29,18 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | (0..13).collect::<Vec<i32>();
- | ^^
+ | ++
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
--> $DIR/issue-40396.rs:11:43
|
LL | let x = std::collections::HashMap<i128, i128>::new();
- | ^ expected one of 7 possible tokens
+ | ^ expected one of 8 possible tokens
|
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | let x = std::collections::HashMap::<i128, i128>::new();
- | ^^
+ | ++
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `,`
--> $DIR/issue-40396.rs:15:39
@@ -51,7 +51,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | std::collections::HashMap::<i128, i128>::new()
- | ^^
+ | ++
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `,`
--> $DIR/issue-40396.rs:20:39
@@ -62,7 +62,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | std::collections::HashMap::<i128, i128>::new();
- | ^^
+ | ++
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `,`
--> $DIR/issue-40396.rs:25:39
@@ -73,7 +73,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | std::collections::HashMap::<i128, i128>::new(1, 2);
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/issue-40396.rs:13:17
diff --git a/src/test/ui/did_you_mean/issue-42764.stderr b/src/test/ui/did_you_mean/issue-42764.stderr
index 16b80a6..b339ce5 100644
--- a/src/test/ui/did_you_mean/issue-42764.stderr
+++ b/src/test/ui/did_you_mean/issue-42764.stderr
@@ -9,9 +9,9 @@
help: try using a variant of the expected enum
|
LL | this_function_expects_a_double_option(DoubleOption::FirstSome(n));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | this_function_expects_a_double_option(DoubleOption::AlternativeSome(n));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-42764.rs:27:33
diff --git a/src/test/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr b/src/test/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr
index d05d6d1..c2e3ead 100644
--- a/src/test/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr
+++ b/src/test/ui/did_you_mean/issue-48492-tuple-destructure-missing-parens.stderr
@@ -7,11 +7,11 @@
help: try adding parentheses to match on a tuple...
|
LL | while let (b1, b2, b3) = reading_frame.next().expect("there should be a start codon") {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | while let b1 | b2 | b3 = reading_frame.next().expect("there should be a start codon") {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:49:14
@@ -22,11 +22,11 @@
help: try adding parentheses to match on a tuple...
|
LL | if let (b1, b2, b3) = reading_frame.next().unwrap() {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | if let b1 | b2 | b3 = reading_frame.next().unwrap() {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:59:28
@@ -37,11 +37,11 @@
help: try adding parentheses to match on a tuple...
|
LL | (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | Nucleotide::Adenine | Nucleotide::Cytosine | _ => true
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:67:10
@@ -52,11 +52,11 @@
help: try adding parentheses to match on a tuple...
|
LL | for (x, _barr_body) in women.iter().map(|woman| woman.allosomes.clone()) {
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | for x | _barr_body in women.iter().map(|woman| woman.allosomes.clone()) {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:75:10
@@ -67,11 +67,11 @@
help: try adding parentheses to match on a tuple...
|
LL | for (x, y @ Allosome::Y(_)) in men.iter().map(|man| man.allosomes.clone()) {
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | for x | y @ Allosome::Y(_) in men.iter().map(|man| man.allosomes.clone()) {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:84:14
@@ -82,11 +82,11 @@
help: try adding parentheses to match on a tuple...
|
LL | let (women, men): (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | let women | men: (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
index 0ccccb5..83fc37e 100644
--- a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
+++ b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
@@ -13,7 +13,7 @@
help: Unicode character '−' (Minus Sign) looks like '-' (Minus/Hyphen), but it is not
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²
- | ^
+ | ~
error[E0277]: cannot subtract `{integer}` from `{float}`
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:1:53
diff --git a/src/test/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr b/src/test/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr
index 9429a0b..abc040c0 100644
--- a/src/test/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr
+++ b/src/test/ui/did_you_mean/issue-56028-there-is-an-enum-variant.stderr
@@ -7,13 +7,13 @@
help: there is an enum variant `AffixHeart::Set` and 7 others; try using the variant's enum
|
LL | fn setup() -> AffixHeart { Set }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
LL | fn setup() -> CauseToBe { Set }
- | ^^^^^^^^^
+ | ~~~~~~~~~
LL | fn setup() -> Determine { Set }
- | ^^^^^^^^^
+ | ~~~~~~~~~
LL | fn setup() -> PutDown { Set }
- | ^^^^^^^
+ | ~~~~~~~
and 3 other candidates
error[E0425]: cannot find value `Set` in this scope
diff --git a/src/test/ui/did_you_mean/recursion_limit.stderr b/src/test/ui/did_you_mean/recursion_limit.stderr
index 2d52172..fa8bee1 100644
--- a/src/test/ui/did_you_mean/recursion_limit.stderr
+++ b/src/test/ui/did_you_mean/recursion_limit.stderr
@@ -1,9 +1,6 @@
error[E0275]: overflow evaluating the requirement `K: Send`
--> $DIR/recursion_limit.rs:34:5
|
-LL | fn is_send<T:Send>() { }
- | ---- required by this bound in `is_send`
-...
LL | is_send::<A>();
| ^^^^^^^^^^^^
|
@@ -58,6 +55,11 @@
|
LL | link! { A, B }
| ^
+note: required by a bound in `is_send`
+ --> $DIR/recursion_limit.rs:31:14
+ |
+LL | fn is_send<T:Send>() { }
+ | ^^^^ required by this bound in `is_send`
error: aborting due to previous error
diff --git a/src/test/ui/discrim/discrim-ill-typed.stderr b/src/test/ui/discrim/discrim-ill-typed.stderr
index 9a695a8..3d8049c 100644
--- a/src/test/ui/discrim/discrim-ill-typed.stderr
+++ b/src/test/ui/discrim/discrim-ill-typed.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `u8` to `i8`
|
LL | OhNo = 0_i8,
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:28:16
@@ -18,7 +18,7 @@
help: change the type of the numeric literal from `i8` to `u8`
|
LL | OhNo = 0_u8,
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:41:16
@@ -29,7 +29,7 @@
help: change the type of the numeric literal from `u16` to `i16`
|
LL | OhNo = 0_i16,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:54:16
@@ -40,7 +40,7 @@
help: change the type of the numeric literal from `i16` to `u16`
|
LL | OhNo = 0_u16,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:67:16
@@ -51,7 +51,7 @@
help: change the type of the numeric literal from `u32` to `i32`
|
LL | OhNo = 0_i32,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:80:16
@@ -62,7 +62,7 @@
help: change the type of the numeric literal from `i32` to `u32`
|
LL | OhNo = 0_u32,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:93:16
@@ -73,7 +73,7 @@
help: change the type of the numeric literal from `u64` to `i64`
|
LL | OhNo = 0_i64,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:106:16
@@ -84,7 +84,7 @@
help: change the type of the numeric literal from `i64` to `u64`
|
LL | OhNo = 0_u64,
- | ^^^^^
+ | ~~~~~
error: aborting due to 8 previous errors
diff --git a/src/test/ui/diverging-tuple-parts-39485.stderr b/src/test/ui/diverging-tuple-parts-39485.stderr
index ad3e5ab..32967b3 100644
--- a/src/test/ui/diverging-tuple-parts-39485.stderr
+++ b/src/test/ui/diverging-tuple-parts-39485.stderr
@@ -9,11 +9,12 @@
help: try adding a return type
|
LL | fn g() -> &_ {
- | ^^^^^
+ | +++++
help: consider removing the borrow
|
-LL | panic!()
- | ^^^^^^^^
+LL - &panic!()
+LL + panic!()
+ |
error[E0308]: mismatched types
--> $DIR/diverging-tuple-parts-39485.rs:12:5
diff --git a/src/test/ui/drop-bounds/drop-bounds.stderr b/src/test/ui/drop-bounds/drop-bounds.stderr
index 15ba4c9..3ffb855 100644
--- a/src/test/ui/drop-bounds/drop-bounds.stderr
+++ b/src/test/ui/drop-bounds/drop-bounds.stderr
@@ -1,4 +1,4 @@
-error: bounds on `T: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor
+error: bounds on `T: Drop` are most likely incorrect, consider instead using `std::mem::needs_drop` to detect whether a type can be trivially dropped
--> $DIR/drop-bounds.rs:2:11
|
LL | fn foo<T: Drop>() {}
@@ -10,37 +10,37 @@
LL | #![deny(drop_bounds)]
| ^^^^^^^^^^^
-error: bounds on `U: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor
+error: bounds on `U: Drop` are most likely incorrect, consider instead using `std::mem::needs_drop` to detect whether a type can be trivially dropped
--> $DIR/drop-bounds.rs:5:8
|
LL | U: Drop,
| ^^^^
-error: bounds on `impl Drop: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor
+error: bounds on `impl Drop: Drop` are most likely incorrect, consider instead using `std::mem::needs_drop` to detect whether a type can be trivially dropped
--> $DIR/drop-bounds.rs:8:17
|
LL | fn baz(_x: impl Drop) {}
| ^^^^
-error: bounds on `T: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor
+error: bounds on `T: Drop` are most likely incorrect, consider instead using `std::mem::needs_drop` to detect whether a type can be trivially dropped
--> $DIR/drop-bounds.rs:9:15
|
LL | struct Foo<T: Drop> {
| ^^^^
-error: bounds on `U: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor
+error: bounds on `U: Drop` are most likely incorrect, consider instead using `std::mem::needs_drop` to detect whether a type can be trivially dropped
--> $DIR/drop-bounds.rs:12:24
|
LL | struct Bar<U> where U: Drop {
| ^^^^
-error: bounds on `Self: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor
+error: bounds on `Self: Drop` are most likely incorrect, consider instead using `std::mem::needs_drop` to detect whether a type can be trivially dropped
--> $DIR/drop-bounds.rs:15:12
|
LL | trait Baz: Drop {
| ^^^^
-error: bounds on `T: Drop` are useless, consider instead using `std::mem::needs_drop` to detect if a type has a destructor
+error: bounds on `T: Drop` are most likely incorrect, consider instead using `std::mem::needs_drop` to detect whether a type can be trivially dropped
--> $DIR/drop-bounds.rs:17:9
|
LL | impl<T: Drop> Baz for T {
diff --git a/src/test/ui/drop/drop-if-let-binding.rs b/src/test/ui/drop/drop-if-let-binding.rs
new file mode 100644
index 0000000..9c1ac4e
--- /dev/null
+++ b/src/test/ui/drop/drop-if-let-binding.rs
@@ -0,0 +1,7 @@
+// build-pass
+// regression test for issue #88307
+// compile-flags: -C opt-level=s
+
+fn main() {
+ if let Some(_val) = Option::<String>::None {}
+}
diff --git a/src/test/ui/drop/dropck_legal_cycles.rs b/src/test/ui/drop/dropck_legal_cycles.rs
index fb13fd7..27a5993 100644
--- a/src/test/ui/drop/dropck_legal_cycles.rs
+++ b/src/test/ui/drop/dropck_legal_cycles.rs
@@ -368,7 +368,7 @@
// We can use refcells if we're single-threaded (as this test is).
// If one were to generalize these constructions to a
// multi-threaded context, then it might seem like we could choose
- // between either a RwLock or a Mutex to hold the owned arcs on
+ // between either an RwLock or a Mutex to hold the owned arcs on
// each node.
//
// Part of the point of this test is to actually confirm that the
diff --git a/src/test/ui/drop/dynamic-drop.rs b/src/test/ui/drop/dynamic-drop.rs
index e90ea1c..7bb43d5 100644
--- a/src/test/ui/drop/dynamic-drop.rs
+++ b/src/test/ui/drop/dynamic-drop.rs
@@ -2,7 +2,6 @@
// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
-#![feature(bindings_after_at)]
#![allow(unused_assignments)]
#![allow(unused_variables)]
diff --git a/src/test/ui/dst/dst-object-from-unsized-type.stderr b/src/test/ui/dst/dst-object-from-unsized-type.stderr
index 2d12265..b7824c0 100644
--- a/src/test/ui/dst/dst-object-from-unsized-type.stderr
+++ b/src/test/ui/dst/dst-object-from-unsized-type.stderr
@@ -7,6 +7,11 @@
| ^ doesn't have a size known at compile-time
|
= note: required for the cast to the object type `dyn Foo`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn test1<T: ?Sized + Foo>(t: &T) {
+LL + fn test1<T: Foo>(t: &T) {
+ |
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/dst-object-from-unsized-type.rs:13:23
@@ -17,6 +22,11 @@
| ^ doesn't have a size known at compile-time
|
= note: required for the cast to the object type `dyn Foo`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn test2<T: ?Sized + Foo>(t: &T) {
+LL + fn test2<T: Foo>(t: &T) {
+ |
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/dst-object-from-unsized-type.rs:18:28
diff --git a/src/test/ui/dst/dst-rvalue.rs b/src/test/ui/dst/dst-rvalue.rs
index aa02839..b52a95a 100644
--- a/src/test/ui/dst/dst-rvalue.rs
+++ b/src/test/ui/dst/dst-rvalue.rs
@@ -4,11 +4,9 @@
pub fn main() {
let _x: Box<str> = box *"hello world";
- //~^ ERROR E0161
- //~^^ ERROR cannot move out of a shared reference
+ //~^ ERROR E0277
let array: &[isize] = &[1, 2, 3];
let _x: Box<[isize]> = box *array;
- //~^ ERROR E0161
- //~^^ ERROR cannot move out of type `[isize]`, a non-copy slice
+ //~^ ERROR E0277
}
diff --git a/src/test/ui/dst/dst-rvalue.stderr b/src/test/ui/dst/dst-rvalue.stderr
index 6a51c51..1583063 100644
--- a/src/test/ui/dst/dst-rvalue.stderr
+++ b/src/test/ui/dst/dst-rvalue.stderr
@@ -1,31 +1,21 @@
-error[E0161]: cannot move a value of type str: the size of str cannot be statically determined
+error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/dst-rvalue.rs:6:28
|
LL | let _x: Box<str> = box *"hello world";
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `str`
+ = note: the type of a box expression must have a statically known size
-error[E0161]: cannot move a value of type [isize]: the size of [isize] cannot be statically determined
- --> $DIR/dst-rvalue.rs:11:32
+error[E0277]: the size for values of type `[isize]` cannot be known at compilation time
+ --> $DIR/dst-rvalue.rs:10:32
|
LL | let _x: Box<[isize]> = box *array;
- | ^^^^^^
-
-error[E0507]: cannot move out of a shared reference
- --> $DIR/dst-rvalue.rs:6:28
+ | ^^^^^^ doesn't have a size known at compile-time
|
-LL | let _x: Box<str> = box *"hello world";
- | ^^^^^^^^^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait
+ = help: the trait `Sized` is not implemented for `[isize]`
+ = note: the type of a box expression must have a statically known size
-error[E0508]: cannot move out of type `[isize]`, a non-copy slice
- --> $DIR/dst-rvalue.rs:11:32
- |
-LL | let _x: Box<[isize]> = box *array;
- | ^^^^^^
- | |
- | cannot move out of here
- | move occurs because `*array` has type `[isize]`, which does not implement the `Copy` trait
+error: aborting due to 2 previous errors
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0161, E0507, E0508.
-For more information about an error, try `rustc --explain E0161`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/dst/dst-sized-trait-param.stderr b/src/test/ui/dst/dst-sized-trait-param.stderr
index 481c01a..8ec94f5 100644
--- a/src/test/ui/dst/dst-sized-trait-param.stderr
+++ b/src/test/ui/dst/dst-sized-trait-param.stderr
@@ -1,28 +1,32 @@
error[E0277]: the size for values of type `[isize]` cannot be known at compilation time
--> $DIR/dst-sized-trait-param.rs:7:6
|
-LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
- | - required by this bound in `Foo`
-LL |
LL | impl Foo<[isize]> for usize { }
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[isize]`
+note: required by a bound in `Foo`
+ --> $DIR/dst-sized-trait-param.rs:5:11
+ |
+LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
+ | ^ required by this bound in `Foo`
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Foo<T: ?Sized> : Sized { fn take(self, x: &T) { } } // Note: T is sized
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
--> $DIR/dst-sized-trait-param.rs:10:6
|
-LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
- | ----- required by this bound in `Foo`
-...
LL | impl Foo<isize> for [usize] { }
| ^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[usize]`
+note: required by a bound in `Foo`
+ --> $DIR/dst-sized-trait-param.rs:5:16
+ |
+LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
+ | ^^^^^ required by this bound in `Foo`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/duplicate/duplicate-check-macro-exports.stderr b/src/test/ui/duplicate/duplicate-check-macro-exports.stderr
index 02f0206..ba723b3 100644
--- a/src/test/ui/duplicate/duplicate-check-macro-exports.stderr
+++ b/src/test/ui/duplicate/duplicate-check-macro-exports.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | pub use std::panic as other_panic;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr
index 30f09e2..c9bb08c 100644
--- a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr
+++ b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr
@@ -10,7 +10,7 @@
LL | #[deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:4:35
@@ -19,7 +19,7 @@
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:9:14
@@ -28,7 +28,7 @@
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to 3 previous errors
diff --git a/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr b/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr
index 798f480..730bc69 100644
--- a/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr
+++ b/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr
@@ -7,7 +7,7 @@
help: add `dyn` keyword before this trait
|
LL | let _x: &dyn SomeTrait = todo!();
- | ^^^
+ | +++
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/dyn-2021-edition-error.rs:3:17
@@ -18,7 +18,7 @@
help: add `dyn` keyword before this trait
|
LL | fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
- | ^^^
+ | +++
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/dyn-2021-edition-error.rs:3:35
@@ -29,7 +29,7 @@
help: add `dyn` keyword before this trait
|
LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
- | ^^^
+ | +++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/dyn-keyword/dyn-angle-brackets.fixed b/src/test/ui/dyn-keyword/dyn-angle-brackets.fixed
new file mode 100644
index 0000000..25caa6a
--- /dev/null
+++ b/src/test/ui/dyn-keyword/dyn-angle-brackets.fixed
@@ -0,0 +1,23 @@
+// See https://github.com/rust-lang/rust/issues/88508
+// run-rustfix
+// edition:2018
+#![deny(bare_trait_objects)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+use std::fmt;
+
+#[derive(Debug)]
+pub struct Foo;
+
+impl fmt::Display for Foo {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ <dyn fmt::Debug>::fmt(self, f)
+ //~^ ERROR trait objects without an explicit `dyn` are deprecated
+ //~| WARNING this is accepted in the current edition
+ //~| ERROR trait objects without an explicit `dyn` are deprecated
+ //~| WARNING this is accepted in the current edition
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/dyn-keyword/dyn-angle-brackets.rs b/src/test/ui/dyn-keyword/dyn-angle-brackets.rs
new file mode 100644
index 0000000..cf72da2
--- /dev/null
+++ b/src/test/ui/dyn-keyword/dyn-angle-brackets.rs
@@ -0,0 +1,23 @@
+// See https://github.com/rust-lang/rust/issues/88508
+// run-rustfix
+// edition:2018
+#![deny(bare_trait_objects)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+use std::fmt;
+
+#[derive(Debug)]
+pub struct Foo;
+
+impl fmt::Display for Foo {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ <fmt::Debug>::fmt(self, f)
+ //~^ ERROR trait objects without an explicit `dyn` are deprecated
+ //~| WARNING this is accepted in the current edition
+ //~| ERROR trait objects without an explicit `dyn` are deprecated
+ //~| WARNING this is accepted in the current edition
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr b/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr
new file mode 100644
index 0000000..ef0f5b7
--- /dev/null
+++ b/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr
@@ -0,0 +1,25 @@
+error: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/dyn-angle-brackets.rs:15:10
+ |
+LL | <fmt::Debug>::fmt(self, f)
+ | ^^^^^^^^^^ help: use `dyn`: `dyn fmt::Debug`
+ |
+note: the lint level is defined here
+ --> $DIR/dyn-angle-brackets.rs:4:9
+ |
+LL | #![deny(bare_trait_objects)]
+ | ^^^^^^^^^^^^^^^^^^
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+error: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/dyn-angle-brackets.rs:15:10
+ |
+LL | <fmt::Debug>::fmt(self, f)
+ | ^^^^^^^^^^ help: use `dyn`: `dyn fmt::Debug`
+ |
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/editions/async-block-2015.rs b/src/test/ui/editions/async-block-2015.rs
index 92eae9e..24112c9 100644
--- a/src/test/ui/editions/async-block-2015.rs
+++ b/src/test/ui/editions/async-block-2015.rs
@@ -1,7 +1,7 @@
async fn foo() {
//~^ ERROR `async fn` is not permitted in Rust 2015
//~| NOTE to use `async fn`, switch to Rust 2018 or later
-//~| HELP set `edition = "2018"` in `Cargo.toml`
+//~| HELP set `edition = "2021"` in `Cargo.toml`
//~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
let x = async {};
@@ -11,7 +11,7 @@
let x = 42;
//~^ ERROR expected identifier, found keyword `let`
//~| NOTE expected identifier, found keyword
- //~| HELP set `edition = "2018"` in `Cargo.toml`
+ //~| HELP set `edition = "2021"` in `Cargo.toml`
//~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
42
};
@@ -19,7 +19,7 @@
42
//~^ ERROR expected identifier, found `42`
//~| NOTE expected identifier
- //~| HELP set `edition = "2018"` in `Cargo.toml`
+ //~| HELP set `edition = "2021"` in `Cargo.toml`
//~| NOTE for more on editions, read https://doc.rust-lang.org/edition-guide
};
y.await;
diff --git a/src/test/ui/editions/async-block-2015.stderr b/src/test/ui/editions/async-block-2015.stderr
index e42747c..da8412d 100644
--- a/src/test/ui/editions/async-block-2015.stderr
+++ b/src/test/ui/editions/async-block-2015.stderr
@@ -4,7 +4,7 @@
LL | async fn foo() {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: expected identifier, found keyword `let`
@@ -15,7 +15,7 @@
LL | let x = 42;
| ^^^ expected identifier, found keyword
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: expected identifier, found `42`
@@ -26,7 +26,7 @@
LL | 42
| ^^ expected identifier
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0422]: cannot find struct, variant or union type `async` in this scope
diff --git a/src/test/ui/editions/dyn-trait-sugg-2021.rs b/src/test/ui/editions/dyn-trait-sugg-2021.rs
new file mode 100644
index 0000000..47c48e7
--- /dev/null
+++ b/src/test/ui/editions/dyn-trait-sugg-2021.rs
@@ -0,0 +1,12 @@
+// edition:2021
+
+trait Foo<T> {}
+
+impl<T> dyn Foo<T> {
+ fn hi(_x: T) {}
+}
+
+fn main() {
+ Foo::hi(123);
+ //~^ ERROR trait objects without an explicit `dyn` are deprecated
+}
diff --git a/src/test/ui/editions/dyn-trait-sugg-2021.stderr b/src/test/ui/editions/dyn-trait-sugg-2021.stderr
new file mode 100644
index 0000000..f6e9fa9
--- /dev/null
+++ b/src/test/ui/editions/dyn-trait-sugg-2021.stderr
@@ -0,0 +1,9 @@
+error[E0783]: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/dyn-trait-sugg-2021.rs:10:5
+ |
+LL | Foo::hi(123);
+ | ^^^ help: use `dyn`: `<dyn Foo>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0783`.
diff --git a/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr
index 22f28a6..65d9199 100644
--- a/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr
+++ b/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr
@@ -8,7 +8,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | () => (pub fn r#async() {})
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
index 2866356..837d35b 100644
--- a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2015-parsing.rs:26:13
@@ -18,7 +18,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();
- | ^^^^^^^
+ | ~~~~~~~
error: no rules expected the token `r#async`
--> $DIR/edition-keywords-2018-2015-parsing.rs:20:31
@@ -37,7 +37,7 @@
|
LL | ($i: ident) => ($i)
| ^ expected one of `move`, `|`, or `||`
- |
+ |
::: $DIR/edition-keywords-2018-2015-parsing.rs:24:8
|
LL | if passes_ident!(async) == 1 {}
diff --git a/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr
index 2a1e7bb..77b95ec 100644
--- a/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr
@@ -8,7 +8,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | () => (pub fn r#async() {})
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
index cda7e65..7c18369 100644
--- a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
+++ b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2018-parsing.rs:26:13
@@ -18,7 +18,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();
- | ^^^^^^^
+ | ~~~~~~~
error: no rules expected the token `r#async`
--> $DIR/edition-keywords-2018-2018-parsing.rs:20:31
@@ -37,7 +37,7 @@
|
LL | ($i: ident) => ($i)
| ^ expected one of `move`, `|`, or `||`
- |
+ |
::: $DIR/edition-keywords-2018-2018-parsing.rs:24:8
|
LL | if passes_ident!(async) == 1 {}
diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr
index 6292ed4..48e5ea8 100644
--- a/src/test/ui/empty/empty-struct-braces-expr.stderr
+++ b/src/test/ui/empty/empty-struct-braces-expr.stderr
@@ -6,7 +6,7 @@
...
LL | let e1 = Empty1;
| ^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
@@ -15,11 +15,11 @@
help: use struct literal syntax instead
|
LL | let e1 = Empty1 {};
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let e1 = XEmpty2;
- | ^^^^^^^
+ | ~~~~~~~
error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1`
--> $DIR/empty-struct-braces-expr.rs:16:14
@@ -29,7 +29,7 @@
...
LL | let e1 = Empty1();
| ^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
@@ -38,11 +38,11 @@
help: use struct literal syntax instead
|
LL | let e1 = Empty1 {};
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let e1 = XEmpty2();
- | ^^^^^^^
+ | ~~~~~~~
error[E0423]: expected value, found struct variant `E::Empty3`
--> $DIR/empty-struct-braces-expr.rs:18:14
@@ -67,7 +67,7 @@
|
LL | let xe1 = XEmpty1;
| ^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:1:1
|
LL | pub struct XEmpty1 {}
@@ -78,18 +78,18 @@
help: use struct literal syntax instead
|
LL | let xe1 = XEmpty1 {};
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let xe1 = XEmpty2;
- | ^^^^^^^
+ | ~~~~~~~
error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1`
--> $DIR/empty-struct-braces-expr.rs:23:15
|
LL | let xe1 = XEmpty1();
| ^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:1:1
|
LL | pub struct XEmpty1 {}
@@ -100,11 +100,11 @@
help: use struct literal syntax instead
|
LL | let xe1 = XEmpty1 {};
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let xe1 = XEmpty2();
- | ^^^^^^^
+ | ~~~~~~~
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:25:19
diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.stderr b/src/test/ui/empty/empty-struct-braces-pat-1.stderr
index 3570012..0215a9e 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-1.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-1.stderr
@@ -12,7 +12,7 @@
|
LL | XE::XEmpty3 => ()
| ^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:6:5
|
LL | XEmpty3 {},
@@ -23,11 +23,11 @@
help: use struct pattern syntax instead
|
LL | XE::XEmpty3 { /* fields */ } => ()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: a unit variant with a similar name exists
|
LL | XE::XEmpty4 => ()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.stderr b/src/test/ui/empty/empty-struct-braces-pat-2.stderr
index 3bd3f6a..2819161 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-2.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-2.stderr
@@ -6,7 +6,7 @@
...
LL | Empty1() => ()
| ^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
@@ -15,18 +15,18 @@
help: use struct pattern syntax instead
|
LL | Empty1 {} => ()
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
--> $DIR/empty-struct-braces-pat-2.rs:18:9
|
LL | XEmpty1() => ()
| ^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:1:1
|
LL | pub struct XEmpty1 {}
@@ -38,11 +38,11 @@
help: use struct pattern syntax instead
|
LL | XEmpty1 {} => ()
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct `Empty1`
--> $DIR/empty-struct-braces-pat-2.rs:21:9
@@ -52,7 +52,7 @@
...
LL | Empty1(..) => ()
| ^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
@@ -61,18 +61,18 @@
help: use struct pattern syntax instead
|
LL | Empty1 {} => ()
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
--> $DIR/empty-struct-braces-pat-2.rs:24:9
|
LL | XEmpty1(..) => ()
| ^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:1:1
|
LL | pub struct XEmpty1 {}
@@ -84,11 +84,11 @@
help: use struct pattern syntax instead
|
LL | XEmpty1 {} => ()
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.stderr b/src/test/ui/empty/empty-struct-braces-pat-3.stderr
index aac872b..60266bb 100644
--- a/src/test/ui/empty/empty-struct-braces-pat-3.stderr
+++ b/src/test/ui/empty/empty-struct-braces-pat-3.stderr
@@ -12,7 +12,7 @@
|
LL | XE::XEmpty3() => ()
| ^^^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:6:5
|
LL | XEmpty3 {},
@@ -24,11 +24,11 @@
help: use struct pattern syntax instead
|
LL | XE::XEmpty3 { /* fields */ } => ()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct variant `E::Empty3`
--> $DIR/empty-struct-braces-pat-3.rs:25:9
@@ -44,7 +44,7 @@
|
LL | XE::XEmpty3(..) => ()
| ^^^^^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:6:5
|
LL | XEmpty3 {},
@@ -56,11 +56,11 @@
help: use struct pattern syntax instead
|
LL | XE::XEmpty3 { /* fields */ } => ()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr
index 7b0d971..e696b85 100644
--- a/src/test/ui/empty/empty-struct-tuple-pat.stderr
+++ b/src/test/ui/empty/empty-struct-tuple-pat.stderr
@@ -30,7 +30,7 @@
|
LL | XE::XEmpty5 => (),
| ^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:7:5
|
LL | XEmpty4,
@@ -41,11 +41,11 @@
help: use the tuple variant pattern syntax instead
|
LL | XE::XEmpty5(/* fields */) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
help: a unit variant with a similar name exists
|
LL | XE::XEmpty4 => (),
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/empty/empty-struct-unit-expr.stderr b/src/test/ui/empty/empty-struct-unit-expr.stderr
index 50b0e19..1023950 100644
--- a/src/test/ui/empty/empty-struct-unit-expr.stderr
+++ b/src/test/ui/empty/empty-struct-unit-expr.stderr
@@ -23,7 +23,7 @@
help: `E::Empty4` is a unit variant, you need to write it without the parenthesis
|
LL | let e4 = E::Empty4;
- | ^^^^^^^^^
+ | ~~~~~~~~~
error[E0618]: expected function, found `empty_struct::XEmpty2`
--> $DIR/empty-struct-unit-expr.rs:18:15
@@ -44,7 +44,7 @@
help: `XE::XEmpty4` is a unit variant, you need to write it without the parenthesis
|
LL | let xe4 = XE::XEmpty4;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/empty/empty-struct-unit-pat.stderr b/src/test/ui/empty/empty-struct-unit-pat.stderr
index a704e1f..b1b2533 100644
--- a/src/test/ui/empty/empty-struct-unit-pat.stderr
+++ b/src/test/ui/empty/empty-struct-unit-pat.stderr
@@ -6,7 +6,7 @@
...
LL | Empty2() => ()
| ^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
@@ -15,18 +15,18 @@
help: use this syntax instead
|
LL | Empty2 => ()
- | ^^^^^^
+ | ~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2`
--> $DIR/empty-struct-unit-pat.rs:24:9
|
LL | XEmpty2() => ()
| ^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
@@ -37,11 +37,11 @@
help: use this syntax instead
|
LL | XEmpty2 => ()
- | ^^^^^^^
+ | ~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2`
--> $DIR/empty-struct-unit-pat.rs:28:9
@@ -51,7 +51,7 @@
...
LL | Empty2(..) => ()
| ^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:3:1
|
LL | pub struct XEmpty6();
@@ -60,18 +60,18 @@
help: use this syntax instead
|
LL | Empty2 => ()
- | ^^^^^^
+ | ~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2`
--> $DIR/empty-struct-unit-pat.rs:32:9
|
LL | XEmpty2(..) => ()
| ^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:2:1
|
LL | pub struct XEmpty2;
@@ -82,11 +82,11 @@
help: use this syntax instead
|
LL | XEmpty2 => ()
- | ^^^^^^^
+ | ~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4`
--> $DIR/empty-struct-unit-pat.rs:37:9
@@ -102,7 +102,7 @@
|
LL | XE::XEmpty4() => (),
| ^^^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:7:5
|
LL | XEmpty4,
@@ -113,11 +113,11 @@
help: use this syntax instead
|
LL | XE::XEmpty4 => (),
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5() => (),
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4`
--> $DIR/empty-struct-unit-pat.rs:46:9
@@ -133,7 +133,7 @@
|
LL | XE::XEmpty4(..) => (),
| ^^^^^^^^^^^^^^^
- |
+ |
::: $DIR/auxiliary/empty-struct.rs:7:5
|
LL | XEmpty4,
@@ -144,11 +144,11 @@
help: use this syntax instead
|
LL | XE::XEmpty4 => (),
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5(..) => (),
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 8 previous errors
diff --git a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs
index d855381..e0bb7db 100644
--- a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs
+++ b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs
@@ -1,5 +1,5 @@
#![feature(imported_main)]
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]
//~^^^ ERROR `main` function not found in crate
pub mod foo {
diff --git a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr
index c4c0afc..6aa170f 100644
--- a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr
+++ b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr
@@ -2,7 +2,7 @@
--> $DIR/imported_main_const_fn_item_type_forbidden.rs:1:1
|
LL | / #![feature(imported_main)]
-LL | | #![feature(min_type_alias_impl_trait)]
+LL | | #![feature(type_alias_impl_trait)]
LL | | #![allow(incomplete_features)]
LL | |
... |
diff --git a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr
index 4d57765..e4e1046 100644
--- a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr
+++ b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr
index f89be63..7ea8a39 100644
--- a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr
+++ b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `T` is never used
--> $DIR/issue-70453-generics-in-discr-ice.rs:7:20
diff --git a/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr b/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr
index 8c97af2..0a7a631 100644
--- a/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr
+++ b/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/enum/enum-discrim-autosizing.rs b/src/test/ui/enum/enum-discrim-autosizing.rs
index e9bb927..473a0ad 100644
--- a/src/test/ui/enum/enum-discrim-autosizing.rs
+++ b/src/test/ui/enum/enum-discrim-autosizing.rs
@@ -4,8 +4,10 @@
// so force the repr.
#[cfg_attr(not(target_pointer_width = "32"), repr(i32))]
enum Eu64 {
- Au64 = 0,
- Bu64 = 0x8000_0000_0000_0000 //~ERROR already exists
+ Au64 = 0, //~NOTE first use of `0`
+ Bu64 = 0x8000_0000_0000_0000
+ //~^ ERROR discriminant value `0` already exists
+ //~| NOTE enum already has `0` (overflowed from `9223372036854775808`)
}
fn main() {}
diff --git a/src/test/ui/enum/enum-discrim-autosizing.stderr b/src/test/ui/enum/enum-discrim-autosizing.stderr
index 8848f98..a0f3909 100644
--- a/src/test/ui/enum/enum-discrim-autosizing.stderr
+++ b/src/test/ui/enum/enum-discrim-autosizing.stderr
@@ -4,7 +4,7 @@
LL | Au64 = 0,
| - first use of `0`
LL | Bu64 = 0x8000_0000_0000_0000
- | ^^^^^^^^^^^^^^^^^^^^^ enum already has `0`
+ | ^^^^^^^^^^^^^^^^^^^^^ enum already has `0` (overflowed from `9223372036854775808`)
error: aborting due to previous error
diff --git a/src/test/ui/enum/issue-67945-1.stderr b/src/test/ui/enum/issue-67945-1.stderr
index 227899e..8f1b5b3 100644
--- a/src/test/ui/enum/issue-67945-1.stderr
+++ b/src/test/ui/enum/issue-67945-1.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `S` is never used
--> $DIR/issue-67945-1.rs:1:10
diff --git a/src/test/ui/enum/issue-67945-2.stderr b/src/test/ui/enum/issue-67945-2.stderr
index 5a90f00..4f5e236 100644
--- a/src/test/ui/enum/issue-67945-2.stderr
+++ b/src/test/ui/enum/issue-67945-2.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `S`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error[E0392]: parameter `S` is never used
--> $DIR/issue-67945-2.rs:3:10
diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr
index 7b3deb1..fd0215e 100644
--- a/src/test/ui/error-codes/E0004-2.stderr
+++ b/src/test/ui/error-codes/E0004-2.stderr
@@ -3,7 +3,7 @@
|
LL | match x { }
| ^ patterns `None` and `Some(_)` not covered
- |
+ |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | None,
diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr
index b9f2702..b95dcbd 100644
--- a/src/test/ui/error-codes/E0005.stderr
+++ b/src/test/ui/error-codes/E0005.stderr
@@ -3,7 +3,7 @@
|
LL | let Some(y) = x;
| ^^^^^^^ pattern `None` not covered
- |
+ |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | None,
@@ -15,7 +15,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Some(y) = x { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0023.stderr b/src/test/ui/error-codes/E0023.stderr
index 832eba6..3e321b0 100644
--- a/src/test/ui/error-codes/E0023.stderr
+++ b/src/test/ui/error-codes/E0023.stderr
@@ -1,54 +1,54 @@
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
- --> $DIR/E0023.rs:11:9
+ --> $DIR/E0023.rs:11:22
|
LL | Apple(String, String),
- | --------------------- tuple variant defined here
+ | ------ ------ tuple variant has 2 fields
...
LL | Fruit::Apple(a) => {},
- | ^^^^^^^^^^^^^^^ expected 2 fields, found 1
+ | ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | Fruit::Apple(a, _) => {},
- | ^^^
+ | +++
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
- --> $DIR/E0023.rs:12:9
+ --> $DIR/E0023.rs:12:22
|
LL | Apple(String, String),
- | --------------------- tuple variant defined here
+ | ------ ------ tuple variant has 2 fields
...
LL | Fruit::Apple(a, b, c) => {},
- | ^^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 3
+ | ^ ^ ^ expected 2 fields, found 3
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
- --> $DIR/E0023.rs:13:9
+ --> $DIR/E0023.rs:13:21
|
LL | Pear(u32),
- | --------- tuple variant defined here
+ | --- tuple variant has 1 field
...
LL | Fruit::Pear(1, 2) => {},
- | ^^^^^^^^^^^^^^^^^ expected 1 field, found 2
+ | ^ ^ expected 1 field, found 2
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 1 field
- --> $DIR/E0023.rs:14:9
+ --> $DIR/E0023.rs:14:23
|
LL | Orange((String, String)),
- | ------------------------ tuple variant defined here
+ | ---------------- tuple variant has 1 field
...
LL | Fruit::Orange(a, b) => {},
- | ^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2
+ | ^ ^ expected 1 field, found 2
|
help: missing parentheses
|
LL | Fruit::Orange((a, b)) => {},
- | ^ ^
+ | + +
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 1 field
--> $DIR/E0023.rs:15:9
|
LL | Banana(()),
- | ---------- tuple variant defined here
+ | -- tuple variant has 1 field
...
LL | Fruit::Banana() => {},
| ^^^^^^^^^^^^^^^ expected 1 field, found 0
@@ -56,7 +56,7 @@
help: missing parentheses
|
LL | Fruit::Banana(()) => {},
- | ^ ^
+ | + +
error: aborting due to 5 previous errors
diff --git a/src/test/ui/error-codes/E0027.stderr b/src/test/ui/error-codes/E0027.stderr
index a3dd691..9ae97e4 100644
--- a/src/test/ui/error-codes/E0027.stderr
+++ b/src/test/ui/error-codes/E0027.stderr
@@ -7,11 +7,11 @@
help: include the missing field in the pattern
|
LL | Dog { age: x, name } => {}
- | ^^^^^^^^
+ | ~~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Dog { age: x, .. } => {}
- | ^^^^^^
+ | ~~~~~~
error[E0027]: pattern does not mention field `age`
--> $DIR/E0027.rs:15:9
@@ -22,11 +22,11 @@
help: include the missing field in the pattern
|
LL | Dog { name: x, age } => {}
- | ^^^^^^^
+ | ~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Dog { name: x, .. } => {}
- | ^^^^^^
+ | ~~~~~~
error[E0027]: pattern does not mention field `age`
--> $DIR/E0027.rs:19:9
@@ -37,11 +37,11 @@
help: include the missing field in the pattern
|
LL | Dog { name: x, age } => {}
- | ^^^^^^^
+ | ~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Dog { name: x, .. } => {}
- | ^^^^^^
+ | ~~~~~~
error[E0027]: pattern does not mention fields `name`, `age`
--> $DIR/E0027.rs:22:9
@@ -52,11 +52,11 @@
help: include the missing fields in the pattern
|
LL | Dog { name, age } => {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if you don't care about these missing fields, you can explicitly ignore them
|
LL | Dog { .. } => {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/error-codes/E0033-teach.stderr b/src/test/ui/error-codes/E0033-teach.stderr
index 513fda3..3b68abb 100644
--- a/src/test/ui/error-codes/E0033-teach.stderr
+++ b/src/test/ui/error-codes/E0033-teach.stderr
@@ -20,11 +20,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0033]: type `&dyn SomeTrait` cannot be dereferenced
--> $DIR/E0033-teach.rs:12:9
diff --git a/src/test/ui/error-codes/E0033.stderr b/src/test/ui/error-codes/E0033.stderr
index fc12484..f064510 100644
--- a/src/test/ui/error-codes/E0033.stderr
+++ b/src/test/ui/error-codes/E0033.stderr
@@ -20,11 +20,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0033]: type `&dyn SomeTrait` cannot be dereferenced
--> $DIR/E0033.rs:10:9
diff --git a/src/test/ui/error-codes/E0034.stderr b/src/test/ui/error-codes/E0034.stderr
index 471512c..83718a1 100644
--- a/src/test/ui/error-codes/E0034.stderr
+++ b/src/test/ui/error-codes/E0034.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | Trait1::foo()
- | ^^^^^^^^^^^
+ | ~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | Trait2::foo()
- | ^^^^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0081.rs b/src/test/ui/error-codes/E0081.rs
index 33c8c14..255e05c 100644
--- a/src/test/ui/error-codes/E0081.rs
+++ b/src/test/ui/error-codes/E0081.rs
@@ -1,9 +1,20 @@
enum Enum {
P = 3,
+ //~^ NOTE first use of `3`
X = 3,
//~^ ERROR discriminant value `3` already exists
+ //~| NOTE enum already has `3`
Y = 5
}
+#[repr(u8)]
+enum EnumOverflowRepr {
+ P = 257,
+ //~^ NOTE first use of `1` (overflowed from `257`)
+ X = 513,
+ //~^ ERROR discriminant value `1` already exists
+ //~| NOTE enum already has `1` (overflowed from `513`)
+}
+
fn main() {
}
diff --git a/src/test/ui/error-codes/E0081.stderr b/src/test/ui/error-codes/E0081.stderr
index 0b3d351..9b279bb 100644
--- a/src/test/ui/error-codes/E0081.stderr
+++ b/src/test/ui/error-codes/E0081.stderr
@@ -1,11 +1,21 @@
error[E0081]: discriminant value `3` already exists
- --> $DIR/E0081.rs:3:9
+ --> $DIR/E0081.rs:4:9
|
LL | P = 3,
| - first use of `3`
+LL |
LL | X = 3,
| ^ enum already has `3`
-error: aborting due to previous error
+error[E0081]: discriminant value `1` already exists
+ --> $DIR/E0081.rs:14:9
+ |
+LL | P = 257,
+ | --- first use of `1` (overflowed from `257`)
+LL |
+LL | X = 513,
+ | ^^^ enum already has `1` (overflowed from `513`)
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0081`.
diff --git a/src/test/ui/error-codes/E0106.stderr b/src/test/ui/error-codes/E0106.stderr
index b961fc8..fbd77d9 100644
--- a/src/test/ui/error-codes/E0106.stderr
+++ b/src/test/ui/error-codes/E0106.stderr
@@ -6,8 +6,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: &'a bool,
+LL ~ struct Foo<'a> {
+LL ~ x: &'a bool,
|
error[E0106]: missing lifetime specifier
@@ -18,9 +18,9 @@
|
help: consider introducing a named lifetime parameter
|
-LL | enum Bar<'a> {
+LL ~ enum Bar<'a> {
LL | A(u8),
-LL | B(&'a bool),
+LL ~ B(&'a bool),
|
error[E0106]: missing lifetime specifier
@@ -31,8 +31,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | struct Quux<'a> {
-LL | baz: Baz<'a>,
+LL ~ struct Quux<'a> {
+LL ~ baz: Baz<'a>,
|
error[E0106]: missing lifetime specifiers
@@ -43,11 +43,11 @@
|
help: consider introducing a named lifetime parameter
|
-LL | struct Quux<'a> {
+LL ~ struct Quux<'a> {
LL | baz: Baz,
LL |
LL |
-LL | buzz: Buzz<'a, 'a>,
+LL ~ buzz: Buzz<'a, 'a>,
|
error[E0106]: missing lifetime specifier
@@ -59,7 +59,7 @@
help: consider introducing a named lifetime parameter
|
LL | type MyStr<'a> = &'a str;
- | ^^^^ ^^^
+ | ++++ ++
error: aborting due to 5 previous errors
diff --git a/src/test/ui/error-codes/E0107.stderr b/src/test/ui/error-codes/E0107.stderr
index 3c7aa6d..c90f85d 100644
--- a/src/test/ui/error-codes/E0107.stderr
+++ b/src/test/ui/error-codes/E0107.stderr
@@ -14,7 +14,7 @@
help: add missing lifetime argument
|
LL | buzz: Buzz<'a, 'a>,
- | ^^^^
+ | ++++
error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/E0107.rs:17:10
diff --git a/src/test/ui/error-codes/E0152.rs b/src/test/ui/error-codes/E0152.rs
index d716ca1..ee8e5e6 100644
--- a/src/test/ui/error-codes/E0152.rs
+++ b/src/test/ui/error-codes/E0152.rs
@@ -2,7 +2,7 @@
#![feature(lang_items)]
#[lang = "owned_box"]
-struct Foo; //~ ERROR E0152
+struct Foo<T>(T); //~ ERROR E0152
fn main() {
}
diff --git a/src/test/ui/error-codes/E0152.stderr b/src/test/ui/error-codes/E0152.stderr
index 7445c28..5cdfe1c 100644
--- a/src/test/ui/error-codes/E0152.stderr
+++ b/src/test/ui/error-codes/E0152.stderr
@@ -1,8 +1,8 @@
error[E0152]: found duplicate lang item `owned_box`
--> $DIR/E0152.rs:5:1
|
-LL | struct Foo;
- | ^^^^^^^^^^^
+LL | struct Foo<T>(T);
+ | ^^^^^^^^^^^^^^^^^
|
= note: the lang item is first defined in crate `alloc` (which `std` depends on)
= note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rlib
diff --git a/src/test/ui/error-codes/E0161.edition.stderr b/src/test/ui/error-codes/E0161.edition.stderr
index 536a81a..6beb29c 100644
--- a/src/test/ui/error-codes/E0161.edition.stderr
+++ b/src/test/ui/error-codes/E0161.edition.stderr
@@ -1,8 +1,8 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:9
+error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
+ --> $DIR/E0161.rs:29:5
|
-LL | box *x;
- | ^^
+LL | x.f();
+ | ^
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0161.editionul.stderr b/src/test/ui/error-codes/E0161.editionul.stderr
deleted file mode 100644
index 2baba99..0000000
--- a/src/test/ui/error-codes/E0161.editionul.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:5
- |
-LL | box *x;
- | ^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0161.migrate.stderr b/src/test/ui/error-codes/E0161.migrate.stderr
index 536a81a..6beb29c 100644
--- a/src/test/ui/error-codes/E0161.migrate.stderr
+++ b/src/test/ui/error-codes/E0161.migrate.stderr
@@ -1,8 +1,8 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:9
+error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
+ --> $DIR/E0161.rs:29:5
|
-LL | box *x;
- | ^^
+LL | x.f();
+ | ^
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0161.migrateul.stderr b/src/test/ui/error-codes/E0161.migrateul.stderr
deleted file mode 100644
index 2baba99..0000000
--- a/src/test/ui/error-codes/E0161.migrateul.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:5
- |
-LL | box *x;
- | ^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0161.nll.stderr b/src/test/ui/error-codes/E0161.nll.stderr
index 536a81a..6beb29c 100644
--- a/src/test/ui/error-codes/E0161.nll.stderr
+++ b/src/test/ui/error-codes/E0161.nll.stderr
@@ -1,8 +1,8 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:9
+error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
+ --> $DIR/E0161.rs:29:5
|
-LL | box *x;
- | ^^
+LL | x.f();
+ | ^
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0161.nllul.stderr b/src/test/ui/error-codes/E0161.nllul.stderr
deleted file mode 100644
index 2baba99..0000000
--- a/src/test/ui/error-codes/E0161.nllul.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:5
- |
-LL | box *x;
- | ^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0161.rs b/src/test/ui/error-codes/E0161.rs
index e0f5776..ba74529 100644
--- a/src/test/ui/error-codes/E0161.rs
+++ b/src/test/ui/error-codes/E0161.rs
@@ -8,6 +8,10 @@
//[edition]edition:2018
//[zflagsul]compile-flags: -Z borrowck=migrate
//[editionul]edition:2018
+//[migrateul] check-pass
+//[nllul] check-pass
+//[zflagsul] check-pass
+//[editionul] check-pass
#![allow(incomplete_features)]
#![cfg_attr(nll, feature(nll))]
@@ -16,12 +20,14 @@
#![cfg_attr(zflagsul, feature(unsized_locals))]
#![cfg_attr(nllul, feature(unsized_locals))]
#![cfg_attr(editionul, feature(unsized_locals))]
-#![feature(box_syntax)]
-fn foo(x: Box<[i32]>) {
- box *x;
+trait Bar {
+ fn f(self);
+}
+
+fn foo(x: Box<dyn Bar>) {
+ x.f();
//[migrate,nll,zflags,edition]~^ ERROR E0161
- //[migrateul,nllul,zflagsul,editionul]~^^ ERROR E0161
}
fn main() {}
diff --git a/src/test/ui/error-codes/E0161.zflags.stderr b/src/test/ui/error-codes/E0161.zflags.stderr
index 536a81a..6beb29c 100644
--- a/src/test/ui/error-codes/E0161.zflags.stderr
+++ b/src/test/ui/error-codes/E0161.zflags.stderr
@@ -1,8 +1,8 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:9
+error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined
+ --> $DIR/E0161.rs:29:5
|
-LL | box *x;
- | ^^
+LL | x.f();
+ | ^
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0161.zflagsul.stderr b/src/test/ui/error-codes/E0161.zflagsul.stderr
deleted file mode 100644
index 2baba99..0000000
--- a/src/test/ui/error-codes/E0161.zflagsul.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined
- --> $DIR/E0161.rs:22:5
- |
-LL | box *x;
- | ^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0161`.
diff --git a/src/test/ui/error-codes/E0221.stderr b/src/test/ui/error-codes/E0221.stderr
index 085f80f..86966d5 100644
--- a/src/test/ui/error-codes/E0221.stderr
+++ b/src/test/ui/error-codes/E0221.stderr
@@ -13,11 +13,11 @@
help: use fully qualified syntax to disambiguate
|
LL | let _: <Self as Foo>::A;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | let _: <Self as Bar>::A;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Err` in bounds of `Self`
--> $DIR/E0221.rs:21:16
diff --git a/src/test/ui/error-codes/E0252.stderr b/src/test/ui/error-codes/E0252.stderr
index 8486806..2722dfe 100644
--- a/src/test/ui/error-codes/E0252.stderr
+++ b/src/test/ui/error-codes/E0252.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use bar::baz as other_baz;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0254.stderr b/src/test/ui/error-codes/E0254.stderr
index 10456fd..b098f8e 100644
--- a/src/test/ui/error-codes/E0254.stderr
+++ b/src/test/ui/error-codes/E0254.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo::alloc as other_alloc;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0255.stderr b/src/test/ui/error-codes/E0255.stderr
index 36e4eee..b5c0949 100644
--- a/src/test/ui/error-codes/E0255.stderr
+++ b/src/test/ui/error-codes/E0255.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use bar::foo as other_foo;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr
index 580b5ae..284eaaf 100644
--- a/src/test/ui/error-codes/E0271.stderr
+++ b/src/test/ui/error-codes/E0271.stderr
@@ -1,11 +1,14 @@
error[E0271]: type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
--> $DIR/E0271.rs:10:5
|
-LL | fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
- | ------------------ required by this bound in `foo`
-...
LL | foo(3_i8);
| ^^^ expected `u32`, found `&str`
+ |
+note: required by a bound in `foo`
+ --> $DIR/E0271.rs:3:32
+ |
+LL | fn foo<T>(t: T) where T: Trait<AssociatedType=u32> {
+ | ^^^^^^^^^^^^^^^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0275.stderr b/src/test/ui/error-codes/E0275.stderr
index 390c1e3..15d851a 100644
--- a/src/test/ui/error-codes/E0275.stderr
+++ b/src/test/ui/error-codes/E0275.stderr
@@ -1,9 +1,6 @@
error[E0275]: overflow evaluating the requirement `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo`
--> $DIR/E0275.rs:5:33
|
-LL | trait Foo {}
- | --------- required by this bound in `Foo`
-...
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^
|
@@ -15,6 +12,11 @@
| ^^^ ^
= note: 127 redundant requirements hidden
= note: required because of the requirements on the impl of `Foo` for `Bar<T>`
+note: required by a bound in `Foo`
+ --> $DIR/E0275.rs:1:1
+ |
+LL | trait Foo {}
+ | ^^^^^^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0277-2.stderr b/src/test/ui/error-codes/E0277-2.stderr
index afd0e03..ca2cb88 100644
--- a/src/test/ui/error-codes/E0277-2.stderr
+++ b/src/test/ui/error-codes/E0277-2.stderr
@@ -1,9 +1,6 @@
error[E0277]: `*const u8` cannot be sent between threads safely
--> $DIR/E0277-2.rs:16:5
|
-LL | fn is_send<T: Send>() { }
- | ---- required by this bound in `is_send`
-...
LL | is_send::<Foo>();
| ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely
|
@@ -23,6 +20,11 @@
|
LL | struct Foo {
| ^^^
+note: required by a bound in `is_send`
+ --> $DIR/E0277-2.rs:13:15
+ |
+LL | fn is_send<T: Send>() { }
+ | ^^^^ required by this bound in `is_send`
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0277.stderr b/src/test/ui/error-codes/E0277.stderr
index dea0bb2..c82665a 100644
--- a/src/test/ui/error-codes/E0277.stderr
+++ b/src/test/ui/error-codes/E0277.stderr
@@ -10,16 +10,19 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f(p: &Path) { }
- | ^
+ | +
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/E0277.rs:15:15
|
-LL | fn some_func<T: Foo>(foo: T) {
- | --- required by this bound in `some_func`
-...
LL | some_func(5i32);
| ^^^^ the trait `Foo` is not implemented for `i32`
+ |
+note: required by a bound in `some_func`
+ --> $DIR/E0277.rs:7:17
+ |
+LL | fn some_func<T: Foo>(foo: T) {
+ | ^^^ required by this bound in `some_func`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr
index ec3452b..957e79a 100644
--- a/src/test/ui/error-codes/E0297.stderr
+++ b/src/test/ui/error-codes/E0297.stderr
@@ -3,7 +3,7 @@
|
LL | for Some(x) in xs {}
| ^^^^^^^ pattern `None` not covered
- |
+ |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | None,
diff --git a/src/test/ui/error-codes/E0423.stderr b/src/test/ui/error-codes/E0423.stderr
index a9aecb5..5f25152 100644
--- a/src/test/ui/error-codes/E0423.stderr
+++ b/src/test/ui/error-codes/E0423.stderr
@@ -7,7 +7,7 @@
help: surround the struct literal with parentheses
|
LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
- | ^ ^
+ | + +
error: expected expression, found `==`
--> $DIR/E0423.rs:14:13
@@ -24,7 +24,7 @@
help: surround the struct literal with parentheses
|
LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}
- | ^ ^
+ | + +
error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo`
--> $DIR/E0423.rs:4:13
@@ -41,11 +41,11 @@
help: use struct literal syntax instead
|
LL | let f = Foo { a: val };
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
help: a function with a similar name exists
|
LL | let f = foo();
- | ^^^
+ | ~~~
error[E0423]: expected value, found struct `T`
--> $DIR/E0423.rs:14:8
@@ -56,7 +56,7 @@
help: surround the struct literal with parentheses
|
LL | if (T {}) == T {} { println!("Ok"); }
- | ^ ^
+ | + +
error: aborting due to 5 previous errors
diff --git a/src/test/ui/error-codes/E0424.stderr b/src/test/ui/error-codes/E0424.stderr
index 20b7a4c..d02da3e 100644
--- a/src/test/ui/error-codes/E0424.stderr
+++ b/src/test/ui/error-codes/E0424.stderr
@@ -9,7 +9,7 @@
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn foo(&self) {
- | ^^^^^
+ | +++++
error[E0424]: expected value, found module `self`
--> $DIR/E0424.rs:11:9
@@ -22,7 +22,7 @@
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn baz(&self, _: i32) {
- | ^^^^^^
+ | ++++++
error[E0424]: expected value, found module `self`
--> $DIR/E0424.rs:15:20
@@ -35,7 +35,7 @@
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn qux(&self) {
- | ^^^^^
+ | +++++
error[E0424]: expected unit struct, unit variant or constant, found module `self`
--> $DIR/E0424.rs:20:9
diff --git a/src/test/ui/error-codes/E0429.stderr b/src/test/ui/error-codes/E0429.stderr
index c598803..0b786ab 100644
--- a/src/test/ui/error-codes/E0429.stderr
+++ b/src/test/ui/error-codes/E0429.stderr
@@ -6,12 +6,13 @@
|
help: consider importing the module directly
|
-LL | use std::fmt;
- | --
+LL - use std::fmt::self;
+LL + use std::fmt;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use std::fmt::{self};
- | ^ ^
+ | + +
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0605.stderr b/src/test/ui/error-codes/E0605.stderr
index 6314e7a..e5647ee 100644
--- a/src/test/ui/error-codes/E0605.stderr
+++ b/src/test/ui/error-codes/E0605.stderr
@@ -13,7 +13,7 @@
help: consider borrowing the value
|
LL | &*v as &u8;
- | ^^
+ | ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/error-codes/E0615.stderr b/src/test/ui/error-codes/E0615.stderr
index 1bc047d..c12e1a3 100644
--- a/src/test/ui/error-codes/E0615.stderr
+++ b/src/test/ui/error-codes/E0615.stderr
@@ -7,7 +7,7 @@
help: use parentheses to call the method
|
LL | f.method();
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0617.stderr b/src/test/ui/error-codes/E0617.stderr
index c029060..ea91ad0 100644
--- a/src/test/ui/error-codes/E0617.stderr
+++ b/src/test/ui/error-codes/E0617.stderr
@@ -37,7 +37,7 @@
help: cast the value to `unsafe extern "C" fn(*const i8, ...)`
|
LL | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/error-codes/E0618.stderr b/src/test/ui/error-codes/E0618.stderr
index 714c8d1..19a1a8e 100644
--- a/src/test/ui/error-codes/E0618.stderr
+++ b/src/test/ui/error-codes/E0618.stderr
@@ -12,7 +12,7 @@
help: `X::Entry` is a unit variant, you need to write it without the parenthesis
|
LL | X::Entry;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0618]: expected function, found `i32`
--> $DIR/E0618.rs:9:5
diff --git a/src/test/ui/error-codes/E0642.stderr b/src/test/ui/error-codes/E0642.stderr
index 83fcac0..dd9e28a 100644
--- a/src/test/ui/error-codes/E0642.stderr
+++ b/src/test/ui/error-codes/E0642.stderr
@@ -7,7 +7,7 @@
help: give this argument a name or use an underscore to ignore it
|
LL | fn foo(_: (i32, i32));
- | ^
+ | ~
error[E0642]: patterns aren't allowed in methods without bodies
--> $DIR/E0642.rs:11:12
@@ -18,7 +18,7 @@
help: give this argument a name or use an underscore to ignore it
|
LL | fn bar(_: (i32, i32)) {}
- | ^
+ | ~
error[E0642]: patterns aren't allowed in methods without bodies
--> $DIR/E0642.rs:13:15
@@ -29,7 +29,7 @@
help: give this argument a name or use an underscore to ignore it
|
LL | fn method(_: S) {}
- | ^
+ | ~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/error-codes/E0660.rs b/src/test/ui/error-codes/E0660.rs
index 842ae59..43af240 100644
--- a/src/test/ui/error-codes/E0660.rs
+++ b/src/test/ui/error-codes/E0660.rs
@@ -1,4 +1,5 @@
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
let a;
diff --git a/src/test/ui/error-codes/E0660.stderr b/src/test/ui/error-codes/E0660.stderr
index 69288ea6..f8d0cb2 100644
--- a/src/test/ui/error-codes/E0660.stderr
+++ b/src/test/ui/error-codes/E0660.stderr
@@ -1,11 +1,11 @@
error[E0660]: malformed inline assembly
- --> $DIR/E0660.rs:5:5
+ --> $DIR/E0660.rs:6:5
|
LL | llvm_asm!("nop" "nop");
| ^^^^^^^^^^^^^^^^^^^^^^^
error[E0660]: malformed inline assembly
- --> $DIR/E0660.rs:7:5
+ --> $DIR/E0660.rs:8:5
|
LL | llvm_asm!("nop" "nop" : "=r"(a));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/error-codes/E0661.rs b/src/test/ui/error-codes/E0661.rs
index 1099edd..854675c 100644
--- a/src/test/ui/error-codes/E0661.rs
+++ b/src/test/ui/error-codes/E0661.rs
@@ -1,6 +1,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
let a; //~ ERROR type annotations needed
diff --git a/src/test/ui/error-codes/E0661.stderr b/src/test/ui/error-codes/E0661.stderr
index fe3887e..73745ef 100644
--- a/src/test/ui/error-codes/E0661.stderr
+++ b/src/test/ui/error-codes/E0661.stderr
@@ -1,11 +1,11 @@
error[E0661]: output operand constraint lacks '=' or '+'
- --> $DIR/E0661.rs:7:23
+ --> $DIR/E0661.rs:8:23
|
LL | llvm_asm!("nop" : "r"(a));
| ^^^
error[E0282]: type annotations needed
- --> $DIR/E0661.rs:6:9
+ --> $DIR/E0661.rs:7:9
|
LL | let a;
| ^ consider giving `a` a type
diff --git a/src/test/ui/error-codes/E0662.rs b/src/test/ui/error-codes/E0662.rs
index 0950059..679a88c 100644
--- a/src/test/ui/error-codes/E0662.rs
+++ b/src/test/ui/error-codes/E0662.rs
@@ -1,6 +1,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
llvm_asm!("xor %eax, %eax"
diff --git a/src/test/ui/error-codes/E0662.stderr b/src/test/ui/error-codes/E0662.stderr
index ebc5f62..f6695d7 100644
--- a/src/test/ui/error-codes/E0662.stderr
+++ b/src/test/ui/error-codes/E0662.stderr
@@ -1,5 +1,5 @@
error[E0662]: input operand constraint contains '='
- --> $DIR/E0662.rs:8:17
+ --> $DIR/E0662.rs:9:17
|
LL | : "=test"("a")
| ^^^^^^^
diff --git a/src/test/ui/error-codes/E0663.rs b/src/test/ui/error-codes/E0663.rs
index 0783d70..b82f1ad 100644
--- a/src/test/ui/error-codes/E0663.rs
+++ b/src/test/ui/error-codes/E0663.rs
@@ -1,6 +1,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
llvm_asm!("xor %eax, %eax"
diff --git a/src/test/ui/error-codes/E0663.stderr b/src/test/ui/error-codes/E0663.stderr
index 4e421aa..5f8dede 100644
--- a/src/test/ui/error-codes/E0663.stderr
+++ b/src/test/ui/error-codes/E0663.stderr
@@ -1,5 +1,5 @@
error[E0663]: input operand constraint contains '+'
- --> $DIR/E0663.rs:8:17
+ --> $DIR/E0663.rs:9:17
|
LL | : "+test"("a")
| ^^^^^^^
diff --git a/src/test/ui/error-codes/E0664.rs b/src/test/ui/error-codes/E0664.rs
index f8ca5c9..d2730f0 100644
--- a/src/test/ui/error-codes/E0664.rs
+++ b/src/test/ui/error-codes/E0664.rs
@@ -1,6 +1,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
llvm_asm!("mov $$0x200, %eax"
diff --git a/src/test/ui/error-codes/E0664.stderr b/src/test/ui/error-codes/E0664.stderr
index d0ed0f0..5e6836f 100644
--- a/src/test/ui/error-codes/E0664.stderr
+++ b/src/test/ui/error-codes/E0664.stderr
@@ -1,5 +1,5 @@
error[E0664]: clobber should not be surrounded by braces
- --> $DIR/E0664.rs:9:17
+ --> $DIR/E0664.rs:10:17
|
LL | : "{eax}"
| ^^^^^^^
diff --git a/src/test/ui/error-codes/E0665.rs b/src/test/ui/error-codes/E0665.rs
deleted file mode 100644
index cfd42bd..0000000
--- a/src/test/ui/error-codes/E0665.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#[derive(Default)] //~ ERROR E0665
-enum Food {
- Sweet,
- Salty,
-}
-
-fn main() {
-}
diff --git a/src/test/ui/error-codes/E0665.stderr b/src/test/ui/error-codes/E0665.stderr
deleted file mode 100644
index bb8b390..0000000
--- a/src/test/ui/error-codes/E0665.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0665]: `Default` cannot be derived for enums, only structs
- --> $DIR/E0665.rs:1:10
- |
-LL | #[derive(Default)]
- | ^^^^^^^
- |
- = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0665`.
diff --git a/src/test/ui/error-codes/E0730.rs b/src/test/ui/error-codes/E0730.rs
index 3074581..04f5e5d 100644
--- a/src/test/ui/error-codes/E0730.rs
+++ b/src/test/ui/error-codes/E0730.rs
@@ -1,6 +1,3 @@
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
-
fn is_123<const N: usize>(x: [u32; N]) -> bool {
match x {
[1, 2, ..] => true, //~ ERROR cannot pattern-match on an array without a fixed length
diff --git a/src/test/ui/error-codes/E0730.stderr b/src/test/ui/error-codes/E0730.stderr
index f915f6e..067e8c5 100644
--- a/src/test/ui/error-codes/E0730.stderr
+++ b/src/test/ui/error-codes/E0730.stderr
@@ -1,18 +1,9 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/E0730.rs:1:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
error[E0730]: cannot pattern-match on an array without a fixed length
- --> $DIR/E0730.rs:6:9
+ --> $DIR/E0730.rs:3:9
|
LL | [1, 2, ..] => true,
| ^^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0730`.
diff --git a/src/test/ui/error-codes/E0746.stderr b/src/test/ui/error-codes/E0746.stderr
index 3757ed6..2153b59 100644
--- a/src/test/ui/error-codes/E0746.stderr
+++ b/src/test/ui/error-codes/E0746.stderr
@@ -8,7 +8,7 @@
help: use `impl Trait` as the return type, as all return paths are of type `Struct`, which implements `Trait`
|
LL | fn foo() -> impl Trait { Struct }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/E0746.rs:11:13
@@ -20,7 +20,7 @@
help: use `impl Trait` as the return type, as all return paths are of type `{integer}`, which implements `Trait`
|
LL | fn bar() -> impl Trait {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/error-codes/E0771.rs b/src/test/ui/error-codes/E0771.rs
index ba35927..67e7d10 100644
--- a/src/test/ui/error-codes/E0771.rs
+++ b/src/test/ui/error-codes/E0771.rs
@@ -1,5 +1,5 @@
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
+#![feature(adt_const_params)]
+//~^ WARN the feature `adt_const_params` is incomplete
fn function_with_str<'a, const STRING: &'a str>() {} //~ ERROR E0771
diff --git a/src/test/ui/error-codes/E0771.stderr b/src/test/ui/error-codes/E0771.stderr
index 60220be..730a7ef 100644
--- a/src/test/ui/error-codes/E0771.stderr
+++ b/src/test/ui/error-codes/E0771.stderr
@@ -1,8 +1,8 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
+warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/E0771.rs:1:12
|
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
+LL | #![feature(adt_const_params)]
+ | ^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
diff --git a/src/test/ui/error-should-say-copy-not-pod.stderr b/src/test/ui/error-should-say-copy-not-pod.stderr
index 346e882..8c6025e 100644
--- a/src/test/ui/error-should-say-copy-not-pod.stderr
+++ b/src/test/ui/error-should-say-copy-not-pod.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/error-should-say-copy-not-pod.rs:6:17
|
-LL | fn check_bound<T:Copy>(_: T) {}
- | ---- required by this bound in `check_bound`
-...
LL | check_bound("nocopy".to_string());
| ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+ |
+note: required by a bound in `check_bound`
+ --> $DIR/error-should-say-copy-not-pod.rs:3:18
+ |
+LL | fn check_bound<T:Copy>(_: T) {}
+ | ^^^^ required by this bound in `check_bound`
error: aborting due to previous error
diff --git a/src/test/ui/estr-subtyping.rs b/src/test/ui/estr-subtyping.rs
deleted file mode 100644
index 9c5825f..0000000
--- a/src/test/ui/estr-subtyping.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-fn wants_uniq(x: String) { }
-fn wants_slice(x: &str) { }
-
-fn has_uniq(x: String) {
- wants_uniq(x);
- wants_slice(&*x);
-}
-
-fn has_slice(x: &str) {
- wants_uniq(x); //~ ERROR mismatched types
- wants_slice(x);
-}
-
-fn main() {
-}
diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr
deleted file mode 100644
index 268ec63..0000000
--- a/src/test/ui/estr-subtyping.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/estr-subtyping.rs:10:15
- |
-LL | wants_uniq(x);
- | ^
- | |
- | expected struct `String`, found `&str`
- | help: try using a conversion method: `x.to_string()`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/explore-issue-38412.stderr b/src/test/ui/explore-issue-38412.stderr
index f4a2330..2f5dab7 100644
--- a/src/test/ui/explore-issue-38412.stderr
+++ b/src/test/ui/explore-issue-38412.stderr
@@ -84,7 +84,7 @@
|
LL | r.pub_crate();
| ^^^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/pub-and-stability.rs:114:9
|
LL | pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
@@ -95,7 +95,7 @@
|
LL | r.pub_mod();
| ^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/pub-and-stability.rs:116:9
|
LL | pub(in m) fn pub_mod(&self) -> i32 { self.d_priv }
@@ -106,7 +106,7 @@
|
LL | r.private();
| ^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/pub-and-stability.rs:118:9
|
LL | fn private(&self) -> i32 { self.d_priv }
@@ -135,7 +135,7 @@
|
LL | t.pub_crate();
| ^^^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/pub-and-stability.rs:129:9
|
LL | pub(crate) fn pub_crate(&self) -> i32 { self.0 }
@@ -146,7 +146,7 @@
|
LL | t.pub_mod();
| ^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/pub-and-stability.rs:130:9
|
LL | pub(in m) fn pub_mod(&self) -> i32 { self.0 }
@@ -157,7 +157,7 @@
|
LL | t.private();
| ^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/pub-and-stability.rs:131:9
|
LL | fn private(&self) -> i32 { self.0 }
diff --git a/src/test/ui/expr/if/if-let.rs b/src/test/ui/expr/if/if-let.rs
index 7208e38..7fdd2be 100644
--- a/src/test/ui/expr/if/if-let.rs
+++ b/src/test/ui/expr/if/if-let.rs
@@ -1,7 +1,7 @@
// check-pass
fn macros() {
- macro_rules! foo{
+ macro_rules! foo {
($p:pat, $e:expr, $b:block) => {{
if let $p = $e $b
//~^ WARN irrefutable `if let`
diff --git a/src/test/ui/expr/if/if-let.stderr b/src/test/ui/expr/if/if-let.stderr
index bcc3f53..7975a9d 100644
--- a/src/test/ui/expr/if/if-let.stderr
+++ b/src/test/ui/expr/if/if-let.stderr
@@ -1,8 +1,8 @@
warning: irrefutable `if let` pattern
- --> $DIR/if-let.rs:6:13
+ --> $DIR/if-let.rs:6:16
|
LL | if let $p = $e $b
- | ^^^^^^^^^^^^^^^^^
+ | ^^^
...
LL | / foo!(a, 1, {
LL | | println!("irrefutable pattern");
@@ -15,10 +15,10 @@
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `if let` pattern
- --> $DIR/if-let.rs:6:13
+ --> $DIR/if-let.rs:6:16
|
LL | if let $p = $e $b
- | ^^^^^^^^^^^^^^^^^
+ | ^^^
...
LL | / bar!(a, 1, {
LL | | println!("irrefutable pattern");
@@ -30,51 +30,37 @@
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `if let` pattern
- --> $DIR/if-let.rs:26:5
+ --> $DIR/if-let.rs:26:8
|
-LL | / if let a = 1 {
-LL | | println!("irrefutable pattern");
-LL | | }
- | |_____^
+LL | if let a = 1 {
+ | ^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
warning: irrefutable `if let` pattern
- --> $DIR/if-let.rs:30:5
+ --> $DIR/if-let.rs:30:8
|
-LL | / if let a = 1 {
-LL | | println!("irrefutable pattern");
-LL | | } else if true {
-LL | | println!("else-if in irrefutable `if let`");
-LL | | } else {
-LL | | println!("else in irrefutable `if let`");
-LL | | }
- | |_____^
+LL | if let a = 1 {
+ | ^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
warning: irrefutable `if let` pattern
- --> $DIR/if-let.rs:40:12
+ --> $DIR/if-let.rs:40:15
|
-LL | } else if let a = 1 {
- | ____________^
-LL | | println!("irrefutable pattern");
-LL | | }
- | |_____^
+LL | } else if let a = 1 {
+ | ^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
warning: irrefutable `if let` pattern
- --> $DIR/if-let.rs:46:12
+ --> $DIR/if-let.rs:46:15
|
-LL | } else if let a = 1 {
- | ____________^
-LL | | println!("irrefutable pattern");
-LL | | }
- | |_____^
+LL | } else if let a = 1 {
+ | ^^^^^^^^^
|
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
diff --git a/src/test/ui/expr/if/if-no-match-bindings.stderr b/src/test/ui/expr/if/if-no-match-bindings.stderr
index 3f382e0..3193717 100644
--- a/src/test/ui/expr/if/if-no-match-bindings.stderr
+++ b/src/test/ui/expr/if/if-no-match-bindings.stderr
@@ -2,73 +2,93 @@
--> $DIR/if-no-match-bindings.rs:18:8
|
LL | if b_ref() {}
- | ^^^^^^^
- | |
- | expected `bool`, found `&bool`
- | help: consider dereferencing the borrow: `*b_ref()`
+ | ^^^^^^^ expected `bool`, found `&bool`
+ |
+help: consider dereferencing the borrow
+ |
+LL | if *b_ref() {}
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:19:8
|
LL | if b_mut_ref() {}
- | ^^^^^^^^^^^
- | |
- | expected `bool`, found `&mut bool`
- | help: consider dereferencing the borrow: `*b_mut_ref()`
+ | ^^^^^^^^^^^ expected `bool`, found `&mut bool`
+ |
+help: consider dereferencing the borrow
+ |
+LL | if *b_mut_ref() {}
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:20:8
|
LL | if &true {}
- | ^^^^^
- | |
- | expected `bool`, found `&bool`
- | help: consider removing the borrow: `true`
+ | ^^^^^ expected `bool`, found `&bool`
+ |
+help: consider removing the borrow
+ |
+LL - if &true {}
+LL + if true {}
+ |
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:21:8
|
LL | if &mut true {}
- | ^^^^^^^^^
- | |
- | expected `bool`, found `&mut bool`
- | help: consider removing the borrow: `true`
+ | ^^^^^^^^^ expected `bool`, found `&mut bool`
+ |
+help: consider removing the borrow
+ |
+LL - if &mut true {}
+LL + if true {}
+ |
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:24:11
|
LL | while b_ref() {}
- | ^^^^^^^
- | |
- | expected `bool`, found `&bool`
- | help: consider dereferencing the borrow: `*b_ref()`
+ | ^^^^^^^ expected `bool`, found `&bool`
+ |
+help: consider dereferencing the borrow
+ |
+LL | while *b_ref() {}
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:25:11
|
LL | while b_mut_ref() {}
- | ^^^^^^^^^^^
- | |
- | expected `bool`, found `&mut bool`
- | help: consider dereferencing the borrow: `*b_mut_ref()`
+ | ^^^^^^^^^^^ expected `bool`, found `&mut bool`
+ |
+help: consider dereferencing the borrow
+ |
+LL | while *b_mut_ref() {}
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:26:11
|
LL | while &true {}
- | ^^^^^
- | |
- | expected `bool`, found `&bool`
- | help: consider removing the borrow: `true`
+ | ^^^^^ expected `bool`, found `&bool`
+ |
+help: consider removing the borrow
+ |
+LL - while &true {}
+LL + while true {}
+ |
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:27:11
|
LL | while &mut true {}
- | ^^^^^^^^^
- | |
- | expected `bool`, found `&mut bool`
- | help: consider removing the borrow: `true`
+ | ^^^^^^^^^ expected `bool`, found `&mut bool`
+ |
+help: consider removing the borrow
+ |
+LL - while &mut true {}
+LL + while true {}
+ |
error: aborting due to 8 previous errors
diff --git a/src/test/ui/expr/if/if-ret.rs b/src/test/ui/expr/if/if-ret.rs
index 6bb0141..896072c 100644
--- a/src/test/ui/expr/if/if-ret.rs
+++ b/src/test/ui/expr/if/if-ret.rs
@@ -3,6 +3,6 @@
#![allow(unused_parens)]
// pretty-expanded FIXME #23616
-fn foo() { if (return) { } } //~ WARNING unreachable block in `if` expression
+fn foo() { if (return) { } } //~ WARNING unreachable block in `if`
pub fn main() { foo(); }
diff --git a/src/test/ui/expr/if/if-ret.stderr b/src/test/ui/expr/if/if-ret.stderr
index 41bbd79..8ced271 100644
--- a/src/test/ui/expr/if/if-ret.stderr
+++ b/src/test/ui/expr/if/if-ret.stderr
@@ -1,8 +1,8 @@
-warning: unreachable block in `if` expression
+warning: unreachable block in `if` or `while` expression
--> $DIR/if-ret.rs:6:24
|
LL | fn foo() { if (return) { } }
- | -------- ^^^ unreachable block in `if` expression
+ | -------- ^^^ unreachable block in `if` or `while` expression
| |
| any code following this expression is unreachable
|
diff --git a/src/test/ui/extern/extern-crate-rename.stderr b/src/test/ui/extern/extern-crate-rename.stderr
index 787c11f..5f14779 100644
--- a/src/test/ui/extern/extern-crate-rename.stderr
+++ b/src/test/ui/extern/extern-crate-rename.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | extern crate m2 as other_m1;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/extern/extern-no-mangle.rs b/src/test/ui/extern/extern-no-mangle.rs
new file mode 100644
index 0000000..ab7c982
--- /dev/null
+++ b/src/test/ui/extern/extern-no-mangle.rs
@@ -0,0 +1,30 @@
+#![warn(unused_attributes)]
+
+// Tests that placing the #[no_mangle] attribute on a foreign fn or static emits
+// a specialized warning.
+// The previous warning only talks about a "function or static" but foreign fns/statics
+// are also not allowed to have #[no_mangle]
+
+// build-pass
+
+extern "C" {
+ #[no_mangle]
+ //~^ WARNING `#[no_mangle]` has no effect on a foreign static
+ //~^^ WARNING this was previously accepted by the compiler
+ pub static FOO: u8;
+
+ #[no_mangle]
+ //~^ WARNING `#[no_mangle]` has no effect on a foreign function
+ //~^^ WARNING this was previously accepted by the compiler
+ pub fn bar();
+}
+
+fn no_new_warn() {
+ // Should emit the generic "not a function or static" warning
+ #[no_mangle]
+ //~^ WARNING attribute should be applied to a free function, impl method or static
+ //~^^ WARNING this was previously accepted by the compiler
+ let x = 0_u8;
+}
+
+fn main() {}
diff --git a/src/test/ui/extern/extern-no-mangle.stderr b/src/test/ui/extern/extern-no-mangle.stderr
new file mode 100644
index 0000000..b564281
--- /dev/null
+++ b/src/test/ui/extern/extern-no-mangle.stderr
@@ -0,0 +1,42 @@
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/extern-no-mangle.rs:24:5
+ |
+LL | #[no_mangle]
+ | ^^^^^^^^^^^^
+...
+LL | let x = 0_u8;
+ | ------------- not a free function, impl method or static
+ |
+note: the lint level is defined here
+ --> $DIR/extern-no-mangle.rs:1:9
+ |
+LL | #![warn(unused_attributes)]
+ | ^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+
+warning: `#[no_mangle]` has no effect on a foreign static
+ --> $DIR/extern-no-mangle.rs:11:5
+ |
+LL | #[no_mangle]
+ | ^^^^^^^^^^^^ help: remove this attribute
+...
+LL | pub static FOO: u8;
+ | ------------------- foreign static
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: symbol names in extern blocks are not mangled
+
+warning: `#[no_mangle]` has no effect on a foreign function
+ --> $DIR/extern-no-mangle.rs:16:5
+ |
+LL | #[no_mangle]
+ | ^^^^^^^^^^^^ help: remove this attribute
+...
+LL | pub fn bar();
+ | ------------- foreign function
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: symbol names in extern blocks are not mangled
+
+warning: 3 warnings emitted
+
diff --git a/src/test/ui/extern/extern-types-not-sync-send.stderr b/src/test/ui/extern/extern-types-not-sync-send.stderr
index 547116f..7865dde 100644
--- a/src/test/ui/extern/extern-types-not-sync-send.stderr
+++ b/src/test/ui/extern/extern-types-not-sync-send.stderr
@@ -1,24 +1,28 @@
error[E0277]: `A` cannot be shared between threads safely
--> $DIR/extern-types-not-sync-send.rs:13:19
|
-LL | fn assert_sync<T: ?Sized + Sync>() {}
- | ---- required by this bound in `assert_sync`
-...
LL | assert_sync::<A>();
| ^ `A` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `A`
+note: required by a bound in `assert_sync`
+ --> $DIR/extern-types-not-sync-send.rs:9:28
+ |
+LL | fn assert_sync<T: ?Sized + Sync>() {}
+ | ^^^^ required by this bound in `assert_sync`
error[E0277]: `A` cannot be sent between threads safely
--> $DIR/extern-types-not-sync-send.rs:16:19
|
-LL | fn assert_send<T: ?Sized + Send>() {}
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<A>();
| ^ `A` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `A`
+note: required by a bound in `assert_send`
+ --> $DIR/extern-types-not-sync-send.rs:10:28
+ |
+LL | fn assert_send<T: ?Sized + Send>() {}
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/extern/extern-types-unsized.stderr b/src/test/ui/extern/extern-types-unsized.stderr
index 72e4be5..e210771 100644
--- a/src/test/ui/extern/extern-types-unsized.stderr
+++ b/src/test/ui/extern/extern-types-unsized.stderr
@@ -1,24 +1,23 @@
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:22:20
|
-LL | fn assert_sized<T>() {}
- | - required by this bound in `assert_sized`
-...
LL | assert_sized::<A>();
| ^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `A`
+note: required by a bound in `assert_sized`
+ --> $DIR/extern-types-unsized.rs:19:17
+ |
+LL | fn assert_sized<T>() {}
+ | ^ required by this bound in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:25:5
|
-LL | fn assert_sized<T>() {}
- | - required by this bound in `assert_sized`
-...
LL | assert_sized::<Foo>();
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -28,17 +27,19 @@
|
LL | struct Foo {
| ^^^
+note: required by a bound in `assert_sized`
+ --> $DIR/extern-types-unsized.rs:19:17
+ |
+LL | fn assert_sized<T>() {}
+ | ^ required by this bound in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:28:5
|
-LL | fn assert_sized<T>() {}
- | - required by this bound in `assert_sized`
-...
LL | assert_sized::<Bar<A>>();
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -48,17 +49,19 @@
|
LL | struct Bar<T: ?Sized> {
| ^^^
+note: required by a bound in `assert_sized`
+ --> $DIR/extern-types-unsized.rs:19:17
+ |
+LL | fn assert_sized<T>() {}
+ | ^ required by this bound in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:31:5
|
-LL | fn assert_sized<T>() {}
- | - required by this bound in `assert_sized`
-...
LL | assert_sized::<Bar<Bar<A>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -73,10 +76,15 @@
|
LL | struct Bar<T: ?Sized> {
| ^^^
+note: required by a bound in `assert_sized`
+ --> $DIR/extern-types-unsized.rs:19:17
+ |
+LL | fn assert_sized<T>() {}
+ | ^ required by this bound in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/extern/extern-wrong-value-type.stderr b/src/test/ui/extern/extern-wrong-value-type.stderr
index d92b5f4..74981eb 100644
--- a/src/test/ui/extern/extern-wrong-value-type.stderr
+++ b/src/test/ui/extern/extern-wrong-value-type.stderr
@@ -1,14 +1,16 @@
error[E0277]: expected a `Fn<()>` closure, found `extern "C" fn() {f}`
--> $DIR/extern-wrong-value-type.rs:9:11
|
-LL | fn is_fn<F>(_: F) where F: Fn() {}
- | ---- required by this bound in `is_fn`
-...
LL | is_fn(f);
| ^ expected an `Fn<()>` closure, found `extern "C" fn() {f}`
|
= help: the trait `Fn<()>` is not implemented for `extern "C" fn() {f}`
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `is_fn`
+ --> $DIR/extern-wrong-value-type.rs:4:28
+ |
+LL | fn is_fn<F>(_: F) where F: Fn() {}
+ | ^^^^ required by this bound in `is_fn`
error: aborting due to previous error
diff --git a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
index 7b731a1..74c6e50 100644
--- a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
+++ b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
@@ -19,9 +19,7 @@
// revisions: no thin fat
//[no]compile-flags: -C lto=no
-// FIXME(#83854) running this revision with 1 CGU triggers llvm assert in register allocator
-// when executed in i686-gnu-nopt runner.
-//[thin]compile-flags: -C lto=thin -Ccodegen-units=2
+//[thin]compile-flags: -C lto=thin
//[fat]compile-flags: -C lto=fat
#![feature(core_panic)]
diff --git a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
index 32e6d0c..bc15fcb 100644
--- a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
+++ b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
@@ -40,9 +40,7 @@
//[no1]compile-flags: -C opt-level=1 -C lto=no
//[no2]compile-flags: -C opt-level=2 -C lto=no
//[no3]compile-flags: -C opt-level=3 -C lto=no
-// FIXME(#83854) running this revision with 1 CGU triggers llvm assert in register allocator
-// when executed in dist-i586-gnu-i586-i686-musl runner.
-//[thin0]compile-flags: -C opt-level=0 -C lto=thin -Ccodegen-units=2
+//[thin0]compile-flags: -C opt-level=0 -C lto=thin
//[thin1]compile-flags: -C opt-level=1 -C lto=thin
//[thin2]compile-flags: -C opt-level=2 -C lto=thin
//[thin3]compile-flags: -C opt-level=3 -C lto=thin
diff --git a/src/test/ui/feature-gates/feature-gate-adt_const_params.rs b/src/test/ui/feature-gates/feature-gate-adt_const_params.rs
new file mode 100644
index 0000000..8a3bcf25
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-adt_const_params.rs
@@ -0,0 +1,2 @@
+struct Foo<const NAME: &'static str>; //~ ERROR `&'static str` is forbidden
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-adt_const_params.stderr b/src/test/ui/feature-gates/feature-gate-adt_const_params.stderr
new file mode 100644
index 0000000..d8f089a
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-adt_const_params.stderr
@@ -0,0 +1,11 @@
+error: `&'static str` is forbidden as the type of a const generic parameter
+ --> $DIR/feature-gate-adt_const_params.rs:1:24
+ |
+LL | struct Foo<const NAME: &'static str>;
+ | ^^^^^^^^^^^^
+ |
+ = note: the only supported types are integers, `bool` and `char`
+ = help: more complex types are supported with `#![feature(adt_const_params)]`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.stderr b/src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.stderr
index a80f9be..f9c53a6 100644
--- a/src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.stderr
+++ b/src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.stderr
@@ -1,17 +1,17 @@
-error[E0658]: `*const Self` cannot be used as the type of `self` without the `arbitrary_self_types` feature
- --> $DIR/feature-gate-arbitrary_self_types-raw-pointer.rs:9:18
+error[E0658]: `*const Foo` cannot be used as the type of `self` without the `arbitrary_self_types` feature
+ --> $DIR/feature-gate-arbitrary_self_types-raw-pointer.rs:4:18
|
-LL | fn bar(self: *const Self);
+LL | fn foo(self: *const Self) {}
| ^^^^^^^^^^^
|
= note: see issue #44874 <https://github.com/rust-lang/rust/issues/44874> for more information
= help: add `#![feature(arbitrary_self_types)]` to the crate attributes to enable
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
-error[E0658]: `*const Foo` cannot be used as the type of `self` without the `arbitrary_self_types` feature
- --> $DIR/feature-gate-arbitrary_self_types-raw-pointer.rs:4:18
+error[E0658]: `*const Self` cannot be used as the type of `self` without the `arbitrary_self_types` feature
+ --> $DIR/feature-gate-arbitrary_self_types-raw-pointer.rs:9:18
|
-LL | fn foo(self: *const Self) {}
+LL | fn bar(self: *const Self);
| ^^^^^^^^^^^
|
= note: see issue #44874 <https://github.com/rust-lang/rust/issues/44874> for more information
diff --git a/src/test/ui/feature-gates/feature-gate-asm.rs b/src/test/ui/feature-gates/feature-gate-asm.rs
index 59f0437..b4dca72 100644
--- a/src/test/ui/feature-gates/feature-gate-asm.rs
+++ b/src/test/ui/feature-gates/feature-gate-asm.rs
@@ -1,5 +1,7 @@
// only-x86_64
+#![allow(deprecated)] // llvm_asm!
+
fn main() {
unsafe {
asm!("");
diff --git a/src/test/ui/feature-gates/feature-gate-asm.stderr b/src/test/ui/feature-gates/feature-gate-asm.stderr
index d770565..144a425 100644
--- a/src/test/ui/feature-gates/feature-gate-asm.stderr
+++ b/src/test/ui/feature-gates/feature-gate-asm.stderr
@@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'asm': inline assembly is not stable enough for use and is subject to change
- --> $DIR/feature-gate-asm.rs:5:9
+ --> $DIR/feature-gate-asm.rs:7:9
|
LL | asm!("");
| ^^^
@@ -8,7 +8,7 @@
= help: add `#![feature(asm)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'llvm_asm': prefer using the new asm! syntax instead
- --> $DIR/feature-gate-asm.rs:7:9
+ --> $DIR/feature-gate-asm.rs:9:9
|
LL | llvm_asm!("");
| ^^^^^^^^
diff --git a/src/test/ui/feature-gates/feature-gate-asm2.rs b/src/test/ui/feature-gates/feature-gate-asm2.rs
index aa63aff..9044f2c 100644
--- a/src/test/ui/feature-gates/feature-gate-asm2.rs
+++ b/src/test/ui/feature-gates/feature-gate-asm2.rs
@@ -1,5 +1,7 @@
// only-x86_64
+#![allow(deprecated)] // llvm_asm!
+
fn main() {
unsafe {
println!("{:?}", asm!(""));
diff --git a/src/test/ui/feature-gates/feature-gate-asm2.stderr b/src/test/ui/feature-gates/feature-gate-asm2.stderr
index 85278c9..0b0c8a6 100644
--- a/src/test/ui/feature-gates/feature-gate-asm2.stderr
+++ b/src/test/ui/feature-gates/feature-gate-asm2.stderr
@@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'asm': inline assembly is not stable enough for use and is subject to change
- --> $DIR/feature-gate-asm2.rs:5:26
+ --> $DIR/feature-gate-asm2.rs:7:26
|
LL | println!("{:?}", asm!(""));
| ^^^
@@ -8,7 +8,7 @@
= help: add `#![feature(asm)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'llvm_asm': prefer using the new asm! syntax instead
- --> $DIR/feature-gate-asm2.rs:7:26
+ --> $DIR/feature-gate-asm2.rs:9:26
|
LL | println!("{:?}", llvm_asm!(""));
| ^^^^^^^^
diff --git a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr
index 2dacb94..8df5fbc 100644
--- a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr
+++ b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr
@@ -138,16 +138,18 @@
|
LL | type A: Iterator<Item: Copy>;
| ^^^^ the trait `Copy` is not implemented for `<<Self as _Tr3>::A as Iterator>::Item`
- |
- ::: $SRC_DIR/core/src/marker.rs:LL:COL
|
-LL | pub trait Copy: Clone {
- | --------------------- required by this bound in `Copy`
+note: required by a bound in `Copy`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
|
+LL | / pub trait Copy: Clone {
+LL | | // Empty.
+LL | | }
+ | |_^ required by this bound in `Copy`
help: consider further restricting the associated type
|
LL | trait _Tr3 where <<Self as _Tr3>::A as Iterator>::Item: Copy {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 17 previous errors
diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.mir.stderr b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.mir.stderr
deleted file mode 100644
index 04efea0..0000000
--- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.mir.stderr
+++ /dev/null
@@ -1,118 +0,0 @@
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:11:43
- |
-LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
- | ^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:14:53
- |
-LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:17:58
- |
-LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:20:48
- |
-LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:23:58
- |
-LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:26:63
- |
-LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:29:39
- |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:33:49
- |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:37:54
- |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/feature-gate-const_fn_transmute.rs:29:39
- |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/feature-gate-const_fn_transmute.rs:33:49
- |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/feature-gate-const_fn_transmute.rs:37:54
- |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error: aborting due to 12 previous errors
-
-Some errors have detailed explanations: E0133, E0658.
-For more information about an error, try `rustc --explain E0133`.
diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs
deleted file mode 100644
index 9a45dbc..0000000
--- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
-use std::mem;
-
-#[repr(transparent)]
-struct Foo(u32);
-
-const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) };
-
-const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
-//~^ ERROR `transmute`
-
-const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
-//~^ ERROR `transmute`
-
-const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
-//~^ ERROR `transmute`
-
-const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-
-const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-
-const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-
-const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-//~| ERROR call to unsafe function is unsafe and requires unsafe function or block
-
-const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-//~| ERROR call to unsafe function is unsafe and requires unsafe function or block
-
-const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-//~| ERROR call to unsafe function is unsafe and requires unsafe function or block
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.thir.stderr b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.thir.stderr
deleted file mode 100644
index df0de7a..0000000
--- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.thir.stderr
+++ /dev/null
@@ -1,118 +0,0 @@
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:11:43
- |
-LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
- | ^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:14:53
- |
-LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:17:58
- |
-LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:20:48
- |
-LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:23:58
- |
-LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:26:63
- |
-LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/feature-gate-const_fn_transmute.rs:29:39
- |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:29:39
- |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/feature-gate-const_fn_transmute.rs:33:49
- |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:33:49
- |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/feature-gate-const_fn_transmute.rs:37:54
- |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
- |
- = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/feature-gate-const_fn_transmute.rs:37:54
- |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
-
-error: aborting due to 12 previous errors
-
-Some errors have detailed explanations: E0133, E0658.
-For more information about an error, try `rustc --explain E0133`.
diff --git a/src/test/ui/feature-gates/feature-gate-const_generics.rs b/src/test/ui/feature-gates/feature-gate-const_generics.rs
deleted file mode 100644
index 06364ee..0000000
--- a/src/test/ui/feature-gates/feature-gate-const_generics.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-fn foo<const X: ()>() {} //~ ERROR `()` is forbidden as the type of a const generic parameter
-
-struct Foo<const X: usize>([(); X]);
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-const_generics.stderr b/src/test/ui/feature-gates/feature-gate-const_generics.stderr
deleted file mode 100644
index ed19109..0000000
--- a/src/test/ui/feature-gates/feature-gate-const_generics.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: `()` is forbidden as the type of a const generic parameter
- --> $DIR/feature-gate-const_generics.rs:1:17
- |
-LL | fn foo<const X: ()>() {}
- | ^^
- |
- = note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(const_generics)]`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/feature-gates/feature-gate-derive_default_enum.rs b/src/test/ui/feature-gates/feature-gate-derive_default_enum.rs
new file mode 100644
index 0000000..05a5d4e
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-derive_default_enum.rs
@@ -0,0 +1,7 @@
+#[derive(Default)] //~ ERROR deriving `Default` on enums is experimental
+enum Foo {
+ #[default]
+ Alpha,
+}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-derive_default_enum.stderr b/src/test/ui/feature-gates/feature-gate-derive_default_enum.stderr
new file mode 100644
index 0000000..58dd4d5
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-derive_default_enum.stderr
@@ -0,0 +1,13 @@
+error[E0658]: deriving `Default` on enums is experimental
+ --> $DIR/feature-gate-derive_default_enum.rs:1:10
+ |
+LL | #[derive(Default)]
+ | ^^^^^^^
+ |
+ = note: see issue #86985 <https://github.com/rust-lang/rust/issues/86985> for more information
+ = help: add `#![feature(derive_default_enum)]` to the crate attributes to enable
+ = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
index e079c2d..c5ffa55 100644
--- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
+++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
@@ -3,7 +3,7 @@
|
LL | let Ok(_x) = foo();
| ^^^^^^ pattern `Err(_)` not covered
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
@@ -15,7 +15,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Ok(_x) = foo() { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr
new file mode 100644
index 0000000..c17f02d
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr
@@ -0,0 +1,12 @@
+error[E0747]: type provided when a constant was expected
+ --> $DIR/feature-gate-generic_arg_infer.rs:11:20
+ |
+LL | let _x = foo::<_>([1,2]);
+ | ^
+ |
+ = help: const arguments cannot yet be inferred with `_`
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/feature-gates/feature-gate-generic_arg_infer.rs b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.rs
new file mode 100644
index 0000000..4729773
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.rs
@@ -0,0 +1,13 @@
+// [feature] run-pass
+// revisions: normal feature
+
+#![cfg_attr(feature, feature(generic_arg_infer))]
+
+fn foo<const N: usize>(_: [u8; N]) -> [u8; N] {
+ [0; N]
+}
+
+fn main() {
+ let _x = foo::<_>([1,2]);
+ //[normal]~^ ERROR: type provided when a constant was expected
+}
diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr
index 4afbde5..318fb63 100644
--- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr
+++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr
@@ -70,7 +70,7 @@
help: consider restricting type parameter `U32`
|
LL | type Pointer2<U32: std::clone::Clone> = Box<U32>;
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 8 previous errors
diff --git a/src/test/ui/feature-gates/feature-gate-global_asm.rs b/src/test/ui/feature-gates/feature-gate-global_asm.rs
index 8c9f22e..1420eef 100644
--- a/src/test/ui/feature-gates/feature-gate-global_asm.rs
+++ b/src/test/ui/feature-gates/feature-gate-global_asm.rs
@@ -1,3 +1,5 @@
+// needs-asm-support
+
global_asm!(""); //~ ERROR `global_asm!` is not stable
fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-global_asm.stderr b/src/test/ui/feature-gates/feature-gate-global_asm.stderr
index e07fbf0..7c4d3e3 100644
--- a/src/test/ui/feature-gates/feature-gate-global_asm.stderr
+++ b/src/test/ui/feature-gates/feature-gate-global_asm.stderr
@@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'global_asm': `global_asm!` is not stable enough for use and is subject to change
- --> $DIR/feature-gate-global_asm.rs:1:1
+ --> $DIR/feature-gate-global_asm.rs:3:1
|
LL | global_asm!("");
| ^^^^^^^^^^
diff --git a/src/test/ui/feature-gates/feature-gate-in_band_lifetimes.stderr b/src/test/ui/feature-gates/feature-gate-in_band_lifetimes.stderr
index 497b8a4..20e6130 100644
--- a/src/test/ui/feature-gates/feature-gate-in_band_lifetimes.stderr
+++ b/src/test/ui/feature-gates/feature-gate-in_band_lifetimes.stderr
@@ -28,11 +28,11 @@
help: consider introducing lifetime `'a` here
|
LL | impl<'a> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'a` here
|
LL | fn my_lifetime<'a>(&self) -> &'a u8 { self.0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:55:27
@@ -44,11 +44,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn any_lifetime<'b>() -> &'b u8 { &0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:27
@@ -60,11 +60,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:40
@@ -76,11 +76,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'x`
--> $DIR/feature-gate-in_band_lifetimes.rs:3:12
@@ -120,11 +120,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> X<'b> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn inner_2<'b>(&self) -> &'b u8 {
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:23:8
@@ -146,11 +146,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b> X<'b> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn inner_3<'b>(&self) -> &'b u8 {
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:33:9
@@ -172,11 +172,11 @@
help: consider introducing lifetime `'a` here
|
LL | impl<'a> Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'a` here
|
LL | fn inner<'a>(&self) -> &'a u8 {
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:43:27
@@ -188,11 +188,11 @@
help: consider introducing lifetime `'b` here
|
LL | trait MyTrait<'b, 'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn any_lifetime<'b>() -> &'b u8;
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:45:27
@@ -204,11 +204,11 @@
help: consider introducing lifetime `'b` here
|
LL | trait MyTrait<'b, 'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8;
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:45:40
@@ -220,11 +220,11 @@
help: consider introducing lifetime `'b` here
|
LL | trait MyTrait<'b, 'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8;
- | ^^^^
+ | ++++
error: aborting due to 17 previous errors
diff --git a/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr b/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr
index 987cde1..2bccec4 100644
--- a/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr
+++ b/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr
@@ -4,7 +4,13 @@
LL | struct Foo<U> {
| - help: consider adding an explicit lifetime bound...: `U: 'static`
LL | bar: Bar<U>
- | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds
+ | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/feature-gate-infer_static_outlives_requirements.rs:7:15
+ |
+LL | struct Bar<T: 'static> {
+ | ^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/feature-gates/feature-gate-let_else.rs b/src/test/ui/feature-gates/feature-gate-let_else.rs
new file mode 100644
index 0000000..3f04a9d
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-let_else.rs
@@ -0,0 +1,5 @@
+fn main() {
+ let Some(x) = Some(1) else { //~ ERROR `let...else` statements are unstable
+ return;
+ };
+}
diff --git a/src/test/ui/feature-gates/feature-gate-let_else.stderr b/src/test/ui/feature-gates/feature-gate-let_else.stderr
new file mode 100644
index 0000000..8625260
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-let_else.stderr
@@ -0,0 +1,14 @@
+error[E0658]: `let...else` statements are unstable
+ --> $DIR/feature-gate-let_else.rs:2:5
+ |
+LL | / let Some(x) = Some(1) else {
+LL | | return;
+LL | | };
+ | |______^
+ |
+ = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information
+ = help: add `#![feature(let_else)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.rs b/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.rs
deleted file mode 100644
index ffe297a..0000000
--- a/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-// ignore-compare-mode-chalk
-use std::fmt::Debug;
-
-type Foo = impl Debug; //~ ERROR `impl Trait` in type aliases is unstable
-
-trait Bar {
- type Baa: Debug;
- fn define() -> Self::Baa;
-}
-
-impl Bar for () {
- type Baa = impl Debug; //~ ERROR `impl Trait` in type aliases is unstable
- fn define() -> Self::Baa {
- 0
- }
-}
-
-fn define() -> Foo {
- 0
-}
-
-trait TraitWithDefault {
- type Assoc = impl Debug;
- //~^ ERROR associated type defaults are unstable
- //~| ERROR `impl Trait` not allowed outside of function
- //~| ERROR `impl Trait` in type aliases is unstable
-}
-
-type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
-//~^ ERROR `impl Trait` in type aliases is unstable
-//~| ERROR `impl Trait` in type aliases is unstable
-//~| ERROR `impl Trait` in type aliases is unstable
-//~| ERROR `impl Trait` in type aliases is unstable
-
-fn define_multiple() -> NestedFree {
- (vec![true], 0u8, 0i32..1)
-}
-
-impl Bar for u8 {
- type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
- //~^ ERROR `impl Trait` in type aliases is unstable
- //~| ERROR `impl Trait` in type aliases is unstable
- //~| ERROR `impl Trait` in type aliases is unstable
- //~| ERROR `impl Trait` in type aliases is unstable
- fn define() -> Self::Baa {
- (vec![true], 0u8, 0i32..1)
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.stderr b/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.stderr
deleted file mode 100644
index 0785728..0000000
--- a/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.stderr
+++ /dev/null
@@ -1,118 +0,0 @@
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:4:12
- |
-LL | type Foo = impl Debug;
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:12:16
- |
-LL | type Baa = impl Debug;
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: associated type defaults are unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:23:5
- |
-LL | type Assoc = impl Debug;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #29661 <https://github.com/rust-lang/rust/issues/29661> for more information
- = help: add `#![feature(associated_type_defaults)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:23:18
- |
-LL | type Assoc = impl Debug;
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:24
- |
-LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:37
- |
-LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:49
- |
-LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:70
- |
-LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:21
- |
-LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:34
- |
-LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:46
- |
-LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:67
- |
-LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug> + Debug);
- | ^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0562]: `impl Trait` not allowed outside of function and method return types
- --> $DIR/feature-gate-min_type_alias_impl_trait.rs:23:18
- |
-LL | type Assoc = impl Debug;
- | ^^^^^^^^^^
-
-error: aborting due to 13 previous errors
-
-Some errors have detailed explanations: E0562, E0658.
-For more information about an error, try `rustc --explain E0562`.
diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-2.rs b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-2.rs
new file mode 100644
index 0000000..1b5fa78
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-2.rs
@@ -0,0 +1,10 @@
+// Test native_link_modifiers_bundle don't need static-nobundle
+// check-pass
+
+#![feature(native_link_modifiers)]
+#![feature(native_link_modifiers_bundle)]
+
+#[link(name = "foo", kind = "static", modifiers = "-bundle")]
+extern "C" {}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-3.rs b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-3.rs
new file mode 100644
index 0000000..3da943e
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-3.rs
@@ -0,0 +1,3 @@
+// compile-flags: -l static:-bundle=nonexistent
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-3.stderr b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-3.stderr
new file mode 100644
index 0000000..86ccb4e
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-native_link_modifiers_bundle-3.stderr
@@ -0,0 +1,2 @@
+error: linking modifiers are currently unstable, the `-Z unstable-options` flag must also be passed to use it
+
diff --git a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
index c13c05f..a3bd65e 100644
--- a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
+++ b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
@@ -28,11 +28,11 @@
help: consider turning `static_fn` into a method by giving it a `&self` argument
|
LL | fn static_fn(&self) {}
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `static_fn` so it does not apply to trait objects
|
LL | fn static_fn() where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0038]: the trait `NonObjectSafe3` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:27:39
diff --git a/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs b/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs
deleted file mode 100644
index 80e4aa7..0000000
--- a/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// Test that `#[plugin_registrar]` attribute is gated by `plugin_registrar`
-// feature gate.
-
-// the registration function isn't typechecked yet
-#[plugin_registrar]
-//~^ ERROR compiler plugins are deprecated
-//~| WARN use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated
-pub fn registrar() {}
-//~^ ERROR compiler plugins are experimental and possibly buggy
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr b/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr
deleted file mode 100644
index b3a43f4..0000000
--- a/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0658]: compiler plugins are experimental and possibly buggy
- --> $DIR/feature-gate-plugin_registrar.rs:8:1
- |
-LL | pub fn registrar() {}
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information
- = help: add `#![feature(plugin_registrar)]` to the crate attributes to enable
-
-error[E0658]: compiler plugins are deprecated
- --> $DIR/feature-gate-plugin_registrar.rs:5:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information
- = help: add `#![feature(plugin_registrar)]` to the crate attributes to enable
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/feature-gate-plugin_registrar.rs:5:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
- |
- = note: `#[warn(deprecated)]` on by default
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle-2.rs b/src/test/ui/feature-gates/feature-gate-static-nobundle-2.rs
index b6c8648..ad0662b 100644
--- a/src/test/ui/feature-gates/feature-gate-static-nobundle-2.rs
+++ b/src/test/ui/feature-gates/feature-gate-static-nobundle-2.rs
@@ -1,6 +1,4 @@
-//~ ERROR kind="static-nobundle" is unstable
-// Test the behavior of rustc when non-existent library is statically linked
-
+// check-pass
// compile-flags: -l static-nobundle=nonexistent
fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr b/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr
index 301a1e13..76c317f 100644
--- a/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr
+++ b/src/test/ui/feature-gates/feature-gate-static-nobundle-2.stderr
@@ -1,10 +1,2 @@
warning: library kind `static-nobundle` has been superseded by specifying `-bundle` on library kind `static`. Try `static:-bundle`
-error[E0658]: kind="static-nobundle" is unstable
- |
- = note: see issue #37403 <https://github.com/rust-lang/rust/issues/37403> for more information
- = help: add `#![feature(static_nobundle)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr b/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr
index 9695618..eaf2e0d 100644
--- a/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr
+++ b/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr
@@ -5,10 +5,10 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0658]: kind="static-nobundle" is unstable
- --> $DIR/feature-gate-static-nobundle.rs:1:1
+ --> $DIR/feature-gate-static-nobundle.rs:1:22
|
LL | #[link(name = "foo", kind = "static-nobundle")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #37403 <https://github.com/rust-lang/rust/issues/37403> for more information
= help: add `#![feature(static_nobundle)]` to the crate attributes to enable
diff --git a/src/test/ui/feature-gates/feature-gate-trait_upcasting.rs b/src/test/ui/feature-gates/feature-gate-trait_upcasting.rs
new file mode 100644
index 0000000..e4102f1
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-trait_upcasting.rs
@@ -0,0 +1,13 @@
+trait Foo {}
+
+trait Bar: Foo {}
+
+impl Foo for () {}
+
+impl Bar for () {}
+
+fn main() {
+ let bar: &dyn Bar = &();
+ let foo: &dyn Foo = bar;
+ //~^ ERROR trait upcasting coercion is experimental [E0658]
+}
diff --git a/src/test/ui/feature-gates/feature-gate-trait_upcasting.stderr b/src/test/ui/feature-gates/feature-gate-trait_upcasting.stderr
new file mode 100644
index 0000000..bc13a5d
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-trait_upcasting.stderr
@@ -0,0 +1,12 @@
+error[E0658]: trait upcasting coercion is experimental
+ --> $DIR/feature-gate-trait_upcasting.rs:11:25
+ |
+LL | let foo: &dyn Foo = bar;
+ | ^^^
+ |
+ = note: see issue #65991 <https://github.com/rust-lang/rust/issues/65991> for more information
+ = help: add `#![feature(trait_upcasting)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
index 4fb1cd2..ea82837 100644
--- a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
+++ b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
@@ -1,5 +1,5 @@
// ignore-compare-mode-chalk
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
type Foo = impl Debug;
@@ -13,7 +13,7 @@
type Foo2 = impl Debug;
fn define2() {
- let x = || -> Foo2 { 42 }; //~ ERROR not permitted here
+ let x = || -> Foo2 { 42 };
}
type Foo3 = impl Debug;
diff --git a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr
index 10409d5..da3ddb1 100644
--- a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr
+++ b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr
@@ -10,15 +10,6 @@
= note: expected opaque type `impl Debug`
found type `{integer}`
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/feature-gate-type_alias_impl_trait.rs:16:19
- |
-LL | let x = || -> Foo2 { 42 };
- | ^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-
error[E0308]: mismatched types
--> $DIR/feature-gate-type_alias_impl_trait.rs:23:18
|
@@ -77,7 +68,6 @@
LL | type Foo4 = impl Debug;
| ^^^^^^^^^^
-error: aborting due to 8 previous errors
+error: aborting due to 7 previous errors
-Some errors have detailed explanations: E0308, E0658.
-For more information about an error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/feature-gates/feature-gate-unnamed_fields.rs b/src/test/ui/feature-gates/feature-gate-unnamed_fields.rs
deleted file mode 100644
index bd815db..0000000
--- a/src/test/ui/feature-gates/feature-gate-unnamed_fields.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-struct Foo {
- foo: u8,
- _: union { //~ ERROR unnamed fields are not yet fully implemented [E0658]
- //~^ ERROR unnamed fields are not yet fully implemented [E0658]
- //~| ERROR anonymous unions are unimplemented
- bar: u8,
- baz: u16
- }
-}
-
-union Bar {
- foobar: u8,
- _: struct { //~ ERROR unnamed fields are not yet fully implemented [E0658]
- //~^ ERROR unnamed fields are not yet fully implemented [E0658]
- //~| ERROR anonymous structs are unimplemented
- //~| ERROR unions may not contain fields that need dropping [E0740]
- foobaz: u8,
- barbaz: u16
- }
-}
-
-struct S;
-struct Baz {
- _: S //~ ERROR unnamed fields are not yet fully implemented [E0658]
-}
-
-fn main(){}
diff --git a/src/test/ui/feature-gates/feature-gate-unnamed_fields.stderr b/src/test/ui/feature-gates/feature-gate-unnamed_fields.stderr
deleted file mode 100644
index 4f3ab85..0000000
--- a/src/test/ui/feature-gates/feature-gate-unnamed_fields.stderr
+++ /dev/null
@@ -1,111 +0,0 @@
-error[E0658]: unnamed fields are not yet fully implemented
- --> $DIR/feature-gate-unnamed_fields.rs:3:5
- |
-LL | _: union {
- | ^
- |
- = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
- = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
-
-error[E0658]: unnamed fields are not yet fully implemented
- --> $DIR/feature-gate-unnamed_fields.rs:3:8
- |
-LL | _: union {
- | ________^
-LL | |
-LL | |
-LL | | bar: u8,
-LL | | baz: u16
-LL | | }
- | |_____^
- |
- = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
- = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
-
-error[E0658]: unnamed fields are not yet fully implemented
- --> $DIR/feature-gate-unnamed_fields.rs:13:5
- |
-LL | _: struct {
- | ^
- |
- = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
- = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
-
-error[E0658]: unnamed fields are not yet fully implemented
- --> $DIR/feature-gate-unnamed_fields.rs:13:8
- |
-LL | _: struct {
- | ________^
-LL | |
-LL | |
-LL | |
-LL | | foobaz: u8,
-LL | | barbaz: u16
-LL | | }
- | |_____^
- |
- = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
- = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
-
-error[E0658]: unnamed fields are not yet fully implemented
- --> $DIR/feature-gate-unnamed_fields.rs:24:5
- |
-LL | _: S
- | ^
- |
- = note: see issue #49804 <https://github.com/rust-lang/rust/issues/49804> for more information
- = help: add `#![feature(unnamed_fields)]` to the crate attributes to enable
-
-error: anonymous unions are unimplemented
- --> $DIR/feature-gate-unnamed_fields.rs:3:8
- |
-LL | _: union {
- | ________^
-LL | |
-LL | |
-LL | | bar: u8,
-LL | | baz: u16
-LL | | }
- | |_____^
-
-error: anonymous structs are unimplemented
- --> $DIR/feature-gate-unnamed_fields.rs:13:8
- |
-LL | _: struct {
- | ________^
-LL | |
-LL | |
-LL | |
-LL | | foobaz: u8,
-LL | | barbaz: u16
-LL | | }
- | |_____^
-
-error[E0740]: unions may not contain fields that need dropping
- --> $DIR/feature-gate-unnamed_fields.rs:13:5
- |
-LL | / _: struct {
-LL | |
-LL | |
-LL | |
-LL | | foobaz: u8,
-LL | | barbaz: u16
-LL | | }
- | |_____^
- |
-note: `std::mem::ManuallyDrop` can be used to wrap the type
- --> $DIR/feature-gate-unnamed_fields.rs:13:5
- |
-LL | / _: struct {
-LL | |
-LL | |
-LL | |
-LL | | foobaz: u8,
-LL | | barbaz: u16
-LL | | }
- | |_____^
-
-error: aborting due to 8 previous errors
-
-Some errors have detailed explanations: E0658, E0740.
-For more information about an error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr b/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr
index 3631a03..fbb18c8 100644
--- a/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr
+++ b/src/test/ui/feature-gates/feature-gate-unsized_fn_params.stderr
@@ -9,7 +9,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(x: &dyn Foo) {
- | ^
+ | +
error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
--> $DIR/feature-gate-unsized_fn_params.rs:24:5
diff --git a/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr b/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr
index 0919c2f..c450784 100644
--- a/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr
+++ b/src/test/ui/feature-gates/feature-gate-unsized_locals.stderr
@@ -9,7 +9,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f(f: &dyn FnOnce()) {}
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs b/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs
deleted file mode 100644
index cd348de..0000000
--- a/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// ignore-wasm32-bare compiled with panic=abort by default
-// compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals
-
-#![crate_type = "lib"]
-
-extern "C" {
- // CHECK: Function Attrs: nounwind
- // CHECK-NEXT: declare void @extern_fn
- fn extern_fn();
- // CHECK-NOT: Function Attrs: nounwind
- // CHECK: declare void @unwinding_extern_fn
- #[unwind(allowed)] //~ ERROR the `#[unwind]` attribute is an experimental feature
- fn unwinding_extern_fn();
-}
-
-pub unsafe fn force_declare() {
- extern_fn();
- unwinding_extern_fn();
-}
diff --git a/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr b/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr
deleted file mode 100644
index 8e78955..0000000
--- a/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: the `#[unwind]` attribute is an experimental feature
- --> $DIR/feature-gate-unwind-attributes.rs:12:5
- |
-LL | #[unwind(allowed)]
- | ^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #58760 <https://github.com/rust-lang/rust/issues/58760> for more information
- = help: add `#![feature(unwind_attributes)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs
index d1fbd38..44abe16 100644
--- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs
+++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs
@@ -1,5 +1,5 @@
//~ NOTE: not an `extern crate` item
-//~^ NOTE: not a function or static
+//~^ NOTE: not a free function, impl method or static
//~^^ NOTE: not a function or closure
// This is testing whether various builtin attributes signals an
// error or warning when put in "weird" places.
@@ -25,7 +25,7 @@
#![no_link]
//~^ ERROR: attribute should be applied to an `extern crate` item
#![export_name = "2200"]
-//~^ ERROR: attribute should be applied to a function or static
+//~^ ERROR: attribute should be applied to a free function, impl method or static
#![inline]
//~^ ERROR: attribute should be applied to function or closure
#[inline]
@@ -83,27 +83,37 @@
}
#[export_name = "2200"]
-//~^ ERROR attribute should be applied to a function or static
+//~^ ERROR attribute should be applied to a free function, impl method or static
mod export_name {
- //~^ NOTE not a function or static
+ //~^ NOTE not a free function, impl method or static
mod inner { #![export_name="2200"] }
- //~^ ERROR attribute should be applied to a function or static
- //~| NOTE not a function or static
+ //~^ ERROR attribute should be applied to a free function, impl method or static
+ //~| NOTE not a free function, impl method or static
#[export_name = "2200"] fn f() { }
#[export_name = "2200"] struct S;
- //~^ ERROR attribute should be applied to a function or static
- //~| NOTE not a function or static
+ //~^ ERROR attribute should be applied to a free function, impl method or static
+ //~| NOTE not a free function, impl method or static
#[export_name = "2200"] type T = S;
- //~^ ERROR attribute should be applied to a function or static
- //~| NOTE not a function or static
+ //~^ ERROR attribute should be applied to a free function, impl method or static
+ //~| NOTE not a free function, impl method or static
#[export_name = "2200"] impl S { }
- //~^ ERROR attribute should be applied to a function or static
- //~| NOTE not a function or static
+ //~^ ERROR attribute should be applied to a free function, impl method or static
+ //~| NOTE not a free function, impl method or static
+
+ trait Tr {
+ #[export_name = "2200"] fn foo();
+ //~^ ERROR attribute should be applied to a free function, impl method or static
+ //~| NOTE not a free function, impl method or static
+
+ #[export_name = "2200"] fn bar() {}
+ //~^ ERROR attribute should be applied to a free function, impl method or static
+ //~| NOTE not a free function, impl method or static
+ }
}
#[start]
diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
index ae2c428..aed1312 100644
--- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
+++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
@@ -17,31 +17,31 @@
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
error: `start` attribute can only be used on functions
- --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:109:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:119:1
|
LL | #[start]
| ^^^^^^^^
error: `start` attribute can only be used on functions
- --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:112:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:122:17
|
LL | mod inner { #![start] }
| ^^^^^^^^^
error: `start` attribute can only be used on functions
- --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:117:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:127:5
|
LL | #[start] struct S;
| ^^^^^^^^
error: `start` attribute can only be used on functions
- --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:120:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:130:5
|
LL | #[start] type T = S;
| ^^^^^^^^
error: `start` attribute can only be used on functions
- --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:123:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:133:5
|
LL | #[start] impl S { }
| ^^^^^^^^
@@ -76,7 +76,7 @@
LL | | }
| |_- not an `extern crate` item
-error: attribute should be applied to a function or static
+error: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:85:1
|
LL | #[export_name = "2200"]
@@ -87,9 +87,9 @@
LL | |
LL | | mod inner { #![export_name="2200"] }
... |
-LL | |
+LL | | }
LL | | }
- | |_- not a function or static
+ | |_- not a free function, impl method or static
error: attribute should be applied to an `extern crate` item
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:25:1
@@ -97,7 +97,7 @@
LL | #![no_link]
| ^^^^^^^^^^^
-error: attribute should be applied to a function or static
+error: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:27:1
|
LL | #![export_name = "2200"]
@@ -199,31 +199,43 @@
LL | #[no_link] impl S { }
| ^^^^^^^^^^ ---------- not an `extern crate` item
-error: attribute should be applied to a function or static
+error: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:90:17
|
LL | mod inner { #![export_name="2200"] }
- | ------------^^^^^^^^^^^^^^^^^^^^^^-- not a function or static
+ | ------------^^^^^^^^^^^^^^^^^^^^^^-- not a free function, impl method or static
-error: attribute should be applied to a function or static
+error: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:96:5
|
LL | #[export_name = "2200"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static
+ | ^^^^^^^^^^^^^^^^^^^^^^^ --------- not a free function, impl method or static
-error: attribute should be applied to a function or static
+error: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:100:5
|
LL | #[export_name = "2200"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static
+ | ^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a free function, impl method or static
-error: attribute should be applied to a function or static
+error: attribute should be applied to a free function, impl method or static
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:104:5
|
LL | #[export_name = "2200"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static
+ | ^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a free function, impl method or static
-error: aborting due to 32 previous errors
+error: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:109:9
+ |
+LL | #[export_name = "2200"] fn foo();
+ | ^^^^^^^^^^^^^^^^^^^^^^^ --------- not a free function, impl method or static
+
+error: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:113:9
+ |
+LL | #[export_name = "2200"] fn bar() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a free function, impl method or static
+
+error: aborting due to 34 previous errors
Some errors have detailed explanations: E0518, E0658.
For more information about an error, try `rustc --explain E0518`.
diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
index 19a60f1..97fa775 100644
--- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
+++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs
@@ -35,18 +35,11 @@
// check-pass
-#![feature(test, plugin_registrar)]
+#![feature(test)]
#![warn(unused_attributes, unknown_lints)]
//~^ NOTE the lint level is defined here
//~| NOTE the lint level is defined here
-// Exception, a gated and deprecated attribute.
-
-#![plugin_registrar]
-//~^ WARN unused attribute
-//~| WARN use of deprecated attribute
-//~| HELP may be removed in a future compiler version
-
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
#![warn(x5400)] //~ WARN unknown lint: `x5400`
@@ -56,14 +49,14 @@
#![macro_use] // (allowed if no argument; see issue-43160-gating-of-macro_use.rs)
// skipping testing of cfg
// skipping testing of cfg_attr
-#![should_panic] //~ WARN unused attribute
-#![ignore] //~ WARN unused attribute
+#![should_panic] //~ WARN `#[should_panic]` only has an effect
+#![ignore] //~ WARN `#[ignore]` only has an effect on functions
#![no_implicit_prelude]
#![reexport_test_harness_main = "2900"]
// see gated-link-args.rs
// see issue-43106-gating-of-macro_escape.rs for crate-level; but non crate-level is below at "2700"
// (cannot easily test gating of crate-level #[no_std]; but non crate-level is below at "2600")
-#![proc_macro_derive()] //~ WARN unused attribute
+#![proc_macro_derive()] //~ WARN `#[proc_macro_derive]` only has an effect
#![doc = "2400"]
#![cold] //~ WARN attribute should be applied to a function
//~^ WARN
@@ -90,6 +83,7 @@
#![crate_id = "10"]
//~^ WARN use of deprecated attribute
//~| HELP remove this attribute
+//~| NOTE `#[warn(deprecated)]` on by default
// FIXME(#44232) we should warn that this isn't used.
#![feature(rust1)]
@@ -188,64 +182,35 @@
mod inner { #![macro_use] }
#[macro_use] fn f() { }
- //~^ WARN unused attribute
+ //~^ `#[macro_use]` only has an effect
#[macro_use] struct S;
- //~^ WARN unused attribute
+ //~^ `#[macro_use]` only has an effect
#[macro_use] type T = S;
- //~^ WARN unused attribute
+ //~^ `#[macro_use]` only has an effect
#[macro_use] impl S { }
- //~^ WARN unused attribute
+ //~^ `#[macro_use]` only has an effect
}
#[macro_export]
-//~^ WARN unused attribute
+//~^ WARN `#[macro_export]` only has an effect on macro definitions
mod macro_export {
mod inner { #![macro_export] }
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_export]` only has an effect on macro definitions
#[macro_export] fn f() { }
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_export]` only has an effect on macro definitions
#[macro_export] struct S;
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_export]` only has an effect on macro definitions
#[macro_export] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_export]` only has an effect on macro definitions
#[macro_export] impl S { }
- //~^ WARN unused attribute
-}
-
-#[plugin_registrar]
-//~^ WARN unused attribute
-//~| WARN use of deprecated attribute
-//~| HELP may be removed in a future compiler version
-mod plugin_registrar {
- mod inner { #![plugin_registrar] }
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
- //~| NOTE `#[warn(deprecated)]` on by default
-
- // for `fn f()` case, see gated-plugin_registrar.rs
-
- #[plugin_registrar] struct S;
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
-
- #[plugin_registrar] type T = S;
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
-
- #[plugin_registrar] impl S { }
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
+ //~^ WARN `#[macro_export]` only has an effect on macro definitions
}
// At time of unit test authorship, if compiling without `--test` then
@@ -298,139 +263,146 @@
mod inner { #![path="3800"] }
#[path = "3800"] fn f() { }
- //~^ WARN unused attribute
+ //~^ WARN `#[path]` only has an effect
#[path = "3800"] struct S;
- //~^ WARN unused attribute
+ //~^ WARN `#[path]` only has an effect
#[path = "3800"] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN `#[path]` only has an effect
#[path = "3800"] impl S { }
- //~^ WARN unused attribute
+ //~^ WARN `#[path]` only has an effect
}
#[automatically_derived]
-//~^ WARN unused attribute
+//~^ WARN `#[automatically_derived]` only has an effect
mod automatically_derived {
mod inner { #![automatically_derived] }
- //~^ WARN unused attribute
+ //~^ WARN `#[automatically_derived]
#[automatically_derived] fn f() { }
- //~^ WARN unused attribute
+ //~^ WARN `#[automatically_derived]
#[automatically_derived] struct S;
- //~^ WARN unused attribute
+ //~^ WARN `#[automatically_derived]
#[automatically_derived] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN `#[automatically_derived]
#[automatically_derived] impl S { }
- //~^ WARN unused attribute
}
#[no_mangle]
-//~^ WARN attribute should be applied to a function or static [unused_attributes]
+//~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
mod no_mangle {
- //~^ NOTE not a function or static
+ //~^ NOTE not a free function, impl method or static
mod inner { #![no_mangle] }
- //~^ WARN attribute should be applied to a function or static [unused_attributes]
+ //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- //~| NOTE not a function or static
+ //~| NOTE not a free function, impl method or static
#[no_mangle] fn f() { }
#[no_mangle] struct S;
- //~^ WARN attribute should be applied to a function or static [unused_attributes]
+ //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- //~| NOTE not a function or static
+ //~| NOTE not a free function, impl method or static
#[no_mangle] type T = S;
- //~^ WARN attribute should be applied to a function or static [unused_attributes]
+ //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- //~| NOTE not a function or static
+ //~| NOTE not a free function, impl method or static
#[no_mangle] impl S { }
- //~^ WARN attribute should be applied to a function or static [unused_attributes]
+ //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- //~| NOTE not a function or static
+ //~| NOTE not a free function, impl method or static
+
+ trait Tr {
+ #[no_mangle] fn foo();
+ //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
+ //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ //~| NOTE not a free function, impl method or static
+
+ #[no_mangle] fn bar() {}
+ //~^ WARN attribute should be applied to a free function, impl method or static [unused_attributes]
+ //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ //~| NOTE not a free function, impl method or static
+ }
}
#[should_panic]
-//~^ WARN unused attribute
+//~^ WARN `#[should_panic]` only has an effect on
mod should_panic {
mod inner { #![should_panic] }
- //~^ WARN unused attribute
+ //~^ WARN `#[should_panic]` only has an effect on
#[should_panic] fn f() { }
- //~^ WARN unused attribute
#[should_panic] struct S;
- //~^ WARN unused attribute
+ //~^ WARN `#[should_panic]` only has an effect on
#[should_panic] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN `#[should_panic]` only has an effect on
#[should_panic] impl S { }
- //~^ WARN unused attribute
+ //~^ WARN `#[should_panic]` only has an effect on
}
#[ignore]
-//~^ WARN unused attribute
+//~^ WARN `#[ignore]` only has an effect on functions
mod ignore {
mod inner { #![ignore] }
- //~^ WARN unused attribute
+ //~^ WARN `#[ignore]` only has an effect on functions
#[ignore] fn f() { }
- //~^ WARN unused attribute
#[ignore] struct S;
- //~^ WARN unused attribute
+ //~^ WARN `#[ignore]` only has an effect on functions
#[ignore] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN `#[ignore]` only has an effect on functions
#[ignore] impl S { }
- //~^ WARN unused attribute
+ //~^ WARN `#[ignore]` only has an effect on functions
}
#[no_implicit_prelude]
-//~^ WARN unused attribute
mod no_implicit_prelude {
mod inner { #![no_implicit_prelude] }
- //~^ WARN unused attribute
#[no_implicit_prelude] fn f() { }
- //~^ WARN unused attribute
+ //~^ WARN `#[no_implicit_prelude]` only has an effect
#[no_implicit_prelude] struct S;
- //~^ WARN unused attribute
+ //~^ WARN `#[no_implicit_prelude]` only has an effect
#[no_implicit_prelude] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN `#[no_implicit_prelude]` only has an effect
#[no_implicit_prelude] impl S { }
- //~^ WARN unused attribute
+ //~^ WARN `#[no_implicit_prelude]` only has an effect
}
#[reexport_test_harness_main = "2900"]
-//~^ WARN unused attribute
+//~^ WARN crate-level attribute should be
mod reexport_test_harness_main {
mod inner { #![reexport_test_harness_main="2900"] }
- //~^ WARN unused attribute
+ //~^ WARN crate-level attribute should be
#[reexport_test_harness_main = "2900"] fn f() { }
- //~^ WARN unused attribute
+ //~^ WARN crate-level attribute should be
#[reexport_test_harness_main = "2900"] struct S;
- //~^ WARN unused attribute
+ //~^ WARN crate-level attribute should be
#[reexport_test_harness_main = "2900"] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN crate-level attribute should be
#[reexport_test_harness_main = "2900"] impl S { }
- //~^ WARN unused attribute
+ //~^ WARN crate-level attribute should be
}
// Cannot feed "2700" to `#[macro_escape]` without signaling an error.
@@ -442,41 +414,35 @@
//~| HELP try an outer attribute: `#[macro_use]`
#[macro_escape] fn f() { }
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_escape]` only has an effect
#[macro_escape] struct S;
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_escape]` only has an effect
#[macro_escape] type T = S;
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_escape]` only has an effect
#[macro_escape] impl S { }
- //~^ WARN unused attribute
+ //~^ WARN `#[macro_escape]` only has an effect
}
#[no_std]
-//~^ WARN unused attribute
-//~| WARN crate-level attribute should be an inner attribute
+//~^ WARN crate-level attribute should be an inner attribute
mod no_std {
mod inner { #![no_std] }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be in the root module
+//~^ WARN crate-level attribute should be in the root module
#[no_std] fn f() { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[no_std] struct S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[no_std] type T = S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[no_std] impl S { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
}
// At time of authorship, #[proc_macro_derive = "2500"] signals error
@@ -656,104 +622,80 @@
// BROKEN USES OF CRATE-LEVEL BUILT-IN ATTRIBUTES
#[crate_name = "0900"]
-//~^ WARN unused attribute
-//~| WARN crate-level attribute should be an inner attribute
+//~^ WARN crate-level attribute should be an inner attribute
mod crate_name {
mod inner { #![crate_name="0900"] }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be in the root module
+//~^ WARN crate-level attribute should be in the root module
#[crate_name = "0900"] fn f() { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[crate_name = "0900"] struct S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[crate_name = "0900"] type T = S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[crate_name = "0900"] impl S { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
}
#[crate_type = "0800"]
-//~^ WARN unused attribute
-//~| WARN crate-level attribute should be an inner attribute
+//~^ WARN crate-level attribute should be an inner attribute
mod crate_type {
mod inner { #![crate_type="0800"] }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be in the root module
+//~^ WARN crate-level attribute should be in the root module
#[crate_type = "0800"] fn f() { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[crate_type = "0800"] struct S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[crate_type = "0800"] type T = S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[crate_type = "0800"] impl S { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
}
#[feature(x0600)]
-//~^ WARN unused attribute
-//~| WARN crate-level attribute should be an inner attribute
+//~^ WARN crate-level attribute should be an inner attribute
mod feature {
mod inner { #![feature(x0600)] }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be in the root module
+//~^ WARN crate-level attribute should be in the root module
#[feature(x0600)] fn f() { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[feature(x0600)] struct S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[feature(x0600)] type T = S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[feature(x0600)] impl S { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
}
#[no_main]
-//~^ WARN unused attribute
-//~| WARN crate-level attribute should be an inner attribute
+//~^ WARN crate-level attribute should be an inner attribute
mod no_main_1 {
mod inner { #![no_main] }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be in the root module
+//~^ WARN crate-level attribute should be in the root module
#[no_main] fn f() { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[no_main] struct S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[no_main] type T = S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[no_main] impl S { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
}
#[no_builtins]
@@ -770,53 +712,41 @@
}
#[recursion_limit="0200"]
-//~^ WARN unused attribute
-//~| WARN crate-level attribute should be an inner attribute
+//~^ WARN crate-level attribute should be an inner attribute
mod recursion_limit {
mod inner { #![recursion_limit="0200"] }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be in the root module
+//~^ WARN crate-level attribute should be in the root module
#[recursion_limit="0200"] fn f() { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[recursion_limit="0200"] struct S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[recursion_limit="0200"] type T = S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[recursion_limit="0200"] impl S { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
}
#[type_length_limit="0100"]
-//~^ WARN unused attribute
-//~| WARN crate-level attribute should be an inner attribute
+//~^ WARN crate-level attribute should be an inner attribute
mod type_length_limit {
mod inner { #![type_length_limit="0100"] }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be in the root module
+//~^ WARN crate-level attribute should be in the root module
#[type_length_limit="0100"] fn f() { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[type_length_limit="0100"] struct S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[type_length_limit="0100"] type T = S;
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
#[type_length_limit="0100"] impl S { }
- //~^ WARN unused attribute
- //~| WARN crate-level attribute should be an inner attribute
+ //~^ WARN crate-level attribute should be an inner attribute
}
fn main() {}
diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
index c207c05..214584f 100644
--- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
+++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr
@@ -1,5 +1,5 @@
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:9
|
LL | #![warn(x5400)]
| ^^^^^
@@ -11,169 +11,169 @@
| ^^^^^^^^^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:10
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:10
|
LL | #![allow(x5300)]
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:11
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:47:11
|
LL | #![forbid(x5200)]
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:48:9
|
LL | #![deny(x5100)]
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:110:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:104:8
|
LL | #[warn(x5400)]
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:113:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:107:25
|
LL | mod inner { #![warn(x5400)] }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:110:12
|
LL | #[warn(x5400)] fn f() { }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:113:12
|
LL | #[warn(x5400)] struct S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:122:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:12
|
LL | #[warn(x5400)] type T = S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:125:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:12
|
LL | #[warn(x5400)] impl S { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:129:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:123:9
|
LL | #[allow(x5300)]
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:132:26
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:126:26
|
LL | mod inner { #![allow(x5300)] }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:129:13
|
LL | #[allow(x5300)] fn f() { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:132:13
|
LL | #[allow(x5300)] struct S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:141:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:13
|
LL | #[allow(x5300)] type T = S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:144:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:13
|
LL | #[allow(x5300)] impl S { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:148:10
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:142:10
|
LL | #[forbid(x5200)]
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:151:27
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:145:27
|
LL | mod inner { #![forbid(x5200)] }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:148:14
|
LL | #[forbid(x5200)] fn f() { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:151:14
|
LL | #[forbid(x5200)] struct S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:160:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:14
|
LL | #[forbid(x5200)] type T = S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:163:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:14
|
LL | #[forbid(x5200)] impl S { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:167:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:161:8
|
LL | #[deny(x5100)]
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:170:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:164:25
|
LL | mod inner { #![deny(x5100)] }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:167:12
|
LL | #[deny(x5100)] fn f() { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:170:12
|
LL | #[deny(x5100)] struct S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:12
|
LL | #[deny(x5100)] type T = S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:12
|
LL | #[deny(x5100)] impl S { }
| ^^^^^
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:440:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:412:17
|
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
@@ -181,63 +181,45 @@
= help: try an outer attribute: `#[macro_use]`
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:437:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:409:1
|
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:227:17
- |
-LL | mod inner { #![plugin_registrar] }
- | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
- |
- = note: `#[warn(deprecated)]` on by default
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5
- |
-LL | #[plugin_registrar] struct S;
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
- |
-LL | #[plugin_registrar] type T = S;
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:245:5
- |
-LL | #[plugin_registrar] impl S { }
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:1
- |
-LL | #![plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
warning: use of deprecated attribute `crate_id`: no longer used.
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:90:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:83:1
|
LL | #![crate_id = "10"]
| ^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+ |
+ = note: `#[warn(deprecated)]` on by default
warning: use of deprecated attribute `no_start`: no longer used.
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:99:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:93:1
|
LL | #![no_start]
| ^^^^^^^^^^^^ help: remove this attribute
-warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:332:1
+warning: `#[macro_export]` only has an effect on macro definitions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:197:1
+ |
+LL | #[macro_export]
+ | ^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:39:9
+ |
+LL | #![warn(unused_attributes, unknown_lints)]
+ | ^^^^^^^^^^^^^^^^^
+
+warning: `#[automatically_derived]` only has an effect on items
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:278:1
+ |
+LL | #[automatically_derived]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:296:1
|
LL | #[no_mangle]
| ^^^^^^^^^^^^
@@ -247,19 +229,38 @@
LL | | mod inner { #![no_mangle] }
LL | |
... |
-LL | |
+LL | | }
LL | | }
- | |_- not a function or static
+ | |_- not a free function, impl method or static
|
-note: the lint level is defined here
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:39:9
- |
-LL | #![warn(unused_attributes, unknown_lints)]
- | ^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+warning: `#[should_panic]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:336:1
+ |
+LL | #[should_panic]
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[ignore]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:354:1
+ |
+LL | #[ignore]
+ | ^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:389:1
+ |
+LL | #[reexport_test_harness_main = "2900"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:1
+ |
+LL | #[no_std]
+ | ^^^^^^^^^
+
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:1
|
LL | #[cold]
| ^^^^^^^
@@ -276,7 +277,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:494:1
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
@@ -293,7 +294,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:567:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:533:1
|
LL | #[link_section = "1800"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -309,8 +310,62 @@
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:624:1
+ |
+LL | #[crate_name = "0900"]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:643:1
+ |
+LL | #[crate_type = "0800"]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:1
+ |
+LL | #[feature(x0600)]
+ | ^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:1
+ |
+LL | #[no_main]
+ | ^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:714:1
+ |
+LL | #[recursion_limit="0200"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:733:1
+ |
+LL | #[type_length_limit="0100"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[should_panic]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:1
+ |
+LL | #![should_panic]
+ | ^^^^^^^^^^^^^^^^
+
+warning: `#[ignore]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:1
+ |
+LL | #![ignore]
+ | ^^^^^^^^^^
+
+warning: `#[proc_macro_derive]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
+ |
+LL | #![proc_macro_derive()]
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:61:1
|
LL | #![cold]
| ^^^^^^^^
@@ -318,7 +373,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1
|
LL | #![link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -326,47 +381,321 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:75:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1
|
LL | #![link_section = "1800"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:337:17
+warning: `#[macro_use]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:184:5
+ |
+LL | #[macro_use] fn f() { }
+ | ^^^^^^^^^^^^
+
+warning: `#[macro_use]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:187:5
+ |
+LL | #[macro_use] struct S;
+ | ^^^^^^^^^^^^
+
+warning: `#[macro_use]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:190:5
+ |
+LL | #[macro_use] type T = S;
+ | ^^^^^^^^^^^^
+
+warning: `#[macro_use]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:193:5
+ |
+LL | #[macro_use] impl S { }
+ | ^^^^^^^^^^^^
+
+warning: `#[macro_export]` only has an effect on macro definitions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:200:17
+ |
+LL | mod inner { #![macro_export] }
+ | ^^^^^^^^^^^^^^^^
+
+warning: `#[macro_export]` only has an effect on macro definitions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:203:5
+ |
+LL | #[macro_export] fn f() { }
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[macro_export]` only has an effect on macro definitions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:206:5
+ |
+LL | #[macro_export] struct S;
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[macro_export]` only has an effect on macro definitions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:209:5
+ |
+LL | #[macro_export] type T = S;
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[macro_export]` only has an effect on macro definitions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:5
+ |
+LL | #[macro_export] impl S { }
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[path]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:265:5
+ |
+LL | #[path = "3800"] fn f() { }
+ | ^^^^^^^^^^^^^^^^
+
+warning: `#[path]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:268:5
+ |
+LL | #[path = "3800"] struct S;
+ | ^^^^^^^^^^^^^^^^
+
+warning: `#[path]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5
+ |
+LL | #[path = "3800"] type T = S;
+ | ^^^^^^^^^^^^^^^^
+
+warning: `#[path]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:274:5
+ |
+LL | #[path = "3800"] impl S { }
+ | ^^^^^^^^^^^^^^^^
+
+warning: `#[automatically_derived]` only has an effect on items
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:281:17
+ |
+LL | mod inner { #![automatically_derived] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[automatically_derived]` only has an effect on items
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:284:5
+ |
+LL | #[automatically_derived] fn f() { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[automatically_derived]` only has an effect on items
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:287:5
+ |
+LL | #[automatically_derived] struct S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[automatically_derived]` only has an effect on items
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:290:5
+ |
+LL | #[automatically_derived] type T = S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:301:17
|
LL | mod inner { #![no_mangle] }
- | ------------^^^^^^^^^^^^^-- not a function or static
+ | ------------^^^^^^^^^^^^^-- not a free function, impl method or static
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:308:5
|
LL | #[no_mangle] struct S;
- | ^^^^^^^^^^^^ --------- not a function or static
+ | ^^^^^^^^^^^^ --------- not a free function, impl method or static
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:349:5
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:5
|
LL | #[no_mangle] type T = S;
- | ^^^^^^^^^^^^ ----------- not a function or static
+ | ^^^^^^^^^^^^ ----------- not a free function, impl method or static
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:354:5
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:318:5
|
LL | #[no_mangle] impl S { }
- | ^^^^^^^^^^^^ ---------- not a function or static
+ | ^^^^^^^^^^^^ ---------- not a free function, impl method or static
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:324:9
+ |
+LL | #[no_mangle] fn foo();
+ | ^^^^^^^^^^^^ --------- not a free function, impl method or static
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+
+warning: attribute should be applied to a free function, impl method or static
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:329:9
+ |
+LL | #[no_mangle] fn bar() {}
+ | ^^^^^^^^^^^^ ----------- not a free function, impl method or static
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+
+warning: `#[should_panic]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:17
+ |
+LL | mod inner { #![should_panic] }
+ | ^^^^^^^^^^^^^^^^
+
+warning: `#[should_panic]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5
+ |
+LL | #[should_panic] struct S;
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[should_panic]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:5
+ |
+LL | #[should_panic] type T = S;
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[should_panic]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5
+ |
+LL | #[should_panic] impl S { }
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[ignore]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:357:17
+ |
+LL | mod inner { #![ignore] }
+ | ^^^^^^^^^^
+
+warning: `#[ignore]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:362:5
+ |
+LL | #[ignore] struct S;
+ | ^^^^^^^^^
+
+warning: `#[ignore]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:365:5
+ |
+LL | #[ignore] type T = S;
+ | ^^^^^^^^^
+
+warning: `#[ignore]` only has an effect on functions
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:368:5
+ |
+LL | #[ignore] impl S { }
+ | ^^^^^^^^^
+
+warning: `#[no_implicit_prelude]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:376:5
+ |
+LL | #[no_implicit_prelude] fn f() { }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[no_implicit_prelude]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:5
+ |
+LL | #[no_implicit_prelude] struct S;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[no_implicit_prelude]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:5
+ |
+LL | #[no_implicit_prelude] type T = S;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[no_implicit_prelude]` only has an effect on modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:5
+ |
+LL | #[no_implicit_prelude] impl S { }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:17
+ |
+LL | mod inner { #![reexport_test_harness_main="2900"] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:395:5
+ |
+LL | #[reexport_test_harness_main = "2900"] fn f() { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:5
+ |
+LL | #[reexport_test_harness_main = "2900"] struct S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:5
+ |
+LL | #[reexport_test_harness_main = "2900"] type T = S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5
+ |
+LL | #[reexport_test_harness_main = "2900"] impl S { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: `#[macro_escape]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:416:5
+ |
+LL | #[macro_escape] fn f() { }
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[macro_escape]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:419:5
+ |
+LL | #[macro_escape] struct S;
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[macro_escape]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:5
+ |
+LL | #[macro_escape] type T = S;
+ | ^^^^^^^^^^^^^^^
+
+warning: `#[macro_escape]` only has an effect on `extern crate` and modules
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:425:5
+ |
+LL | #[macro_escape] impl S { }
+ | ^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:17
+ |
+LL | mod inner { #![no_std] }
+ | ^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:435:5
+ |
+LL | #[no_std] fn f() { }
+ | ^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5
+ |
+LL | #[no_std] struct S;
+ | ^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:441:5
+ |
+LL | #[no_std] type T = S;
+ | ^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5
+ |
+LL | #[no_std] impl S { }
+ | ^^^^^^^^^
+
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:471:17
|
LL | mod inner { #![cold] }
| ------------^^^^^^^^-- not a function
@@ -374,7 +703,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:478:5
|
LL | #[cold] struct S;
| ^^^^^^^ --------- not a function
@@ -382,7 +711,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:517:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:5
|
LL | #[cold] type T = S;
| ^^^^^^^ ----------- not a function
@@ -390,7 +719,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:522:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:488:5
|
LL | #[cold] impl S { }
| ^^^^^^^ ---------- not a function
@@ -398,7 +727,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:534:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:5
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
@@ -408,13 +737,13 @@
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
help: try `#[link(name = "1900")]` instead
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:534:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:500:5
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:541:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:507:17
|
LL | mod inner { #![link_name="1900"] }
| ------------^^^^^^^^^^^^^^^^^^^^-- not a foreign function or static
@@ -422,7 +751,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:546:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
|
LL | #[link_name = "1900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
@@ -430,7 +759,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:517:5
|
LL | #[link_name = "1900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^ --------- not a foreign function or static
@@ -438,7 +767,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:556:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:522:5
|
LL | #[link_name = "1900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^ ----------- not a foreign function or static
@@ -446,7 +775,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:561:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5
|
LL | #[link_name = "1900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
@@ -454,7 +783,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:573:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:539:17
|
LL | mod inner { #![link_section="1800"] }
| ------------^^^^^^^^^^^^^^^^^^^^^^^-- not a function or static
@@ -462,7 +791,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:580:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:546:5
|
LL | #[link_section = "1800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static
@@ -470,7 +799,7 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:585:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:5
|
LL | #[link_section = "1800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static
@@ -478,866 +807,200 @@
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:590:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:556:5
|
LL | #[link_section = "1800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:627:17
+ |
+LL | mod inner { #![crate_name="0900"] }
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:630:5
+ |
+LL | #[crate_name = "0900"] fn f() { }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:633:5
+ |
+LL | #[crate_name = "0900"] struct S;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:636:5
+ |
+LL | #[crate_name = "0900"] type T = S;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:639:5
+ |
+LL | #[crate_name = "0900"] impl S { }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:646:17
+ |
+LL | mod inner { #![crate_type="0800"] }
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:649:5
+ |
+LL | #[crate_type = "0800"] fn f() { }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:652:5
+ |
+LL | #[crate_type = "0800"] struct S;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:655:5
+ |
+LL | #[crate_type = "0800"] type T = S;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:5
+ |
+LL | #[crate_type = "0800"] impl S { }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:665:17
+ |
+LL | mod inner { #![feature(x0600)] }
+ | ^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:668:5
+ |
+LL | #[feature(x0600)] fn f() { }
+ | ^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:671:5
+ |
+LL | #[feature(x0600)] struct S;
+ | ^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5
+ |
+LL | #[feature(x0600)] type T = S;
+ | ^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:5
+ |
+LL | #[feature(x0600)] impl S { }
+ | ^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:17
+ |
+LL | mod inner { #![no_main] }
+ | ^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:688:5
+ |
+LL | #[no_main] fn f() { }
+ | ^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
+ |
+LL | #[no_main] struct S;
+ | ^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:694:5
+ |
+LL | #[no_main] type T = S;
+ | ^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:697:5
+ |
+LL | #[no_main] impl S { }
+ | ^^^^^^^^^^
+
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:17
+ |
+LL | mod inner { #![recursion_limit="0200"] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
+ |
+LL | #[recursion_limit="0200"] fn f() { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:5
+ |
+LL | #[recursion_limit="0200"] struct S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:726:5
+ |
+LL | #[recursion_limit="0200"] type T = S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5
+ |
+LL | #[recursion_limit="0200"] impl S { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be in the root module
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:736:17
+ |
+LL | mod inner { #![type_length_limit="0100"] }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:739:5
+ |
+LL | #[type_length_limit="0100"] fn f() { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:5
+ |
+LL | #[type_length_limit="0100"] struct S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
+ |
+LL | #[type_length_limit="0100"] type T = S;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:748:5
+ |
+LL | #[type_length_limit="0100"] impl S { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:95:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:89:12
|
LL | #![feature(rust1)]
| ^^^^^
|
= note: `#[warn(stable_features)]` on by default
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:1
- |
-LL | #![plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
- |
-LL | #![should_panic]
- | ^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1
- |
-LL | #![ignore]
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1
- |
-LL | #![proc_macro_derive()]
- | ^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:190:5
- |
-LL | #[macro_use] fn f() { }
- | ^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:193:5
- |
-LL | #[macro_use] struct S;
- | ^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:196:5
- |
-LL | #[macro_use] type T = S;
- | ^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:199:5
- |
-LL | #[macro_use] impl S { }
- | ^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:203:1
- |
-LL | #[macro_export]
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:206:17
- |
-LL | mod inner { #![macro_export] }
- | ^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:209:5
- |
-LL | #[macro_export] fn f() { }
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:5
- |
-LL | #[macro_export] struct S;
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:215:5
- |
-LL | #[macro_export] type T = S;
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:218:5
- |
-LL | #[macro_export] impl S { }
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:227:17
- |
-LL | mod inner { #![plugin_registrar] }
- | ^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5
- |
-LL | #[plugin_registrar] struct S;
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
- |
-LL | #[plugin_registrar] type T = S;
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:245:5
- |
-LL | #[plugin_registrar] impl S { }
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:300:5
- |
-LL | #[path = "3800"] fn f() { }
- | ^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:5
- |
-LL | #[path = "3800"] struct S;
- | ^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:306:5
- |
-LL | #[path = "3800"] type T = S;
- | ^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:309:5
- |
-LL | #[path = "3800"] impl S { }
- | ^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:1
- |
-LL | #[automatically_derived]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:17
- |
-LL | mod inner { #![automatically_derived] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:319:5
- |
-LL | #[automatically_derived] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:322:5
- |
-LL | #[automatically_derived] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:325:5
- |
-LL | #[automatically_derived] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:5
- |
-LL | #[automatically_derived] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:360:1
- |
-LL | #[should_panic]
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:363:17
- |
-LL | mod inner { #![should_panic] }
- | ^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:5
- |
-LL | #[should_panic] fn f() { }
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:369:5
- |
-LL | #[should_panic] struct S;
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:5
- |
-LL | #[should_panic] type T = S;
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:5
- |
-LL | #[should_panic] impl S { }
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:1
- |
-LL | #[ignore]
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:17
- |
-LL | mod inner { #![ignore] }
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:5
- |
-LL | #[ignore] fn f() { }
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:5
- |
-LL | #[ignore] struct S;
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:5
- |
-LL | #[ignore] type T = S;
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:5
- |
-LL | #[ignore] impl S { }
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:1
- |
-LL | #[no_implicit_prelude]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:17
- |
-LL | mod inner { #![no_implicit_prelude] }
- | ^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5
- |
-LL | #[no_implicit_prelude] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:5
- |
-LL | #[no_implicit_prelude] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:410:5
- |
-LL | #[no_implicit_prelude] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:5
- |
-LL | #[no_implicit_prelude] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:1
- |
-LL | #[reexport_test_harness_main = "2900"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:17
- |
-LL | mod inner { #![reexport_test_harness_main="2900"] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5
- |
-LL | #[reexport_test_harness_main = "2900"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5
- |
-LL | #[reexport_test_harness_main = "2900"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5
- |
-LL | #[reexport_test_harness_main = "2900"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5
- |
-LL | #[reexport_test_harness_main = "2900"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5
- |
-LL | #[macro_escape] fn f() { }
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5
- |
-LL | #[macro_escape] struct S;
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:5
- |
-LL | #[macro_escape] type T = S;
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:453:5
- |
-LL | #[macro_escape] impl S { }
- | ^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:1
- |
-LL | #[no_std]
- | ^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:1
- |
-LL | #[no_std]
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:17
- |
-LL | mod inner { #![no_std] }
- | ^^^^^^^^^^
-
-warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:17
- |
-LL | mod inner { #![no_std] }
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5
- |
-LL | #[no_std] fn f() { }
- | ^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5
- |
-LL | #[no_std] fn f() { }
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:5
- |
-LL | #[no_std] struct S;
- | ^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:5
- |
-LL | #[no_std] struct S;
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:5
- |
-LL | #[no_std] type T = S;
- | ^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:5
- |
-LL | #[no_std] type T = S;
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:5
- |
-LL | #[no_std] impl S { }
- | ^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:5
- |
-LL | #[no_std] impl S { }
- | ^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:1
- |
-LL | #[crate_name = "0900"]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:1
- |
-LL | #[crate_name = "0900"]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:17
- |
-LL | mod inner { #![crate_name="0900"] }
- | ^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:17
- |
-LL | mod inner { #![crate_name="0900"] }
- | ^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5
- |
-LL | #[crate_name = "0900"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5
- |
-LL | #[crate_name = "0900"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5
- |
-LL | #[crate_name = "0900"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5
- |
-LL | #[crate_name = "0900"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5
- |
-LL | #[crate_name = "0900"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5
- |
-LL | #[crate_name = "0900"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:5
- |
-LL | #[crate_name = "0900"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:5
- |
-LL | #[crate_name = "0900"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:1
- |
-LL | #[crate_type = "0800"]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:1
- |
-LL | #[crate_type = "0800"]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:17
- |
-LL | mod inner { #![crate_type="0800"] }
- | ^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:17
- |
-LL | mod inner { #![crate_type="0800"] }
- | ^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
- |
-LL | #[crate_type = "0800"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
- |
-LL | #[crate_type = "0800"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
- |
-LL | #[crate_type = "0800"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
- |
-LL | #[crate_type = "0800"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
- |
-LL | #[crate_type = "0800"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
- |
-LL | #[crate_type = "0800"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
- |
-LL | #[crate_type = "0800"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
- |
-LL | #[crate_type = "0800"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:1
- |
-LL | #[feature(x0600)]
- | ^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:1
- |
-LL | #[feature(x0600)]
- | ^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:17
- |
-LL | mod inner { #![feature(x0600)] }
- | ^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:17
- |
-LL | mod inner { #![feature(x0600)] }
- | ^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
- |
-LL | #[feature(x0600)] fn f() { }
- | ^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
- |
-LL | #[feature(x0600)] fn f() { }
- | ^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
- |
-LL | #[feature(x0600)] struct S;
- | ^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
- |
-LL | #[feature(x0600)] struct S;
- | ^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
- |
-LL | #[feature(x0600)] type T = S;
- | ^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
- |
-LL | #[feature(x0600)] type T = S;
- | ^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
- |
-LL | #[feature(x0600)] impl S { }
- | ^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
- |
-LL | #[feature(x0600)] impl S { }
- | ^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:1
- |
-LL | #[no_main]
- | ^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:1
- |
-LL | #[no_main]
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:17
- |
-LL | mod inner { #![no_main] }
- | ^^^^^^^^^^^
-
-warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:17
- |
-LL | mod inner { #![no_main] }
- | ^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:5
- |
-LL | #[no_main] fn f() { }
- | ^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:5
- |
-LL | #[no_main] fn f() { }
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5
- |
-LL | #[no_main] struct S;
- | ^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5
- |
-LL | #[no_main] struct S;
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
- |
-LL | #[no_main] type T = S;
- | ^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
- |
-LL | #[no_main] type T = S;
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:5
- |
-LL | #[no_main] impl S { }
- | ^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:5
- |
-LL | #[no_main] impl S { }
- | ^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:1
- |
-LL | #[recursion_limit="0200"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:1
- |
-LL | #[recursion_limit="0200"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:17
- |
-LL | mod inner { #![recursion_limit="0200"] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:17
- |
-LL | mod inner { #![recursion_limit="0200"] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5
- |
-LL | #[recursion_limit="0200"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5
- |
-LL | #[recursion_limit="0200"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5
- |
-LL | #[recursion_limit="0200"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5
- |
-LL | #[recursion_limit="0200"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5
- |
-LL | #[recursion_limit="0200"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5
- |
-LL | #[recursion_limit="0200"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5
- |
-LL | #[recursion_limit="0200"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5
- |
-LL | #[recursion_limit="0200"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:1
- |
-LL | #[type_length_limit="0100"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:1
- |
-LL | #[type_length_limit="0100"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:17
- |
-LL | mod inner { #![type_length_limit="0100"] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:17
- |
-LL | mod inner { #![type_length_limit="0100"] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:5
- |
-LL | #[type_length_limit="0100"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:5
- |
-LL | #[type_length_limit="0100"] fn f() { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
- |
-LL | #[type_length_limit="0100"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
- |
-LL | #[type_length_limit="0100"] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
- |
-LL | #[type_length_limit="0100"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
- |
-LL | #[type_length_limit="0100"] type T = S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
- |
-LL | #[type_length_limit="0100"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
- |
-LL | #[type_length_limit="0100"] impl S { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: 205 warnings emitted
+warning: 148 warnings emitted
diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-macro_use.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-macro_use.stderr
index 7f6d608..c0d2df3 100644
--- a/src/test/ui/feature-gates/issue-43106-gating-of-macro_use.stderr
+++ b/src/test/ui/feature-gates/issue-43106-gating-of-macro_use.stderr
@@ -25,9 +25,9 @@
help: the following are the possible correct uses
|
LL | #[macro_use] struct S;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
LL | #[macro_use(name1, name2, ...)] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/float-literal-inference-restrictions.stderr b/src/test/ui/float-literal-inference-restrictions.stderr
index 62ca8dc..263b5e5 100644
--- a/src/test/ui/float-literal-inference-restrictions.stderr
+++ b/src/test/ui/float-literal-inference-restrictions.stderr
@@ -19,7 +19,7 @@
help: change the type of the numeric literal from `f64` to `f32`
|
LL | let y: f32 = 1f32;
- | ^^^^
+ | ~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/fmt/format-string-error-2.rs b/src/test/ui/fmt/format-string-error-2.rs
index 69fed2c..1f7f0d8 100644
--- a/src/test/ui/fmt/format-string-error-2.rs
+++ b/src/test/ui/fmt/format-string-error-2.rs
@@ -5,7 +5,7 @@
a");
//~^ ERROR invalid format string
format!("{ \
-
+ \
b");
//~^ ERROR invalid format string
format!(r#"{ \
@@ -38,12 +38,12 @@
{ \
\
b \
-
+ \
");
//~^^^ ERROR invalid format string
format!(r#"
raw { \
-
+ \
c"#);
//~^^^ ERROR invalid format string
format!(r#"
diff --git a/src/test/ui/fmt/format-string-error-2.stderr b/src/test/ui/fmt/format-string-error-2.stderr
index c421fe4..76cdfbb 100644
--- a/src/test/ui/fmt/format-string-error-2.stderr
+++ b/src/test/ui/fmt/format-string-error-2.stderr
@@ -19,7 +19,7 @@
|
LL | format!("{ \
| - because of this opening brace
-LL |
+LL | \
LL | b");
| ^ expected `}` in format string
|
diff --git a/src/test/ui/fmt/ifmt-bad-format-args.stderr b/src/test/ui/fmt/ifmt-bad-format-args.stderr
index d117f32..854abb9 100644
--- a/src/test/ui/fmt/ifmt-bad-format-args.stderr
+++ b/src/test/ui/fmt/ifmt-bad-format-args.stderr
@@ -15,7 +15,7 @@
help: you might be missing a string literal to format with
|
LL | format_args!("{}", || {});
- | ^^^^^
+ | +++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/fmt/send-sync.stderr b/src/test/ui/fmt/send-sync.stderr
index 780c711..7c7a3c8 100644
--- a/src/test/ui/fmt/send-sync.stderr
+++ b/src/test/ui/fmt/send-sync.stderr
@@ -1,9 +1,6 @@
error[E0277]: `core::fmt::Opaque` cannot be shared between threads safely
--> $DIR/send-sync.rs:8:5
|
-LL | fn send<T: Send>(_: T) {}
- | ---- required by this bound in `send`
-...
LL | send(format_args!("{:?}", c));
| ^^^^ `core::fmt::Opaque` cannot be shared between threads safely
|
@@ -13,13 +10,15 @@
= note: required because it appears within the type `[ArgumentV1<'_>]`
= note: required because of the requirements on the impl of `Send` for `&[ArgumentV1<'_>]`
= note: required because it appears within the type `Arguments<'_>`
+note: required by a bound in `send`
+ --> $DIR/send-sync.rs:1:12
+ |
+LL | fn send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `send`
error[E0277]: `core::fmt::Opaque` cannot be shared between threads safely
--> $DIR/send-sync.rs:9:5
|
-LL | fn sync<T: Sync>(_: T) {}
- | ---- required by this bound in `sync`
-...
LL | sync(format_args!("{:?}", c));
| ^^^^ `core::fmt::Opaque` cannot be shared between threads safely
|
@@ -29,6 +28,11 @@
= note: required because it appears within the type `[ArgumentV1<'_>]`
= note: required because it appears within the type `&[ArgumentV1<'_>]`
= note: required because it appears within the type `Arguments<'_>`
+note: required by a bound in `sync`
+ --> $DIR/send-sync.rs:2:12
+ |
+LL | fn sync<T: Sync>(_: T) {}
+ | ^^^^ required by this bound in `sync`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/fn/fn-compare-mismatch.stderr b/src/test/ui/fn/fn-compare-mismatch.stderr
index 326418e..585f556 100644
--- a/src/test/ui/fn/fn-compare-mismatch.stderr
+++ b/src/test/ui/fn/fn-compare-mismatch.stderr
@@ -9,11 +9,11 @@
help: you might have forgotten to call this function
|
LL | let x = f() == g;
- | ^^^
+ | ~~~
help: you might have forgotten to call this function
|
LL | let x = f == g();
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/fn-compare-mismatch.rs:4:18
diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr
index 5b63b8e..57a25b8 100644
--- a/src/test/ui/fn/fn-trait-formatting.stderr
+++ b/src/test/ui/fn/fn-trait-formatting.stderr
@@ -34,13 +34,15 @@
error[E0277]: expected a `Fn<(isize,)>` closure, found `{integer}`
--> $DIR/fn-trait-formatting.rs:19:14
|
-LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
- | ------------------ required by this bound in `needs_fn`
-...
LL | needs_fn(1);
| ^ expected an `Fn<(isize,)>` closure, found `{integer}`
|
= help: the trait `Fn<(isize,)>` is not implemented for `{integer}`
+note: required by a bound in `needs_fn`
+ --> $DIR/fn-trait-formatting.rs:3:31
+ |
+LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
+ | ^^^^^^^^^^^^^^^^^^ required by this bound in `needs_fn`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/foreign-fn-return-lifetime.stderr b/src/test/ui/foreign-fn-return-lifetime.stderr
index feecb6d..b174766 100644
--- a/src/test/ui/foreign-fn-return-lifetime.stderr
+++ b/src/test/ui/foreign-fn-return-lifetime.stderr
@@ -8,7 +8,7 @@
help: consider using the `'static` lifetime
|
LL | pub fn f() -> &'static u8;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generator/auto-trait-regions.nll.stderr b/src/test/ui/generator/auto-trait-regions.nll.stderr
index 794369a..76970fb 100644
--- a/src/test/ui/generator/auto-trait-regions.nll.stderr
+++ b/src/test/ui/generator/auto-trait-regions.nll.stderr
@@ -24,17 +24,23 @@
|
= note: consider using a `let` binding to create a longer lived value
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:31:5
|
LL | assert_foo(gen);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`...
+ = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef`
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:50:5
|
LL | assert_foo(gen);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
+ = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr
index 5043a3b..62a7b37 100644
--- a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr
+++ b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr
@@ -1,11 +1,6 @@
error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 19:6] as Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 19:6]`
--> $DIR/generator-yielding-or-returning-itself.rs:15:5
|
-LL | pub fn want_cyclic_generator_return<T>(_: T)
- | ---------------------------- required by a bound in this
-LL | where T: Generator<Yield = (), Return = T>
- | ---------- required by this bound in `want_cyclic_generator_return`
-...
LL | want_cyclic_generator_return(|| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
|
@@ -13,15 +8,17 @@
this error may be the result of a recent compiler bug-fix,
see issue #46062 <https://github.com/rust-lang/rust/issues/46062>
for more information
+note: required by a bound in `want_cyclic_generator_return`
+ --> $DIR/generator-yielding-or-returning-itself.rs:10:36
+ |
+LL | pub fn want_cyclic_generator_return<T>(_: T)
+ | ---------------------------- required by a bound in this
+LL | where T: Generator<Yield = (), Return = T>
+ | ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return`
error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6] as Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6]`
--> $DIR/generator-yielding-or-returning-itself.rs:28:5
|
-LL | pub fn want_cyclic_generator_yield<T>(_: T)
- | --------------------------- required by a bound in this
-LL | where T: Generator<Yield = T, Return = ()>
- | --------- required by this bound in `want_cyclic_generator_yield`
-...
LL | want_cyclic_generator_yield(|| {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
|
@@ -29,6 +26,13 @@
this error may be the result of a recent compiler bug-fix,
see issue #46062 <https://github.com/rust-lang/rust/issues/46062>
for more information
+note: required by a bound in `want_cyclic_generator_yield`
+ --> $DIR/generator-yielding-or-returning-itself.rs:23:24
+ |
+LL | pub fn want_cyclic_generator_yield<T>(_: T)
+ | --------------------------- required by a bound in this
+LL | where T: Generator<Yield = T, Return = ()>
+ | ^^^^^^^^^ required by this bound in `want_cyclic_generator_yield`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generator/issue-68112.stderr b/src/test/ui/generator/issue-68112.stderr
index 46d27ba..c3fc8dd 100644
--- a/src/test/ui/generator/issue-68112.stderr
+++ b/src/test/ui/generator/issue-68112.stderr
@@ -1,9 +1,6 @@
error: generator cannot be sent between threads safely
--> $DIR/issue-68112.rs:33:5
|
-LL | fn require_send(_: impl Send) {}
- | ---- required by this bound in `require_send`
-...
LL | require_send(send_gen);
| ^^^^^^^^^^^^ generator is not `Send`
|
@@ -17,13 +14,15 @@
| ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
LL | };
| - `_non_send_gen` is later dropped here
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:22:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
--> $DIR/issue-68112.rs:52:5
|
-LL | fn require_send(_: impl Send) {}
- | ---- required by this bound in `require_send`
-...
LL | require_send(send_gen);
| ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
@@ -34,6 +33,11 @@
= note: required because it appears within the type `impl Generator`
= note: required because it appears within the type `{impl Generator, ()}`
= note: required because it appears within the type `[generator@$DIR/issue-68112.rs:48:20: 51:6]`
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:22:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generator/layout-error.full_tait.stderr b/src/test/ui/generator/layout-error.full_tait.stderr
deleted file mode 100644
index bf647d0..0000000
--- a/src/test/ui/generator/layout-error.full_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0425]: cannot find value `Foo` in this scope
- --> $DIR/layout-error.rs:24:17
- |
-LL | let a = Foo;
- | ^^^ not found in this scope
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/layout-error.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/generator/layout-error.min_tait.stderr b/src/test/ui/generator/layout-error.min_tait.stderr
deleted file mode 100644
index ed31c26..0000000
--- a/src/test/ui/generator/layout-error.min_tait.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0425]: cannot find value `Foo` in this scope
- --> $DIR/layout-error.rs:24:17
- |
-LL | let a = Foo;
- | ^^^ not found in this scope
-
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/layout-error.rs:30:27
- |
-LL | Task::spawn(&POOL, || cb());
- | ^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0425, E0658.
-For more information about an error, try `rustc --explain E0425`.
diff --git a/src/test/ui/generator/layout-error.rs b/src/test/ui/generator/layout-error.rs
index a5efc38..7c3d187 100644
--- a/src/test/ui/generator/layout-error.rs
+++ b/src/test/ui/generator/layout-error.rs
@@ -3,10 +3,7 @@
//
// edition:2018
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::future::Future;
pub struct Task<F: Future>(F);
@@ -27,5 +24,5 @@
type F = impl Future;
// Check that statics are inhabited computes they layout.
static POOL: Task<F> = Task::new();
- Task::spawn(&POOL, || cb()); //[min_tait]~ ERROR type alias impl trait is not permitted here
+ Task::spawn(&POOL, || cb());
}
diff --git a/src/test/ui/generator/layout-error.stderr b/src/test/ui/generator/layout-error.stderr
new file mode 100644
index 0000000..b1a258f
--- /dev/null
+++ b/src/test/ui/generator/layout-error.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `Foo` in this scope
+ --> $DIR/layout-error.rs:21:17
+ |
+LL | let a = Foo;
+ | ^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/generator/metadata-sufficient-for-layout.full_tait.stderr b/src/test/ui/generator/metadata-sufficient-for-layout.full_tait.stderr
deleted file mode 100644
index 1e609e8..0000000
--- a/src/test/ui/generator/metadata-sufficient-for-layout.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/metadata-sufficient-for-layout.rs:10:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: fatal error triggered by #[rustc_error]
- --> $DIR/metadata-sufficient-for-layout.rs:28:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/generator/metadata-sufficient-for-layout.min_tait.stderr b/src/test/ui/generator/metadata-sufficient-for-layout.min_tait.stderr
deleted file mode 100644
index 52d42fd..0000000
--- a/src/test/ui/generator/metadata-sufficient-for-layout.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
- --> $DIR/metadata-sufficient-for-layout.rs:28:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/generator/metadata-sufficient-for-layout.rs b/src/test/ui/generator/metadata-sufficient-for-layout.rs
index c013545..d0e648e 100644
--- a/src/test/ui/generator/metadata-sufficient-for-layout.rs
+++ b/src/test/ui/generator/metadata-sufficient-for-layout.rs
@@ -5,10 +5,7 @@
//
// aux-build:metadata-sufficient-for-layout.rs
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait, rustc_attrs)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait, rustc_attrs)]
#![feature(generator_trait)]
extern crate metadata_sufficient_for_layout;
diff --git a/src/test/ui/generator/metadata-sufficient-for-layout.stderr b/src/test/ui/generator/metadata-sufficient-for-layout.stderr
new file mode 100644
index 0000000..3488b04
--- /dev/null
+++ b/src/test/ui/generator/metadata-sufficient-for-layout.stderr
@@ -0,0 +1,8 @@
+error: fatal error triggered by #[rustc_error]
+ --> $DIR/metadata-sufficient-for-layout.rs:25:1
+ |
+LL | fn main() {}
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/generator/not-send-sync.stderr b/src/test/ui/generator/not-send-sync.stderr
index 448cb2a..4d2faa1 100644
--- a/src/test/ui/generator/not-send-sync.stderr
+++ b/src/test/ui/generator/not-send-sync.stderr
@@ -1,22 +1,21 @@
error[E0277]: `Cell<i32>` cannot be shared between threads safely
--> $DIR/not-send-sync.rs:16:5
|
-LL | fn assert_send<T: Send>(_: T) {}
- | ---- required by this bound in `assert_send`
-...
LL | assert_send(|| {
| ^^^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
= note: required because of the requirements on the impl of `Send` for `&Cell<i32>`
= note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:16:17: 20:6]`
+note: required by a bound in `assert_send`
+ --> $DIR/not-send-sync.rs:7:23
+ |
+LL | fn assert_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `assert_send`
error: generator cannot be shared between threads safely
--> $DIR/not-send-sync.rs:9:5
|
-LL | fn assert_sync<T: Sync>(_: T) {}
- | ---- required by this bound in `assert_sync`
-...
LL | assert_sync(|| {
| ^^^^^^^^^^^ generator is not `Sync`
|
@@ -30,6 +29,11 @@
| ^^^^^ yield occurs here, with `a` maybe used later
LL | });
| - `a` is later dropped here
+note: required by a bound in `assert_sync`
+ --> $DIR/not-send-sync.rs:6:23
+ |
+LL | fn assert_sync<T: Sync>(_: T) {}
+ | ^^^^ required by this bound in `assert_sync`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generator/print/generator-print-verbose-1.stderr b/src/test/ui/generator/print/generator-print-verbose-1.stderr
index bd0d27f..53f0936 100644
--- a/src/test/ui/generator/print/generator-print-verbose-1.stderr
+++ b/src/test/ui/generator/print/generator-print-verbose-1.stderr
@@ -1,9 +1,6 @@
error: generator cannot be sent between threads safely
--> $DIR/generator-print-verbose-1.rs:37:5
|
-LL | fn require_send(_: impl Send) {}
- | ---- required by this bound in `require_send`
-...
LL | require_send(send_gen);
| ^^^^^^^^^^^^ generator is not `Send`
|
@@ -17,13 +14,15 @@
| ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
LL | };
| - `_non_send_gen` is later dropped here
+note: required by a bound in `require_send`
+ --> $DIR/generator-print-verbose-1.rs:26:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
--> $DIR/generator-print-verbose-1.rs:56:5
|
-LL | fn require_send(_: impl Send) {}
- | ---- required by this bound in `require_send`
-...
LL | require_send(send_gen);
| ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
@@ -34,6 +33,11 @@
= note: required because it appears within the type `Opaque(DefId(0:42 ~ generator_print_verbose_1[70c9]::make_non_send_generator2::{opaque#0}), [])`
= note: required because it appears within the type `{Opaque(DefId(0:42 ~ generator_print_verbose_1[70c9]::make_non_send_generator2::{opaque#0}), []), ()}`
= note: required because it appears within the type `[test2::{closure#0} upvar_tys=() {Opaque(DefId(0:42 ~ generator_print_verbose_1[70c9]::make_non_send_generator2::{opaque#0}), []), ()}]`
+note: required by a bound in `require_send`
+ --> $DIR/generator-print-verbose-1.rs:26:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generator/print/generator-print-verbose-2.stderr b/src/test/ui/generator/print/generator-print-verbose-2.stderr
index d590f87..fb2a575 100644
--- a/src/test/ui/generator/print/generator-print-verbose-2.stderr
+++ b/src/test/ui/generator/print/generator-print-verbose-2.stderr
@@ -1,22 +1,21 @@
error[E0277]: `Cell<i32>` cannot be shared between threads safely
--> $DIR/generator-print-verbose-2.rs:19:5
|
-LL | fn assert_send<T: Send>(_: T) {}
- | ---- required by this bound in `assert_send`
-...
LL | assert_send(|| {
| ^^^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
= note: required because of the requirements on the impl of `Send` for `&'_#4r Cell<i32>`
= note: required because it appears within the type `[main::{closure#1} upvar_tys=(&'_#4r Cell<i32>) _#17t]`
+note: required by a bound in `assert_send`
+ --> $DIR/generator-print-verbose-2.rs:10:23
+ |
+LL | fn assert_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `assert_send`
error: generator cannot be shared between threads safely
--> $DIR/generator-print-verbose-2.rs:12:5
|
-LL | fn assert_sync<T: Sync>(_: T) {}
- | ---- required by this bound in `assert_sync`
-...
LL | assert_sync(|| {
| ^^^^^^^^^^^ generator is not `Sync`
|
@@ -30,6 +29,11 @@
| ^^^^^ yield occurs here, with `a` maybe used later
LL | });
| - `a` is later dropped here
+note: required by a bound in `assert_sync`
+ --> $DIR/generator-print-verbose-2.rs:9:23
+ |
+LL | fn assert_sync<T: Sync>(_: T) {}
+ | ^^^^ required by this bound in `assert_sync`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generator/resume-arg-late-bound.nll.stderr b/src/test/ui/generator/resume-arg-late-bound.nll.stderr
index 7d71219..25bc6af 100644
--- a/src/test/ui/generator/resume-arg-late-bound.nll.stderr
+++ b/src/test/ui/generator/resume-arg-late-bound.nll.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/resume-arg-late-bound.rs:15:5
|
LL | test(gen);
- | ^^^^^^^^^
+ | ^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected type `for<'a> Generator<&'a mut bool>`
+ found type `Generator<&mut bool>`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/generator/sized-yield.stderr b/src/test/ui/generator/sized-yield.stderr
index 8e3c2f67..ea2a48d 100644
--- a/src/test/ui/generator/sized-yield.stderr
+++ b/src/test/ui/generator/sized-yield.stderr
@@ -16,13 +16,13 @@
|
LL | Pin::new(&mut gen).resume(());
| ^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/ops/generator.rs:LL:COL
- |
-LL | pub enum GeneratorState<Y, R> {
- | - required by this bound in `GeneratorState`
|
= help: the trait `Sized` is not implemented for `str`
+note: required by a bound in `GeneratorState`
+ --> $SRC_DIR/core/src/ops/generator.rs:LL:COL
+ |
+LL | pub enum GeneratorState<Y, R> {
+ | ^ required by this bound in `GeneratorState`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generator/static-not-unpin.stderr b/src/test/ui/generator/static-not-unpin.stderr
index 74ac53a..7ae128d 100644
--- a/src/test/ui/generator/static-not-unpin.stderr
+++ b/src/test/ui/generator/static-not-unpin.stderr
@@ -1,13 +1,15 @@
error[E0277]: `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6]` cannot be unpinned
--> $DIR/static-not-unpin.rs:14:18
|
-LL | fn assert_unpin<T: Unpin>(_: T) {
- | ----- required by this bound in `assert_unpin`
-...
LL | assert_unpin(generator);
| ^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6]`
|
= note: consider using `Box::pin`
+note: required by a bound in `assert_unpin`
+ --> $DIR/static-not-unpin.rs:7:20
+ |
+LL | fn assert_unpin<T: Unpin>(_: T) {
+ | ^^^^^ required by this bound in `assert_unpin`
error: aborting due to previous error
diff --git a/src/test/ui/generator/yielding-in-match-guards.rs b/src/test/ui/generator/yielding-in-match-guards.rs
index 5c10a7c..4e89fc9 100644
--- a/src/test/ui/generator/yielding-in-match-guards.rs
+++ b/src/test/ui/generator/yielding-in-match-guards.rs
@@ -11,7 +11,6 @@
// of the underlying generator.
#![feature(if_let_guard)]
-#![allow(incomplete_features)]
async fn f() -> u8 { 1 }
async fn foo() -> [bool; 10] { [false; 10] }
diff --git a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr
index ad02202..957ae5d 100644
--- a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr
+++ b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr
@@ -11,7 +11,7 @@
help: consider constraining the associated type `<T as X>::Y<i32>` to `Vec<i32>`
|
LL | fn f<T: X<Y<i32> = Vec<i32>>>(a: T::Y<i32>) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr
index d96c5f4..d6716ca 100644
--- a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr
+++ b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr
@@ -3,11 +3,12 @@
|
LL | type Bar = ();
| ^^^^^^^^^^^^^^ the trait `AsRef<()>` is not implemented for `()`
- |
- ::: $DIR/auxiliary/foo_defn.rs:6:15
+ |
+note: required by a bound in `foo_defn::Foo::Bar`
+ --> $DIR/auxiliary/foo_defn.rs:6:15
|
LL | type Bar: AsRef<()>;
- | --------- required by this bound in `foo_defn::Foo::Bar`
+ | ^^^^^^^^^ required by this bound in `foo_defn::Foo::Bar`
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr
index 310f722..e82cbf7 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr
+++ b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr
@@ -15,7 +15,7 @@
help: consider introducing a named lifetime parameter
|
LL | type F<'a, T1> = &'a [u8];
- | ^^^ ^^^
+ | +++ ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
index 9b63e8f..aeb9238 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
+++ b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> {
- | ^^^^^
+ | ~~~~~
error[E0107]: missing generics for associated type `X::Y`
--> $DIR/gat-trait-path-missing-lifetime.rs:10:20
@@ -28,7 +28,7 @@
help: add missing lifetime argument
|
LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> {
- | ^^^^^
+ | ~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
index d6fba8b..5e0f98c 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
+++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
@@ -18,7 +18,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/gat-trait-path-parenthesised-args.rs:7:27
@@ -34,7 +34,7 @@
help: add missing lifetime argument
|
LL | fn foo<'a>(arg: Box<dyn X<Y('a, 'a) = &'a ()>>) {}
- | ^^^
+ | +++
error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/gat-trait-path-parenthesised-args.rs:7:27
diff --git a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr
index d652654..99a6010 100644
--- a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr
+++ b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr
@@ -8,7 +8,7 @@
help: consider restricting type parameter `T`
|
LL | type Assoc2<T: std::fmt::Display> = Vec<T>;
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0276]: impl has stricter requirements than trait
--> $DIR/generic-associated-types-where.rs:22:5
diff --git a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr
index e87176e..adbd47a 100644
--- a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr
+++ b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr
@@ -8,11 +8,11 @@
help: consider introducing lifetime `'b` here
|
LL | trait Iterable<'b> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | type Iter<'b, 'a>: Iterator<Item = Self::Item<'a>>
- | ^^^
+ | +++
error[E0261]: use of undeclared lifetime name `'undeclared`
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:41
@@ -24,11 +24,11 @@
help: consider introducing lifetime `'undeclared` here
|
LL | trait Iterable<'undeclared> {
- | ^^^^^^^^^^^^^
+ | +++++++++++++
help: consider introducing lifetime `'undeclared` here
|
LL | fn iter<'undeclared, 'a>(&'a self) -> Self::Iter<'undeclared>;
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr
index 585ba16..8cf923c 100644
--- a/src/test/ui/generic-associated-types/impl_bounds.stderr
+++ b/src/test/ui/generic-associated-types/impl_bounds.stderr
@@ -64,7 +64,7 @@
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/impl_bounds.rs:22:5
@@ -89,7 +89,7 @@
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 5 previous errors
diff --git a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr
index 7ac1ccf..1d3aeae 100644
--- a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr
+++ b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-68641-check-gat-bounds.rs:14:5
|
-LL | type Item<'a>: Copy;
- | ---- required by this bound in `UnsafeCopy::Item`
-...
LL | type Item<'a> = T;
| ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `UnsafeCopy::Item`
+ --> $DIR/issue-68641-check-gat-bounds.rs:6:20
+ |
+LL | type Item<'a>: Copy;
+ | ^^^^ required by this bound in `UnsafeCopy::Item`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> UnsafeCopy for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr
index 4e609ca..574b815 100644
--- a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr
+++ b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr
@@ -1,17 +1,19 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
--> $DIR/issue-68642-broken-llvm-ir.rs:14:5
|
-LL | type F<'a>: Fn() -> u32;
- | ----------- required by this bound in `Fun::F`
-...
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `Fun::F`
+ --> $DIR/issue-68642-broken-llvm-ir.rs:6:17
+ |
+LL | type F<'a>: Fn() -> u32;
+ | ^^^^^^^^^^^ required by this bound in `Fun::F`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr
index 44600bf..9c4cbc5 100644
--- a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr
+++ b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr
@@ -1,17 +1,19 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
--> $DIR/issue-68643-broken-mir.rs:14:5
|
-LL | type F<'a>: Fn() -> u32;
- | ----------- required by this bound in `Fun::F`
-...
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `Fun::F`
+ --> $DIR/issue-68643-broken-mir.rs:6:17
+ |
+LL | type F<'a>: Fn() -> u32;
+ | ^^^^^^^^^^^ required by this bound in `Fun::F`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr
index 2c21795..0df5c0f 100644
--- a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr
+++ b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr
@@ -1,17 +1,19 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
--> $DIR/issue-68644-codegen-selection.rs:14:5
|
-LL | type F<'a>: Fn() -> u32;
- | ----------- required by this bound in `Fun::F`
-...
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `Fun::F`
+ --> $DIR/issue-68644-codegen-selection.rs:6:17
+ |
+LL | type F<'a>: Fn() -> u32;
+ | ^^^^^^^^^^^ required by this bound in `Fun::F`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr
index b2a2636..35a4350 100644
--- a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr
+++ b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr
@@ -1,17 +1,19 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
--> $DIR/issue-68645-codegen-fulfillment.rs:14:5
|
-LL | type F<'a>: Fn() -> u32;
- | ----------- required by this bound in `Fun::F`
-...
LL | type F<'a> = Self;
| ^^^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
+note: required by a bound in `Fun::F`
+ --> $DIR/issue-68645-codegen-fulfillment.rs:6:17
+ |
+LL | type F<'a>: Fn() -> u32;
+ | ^^^^^^^^^^^ required by this bound in `Fun::F`
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr b/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr
index 9d90d6f..d69ac8e 100644
--- a/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr
+++ b/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr
@@ -1,9 +1,6 @@
error[E0271]: type mismatch resolving `<T as Deref>::Target == T`
--> $DIR/issue-68656-unsized-values.rs:15:5
|
-LL | type Item<'a>: std::ops::Deref<Target = T>;
- | ---------- required by this bound in `UnsafeCopy::Item`
-...
LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T {
| - this type parameter
LL | type Item<'a> = T;
@@ -11,10 +8,15 @@
|
= note: expected type parameter `T`
found associated type `<T as Deref>::Target`
+note: required by a bound in `UnsafeCopy::Item`
+ --> $DIR/issue-68656-unsized-values.rs:6:36
+ |
+LL | type Item<'a>: std::ops::Deref<Target = T>;
+ | ^^^^^^^^^^ required by this bound in `UnsafeCopy::Item`
help: consider further restricting this bound
|
LL | impl<T: Copy + std::ops::Deref + Deref<Target = T>> UnsafeCopy<T> for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-70304.stderr b/src/test/ui/generic-associated-types/issue-70304.stderr
index fd9e1ac..c53dbf6 100644
--- a/src/test/ui/generic-associated-types/issue-70304.stderr
+++ b/src/test/ui/generic-associated-types/issue-70304.stderr
@@ -8,7 +8,7 @@
help: consider using the `'static` lifetime
|
LL | fn create_doc() -> impl Document<Cursor<'static> = DocCursorImpl<'_>> {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-71176.stderr b/src/test/ui/generic-associated-types/issue-71176.stderr
index f0babda..08c8d41 100644
--- a/src/test/ui/generic-associated-types/issue-71176.stderr
+++ b/src/test/ui/generic-associated-types/issue-71176.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | inner: Box<dyn Provider<A<'a> = B>>,
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-74684-2.stderr b/src/test/ui/generic-associated-types/issue-74684-2.stderr
index 23fb428..86e9450 100644
--- a/src/test/ui/generic-associated-types/issue-74684-2.stderr
+++ b/src/test/ui/generic-associated-types/issue-74684-2.stderr
@@ -1,11 +1,14 @@
error[E0271]: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
--> $DIR/issue-74684-2.rs:23:5
|
-LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
- | ------------ required by this bound in `bug`
-...
LL | bug(Box::new(x));
| ^^^ expected slice `[u8]`, found `i32`
+ |
+note: required by a bound in `bug`
+ --> $DIR/issue-74684-2.rs:13:28
+ |
+LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
+ | ^^^^^^^^^^^^ required by this bound in `bug`
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-74816.stderr b/src/test/ui/generic-associated-types/issue-74816.stderr
index 431182e..49ae87c 100644
--- a/src/test/ui/generic-associated-types/issue-74816.stderr
+++ b/src/test/ui/generic-associated-types/issue-74816.stderr
@@ -2,29 +2,33 @@
--> $DIR/issue-74816.rs:9:5
|
LL | type Associated: Trait1 = Self;
- | ^^^^^^^^^^^^^^^^^------^^^^^^^^
- | | |
- | | required by this bound in `Trait2::Associated`
- | the trait `Trait1` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait1` is not implemented for `Self`
|
+note: required by a bound in `Trait2::Associated`
+ --> $DIR/issue-74816.rs:9:22
+ |
+LL | type Associated: Trait1 = Self;
+ | ^^^^^^ required by this bound in `Trait2::Associated`
help: consider further restricting `Self`
|
LL | trait Trait2: Trait1 {
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-74816.rs:9:5
|
LL | type Associated: Trait1 = Self;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | doesn't have a size known at compile-time
- | required by this bound in `Trait2::Associated`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
+note: required by a bound in `Trait2::Associated`
+ --> $DIR/issue-74816.rs:9:5
+ |
+LL | type Associated: Trait1 = Self;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
help: consider further restricting `Self`
|
LL | trait Trait2: Sized {
- | ^^^^^^^
+ | +++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generic-associated-types/issue-74824.stderr b/src/test/ui/generic-associated-types/issue-74824.stderr
index 54cb3fb..bd51e5a 100644
--- a/src/test/ui/generic-associated-types/issue-74824.stderr
+++ b/src/test/ui/generic-associated-types/issue-74824.stderr
@@ -2,25 +2,30 @@
--> $DIR/issue-74824.rs:7:5
|
LL | type Copy<T>: Copy = Box<T>;
- | ^^^^^^^^^^^^^^----^^^^^^^^^^
- | | |
- | | required by this bound in `UnsafeCopy::Copy`
- | the trait `Copy` is not implemented for `Box<T>`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<T>`
+ |
+note: required by a bound in `UnsafeCopy::Copy`
+ --> $DIR/issue-74824.rs:7:19
+ |
+LL | type Copy<T>: Copy = Box<T>;
+ | ^^^^ required by this bound in `UnsafeCopy::Copy`
error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/issue-74824.rs:7:5
|
LL | type Copy<T>: Copy = Box<T>;
- | ^^^^^^^^^^^^^^----^^^^^^^^^^
- | | |
- | | required by this bound in `UnsafeCopy::Copy`
- | the trait `Clone` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `T`
|
= note: required because of the requirements on the impl of `Clone` for `Box<T>`
+note: required by a bound in `UnsafeCopy::Copy`
+ --> $DIR/issue-74824.rs:7:19
+ |
+LL | type Copy<T>: Copy = Box<T>;
+ | ^^^^ required by this bound in `UnsafeCopy::Copy`
help: consider restricting type parameter `T`
|
LL | type Copy<T: std::clone::Clone>: Copy = Box<T>;
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generic-associated-types/issue-76535.stderr b/src/test/ui/generic-associated-types/issue-76535.stderr
index 45af30e..246454f 100644
--- a/src/test/ui/generic-associated-types/issue-76535.stderr
+++ b/src/test/ui/generic-associated-types/issue-76535.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperStruct::new(0));
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0038]: the trait `SuperTrait` cannot be made into an object
--> $DIR/issue-76535.rs:36:14
diff --git a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
index fedc6a3..8ff6cb5 100644
--- a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
+++ b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
@@ -23,7 +23,7 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl A for Box<dyn A + '_> {}
- | ^^^^
+ | ++++
error: incompatible lifetime on type
--> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:5
@@ -77,11 +77,11 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl E for (Box<dyn A + '_>, Box<dyn A>) {}
- | ^^^^
+ | ++++
help: consider relaxing the implicit `'static` requirement
|
LL | impl E for (Box<dyn A>, Box<dyn A + '_>) {}
- | ^^^^
+ | ++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generic-associated-types/issue-78671.stderr b/src/test/ui/generic-associated-types/issue-78671.stderr
index 802621b..b927308 100644
--- a/src/test/ui/generic-associated-types/issue-78671.stderr
+++ b/src/test/ui/generic-associated-types/issue-78671.stderr
@@ -12,7 +12,7 @@
help: add missing generic argument
|
LL | Box::new(Family) as &dyn CollectionFamily<Member<T>=usize>
- | ^^^^^^^^^
+ | ~~~~~~~~~
error[E0038]: the trait `CollectionFamily` cannot be made into an object
--> $DIR/issue-78671.rs:7:25
diff --git a/src/test/ui/generic-associated-types/issue-79422.stderr b/src/test/ui/generic-associated-types/issue-79422.stderr
index cf0a80b..8d8ef6b 100644
--- a/src/test/ui/generic-associated-types/issue-79422.stderr
+++ b/src/test/ui/generic-associated-types/issue-79422.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0038]: the trait `MapLike` cannot be made into an object
--> $DIR/issue-79422.rs:42:12
diff --git a/src/test/ui/generic-associated-types/issue-79636-1.stderr b/src/test/ui/generic-associated-types/issue-79636-1.stderr
index e6f9a0c..1ecb862 100644
--- a/src/test/ui/generic-associated-types/issue-79636-1.stderr
+++ b/src/test/ui/generic-associated-types/issue-79636-1.stderr
@@ -12,7 +12,7 @@
help: add missing generic argument
|
LL | MInner: Monad<Unwrapped = A, Wrapped<B> = MOuter::Wrapped<A>>,
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-79636-2.stderr b/src/test/ui/generic-associated-types/issue-79636-2.stderr
index 9a240c6..ae61b7b 100644
--- a/src/test/ui/generic-associated-types/issue-79636-2.stderr
+++ b/src/test/ui/generic-associated-types/issue-79636-2.stderr
@@ -12,7 +12,7 @@
help: add missing generic argument
|
LL | W: SomeTrait<Wrapped<A> = W>,
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-80433.stderr b/src/test/ui/generic-associated-types/issue-80433.stderr
index 26c8791..d8c210d 100644
--- a/src/test/ui/generic-associated-types/issue-80433.stderr
+++ b/src/test/ui/generic-associated-types/issue-80433.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | fn test_simpler<'a>(dst: &'a mut impl TestMut<Output<'a> = &'a mut f32>)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr
index 850b434..86c99c3 100644
--- a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr
+++ b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr
@@ -12,7 +12,7 @@
help: add missing generic argument
|
LL | type CType: C<DType<T> = Self>;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-81862.stderr b/src/test/ui/generic-associated-types/issue-81862.stderr
index 1ba21cc..024f8ad 100644
--- a/src/test/ui/generic-associated-types/issue-81862.stderr
+++ b/src/test/ui/generic-associated-types/issue-81862.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | fn next(&mut self) -> Option<Self::Item<'_>>;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-84931.rs b/src/test/ui/generic-associated-types/issue-84931.rs
new file mode 100644
index 0000000..9e247de
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-84931.rs
@@ -0,0 +1,22 @@
+#![feature(generic_associated_types)]
+// check-fail
+
+trait StreamingIter {
+ type Item<'a> where Self: 'a;
+ fn next<'a>(&'a mut self) -> Option<Self::Item::<'a>>;
+}
+
+struct StreamingSliceIter<'a, T> {
+ idx: usize,
+ data: &'a mut [T],
+}
+
+impl<'b, T: 'b> StreamingIter for StreamingSliceIter<'b, T> {
+ type Item<'a> = &'a mut T;
+ //~^ the parameter type
+ fn next(&mut self) -> Option<&mut T> {
+ loop {}
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-84931.stderr b/src/test/ui/generic-associated-types/issue-84931.stderr
new file mode 100644
index 0000000..47decb7
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-84931.stderr
@@ -0,0 +1,11 @@
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/issue-84931.rs:15:21
+ |
+LL | type Item<'a> = &'a mut T;
+ | - ^^^^^^^^^ ...so that the reference type `&'a mut T` does not outlive the data it points at
+ | |
+ | help: consider adding a where clause: `where T: 'a`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/generic-associated-types/issue-86483.stderr b/src/test/ui/generic-associated-types/issue-86483.stderr
index 2106b21..d697879 100644
--- a/src/test/ui/generic-associated-types/issue-86483.stderr
+++ b/src/test/ui/generic-associated-types/issue-86483.stderr
@@ -11,7 +11,13 @@
... |
LL | |
LL | | }
- | |_^ ...so that the type `T` will meet its required lifetime bounds
+ | |_^ ...so that the type `T` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/issue-86483.rs:7:16
+ |
+LL | for<'a> T: 'a,
+ | ^^
error[E0311]: the parameter type `T` may not live long enough
--> $DIR/issue-86483.rs:9:5
@@ -20,16 +26,21 @@
| - help: consider adding an explicit lifetime bound...: `T: 'a`
...
LL | type Ice<'v>: IntoIterator<Item = &'v T>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/issue-86483.rs:7:16
+ |
+LL | for<'a> T: 'a,
+ | ^^
error[E0309]: the parameter type `T` may not live long enough
--> $DIR/issue-86483.rs:9:32
|
-LL | pub trait IceIce<T>
- | - help: consider adding an explicit lifetime bound...: `T: 'v`
-...
LL | type Ice<'v>: IntoIterator<Item = &'v T>;
- | ^^^^^^^^^^^^ ...so that the reference type `&'v T` does not outlive the data it points at
+ | ^^^^^^^^^^^^ - help: consider adding a where clause: `where T: 'v`
+ | |
+ | ...so that the reference type `&'v T` does not outlive the data it points at
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generic-associated-types/issue-86787.rs b/src/test/ui/generic-associated-types/issue-86787.rs
new file mode 100644
index 0000000..57d478a
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-86787.rs
@@ -0,0 +1,40 @@
+#![feature(generic_associated_types)]
+// check-fail
+
+enum Either<L, R> {
+ Left(L),
+ Right(R),
+}
+
+pub trait HasChildrenOf {
+ type T;
+ type TRef<'a>;
+
+ fn ref_children<'a>(&'a self) -> Vec<Self::TRef<'a>>;
+ fn take_children(self) -> Vec<Self::T>;
+}
+
+impl<Left, Right> HasChildrenOf for Either<Left, Right>
+where
+ Left: HasChildrenOf,
+ Right: HasChildrenOf,
+{
+ type T = Either<Left::T, Right::T>;
+ type TRef<'a>
+ //~^ the associated type
+ //~^^ the associated type
+ where
+ <Left as HasChildrenOf>::T: 'a,
+ <Right as HasChildrenOf>::T: 'a
+ = Either<&'a Left::T, &'a Right::T>;
+
+ fn ref_children<'a>(&'a self) -> Vec<Self::TRef<'a>> {
+ todo!()
+ }
+
+ fn take_children(self) -> Vec<Self::T> {
+ todo!()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-86787.stderr b/src/test/ui/generic-associated-types/issue-86787.stderr
new file mode 100644
index 0000000..04cd84b
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-86787.stderr
@@ -0,0 +1,29 @@
+error[E0309]: the associated type `<Left as HasChildrenOf>::T` may not live long enough
+ --> $DIR/issue-86787.rs:23:5
+ |
+LL | / type TRef<'a>
+LL | |
+LL | |
+LL | | where
+LL | | <Left as HasChildrenOf>::T: 'a,
+LL | | <Right as HasChildrenOf>::T: 'a
+ | | - help: consider adding a where clause: `, <Left as HasChildrenOf>::T: 'a`
+LL | | = Either<&'a Left::T, &'a Right::T>;
+ | |________________________________________^ ...so that the type `<Left as HasChildrenOf>::T` will meet its required lifetime bounds
+
+error[E0309]: the associated type `<Right as HasChildrenOf>::T` may not live long enough
+ --> $DIR/issue-86787.rs:23:5
+ |
+LL | / type TRef<'a>
+LL | |
+LL | |
+LL | | where
+LL | | <Left as HasChildrenOf>::T: 'a,
+LL | | <Right as HasChildrenOf>::T: 'a
+ | | - help: consider adding a where clause: `, <Right as HasChildrenOf>::T: 'a`
+LL | | = Either<&'a Left::T, &'a Right::T>;
+ | |________________________________________^ ...so that the type `<Right as HasChildrenOf>::T` will meet its required lifetime bounds
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/generic-associated-types/issue-87429-2.rs b/src/test/ui/generic-associated-types/issue-87429-2.rs
new file mode 100644
index 0000000..d35bb09
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87429-2.rs
@@ -0,0 +1,20 @@
+// Derived from `issue-87429`. A test that ensures that using bound vars in the
+// predicates in the param env when checking that an associated type satisfies
+// its bounds does not cause us to not be able to use the bounds on the parameters.
+
+// check-pass
+
+#![feature(generic_associated_types)]
+
+trait Family {
+ type Member<'a, C: Eq>: for<'b> MyBound<'b, C>;
+}
+
+trait MyBound<'a, C> { }
+impl<'a, C: Eq> MyBound<'a, C> for i32 { }
+
+impl Family for () {
+ type Member<'a, C: Eq> = i32;
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs
new file mode 100644
index 0000000..9ee07c2
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs
@@ -0,0 +1,18 @@
+// check-fail
+
+#![feature(associated_type_defaults)]
+#![feature(generic_associated_types)]
+
+trait Family {
+ // Fine, i32: PartialEq<i32>
+ type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = i32;
+}
+
+struct Foo;
+trait Family2 {
+ // Not fine, not Foo: PartialEq<Foo>
+ type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
+ //~^ ERROR can't compare
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr
new file mode 100644
index 0000000..01cb0bf
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr
@@ -0,0 +1,16 @@
+error[E0277]: can't compare `Foo` with `Foo`
+ --> $DIR/issue-87429-associated-type-default.rs:14:5
+ |
+LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Foo == Foo`
+ |
+ = help: the trait `PartialEq` is not implemented for `Foo`
+note: required by a bound in `Family2::Member`
+ --> $DIR/issue-87429-associated-type-default.rs:14:22
+ |
+LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family2::Member`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/generic-associated-types/issue-87429-specialization.rs b/src/test/ui/generic-associated-types/issue-87429-specialization.rs
new file mode 100644
index 0000000..b365e07
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87429-specialization.rs
@@ -0,0 +1,25 @@
+// check-fail
+
+#![feature(specialization)]
+//~^ WARN incomplete
+#![feature(generic_associated_types)]
+
+trait Family {
+ type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
+}
+
+struct I32Family;
+
+impl Family for I32Family {
+ default type Member<'a> = i32;
+}
+
+struct Foo;
+struct FooFamily;
+
+impl Family for FooFamily {
+ default type Member<'a> = Foo;
+ //~^ ERROR can't compare
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-87429-specialization.stderr b/src/test/ui/generic-associated-types/issue-87429-specialization.stderr
new file mode 100644
index 0000000..87bd35f
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87429-specialization.stderr
@@ -0,0 +1,26 @@
+warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/issue-87429-specialization.rs:3:12
+ |
+LL | #![feature(specialization)]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
+ = help: consider using `min_specialization` instead, which is more stable and complete
+
+error[E0277]: can't compare `Foo` with `Foo`
+ --> $DIR/issue-87429-specialization.rs:21:5
+ |
+LL | default type Member<'a> = Foo;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `Foo == Foo`
+ |
+ = help: the trait `PartialEq` is not implemented for `Foo`
+note: required by a bound in `Family::Member`
+ --> $DIR/issue-87429-specialization.rs:8:22
+ |
+LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family::Member`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/generic-associated-types/issue-87429.rs b/src/test/ui/generic-associated-types/issue-87429.rs
new file mode 100644
index 0000000..f905348
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87429.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+#![feature(generic_associated_types)]
+
+trait Family {
+ type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
+}
+
+struct I32;
+
+impl Family for I32 {
+ type Member<'a> = i32;
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-87748.rs b/src/test/ui/generic-associated-types/issue-87748.rs
new file mode 100644
index 0000000..93c3b39
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87748.rs
@@ -0,0 +1,30 @@
+// Checks that we properly add implied bounds from unnormalized projections in
+// inputs when typechecking functions.
+
+// check-pass
+
+#![feature(generic_associated_types)]
+
+trait MyTrait {
+ type Assoc<'a, 'b> where 'b: 'a;
+ fn do_sth(arg: Self::Assoc<'_, '_>);
+}
+
+struct A;
+struct B;
+struct C;
+
+impl MyTrait for A {
+ type Assoc<'a, 'b> where 'b: 'a = u32;
+ fn do_sth(_: u32) {}
+}
+impl MyTrait for B {
+ type Assoc<'a, 'b> where 'b: 'a = u32;
+ fn do_sth(_: Self::Assoc<'_, '_>) {}
+}
+impl MyTrait for C {
+ type Assoc<'a, 'b> where 'b: 'a = u32;
+ fn do_sth(_: Self::Assoc<'static, 'static>) {}
+}
+
+fn main () {}
diff --git a/src/test/ui/generic-associated-types/missing-bounds.stderr b/src/test/ui/generic-associated-types/missing-bounds.stderr
index 4d4f7e5..4d33fe8 100644
--- a/src/test/ui/generic-associated-types/missing-bounds.stderr
+++ b/src/test/ui/generic-associated-types/missing-bounds.stderr
@@ -12,7 +12,7 @@
help: consider further restricting this bound
|
LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0308]: mismatched types
--> $DIR/missing-bounds.rs:21:14
@@ -28,7 +28,7 @@
help: consider further restricting this bound
|
LL | impl<B: Add + Add<Output = B>> Add for C<B> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0369]: cannot add `B` to `B`
--> $DIR/missing-bounds.rs:31:21
@@ -41,7 +41,7 @@
help: consider restricting type parameter `B`
|
LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generic-associated-types/missing_lifetime_args.stderr b/src/test/ui/generic-associated-types/missing_lifetime_args.stderr
index 95b048d..7cf3f4b 100644
--- a/src/test/ui/generic-associated-types/missing_lifetime_args.stderr
+++ b/src/test/ui/generic-associated-types/missing_lifetime_args.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime arguments
|
LL | fn foo<'c, 'd>(_arg: Box<dyn X<Y<'c, 'd> = (&'c u32, &'d u32)>>) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error[E0107]: this struct takes 3 lifetime arguments but 2 lifetime arguments were supplied
--> $DIR/missing_lifetime_args.rs:16:26
@@ -30,7 +30,7 @@
help: add missing lifetime argument
|
LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b, 'a>) {}
- | ^^^^
+ | ++++
error[E0107]: this struct takes 3 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing_lifetime_args.rs:19:16
@@ -48,7 +48,7 @@
help: add missing lifetime arguments
|
LL | fn f<'a>(_arg: Foo<'a, 'b, 'c>) {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generic-associated-types/missing_lifetime_const.stderr b/src/test/ui/generic-associated-types/missing_lifetime_const.stderr
index 02d3cd2..5d50637 100644
--- a/src/test/ui/generic-associated-types/missing_lifetime_const.stderr
+++ b/src/test/ui/generic-associated-types/missing_lifetime_const.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | let _: <T as Foo>::Assoc<'a, 3>;
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr b/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr
index db46959..53d76fd 100644
--- a/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr
+++ b/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr
@@ -26,7 +26,7 @@
help: add missing generic argument
|
LL | type FErr1 = Self::E<'static, 'static, T>;
- | ^^^
+ | +++
error[E0107]: this associated type takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/parameter_number_and_kind.rs:15:27
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr
index c290815..3ace774 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr
@@ -7,7 +7,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | fn f1<'a>(arg : Box<{ dyn X< : 32 } >>) {}
- | ^ ^
+ | + +
error: expected parameter name, found `>`
--> $DIR/trait-path-missing-gen_arg.rs:8:36
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
index 59b53c7..46ddcb6 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | fn f2<'a>(arg : Box<dyn X<Y<'a, 1> = &'a ()>>) {}
- | ^^^
+ | +++
error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/trait-path-type-error-once-implemented.rs:8:29
diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
index d5e9caf..2b57c43 100644
--- a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
+++ b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
@@ -1,11 +1,14 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
- --> $DIR/projection-bound-cycle-generic.rs:44:5
+ --> $DIR/projection-bound-cycle-generic.rs:44:18
+ |
+LL | type Assoc = OnlySized<<T as Foo>::Item>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: required by a bound in `OnlySized`
+ --> $DIR/projection-bound-cycle-generic.rs:28:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
- | - required by this bound in `OnlySized`
-...
-LL | type Assoc = OnlySized<<T as Foo>::Item>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^ required by this bound in `OnlySized`
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle.stderr b/src/test/ui/generic-associated-types/projection-bound-cycle.stderr
index fac62fe..d9d0bf4 100644
--- a/src/test/ui/generic-associated-types/projection-bound-cycle.stderr
+++ b/src/test/ui/generic-associated-types/projection-bound-cycle.stderr
@@ -1,11 +1,14 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
- --> $DIR/projection-bound-cycle.rs:46:5
+ --> $DIR/projection-bound-cycle.rs:46:18
+ |
+LL | type Assoc = OnlySized<<T as Foo>::Item>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: required by a bound in `OnlySized`
+ --> $DIR/projection-bound-cycle.rs:30:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
- | - required by this bound in `OnlySized`
-...
-LL | type Assoc = OnlySized<<T as Foo>::Item>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^ required by this bound in `OnlySized`
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr
index d2482b2..8237d37 100644
--- a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr
+++ b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr
@@ -4,7 +4,7 @@
LL | type Item<'a> = &'b ();
| ^^^^^^^^^^^^^^^^^^^^^^^
|
-note: type must outlive the lifetime `'a` as defined on the associated item at 8:15
+note: type must outlive the lifetime `'a` as defined on the associated item at 8:15 as required by this binding
--> $DIR/unsatisfied-outlives-bound.rs:8:15
|
LL | type Item<'a> = &'b ();
@@ -16,7 +16,11 @@
LL | type Item<'a> = &'a ();
| ^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/unsatisfied-outlives-bound.rs:13:20
+ |
+LL | type Item<'a>: 'static;
+ | ^^^^^^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generics/generic-extern-lifetime.stderr b/src/test/ui/generics/generic-extern-lifetime.stderr
index 3c9ed7a..9098486 100644
--- a/src/test/ui/generics/generic-extern-lifetime.stderr
+++ b/src/test/ui/generics/generic-extern-lifetime.stderr
@@ -14,7 +14,7 @@
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | pub fn life4<'b>(x: for<'c, 'a> fn(&'a i32));
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/generic-extern-lifetime.rs:11:39
@@ -26,7 +26,7 @@
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | pub fn life7<'b>() -> for<'c, 'a> fn(&'a i32);
- | ^^^^
+ | ++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generics/generic-impl-less-params-with-defaults.stderr b/src/test/ui/generics/generic-impl-less-params-with-defaults.stderr
index 2c7ffde..cdbb579 100644
--- a/src/test/ui/generics/generic-impl-less-params-with-defaults.stderr
+++ b/src/test/ui/generics/generic-impl-less-params-with-defaults.stderr
@@ -14,7 +14,7 @@
help: add missing generic argument
|
LL | Foo::<isize, B>::new();
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/generics/generic-no-mangle.fixed b/src/test/ui/generics/generic-no-mangle.fixed
index 207d8a9..9126ac1 100644
--- a/src/test/ui/generics/generic-no-mangle.fixed
+++ b/src/test/ui/generics/generic-no-mangle.fixed
@@ -14,4 +14,146 @@
#[no_mangle]
pub fn qux<'a>(x: &'a i32) -> &i32 { x }
+pub struct Foo;
+
+impl Foo {
+
+ pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ pub extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ pub fn baz(x: &i32) -> &i32 { x }
+
+ #[no_mangle]
+ pub fn qux<'a>(x: &'a i32) -> &i32 { x }
+}
+
+trait Trait1 {
+ fn foo<T>();
+ extern "C" fn bar<T>();
+ fn baz(x: &i32) -> &i32;
+ fn qux<'a>(x: &'a i32) -> &i32;
+}
+
+impl Trait1 for Foo {
+
+ fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ fn baz(x: &i32) -> &i32 { x }
+
+ #[no_mangle]
+ fn qux<'a>(x: &'a i32) -> &i32 { x }
+}
+
+trait Trait2<T> {
+ fn foo();
+ fn foo2<U>();
+ extern "C" fn bar();
+ fn baz(x: &i32) -> &i32;
+ fn qux<'a>(x: &'a i32) -> &i32;
+}
+
+impl<T> Trait2<T> for Foo {
+
+ fn foo() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ fn foo2<U>() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ fn baz(x: &i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled
+
+
+ fn qux<'a>(x: &'a i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled
+}
+
+pub struct Bar<T>(T);
+
+impl<T> Bar<T> {
+
+ pub fn foo() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ pub extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ pub fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
+}
+
+impl Bar<i32> {
+ #[no_mangle]
+ pub fn qux() {}
+}
+
+trait Trait3 {
+ fn foo();
+ extern "C" fn bar();
+ fn baz<U>();
+}
+
+impl<T> Trait3 for Bar<T> {
+
+ fn foo() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
+
+
+ fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
+}
+
+pub struct Baz<'a>(&'a i32);
+
+impl<'a> Baz<'a> {
+ #[no_mangle]
+ pub fn foo() {}
+
+ #[no_mangle]
+ pub fn bar<'b>(x: &'b i32) -> &i32 { x }
+}
+
+trait Trait4 {
+ fn foo();
+ fn bar<'a>(x: &'a i32) -> &i32;
+}
+
+impl Trait4 for Bar<i32> {
+ #[no_mangle]
+ fn foo() {}
+
+ #[no_mangle]
+ fn bar<'b>(x: &'b i32) -> &i32 { x }
+}
+
+impl<'a> Trait4 for Baz<'a> {
+ #[no_mangle]
+ fn foo() {}
+
+ #[no_mangle]
+ fn bar<'b>(x: &'b i32) -> &i32 { x }
+}
+
+trait Trait5<T> {
+ fn foo();
+}
+
+impl Trait5<i32> for Foo {
+ #[no_mangle]
+ fn foo() {}
+}
+
+impl Trait5<i32> for Bar<i32> {
+ #[no_mangle]
+ fn foo() {}
+}
+
fn main() {}
diff --git a/src/test/ui/generics/generic-no-mangle.rs b/src/test/ui/generics/generic-no-mangle.rs
index 146896c..e283cf4 100644
--- a/src/test/ui/generics/generic-no-mangle.rs
+++ b/src/test/ui/generics/generic-no-mangle.rs
@@ -14,4 +14,146 @@
#[no_mangle]
pub fn qux<'a>(x: &'a i32) -> &i32 { x }
+pub struct Foo;
+
+impl Foo {
+ #[no_mangle]
+ pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ pub extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ pub fn baz(x: &i32) -> &i32 { x }
+
+ #[no_mangle]
+ pub fn qux<'a>(x: &'a i32) -> &i32 { x }
+}
+
+trait Trait1 {
+ fn foo<T>();
+ extern "C" fn bar<T>();
+ fn baz(x: &i32) -> &i32;
+ fn qux<'a>(x: &'a i32) -> &i32;
+}
+
+impl Trait1 for Foo {
+ #[no_mangle]
+ fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ extern "C" fn bar<T>() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ fn baz(x: &i32) -> &i32 { x }
+
+ #[no_mangle]
+ fn qux<'a>(x: &'a i32) -> &i32 { x }
+}
+
+trait Trait2<T> {
+ fn foo();
+ fn foo2<U>();
+ extern "C" fn bar();
+ fn baz(x: &i32) -> &i32;
+ fn qux<'a>(x: &'a i32) -> &i32;
+}
+
+impl<T> Trait2<T> for Foo {
+ #[no_mangle]
+ fn foo() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ fn foo2<U>() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ fn baz(x: &i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ fn qux<'a>(x: &'a i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled
+}
+
+pub struct Bar<T>(T);
+
+impl<T> Bar<T> {
+ #[no_mangle]
+ pub fn foo() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ pub extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ pub fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
+}
+
+impl Bar<i32> {
+ #[no_mangle]
+ pub fn qux() {}
+}
+
+trait Trait3 {
+ fn foo();
+ extern "C" fn bar();
+ fn baz<U>();
+}
+
+impl<T> Trait3 for Bar<T> {
+ #[no_mangle]
+ fn foo() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ extern "C" fn bar() {} //~ ERROR functions generic over types or consts must be mangled
+
+ #[no_mangle]
+ fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled
+}
+
+pub struct Baz<'a>(&'a i32);
+
+impl<'a> Baz<'a> {
+ #[no_mangle]
+ pub fn foo() {}
+
+ #[no_mangle]
+ pub fn bar<'b>(x: &'b i32) -> &i32 { x }
+}
+
+trait Trait4 {
+ fn foo();
+ fn bar<'a>(x: &'a i32) -> &i32;
+}
+
+impl Trait4 for Bar<i32> {
+ #[no_mangle]
+ fn foo() {}
+
+ #[no_mangle]
+ fn bar<'b>(x: &'b i32) -> &i32 { x }
+}
+
+impl<'a> Trait4 for Baz<'a> {
+ #[no_mangle]
+ fn foo() {}
+
+ #[no_mangle]
+ fn bar<'b>(x: &'b i32) -> &i32 { x }
+}
+
+trait Trait5<T> {
+ fn foo();
+}
+
+impl Trait5<i32> for Foo {
+ #[no_mangle]
+ fn foo() {}
+}
+
+impl Trait5<i32> for Bar<i32> {
+ #[no_mangle]
+ fn foo() {}
+}
+
fn main() {}
diff --git a/src/test/ui/generics/generic-no-mangle.stderr b/src/test/ui/generics/generic-no-mangle.stderr
index b437417..adfddbe 100644
--- a/src/test/ui/generics/generic-no-mangle.stderr
+++ b/src/test/ui/generics/generic-no-mangle.stderr
@@ -20,5 +20,125 @@
LL | pub extern "C" fn bar<T>() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 2 previous errors
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:21:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | pub fn foo<T>() {}
+ | ^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:24:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | pub extern "C" fn bar<T>() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:42:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | fn foo<T>() {}
+ | ^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:45:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | extern "C" fn bar<T>() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:64:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | fn foo() {}
+ | ^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:67:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | fn foo2<U>() {}
+ | ^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:70:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | extern "C" fn bar() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:73:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | fn baz(x: &i32) -> &i32 { x }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:76:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | fn qux<'a>(x: &'a i32) -> &i32 { x }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:83:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | pub fn foo() {}
+ | ^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:86:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | pub extern "C" fn bar() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:89:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | pub fn baz<U>() {}
+ | ^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:105:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | fn foo() {}
+ | ^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:108:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | extern "C" fn bar() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: functions generic over types or consts must be mangled
+ --> $DIR/generic-no-mangle.rs:111:5
+ |
+LL | #[no_mangle]
+ | ------------ help: remove this attribute
+LL | fn baz<U>() {}
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to 17 previous errors
diff --git a/src/test/ui/generics/generic-type-less-params-with-defaults.stderr b/src/test/ui/generics/generic-type-less-params-with-defaults.stderr
index 7c08363..e45a0d9 100644
--- a/src/test/ui/generics/generic-type-less-params-with-defaults.stderr
+++ b/src/test/ui/generics/generic-type-less-params-with-defaults.stderr
@@ -12,7 +12,7 @@
help: add missing generic argument
|
LL | let _: Vec<T>;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/generics/issue-61631-default-type-param-can-reference-self-in-trait.stderr b/src/test/ui/generics/issue-61631-default-type-param-can-reference-self-in-trait.stderr
index 2b88a60..2c397d8 100644
--- a/src/test/ui/generics/issue-61631-default-type-param-can-reference-self-in-trait.stderr
+++ b/src/test/ui/generics/issue-61631-default-type-param-can-reference-self-in-trait.stderr
@@ -1,13 +1,15 @@
error[E0277]: the size for values of type `[()]` cannot be known at compilation time
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:19:6
|
-LL | trait Tsized<P: Sized = [Self]> {}
- | - required by this bound in `Tsized`
-LL |
LL | impl Tsized for () {}
| ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[()]`
+note: required by a bound in `Tsized`
+ --> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:14
+ |
+LL | trait Tsized<P: Sized = [Self]> {}
+ | ^ required by this bound in `Tsized`
error: aborting due to previous error
diff --git a/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr b/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
index ce853d4..270d6b8 100644
--- a/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
+++ b/src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
@@ -13,7 +13,7 @@
help: consider using the `'b` lifetime
|
LL | fn bar<'b, L: X<'b, &'b Nested<i32>>>(){}
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:21
@@ -31,7 +31,7 @@
help: consider using one of the available lifetimes here
|
LL | fn foo<'b, L: X<'lifetime, &'b Nested<K>>>();
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr b/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr
index 41a0a03..ab09ebc 100644
--- a/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr
+++ b/src/test/ui/generics/param-in-ct-in-ty-param-default.stderr
@@ -5,7 +5,7 @@
| ^ cannot perform const operation using `T`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/generics/wrong-number-of-args.stderr b/src/test/ui/generics/wrong-number-of-args.stderr
index 4e921db..98e5cd6 100644
--- a/src/test/ui/generics/wrong-number-of-args.stderr
+++ b/src/test/ui/generics/wrong-number-of-args.stderr
@@ -82,7 +82,7 @@
help: add missing generic arguments
|
LL | type A = Ty<A, B>;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this struct takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:30:14
@@ -100,7 +100,7 @@
help: add missing generic argument
|
LL | type B = Ty<usize, B>;
- | ^^^
+ | +++
error[E0107]: this struct takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:36:14
@@ -130,7 +130,7 @@
help: add missing generic arguments
|
LL | type E = Ty<A, B>;
- | ^^^^
+ | ++++
error[E0107]: missing generics for struct `lifetime_and_type::Ty`
--> $DIR/wrong-number-of-args.rs:48:14
@@ -146,7 +146,7 @@
help: add missing generic argument
|
LL | type A = Ty<T>;
- | ^^^^^
+ | ~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:48:14
@@ -157,7 +157,7 @@
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Ty<'a>;
- | ^^^^ ^^^^^^
+ | ++++ ~~~~~~
error[E0107]: this struct takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:54:14
@@ -173,7 +173,7 @@
help: add missing generic argument
|
LL | type B = Ty<'static, T>;
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:58:17
@@ -184,7 +184,7 @@
help: consider introducing a named lifetime parameter
|
LL | type C<'a> = Ty<'a, usize>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this struct takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:64:14
@@ -200,7 +200,7 @@
help: add missing generic argument
|
LL | type E = Ty<T>;
- | ^
+ | +
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:64:16
@@ -211,7 +211,7 @@
help: consider introducing a named lifetime parameter
|
LL | type E<'a> = Ty<'a>;
- | ^^^^ ^^
+ | ++++ ++
error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:70:14
@@ -255,7 +255,7 @@
help: add missing generic arguments
|
LL | type A = Ty<A, B>;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this struct takes at least 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:84:14
@@ -273,7 +273,7 @@
help: add missing generic argument
|
LL | type B = Ty<usize, B>;
- | ^^^
+ | +++
error[E0107]: this struct takes at most 3 generic arguments but 4 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:92:14
@@ -303,7 +303,7 @@
help: add missing generic arguments
|
LL | type F = Ty<A, B>;
- | ^^^^
+ | ++++
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:116:22
@@ -328,7 +328,7 @@
help: consider introducing a named lifetime parameter
|
LL | type B<'a> = Box<dyn GenericLifetime<'a>>;
- | ^^^^ ^^^^^^^^^^^^^^^^^^^
+ | ++++ ~~~~~~~~~~~~~~~~~~~
error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:124:22
@@ -358,7 +358,7 @@
help: add missing generic argument
|
LL | type D = Box<dyn GenericType<A>>;
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:132:22
@@ -383,7 +383,7 @@
help: consider introducing a named lifetime parameter
|
LL | type F<'a> = Box<dyn GenericLifetime<'a>>;
- | ^^^^ ^^
+ | ++++ ++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:140:22
@@ -399,7 +399,7 @@
help: add missing generic argument
|
LL | type G = Box<dyn GenericType<A>>;
- | ^
+ | +
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:151:26
@@ -424,7 +424,7 @@
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeAT<'a, AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:165:26
@@ -449,7 +449,7 @@
help: consider introducing a named lifetime parameter
|
LL | type C<'a> = Box<dyn GenericLifetimeAT<'a, (), AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:169:26
@@ -479,7 +479,7 @@
help: add missing generic argument
|
LL | type A = Box<dyn GenericTypeAT<A, AssocTy=()>>;
- | ^^
+ | ++
error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:185:26
@@ -523,7 +523,7 @@
help: add missing generic argument
|
LL | type C = Box<dyn GenericTypeAT<'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:201:48
@@ -534,7 +534,7 @@
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeTypeAT<'a, AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:201:26
@@ -550,7 +550,7 @@
help: add missing generic argument
|
LL | type A = Box<dyn GenericLifetimeTypeAT<A, AssocTy=()>>;
- | ^^
+ | ++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:207:26
@@ -566,7 +566,7 @@
help: add missing generic argument
|
LL | type B = Box<dyn GenericLifetimeTypeAT<'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:211:26
@@ -596,7 +596,7 @@
help: add missing generic argument
|
LL | type C = Box<dyn GenericLifetimeTypeAT<'static, 'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:217:48
@@ -607,7 +607,7 @@
help: consider introducing a named lifetime parameter
|
LL | type D<'a> = Box<dyn GenericLifetimeTypeAT<'a, (), AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:221:48
@@ -618,7 +618,7 @@
help: consider introducing a named lifetime parameter
|
LL | type E<'a> = Box<dyn GenericLifetimeTypeAT<'a, (), (), AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:221:26
@@ -704,7 +704,7 @@
help: add missing generic arguments
|
LL | type A = Box<dyn GenericTypeTypeAT<A, B, AssocTy=()>>;
- | ^^^^^
+ | +++++
error[E0107]: this trait takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:251:26
@@ -722,7 +722,7 @@
help: add missing generic argument
|
LL | type B = Box<dyn GenericTypeTypeAT<(), B, AssocTy=()>>;
- | ^^^
+ | +++
error[E0107]: this trait takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:255:26
@@ -747,7 +747,7 @@
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeLifetimeAT<'a, 'a, AssocTy=()>>;
- | ^^^^ ^^^^^^^
+ | ++++ +++++++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:269:26
@@ -765,7 +765,7 @@
help: add missing lifetime argument
|
LL | type B = Box<dyn GenericLifetimeLifetimeAT<'static, 'b, AssocTy=()>>;
- | ^^^^
+ | ++++
error[E0106]: missing lifetime specifiers
--> $DIR/wrong-number-of-args.rs:279:56
@@ -776,7 +776,7 @@
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeLifetimeTypeAT<'a, 'a, AssocTy=()>>;
- | ^^^^ ^^^^^^^
+ | ++++ +++++++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:279:26
@@ -792,7 +792,7 @@
help: add missing generic argument
|
LL | type A = Box<dyn GenericLifetimeLifetimeTypeAT<A, AssocTy=()>>;
- | ^^
+ | ++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:285:26
@@ -810,7 +810,7 @@
help: add missing lifetime argument
|
LL | type B = Box<dyn GenericLifetimeLifetimeTypeAT<'static, 'b, AssocTy=()>>;
- | ^^^^
+ | ++++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:285:26
@@ -826,7 +826,7 @@
help: add missing generic argument
|
LL | type B = Box<dyn GenericLifetimeLifetimeTypeAT<'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:291:26
@@ -844,7 +844,7 @@
help: add missing lifetime argument
|
LL | type C = Box<dyn GenericLifetimeLifetimeTypeAT<'static, 'b, (), AssocTy=()>>;
- | ^^^^
+ | ++++
error[E0107]: missing generics for struct `HashMap`
--> $DIR/wrong-number-of-args.rs:301:18
@@ -860,7 +860,7 @@
help: add missing generic arguments
|
LL | type A = HashMap<K, V>;
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0107]: this struct takes at least 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:305:18
@@ -878,7 +878,7 @@
help: add missing generic argument
|
LL | type B = HashMap<String, V>;
- | ^^^
+ | +++
error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:309:18
@@ -908,7 +908,7 @@
help: add missing generic arguments
|
LL | type C = HashMap<'static, K, V>;
- | ^^^^^^
+ | ++++++
error[E0107]: this struct takes at most 3 generic arguments but 4 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:315:18
@@ -938,7 +938,7 @@
help: add missing generic arguments
|
LL | type E = HashMap<K, V>;
- | ^^^^
+ | ++++
error[E0107]: missing generics for enum `Result`
--> $DIR/wrong-number-of-args.rs:325:18
@@ -954,7 +954,7 @@
help: add missing generic arguments
|
LL | type A = Result<T, E>;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:329:18
@@ -972,7 +972,7 @@
help: add missing generic argument
|
LL | type B = Result<String, E>;
- | ^^^
+ | +++
error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:333:18
@@ -1002,7 +1002,7 @@
help: add missing generic arguments
|
LL | type C = Result<'static, T, E>;
- | ^^^^^^
+ | ++++++
error[E0107]: this enum takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:339:18
@@ -1032,7 +1032,7 @@
help: add missing generic arguments
|
LL | type E = Result<T, E>;
- | ^^^^
+ | ++++
error: aborting due to 71 previous errors
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
index 1e1241c..d617571 100644
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.rs
@@ -14,7 +14,7 @@
where
for<'a> &'a V: T + 'static,
{
- v.t(|| {}); //~ ERROR: higher-ranked subtype error
+ v.t(|| {}); //~ ERROR: higher-ranked lifetime error
}
fn main() {}
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr b/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
index ca63262..c16c820 100644
--- a/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-59311.stderr
@@ -1,8 +1,10 @@
-error: higher-ranked subtype error
+error: higher-ranked lifetime error
--> $DIR/issue-59311.rs:17:9
|
LL | v.t(|| {});
| ^^^^^
+ |
+ = note: could not prove for<'a> &'a V: 'static
error: aborting due to previous error
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.rs
new file mode 100644
index 0000000..24ac566
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.rs
@@ -0,0 +1,88 @@
+// FamilyType (GAT workaround)
+pub trait FamilyLt<'a> {
+ type Out;
+}
+
+struct RefMutFamily<T>(std::marker::PhantomData<T>, ());
+impl<'a, T: 'a> FamilyLt<'a> for RefMutFamily<T> {
+ type Out = &'a mut T;
+}
+
+pub trait Execute {
+ type E: Inject;
+ fn execute(self, value: <<Self::E as Inject>::I as FamilyLt>::Out);
+}
+
+pub trait Inject
+where
+ Self: Sized,
+{
+ type I: for<'a> FamilyLt<'a>;
+ fn inject(_: &()) -> <Self::I as FamilyLt>::Out;
+}
+
+impl<T: 'static> Inject for RefMutFamily<T> {
+ type I = Self;
+ fn inject(_: &()) -> <Self::I as FamilyLt>::Out {
+ unimplemented!()
+ }
+}
+
+// This struct is only used to give a hint to the compiler about the type `Q`
+struct Annotate<Q>(std::marker::PhantomData<Q>);
+impl<Q> Annotate<Q> {
+ fn new() -> Self {
+ Self(std::marker::PhantomData)
+ }
+}
+
+// This function annotate a closure so it can have Higher-Rank Lifetime Bounds
+//
+// See 'annotate' workaround: https://github.com/rust-lang/rust/issues/58052
+fn annotate<F, Q>(_q: Annotate<Q>, func: F) -> impl Execute + 'static
+where
+ F: for<'r> FnOnce(<<Q as Inject>::I as FamilyLt<'r>>::Out) + 'static,
+ Q: Inject + 'static,
+{
+ let wrapper: Wrapper<Q, F> = Wrapper(std::marker::PhantomData, func);
+ wrapper
+}
+
+struct Wrapper<Q, F>(std::marker::PhantomData<Q>, F);
+impl<Q, F> Execute for Wrapper<Q, F>
+ where
+ Q: Inject,
+ F: for<'r> FnOnce(<<Q as Inject>::I as FamilyLt<'r>>::Out),
+{
+ type E = Q;
+
+ fn execute(self, value: <<Self::E as Inject>::I as FamilyLt>::Out) {
+ (self.1)(value)
+ }
+}
+
+struct Task {
+ _processor: Box<dyn FnOnce()>,
+}
+
+// This function consume the closure
+fn task<P>(processor: P) -> Task
+where P: Execute + 'static {
+ Task {
+ _processor: Box::new(move || {
+ let q = P::E::inject(&());
+ processor.execute(q);
+ })
+ }
+}
+
+fn main() {
+ task(annotate( //~ type mismatch
+ //~^ the size
+ //~^^ the trait bound
+ Annotate::<RefMutFamily<usize>>::new(),
+ |value: &mut usize| {
+ *value = 2;
+ }
+ ));
+}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.stderr
new file mode 100644
index 0000000..8311c147
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-1.stderr
@@ -0,0 +1,67 @@
+error[E0631]: type mismatch in closure arguments
+ --> $DIR/issue-62529-1.rs:80:10
+ |
+LL | task(annotate(
+ | ^^^^^^^^ expected signature of `for<'r> fn(<RefMutFamily<usize> as FamilyLt<'r>>::Out) -> _`
+...
+LL | |value: &mut usize| {
+ | ------------------- found signature of `for<'r> fn(&'r mut usize) -> _`
+ |
+note: required by a bound in `annotate`
+ --> $DIR/issue-62529-1.rs:44:8
+ |
+LL | fn annotate<F, Q>(_q: Annotate<Q>, func: F) -> impl Execute + 'static
+ | -------- required by a bound in this
+LL | where
+LL | F: for<'r> FnOnce(<<Q as Inject>::I as FamilyLt<'r>>::Out) + 'static,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `annotate`
+
+error[E0277]: the size for values of type `impl Execute` cannot be known at compilation time
+ --> $DIR/issue-62529-1.rs:80:10
+ |
+LL | task(annotate(
+ | __________^
+LL | |
+LL | |
+LL | | Annotate::<RefMutFamily<usize>>::new(),
+... |
+LL | | }
+LL | | ));
+ | |_____^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `impl Execute`
+note: required by a bound in `task`
+ --> $DIR/issue-62529-1.rs:69:9
+ |
+LL | fn task<P>(processor: P) -> Task
+ | ^ required by this bound in `task`
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | fn task<P: ?Sized>(processor: P) -> Task
+ | ++++++++
+
+error[E0277]: the trait bound `impl Execute: Execute` is not satisfied
+ --> $DIR/issue-62529-1.rs:80:10
+ |
+LL | task(annotate(
+ | __________^
+LL | |
+LL | |
+LL | | Annotate::<RefMutFamily<usize>>::new(),
+... |
+LL | | }
+LL | | ));
+ | |_____^ the trait `Execute` is not implemented for `impl Execute`
+ |
+note: required by a bound in `task`
+ --> $DIR/issue-62529-1.rs:70:10
+ |
+LL | fn task<P>(processor: P) -> Task
+ | ---- required by a bound in this
+LL | where P: Execute + 'static {
+ | ^^^^^^^ required by this bound in `task`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0277, E0631.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-2.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-2.rs
new file mode 100644
index 0000000..0020547
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-2.rs
@@ -0,0 +1,33 @@
+// check-pass
+
+use std::marker::PhantomData;
+
+trait Lt<'a> {
+ type T;
+}
+struct Id<T>(PhantomData<T>);
+impl<'a,T> Lt<'a> for Id<T> {
+ type T = T;
+}
+
+struct Ref<T>(PhantomData<T>) where T: ?Sized;
+impl<'a,T> Lt<'a> for Ref<T>
+where T: 'a + Lt<'a> + ?Sized
+{
+ type T = &'a T;
+}
+struct Mut<T>(PhantomData<T>) where T: ?Sized;
+impl<'a,T> Lt<'a> for Mut<T>
+where T: 'a + Lt<'a> + ?Sized
+{
+ type T = &'a mut T;
+}
+
+struct C<I,O>(for<'a> fn(<I as Lt<'a>>::T) -> O) where I: for<'a> Lt<'a>;
+
+
+fn main() {
+ let c = C::<Id<_>,_>(|()| 3);
+ c.0(());
+
+}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.rs
new file mode 100644
index 0000000..d84e30f
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.rs
@@ -0,0 +1,32 @@
+trait ATC<'a> {
+ type Type: Sized;
+}
+
+trait WithDefault: for<'a> ATC<'a> {
+ fn with_default<F: for<'a> Fn(<Self as ATC<'a>>::Type)>(f: F);
+}
+
+fn call<'b, T: for<'a> ATC<'a>, F: for<'a> Fn(<T as ATC<'a>>::Type)>(
+ f: F,
+ x: <T as ATC<'b>>::Type,
+) {
+ f(x);
+}
+
+impl<'a> ATC<'a> for () {
+ type Type = Self;
+}
+
+impl WithDefault for () {
+ fn with_default<F: for<'a> Fn(<Self as ATC<'a>>::Type)>(f: F) {
+ // Errors with a bogus type mismatch.
+ //f(());
+ // Going through another generic function works fine.
+ call(f, ());
+ //~^ expected a
+ }
+}
+
+fn main() {
+ // <()>::with_default(|_| {});
+}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr
new file mode 100644
index 0000000..b110734
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr
@@ -0,0 +1,15 @@
+error[E0277]: expected a `Fn<(<_ as ATC<'a>>::Type,)>` closure, found `F`
+ --> $DIR/issue-62529-3.rs:25:9
+ |
+LL | call(f, ());
+ | ^^^^ expected an `Fn<(<_ as ATC<'a>>::Type,)>` closure, found `F`
+ |
+note: required by a bound in `call`
+ --> $DIR/issue-62529-3.rs:9:36
+ |
+LL | fn call<'b, T: for<'a> ATC<'a>, F: for<'a> Fn(<T as ATC<'a>>::Type)>(
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-4.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-4.rs
new file mode 100644
index 0000000..8c2a598
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-4.rs
@@ -0,0 +1,39 @@
+// check-pass
+
+use std::marker::PhantomData;
+use std::mem;
+
+trait Container<'a> {
+ type Root: 'a;
+}
+
+type RootOf<'a, T> = <T as Container<'a>>::Root;
+
+struct Test<'a, T> where T: Container<'a> {
+ pub root: T::Root,
+ marker: PhantomData<&'a mut &'a mut ()>,
+}
+
+impl<'a, 'b> Container<'b> for &'a str {
+ type Root = &'b str;
+}
+
+impl<'a, T> Test<'a, T> where T: for<'b> Container<'b> {
+ fn new(root: RootOf<'a, T>) -> Test<'a, T> {
+ Test {
+ root: root,
+ marker: PhantomData
+ }
+ }
+
+ fn with_mut<F, R>(&mut self, f: F) -> R where
+ F: for<'b> FnOnce(&'b mut RootOf<'b, T>) -> R {
+ f(unsafe { mem::transmute(&mut self.root) })
+ }
+}
+
+fn main() {
+ let val = "root";
+ let mut test: Test<&str> = Test::new(val);
+ test.with_mut(|_| { });
+}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-5.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-5.rs
new file mode 100644
index 0000000..03f257a
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-5.rs
@@ -0,0 +1,27 @@
+// check-pass
+
+pub struct Struct {}
+
+pub trait Trait<'a> {
+ type Assoc;
+
+ fn method() -> Self::Assoc;
+}
+
+impl<'a> Trait<'a> for Struct {
+ type Assoc = ();
+
+ fn method() -> Self::Assoc {}
+}
+
+pub fn function<F, T>(f: F)
+where
+ F: for<'a> FnOnce(<T as Trait<'a>>::Assoc),
+ T: for<'b> Trait<'b>,
+{
+ f(T::method());
+}
+
+fn main() {
+ function::<_, Struct>(|_| {});
+}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-6.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-6.rs
new file mode 100644
index 0000000..74a4785
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-6.rs
@@ -0,0 +1,77 @@
+// check-pass
+
+use std::cell::RefMut;
+
+fn main() {
+ StateMachine2::Init.resume();
+}
+
+enum StateMachine2<'a> {
+ Init,
+ #[allow(dead_code)] // match required for ICE
+ AfterTwoYields {
+ p: Backed<'a, *mut String>,
+ },
+}
+
+impl<'a> StateMachine2<'a> {
+ fn take(&self) -> Self {
+ StateMachine2::Init
+ }
+}
+
+impl<'a> StateMachine2<'a> {
+ fn resume(&mut self) -> () {
+ use StateMachine2::*;
+ match self.take() {
+ AfterTwoYields { p } => {
+ p.with(|_| {});
+ }
+ _ => panic!("Resume after completed."),
+ }
+ }
+}
+
+unsafe trait Unpack<'a> {
+ type Unpacked: 'a;
+
+ fn unpack(&self) -> Self::Unpacked {
+ unsafe { std::mem::transmute_copy(&self) }
+ }
+}
+
+unsafe trait Pack {
+ type Packed;
+
+ fn pack(&self) -> Self::Packed {
+ unsafe { std::mem::transmute_copy(&self) }
+ }
+}
+
+unsafe impl<'a> Unpack<'a> for String {
+ type Unpacked = String;
+}
+
+unsafe impl Pack for String {
+ type Packed = String;
+}
+
+unsafe impl<'a> Unpack<'a> for *mut String {
+ type Unpacked = &'a mut String;
+}
+
+unsafe impl<'a> Pack for &'a mut String {
+ type Packed = *mut String;
+}
+
+struct Backed<'a, U>(RefMut<'a, Option<String>>, U);
+
+impl<'a, 'b, U: Unpack<'b>> Backed<'a, U> {
+ fn with<F>(self, f: F) -> Backed<'a, ()>
+ where
+ F: for<'f> FnOnce(<U as Unpack<'f>>::Unpacked) -> (),
+ {
+ let result = f(self.1.unpack());
+ Backed(self.0, result)
+ }
+}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.rs
new file mode 100644
index 0000000..87d1a25
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.rs
@@ -0,0 +1,29 @@
+pub trait MyTrait<'a> {
+ type Output: 'a;
+ fn gimme_value(&self) -> Self::Output;
+}
+
+pub struct MyStruct;
+
+impl<'a> MyTrait<'a> for MyStruct {
+ type Output = &'a usize;
+ fn gimme_value(&self) -> Self::Output {
+ unimplemented!()
+ }
+}
+
+fn meow<T, F>(t: T, f: F)
+where
+ T: for<'any> MyTrait<'any>,
+ F: for<'any2> Fn(<T as MyTrait<'any2>>::Output),
+{
+ let v = t.gimme_value();
+ f(v);
+}
+
+fn main() {
+ let struc = MyStruct;
+ meow(struc, |foo| { //~ type mismatch
+ println!("{:?}", foo);
+ })
+}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.stderr
new file mode 100644
index 0000000..efc9568
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-70120.stderr
@@ -0,0 +1,20 @@
+error[E0631]: type mismatch in closure arguments
+ --> $DIR/issue-70120.rs:26:5
+ |
+LL | meow(struc, |foo| {
+ | ^^^^ ----- found signature of `for<'r> fn(&'r usize) -> _`
+ | |
+ | expected signature of `for<'any2> fn(<MyStruct as MyTrait<'any2>>::Output) -> _`
+ |
+note: required by a bound in `meow`
+ --> $DIR/issue-70120.rs:18:8
+ |
+LL | fn meow<T, F>(t: T, f: F)
+ | ---- required by a bound in this
+...
+LL | F: for<'any2> Fn(<T as MyTrait<'any2>>::Output),
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `meow`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0631`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.nll.stderr
index 4cca552..439a113 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.nll.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.nll.stderr
@@ -1,14 +1,17 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/hr-subtype.rs:45:13
|
LL | gimme::<$t1>(None::<$t2>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
...
LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32,
LL | | for<'a> fn(&'a u32, &'a u32) -> &'a u32) }
| |_____________________________________________- in this macro invocation
|
+ = note: expected enum `Option<for<'r, 's> fn(&'r u32, &'s u32) -> &'r u32>`
+ found enum `Option<for<'r> fn(&'r u32, &'r u32) -> &'r u32>`
= note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.nll.stderr
index 2c1ac12..61b3f0c 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.nll.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.nll.stderr
@@ -1,14 +1,17 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/hr-subtype.rs:45:13
|
LL | gimme::<$t1>(None::<$t2>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
...
LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32),
LL | | fn(&'x u32)) }
| |______________- in this macro invocation
|
+ = note: expected enum `Option<for<'r> fn(&'r u32)>`
+ found enum `Option<fn(&u32)>`
= note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.nll.stderr
index 8169846..75e2ba5 100644
--- a/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.nll.stderr
+++ b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.nll.stderr
@@ -1,26 +1,31 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/hr-subtype.rs:45:13
|
LL | gimme::<$t1>(None::<$t2>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
...
LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
LL | | for<'a> fn(Inv<'a>, Inv<'a>)) }
| |__________________________________- in this macro invocation
|
+ = note: expected enum `Option<for<'r, 's> fn(Inv<'r>, Inv<'s>)>`
+ found enum `Option<for<'r> fn(Inv<'r>, Inv<'r>)>`
= note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/hr-subtype.rs:45:13
|
LL | gimme::<$t1>(None::<$t2>);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
...
LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>),
LL | | for<'a> fn(Inv<'a>, Inv<'a>)) }
| |__________________________________- in this macro invocation
|
+ = note: expected enum `Option<for<'r, 's> fn(Inv<'r>, Inv<'s>)>`
+ found enum `Option<for<'r> fn(Inv<'r>, Inv<'r>)>`
= note: this error originates in the macro `check` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hrtb/due-to-where-clause.nll.stderr b/src/test/ui/hrtb/due-to-where-clause.nll.stderr
deleted file mode 100644
index 90803a0..0000000
--- a/src/test/ui/hrtb/due-to-where-clause.nll.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: higher-ranked subtype error
- --> $DIR/due-to-where-clause.rs:2:5
- |
-LL | test::<FooS>(&mut 42);
- | ^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/hrtb/hrtb-cache-issue-54302.nll.stderr b/src/test/ui/hrtb/hrtb-cache-issue-54302.nll.stderr
deleted file mode 100644
index 4de35d7..0000000
--- a/src/test/ui/hrtb/hrtb-cache-issue-54302.nll.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: higher-ranked subtype error
- --> $DIR/hrtb-cache-issue-54302.rs:19:5
- |
-LL | assert_deserialize_owned::<&'static str>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr
index f290a93..46f5308 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-conflate-regions.nll.stderr
@@ -1,14 +1,20 @@
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/hrtb-conflate-regions.rs:27:10
|
LL | fn b() { want_foo2::<SomeStruct>(); }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
+ = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/hrtb-conflate-regions.rs:27:10
|
LL | fn b() { want_foo2::<SomeStruct>(); }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `SomeStruct` must implement `Foo<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
+ = note: ...but it actually implements `Foo<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-fn.nll.stderr b/src/test/ui/hrtb/hrtb-exists-forall-fn.nll.stderr
index 11390d9..1ee3c67 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-fn.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-exists-forall-fn.nll.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/hrtb-exists-forall-fn.rs:17:12
|
LL | let _: for<'b> fn(&'b u32) = foo();
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'b> fn(&'b u32)`
+ found fn pointer `fn(&u32)`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-fn.rs b/src/test/ui/hrtb/hrtb-exists-forall-fn.rs
index 828331c..5678023 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-fn.rs
+++ b/src/test/ui/hrtb/hrtb-exists-forall-fn.rs
@@ -1,4 +1,4 @@
-// Test a `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
+// Test an `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
//
// In particular, we test this pattern in trait solving, where it is not connected
// to any part of the source code.
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr
index a4c3ffd..364b613 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.nll.stderr
@@ -1,8 +1,11 @@
-error: higher-ranked subtype error
+error: implementation of `Trait` is not general enough
--> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5
|
LL | foo::<()>();
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `()` must implement `Trait<for<'b> fn(&'b u32)>`
+ = note: ...but it actually implements `Trait<fn(&'0 u32)>`, for some specific lifetime `'0`
error: aborting due to previous error
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr
index e2a399b..cb2ce8a 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.nll.stderr
@@ -1,8 +1,11 @@
-error: higher-ranked subtype error
+error: implementation of `Trait` is not general enough
--> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5
|
LL | foo::<()>();
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `()` must implement `Trait<for<'b> fn(Cell<&'b u32>)>`
+ = note: ...but it actually implements `Trait<fn(Cell<&'0 u32>)>`, for some specific lifetime `'0`
error: aborting due to previous error
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
index b1b7ec6..9b9e449 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
+++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
@@ -1,4 +1,4 @@
-// Test a `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
+// Test an `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
//
// In particular, we test this pattern in trait solving, where it is not connected
// to any part of the source code.
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr
index 87a1388..d826771 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr
+++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr
@@ -1,18 +1,20 @@
error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:26
|
-LL | fn want_bar_for_any_ccx<B>(b: &B)
- | -------------------- required by a bound in this
-LL | where B : for<'ccx> Bar<'ccx>
- | ------------------- required by this bound in `want_bar_for_any_ccx`
-...
LL | want_bar_for_any_ccx(b);
| ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
|
+note: required by a bound in `want_bar_for_any_ccx`
+ --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:32:15
+ |
+LL | fn want_bar_for_any_ccx<B>(b: &B)
+ | -------------------- required by a bound in this
+LL | where B : for<'ccx> Bar<'ccx>
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `want_bar_for_any_ccx`
help: consider further restricting this bound
|
LL | where B : Qux + for<'ccx> Bar<'ccx>
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr
index 0123faa..a510c05 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr
+++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr
@@ -3,32 +3,36 @@
|
LL | want_foo_for_any_tcx(f);
| ^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
-...
+ |
+note: required by a bound in `want_foo_for_any_tcx`
+ --> $DIR/hrtb-higher-ranker-supertraits.rs:22:15
+ |
LL | fn want_foo_for_any_tcx<F>(f: &F)
| -------------------- required by a bound in this
LL | where F : for<'tcx> Foo<'tcx>
- | ------------------- required by this bound in `want_foo_for_any_tcx`
- |
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `want_foo_for_any_tcx`
help: consider further restricting this bound
|
LL | where F : Foo<'x> + for<'tcx> Foo<'tcx>
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits.rs:35:26
|
LL | want_bar_for_any_ccx(b);
| ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`
-...
+ |
+note: required by a bound in `want_bar_for_any_ccx`
+ --> $DIR/hrtb-higher-ranker-supertraits.rs:39:15
+ |
LL | fn want_bar_for_any_ccx<B>(b: &B)
| -------------------- required by a bound in this
LL | where B : for<'ccx> Bar<'ccx>
- | ------------------- required by this bound in `want_bar_for_any_ccx`
- |
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `want_bar_for_any_ccx`
help: consider further restricting this bound
|
LL | where B : Bar<'x> + for<'ccx> Bar<'ccx>
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr b/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr
index 8901a1b..17d59bb 100644
--- a/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-just-for-static.nll.stderr
@@ -1,8 +1,11 @@
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/hrtb-just-for-static.rs:24:5
|
LL | want_hrtb::<StaticInt>()
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `StaticInt` must implement `Foo<&'0 isize>`, for any lifetime `'0`...
+ = note: ...but it actually implements `Foo<&'static isize>`
error: lifetime may not live long enough
--> $DIR/hrtb-just-for-static.rs:30:5
@@ -14,11 +17,14 @@
|
= help: consider replacing `'a` with `'static`
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/hrtb-just-for-static.rs:30:5
|
LL | want_hrtb::<&'a u32>()
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<&'0 isize>` would have to be implemented for the type `&u32`, for any lifetime `'0`...
+ = note: ...but `Foo<&'1 isize>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr
index c3dd794..aefe3cd 100644
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr
+++ b/src/test/ui/hrtb/hrtb-perfect-forwarding.nll.stderr
@@ -57,11 +57,14 @@
|
= help: consider replacing `'b` with `'static`
-error: higher-ranked subtype error
+error: implementation of `Bar` is not general enough
--> $DIR/hrtb-perfect-forwarding.rs:43:5
|
LL | foo_hrtb_bar_not(&mut t);
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Bar` is not general enough
+ |
+ = note: `T` must implement `Bar<&'0 isize>`, for any lifetime `'0`...
+ = note: ...but it actually implements `Bar<&'1 isize>`, for some specific lifetime `'1`
warning: function cannot return without recursing
--> $DIR/hrtb-perfect-forwarding.rs:48:1
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr
index 676a9345..a94c80e 100644
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr
+++ b/src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr
@@ -1,11 +1,11 @@
warning: function cannot return without recursing
- --> $DIR/hrtb-perfect-forwarding.rs:22:1
+ --> $DIR/hrtb-perfect-forwarding.rs:16:1
|
-LL | / fn no_hrtb<'b,T>(mut t: T)
-LL | | where T : Bar<&'b isize>
+LL | / fn no_hrtb<'b, T>(mut t: T)
+LL | | where
+LL | | T: Bar<&'b isize>,
LL | | {
-LL | | // OK -- `T : Bar<&'b isize>`, and thus the impl above ensures that
-LL | | // `&mut T : Bar<&'b isize>`.
+... |
LL | | no_hrtb(&mut t);
| | --------------- recursive call site
LL | | }
@@ -15,12 +15,12 @@
= help: a `loop` may express intention better if this is on purpose
warning: function cannot return without recursing
- --> $DIR/hrtb-perfect-forwarding.rs:30:1
+ --> $DIR/hrtb-perfect-forwarding.rs:25:1
|
LL | / fn bar_hrtb<T>(mut t: T)
-LL | | where T : for<'b> Bar<&'b isize>
+LL | | where
+LL | | T: for<'b> Bar<&'b isize>,
LL | | {
-LL | | // OK -- `T : for<'b> Bar<&'b isize>`, and thus the impl above
... |
LL | | bar_hrtb(&mut t);
| | ---------------- recursive call site
@@ -30,34 +30,36 @@
= help: a `loop` may express intention better if this is on purpose
warning: function cannot return without recursing
- --> $DIR/hrtb-perfect-forwarding.rs:39:1
+ --> $DIR/hrtb-perfect-forwarding.rs:35:1
|
-LL | / fn foo_hrtb_bar_not<'b,T>(mut t: T)
-LL | | where T : for<'a> Foo<&'a isize> + Bar<&'b isize>
+LL | / fn foo_hrtb_bar_not<'b, T>(mut t: T)
+LL | | where
+LL | | T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
LL | | {
-LL | | // Not OK -- The forwarding impl for `Foo` requires that `Bar` also
... |
LL | | foo_hrtb_bar_not(&mut t);
| | ------------------------ recursive call site
LL | |
+LL | |
LL | | }
| |_^ cannot return without recursing
|
= help: a `loop` may express intention better if this is on purpose
error: higher-ranked subtype error
- --> $DIR/hrtb-perfect-forwarding.rs:46:5
+ --> $DIR/hrtb-perfect-forwarding.rs:43:5
|
LL | foo_hrtb_bar_not(&mut t);
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: function cannot return without recursing
- --> $DIR/hrtb-perfect-forwarding.rs:50:1
+ --> $DIR/hrtb-perfect-forwarding.rs:48:1
|
LL | / fn foo_hrtb_bar_hrtb<T>(mut t: T)
-LL | | where T : for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>
+LL | | where
+LL | | T: for<'a> Foo<&'a isize> + for<'b> Bar<&'b isize>,
LL | | {
-LL | | // OK -- now we have `T : for<'b> Bar&'b isize>`.
+LL | | // OK -- now we have `T : for<'b> Bar<&'b isize>`.
LL | | foo_hrtb_bar_hrtb(&mut t);
| | ------------------------- recursive call site
LL | | }
@@ -65,5 +67,5 @@
|
= help: a `loop` may express intention better if this is on purpose
-error: aborting due to previous error
+error: aborting due to previous error; 4 warnings emitted
diff --git a/src/test/ui/hrtb/issue-46989.nll.stderr b/src/test/ui/hrtb/issue-46989.nll.stderr
index 6c127b9..309e1a6 100644
--- a/src/test/ui/hrtb/issue-46989.nll.stderr
+++ b/src/test/ui/hrtb/issue-46989.nll.stderr
@@ -1,8 +1,11 @@
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/issue-46989.rs:38:5
|
LL | assert_foo::<fn(&i32)>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r i32)`
+ = note: ...but `Foo` is actually implemented for the type `fn(&'0 i32)`, for some specific lifetime `'0`
error: aborting due to previous error
diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr
index 7b81bee..97f53bc 100644
--- a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr
+++ b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]> as T0<'r, (<Unit2 as Ty<'r>>::V,)>>::O == <_ as Ty<'r>>::V`
+error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V`
--> $DIR/issue-62203-hrtb-ice.rs:38:19
|
LL | let v = Unit2.m(
@@ -9,13 +9,13 @@
= help: consider constraining the associated type `<_ as Ty<'_>>::V` to `Unit4`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html
-error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&u8,),)>>::Output == Unit3`
+error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39] as FnOnce<((&'r u8,),)>>::Output == Unit3`
--> $DIR/issue-62203-hrtb-ice.rs:38:19
|
LL | let v = Unit2.m(
| ^ expected struct `Unit4`, found struct `Unit3`
|
-note: required because of the requirements on the impl of `for<'r> T0<'r, (<Unit2 as Ty<'r>>::V,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>`
+note: required because of the requirements on the impl of `for<'r> T0<'r, (&'r u8,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>`
--> $DIR/issue-62203-hrtb-ice.rs:17:16
|
LL | impl<'a, A, T> T0<'a, A> for L<T>
diff --git a/src/test/ui/hygiene/auxiliary/intercrate.rs b/src/test/ui/hygiene/auxiliary/intercrate.rs
index 10d399b..0685358 100644
--- a/src/test/ui/hygiene/auxiliary/intercrate.rs
+++ b/src/test/ui/hygiene/auxiliary/intercrate.rs
@@ -5,7 +5,7 @@
mod bar {
fn f() -> u32 { 1 }
pub macro m() {
- f();
+ f()
}
}
}
diff --git a/src/test/ui/hygiene/expansion-info-reset.stderr b/src/test/ui/hygiene/expansion-info-reset.stderr
index 216f7a2..64d27e0 100644
--- a/src/test/ui/hygiene/expansion-info-reset.stderr
+++ b/src/test/ui/hygiene/expansion-info-reset.stderr
@@ -7,7 +7,7 @@
help: you might be missing a string literal to format with
|
LL | format_args!("{}", { #[derive(Clone)] struct S; });
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/hygiene/generic_params.rs b/src/test/ui/hygiene/generic_params.rs
index d319ae6..3b6216c 100644
--- a/src/test/ui/hygiene/generic_params.rs
+++ b/src/test/ui/hygiene/generic_params.rs
@@ -3,8 +3,7 @@
// check-pass
// ignore-pretty pretty-printing is unhygienic
-#![feature(decl_macro, rustc_attrs, const_generics)]
-//~^ WARNING the feature `const_generics` is incomplete
+#![feature(decl_macro, rustc_attrs)]
mod type_params {
macro m($T:ident) {
diff --git a/src/test/ui/hygiene/generic_params.stderr b/src/test/ui/hygiene/generic_params.stderr
deleted file mode 100644
index 4ca6d19..0000000
--- a/src/test/ui/hygiene/generic_params.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_params.rs:6:37
- |
-LL | #![feature(decl_macro, rustc_attrs, const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/hygiene/hygienic-label-1.rs b/src/test/ui/hygiene/hygienic-label-1.rs
index 66361ee..a06d9255 100644
--- a/src/test/ui/hygiene/hygienic-label-1.rs
+++ b/src/test/ui/hygiene/hygienic-label-1.rs
@@ -3,5 +3,5 @@
}
pub fn main() {
- 'x: loop { foo!() }
+ 'x: loop { foo!(); }
}
diff --git a/src/test/ui/hygiene/hygienic-label-1.stderr b/src/test/ui/hygiene/hygienic-label-1.stderr
index 97a7240..c1ed861 100644
--- a/src/test/ui/hygiene/hygienic-label-1.stderr
+++ b/src/test/ui/hygiene/hygienic-label-1.stderr
@@ -4,8 +4,8 @@
LL | () => { break 'x; }
| ^^ undeclared label `'x`
...
-LL | 'x: loop { foo!() }
- | ------ in this macro invocation
+LL | 'x: loop { foo!(); }
+ | ------- in this macro invocation
|
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/hygiene/hygienic-label-3.rs b/src/test/ui/hygiene/hygienic-label-3.rs
index a81eb84..ab0559e 100644
--- a/src/test/ui/hygiene/hygienic-label-3.rs
+++ b/src/test/ui/hygiene/hygienic-label-3.rs
@@ -4,6 +4,6 @@
pub fn main() {
'x: for _ in 0..1 {
- foo!()
+ foo!();
};
}
diff --git a/src/test/ui/hygiene/hygienic-label-3.stderr b/src/test/ui/hygiene/hygienic-label-3.stderr
index 5284004..29d1b67 100644
--- a/src/test/ui/hygiene/hygienic-label-3.stderr
+++ b/src/test/ui/hygiene/hygienic-label-3.stderr
@@ -4,8 +4,8 @@
LL | () => { break 'x; }
| ^^ undeclared label `'x`
...
-LL | foo!()
- | ------ in this macro invocation
+LL | foo!();
+ | ------- in this macro invocation
|
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/hygiene/issue-61574-const-parameters.rs b/src/test/ui/hygiene/issue-61574-const-parameters.rs
index 81e9b1b..3634ee0 100644
--- a/src/test/ui/hygiene/issue-61574-const-parameters.rs
+++ b/src/test/ui/hygiene/issue-61574-const-parameters.rs
@@ -3,8 +3,6 @@
// check-pass
-#![feature(const_generics)] //~ WARNING `const_generics` is incomplete
-
use std::ops::Add;
struct VectorLike<T, const SIZE: usize>([T; {SIZE}]);
diff --git a/src/test/ui/hygiene/issue-61574-const-parameters.stderr b/src/test/ui/hygiene/issue-61574-const-parameters.stderr
deleted file mode 100644
index b351b8b..0000000
--- a/src/test/ui/hygiene/issue-61574-const-parameters.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61574-const-parameters.rs:6:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/hygiene/rustc-macro-transparency.stderr b/src/test/ui/hygiene/rustc-macro-transparency.stderr
index 94256b2..ef650b7 100644
--- a/src/test/ui/hygiene/rustc-macro-transparency.stderr
+++ b/src/test/ui/hygiene/rustc-macro-transparency.stderr
@@ -13,7 +13,7 @@
help: use `!` to invoke the macro
|
LL | semitransparent!;
- | ^
+ | +
error[E0423]: expected value, found macro `opaque`
--> $DIR/rustc-macro-transparency.rs:30:5
@@ -24,7 +24,7 @@
help: use `!` to invoke the macro
|
LL | opaque!;
- | ^
+ | +
error: aborting due to 3 previous errors
diff --git a/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr b/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr
index 211a328..44955c5 100644
--- a/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr
+++ b/src/test/ui/impl-header-lifetime-elision/assoc-type.stderr
@@ -7,7 +7,7 @@
help: consider introducing a named lifetime parameter
|
LL | type Output<'a> = &'a i32;
- | ^^^^ ^^^
+ | ++++ ++
error[E0106]: missing lifetime specifier
--> $DIR/assoc-type.rs:16:20
@@ -18,7 +18,7 @@
help: consider introducing a named lifetime parameter
|
LL | type Output<'a> = &'a i32;
- | ^^^^ ^^
+ | ++++ ~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.full_tait.stderr b/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.full_tait.stderr
deleted file mode 100644
index 174c4c6..0000000
--- a/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/associated-impl-trait-type-generic-trait.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs b/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
index b2dad59..6c7c46b 100644
--- a/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
+++ b/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// build-pass (FIXME(62277): could be check-pass?)
trait Bar {}
diff --git a/src/test/ui/impl-trait/associated-impl-trait-type-trivial.full_tait.stderr b/src/test/ui/impl-trait/associated-impl-trait-type-trivial.full_tait.stderr
deleted file mode 100644
index e3dd4a6..0000000
--- a/src/test/ui/impl-trait/associated-impl-trait-type-trivial.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/associated-impl-trait-type-trivial.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs b/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs
index c101ba2..cdda341 100644
--- a/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs
+++ b/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// build-pass (FIXME(62277): could be check-pass?)
trait Bar {}
diff --git a/src/test/ui/impl-trait/associated-impl-trait-type.full_tait.stderr b/src/test/ui/impl-trait/associated-impl-trait-type.full_tait.stderr
deleted file mode 100644
index 39147b0..0000000
--- a/src/test/ui/impl-trait/associated-impl-trait-type.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/associated-impl-trait-type.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/associated-impl-trait-type.rs b/src/test/ui/impl-trait/associated-impl-trait-type.rs
index 5c28eba..d0661d6 100644
--- a/src/test/ui/impl-trait/associated-impl-trait-type.rs
+++ b/src/test/ui/impl-trait/associated-impl-trait-type.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// build-pass (FIXME(62277): could be check-pass?)
trait Bar {}
diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr
index 3eb141c..a31c104 100644
--- a/src/test/ui/impl-trait/auto-trait-leak.stderr
+++ b/src/test/ui/impl-trait/auto-trait-leak.stderr
@@ -30,10 +30,10 @@
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires type-checking `cycle1`...
- --> $DIR/auto-trait-leak.rs:12:1
+ --> $DIR/auto-trait-leak.rs:14:5
|
-LL | fn cycle1() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | send(cycle2().clone());
+ | ^^^^
= note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
note: ...which requires computing type of `cycle2::{opaque#0}`...
--> $DIR/auto-trait-leak.rs:19:16
@@ -66,10 +66,10 @@
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires type-checking `cycle2`...
- --> $DIR/auto-trait-leak.rs:19:1
+ --> $DIR/auto-trait-leak.rs:20:5
|
-LL | fn cycle2() -> impl Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | send(cycle1().clone());
+ | ^^^^
= note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
= note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
diff --git a/src/test/ui/impl-trait/auto-trait-leak2.stderr b/src/test/ui/impl-trait/auto-trait-leak2.stderr
index 6b2b824..5a8e503 100644
--- a/src/test/ui/impl-trait/auto-trait-leak2.stderr
+++ b/src/test/ui/impl-trait/auto-trait-leak2.stderr
@@ -4,22 +4,21 @@
LL | fn before() -> impl Fn(i32) {
| ------------ within this `impl Fn<(i32,)>`
...
-LL | fn send<T: Send>(_: T) {}
- | ---- required by this bound in `send`
-...
LL | send(before());
| ^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
|
= help: within `impl Fn<(i32,)>`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
= note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:7:5: 7:22]`
= note: required because it appears within the type `impl Fn<(i32,)>`
+note: required by a bound in `send`
+ --> $DIR/auto-trait-leak2.rs:10:12
+ |
+LL | fn send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `send`
error[E0277]: `Rc<Cell<i32>>` cannot be sent between threads safely
--> $DIR/auto-trait-leak2.rs:16:5
|
-LL | fn send<T: Send>(_: T) {}
- | ---- required by this bound in `send`
-...
LL | send(after());
| ^^^^ `Rc<Cell<i32>>` cannot be sent between threads safely
...
@@ -29,6 +28,11 @@
= help: within `impl Fn<(i32,)>`, the trait `Send` is not implemented for `Rc<Cell<i32>>`
= note: required because it appears within the type `[closure@$DIR/auto-trait-leak2.rs:24:5: 24:22]`
= note: required because it appears within the type `impl Fn<(i32,)>`
+note: required by a bound in `send`
+ --> $DIR/auto-trait-leak2.rs:10:12
+ |
+LL | fn send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `send`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-trait/auto-trait.full_tait.stderr b/src/test/ui/impl-trait/auto-trait.full_tait.stderr
deleted file mode 100644
index 3146177..0000000
--- a/src/test/ui/impl-trait/auto-trait.full_tait.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/auto-trait.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
- --> $DIR/auto-trait.rs:24:1
- |
-LL | impl<T: Send> AnotherTrait for T {}
- | -------------------------------- first implementation here
-...
-LL | impl AnotherTrait for D<OpaqueType> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/impl-trait/auto-trait.min_tait.stderr b/src/test/ui/impl-trait/auto-trait.min_tait.stderr
deleted file mode 100644
index 75a5b0c..0000000
--- a/src/test/ui/impl-trait/auto-trait.min_tait.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
- --> $DIR/auto-trait.rs:24:1
- |
-LL | impl<T: Send> AnotherTrait for T {}
- | -------------------------------- first implementation here
-...
-LL | impl AnotherTrait for D<OpaqueType> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/impl-trait/auto-trait.rs b/src/test/ui/impl-trait/auto-trait.rs
index c965a34..cf2773f 100644
--- a/src/test/ui/impl-trait/auto-trait.rs
+++ b/src/test/ui/impl-trait/auto-trait.rs
@@ -1,9 +1,6 @@
// Tests that type alias impls traits do not leak auto-traits for
// the purposes of coherence checking
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait OpaqueTrait {}
impl<T> OpaqueTrait for T {}
diff --git a/src/test/ui/impl-trait/auto-trait.stderr b/src/test/ui/impl-trait/auto-trait.stderr
new file mode 100644
index 0000000..26cd8fb
--- /dev/null
+++ b/src/test/ui/impl-trait/auto-trait.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
+ --> $DIR/auto-trait.rs:21:1
+ |
+LL | impl<T: Send> AnotherTrait for T {}
+ | -------------------------------- first implementation here
+...
+LL | impl AnotherTrait for D<OpaqueType> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/impl-trait/bound-normalization-fail.stderr b/src/test/ui/impl-trait/bound-normalization-fail.stderr
index 611543a..3c720f5 100644
--- a/src/test/ui/impl-trait/bound-normalization-fail.stderr
+++ b/src/test/ui/impl-trait/bound-normalization-fail.stderr
@@ -5,11 +5,11 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found `()`
|
= note: expected associated type `<T as impl_trait::Trait>::Assoc`
- found type `()`
+ found unit type `()`
help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
|
LL | fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error[E0760]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
--> $DIR/bound-normalization-fail.rs:41:41
@@ -24,11 +24,11 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found `()`
|
= note: expected associated type `<T as lifetimes::Trait<'static>>::Assoc`
- found type `()`
+ found unit type `()`
help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
|
LL | fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/impl-trait/bound-normalization-pass.rs b/src/test/ui/impl-trait/bound-normalization-pass.rs
index 4218bc5..5171807 100644
--- a/src/test/ui/impl-trait/bound-normalization-pass.rs
+++ b/src/test/ui/impl-trait/bound-normalization-pass.rs
@@ -4,7 +4,7 @@
//[sa] compile-flags: -Z save-analysis
//-^ To make this the regression test for #75962.
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
// See issue 60414
diff --git a/src/test/ui/impl-trait/does-not-live-long-enough.stderr b/src/test/ui/impl-trait/does-not-live-long-enough.stderr
index 468c2f3..f4bd0fd 100644
--- a/src/test/ui/impl-trait/does-not-live-long-enough.stderr
+++ b/src/test/ui/impl-trait/does-not-live-long-enough.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `prefix` (and any other referenced variables), use the `move` keyword
|
LL | self.data.iter().filter(move |s| s.starts_with(prefix)).map(|s| s.as_ref())
- | ^^^^^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr b/src/test/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
index 00145d1..0d4f82b 100644
--- a/src/test/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
+++ b/src/test/ui/impl-trait/dyn-trait-return-should-be-impl-trait.stderr
@@ -50,7 +50,7 @@
help: use `impl Trait` as the return type, as all return paths are of type `Struct`, which implements `Trait`
|
LL | fn bap() -> impl Trait { Struct }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:15:13
@@ -62,7 +62,7 @@
help: use `impl Trait` as the return type, as all return paths are of type `Struct`, which implements `Trait`
|
LL | fn ban() -> impl Trait { Struct }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:17:13
@@ -73,15 +73,15 @@
help: use some type `T` that is `T: Sized` as the return type if all return paths have the same type
|
LL | fn bak() -> T { unimplemented!() }
- | ^
+ | ~
help: use `impl Trait` as the return type if all return paths have the same type but you want to expose only the trait in the signature
|
LL | fn bak() -> impl Trait { unimplemented!() }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: use a boxed trait object if all return paths implement trait `Trait`
|
LL | fn bak() -> Box<dyn Trait> { unimplemented!() }
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:19:13
@@ -95,11 +95,11 @@
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn bal() -> Box<dyn Trait> {
+LL ~ fn bal() -> Box<dyn Trait> {
LL | if true {
-LL | return Box::new(Struct);
+LL ~ return Box::new(Struct);
LL | }
-LL | Box::new(42)
+LL ~ Box::new(42)
|
error[E0308]: `if` and `else` have incompatible types
@@ -126,11 +126,11 @@
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn bax() -> Box<dyn Trait> {
+LL ~ fn bax() -> Box<dyn Trait> {
LL | if true {
-LL | Box::new(Struct)
+LL ~ Box::new(Struct)
LL | } else {
-LL | Box::new(42)
+LL ~ Box::new(42)
|
error[E0308]: mismatched types
@@ -140,14 +140,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
LL | if true {
LL | return Struct;
- | ^^^^^^
- | |
- | expected struct `Box`, found struct `Struct`
- | help: store this in the heap by calling `Box::new`: `Box::new(Struct)`
+ | ^^^^^^ expected struct `Box`, found struct `Struct`
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found struct `Struct`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | return Box::new(Struct);
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:36:5
@@ -156,14 +157,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
...
LL | 42
- | ^^
- | |
- | expected struct `Box`, found integer
- | help: store this in the heap by calling `Box::new`: `Box::new(42)`
+ | ^^ expected struct `Box`, found integer
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found type `{integer}`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | Box::new(42)
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:40:16
@@ -172,14 +174,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
LL | if true {
LL | return 0;
- | ^
- | |
- | expected struct `Box`, found integer
- | help: store this in the heap by calling `Box::new`: `Box::new(0)`
+ | ^ expected struct `Box`, found integer
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found type `{integer}`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | return Box::new(0);
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:42:5
@@ -188,14 +191,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
...
LL | 42
- | ^^
- | |
- | expected struct `Box`, found integer
- | help: store this in the heap by calling `Box::new`: `Box::new(42)`
+ | ^^ expected struct `Box`, found integer
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found type `{integer}`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | Box::new(42)
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:46:9
@@ -204,14 +208,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
LL | if true {
LL | Struct
- | ^^^^^^
- | |
- | expected struct `Box`, found struct `Struct`
- | help: store this in the heap by calling `Box::new`: `Box::new(Struct)`
+ | ^^^^^^ expected struct `Box`, found struct `Struct`
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found struct `Struct`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | Box::new(Struct)
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:48:9
@@ -220,14 +225,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
...
LL | 42
- | ^^
- | |
- | expected struct `Box`, found integer
- | help: store this in the heap by calling `Box::new`: `Box::new(42)`
+ | ^^ expected struct `Box`, found integer
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found type `{integer}`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | Box::new(42)
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:53:9
@@ -236,14 +242,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
LL | if true {
LL | 0
- | ^
- | |
- | expected struct `Box`, found integer
- | help: store this in the heap by calling `Box::new`: `Box::new(0)`
+ | ^ expected struct `Box`, found integer
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found type `{integer}`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | Box::new(0)
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:55:9
@@ -252,14 +259,15 @@
| -------------- expected `Box<(dyn Trait + 'static)>` because of return type
...
LL | 42
- | ^^
- | |
- | expected struct `Box`, found integer
- | help: store this in the heap by calling `Box::new`: `Box::new(42)`
+ | ^^ expected struct `Box`, found integer
|
= note: expected struct `Box<(dyn Trait + 'static)>`
found type `{integer}`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | Box::new(42)
+ | +++++++++ +
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:60:13
@@ -271,7 +279,7 @@
help: use `impl Trait` as the return type, as all return paths are of type `{integer}`, which implements `Trait`
|
LL | fn bat() -> impl Trait {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:66:13
@@ -283,7 +291,7 @@
help: use `impl Trait` as the return type, as all return paths are of type `{integer}`, which implements `Trait`
|
LL | fn bay() -> impl Trait {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to 20 previous errors
diff --git a/src/test/ui/impl-trait/equality2.stderr b/src/test/ui/impl-trait/equality2.stderr
index 3318866..46053c6 100644
--- a/src/test/ui/impl-trait/equality2.stderr
+++ b/src/test/ui/impl-trait/equality2.stderr
@@ -38,7 +38,7 @@
help: consider constraining the associated type `<impl Foo as Leak>::T` to `i32`
|
LL | fn hide<T: Foo>(x: T) -> impl Foo<T = i32> {
- | ^^^^^^^^^
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/equality2.rs:38:10
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.rs
new file mode 100644
index 0000000..832a3e3
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.rs
@@ -0,0 +1,7 @@
+#![feature(explicit_generic_args_with_impl_trait)]
+
+fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
+
+fn main() {
+ foo::<str, String>("".to_string()); //~ ERROR E0107
+}
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr
new file mode 100644
index 0000000..3add042
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr
@@ -0,0 +1,17 @@
+error[E0107]: this function takes 1 generic argument but 2 generic arguments were supplied
+ --> $DIR/explicit-generic-args-for-impl.rs:6:5
+ |
+LL | foo::<str, String>("".to_string());
+ | ^^^ ------ help: remove this generic argument
+ | |
+ | expected 1 generic argument
+ |
+note: function defined here, with 1 generic parameter: `T`
+ --> $DIR/explicit-generic-args-for-impl.rs:3:4
+ |
+LL | fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
+ | ^^^ -
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args.rs
new file mode 100644
index 0000000..a6585bc
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+#![feature(explicit_generic_args_with_impl_trait)]
+
+fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
+
+fn main() {
+ foo::<str>("".to_string());
+}
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.rs
new file mode 100644
index 0000000..0e4d698
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.rs
@@ -0,0 +1,7 @@
+// gate-test-explicit_generic_args_with_impl_trait
+
+fn foo<T: ?Sized>(_f: impl AsRef<T>) {}
+
+fn main() {
+ foo::<str>("".to_string()); //~ ERROR E0632
+}
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr
new file mode 100644
index 0000000..6adc4e6
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/feature-gate.stderr
@@ -0,0 +1,9 @@
+error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
+ --> $DIR/feature-gate.rs:6:11
+ |
+LL | foo::<str>("".to_string());
+ | ^^^ explicit generic argument not allowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0632`.
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs
new file mode 100644
index 0000000..e2ee638
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/issue-87718.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+#![feature(explicit_generic_args_with_impl_trait)]
+
+fn f<T: ?Sized>(_: impl AsRef<T>, _: impl AsRef<T>) {}
+
+fn main() {
+ f::<[u8]>("a", b"a");
+}
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs
new file mode 100644
index 0000000..ffb0582
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.rs
@@ -0,0 +1,8 @@
+#![feature(explicit_generic_args_with_impl_trait)]
+
+fn f<T: ?Sized, U: ?Sized>(_: impl AsRef<T>, _: impl AsRef<U>) {}
+
+fn main() {
+ f::<[u8]>("a", b"a");
+ //~^ ERROR: this function takes 2 generic arguments but 1 generic argument was supplied
+}
diff --git a/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr
new file mode 100644
index 0000000..b6701b6
--- /dev/null
+++ b/src/test/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr
@@ -0,0 +1,21 @@
+error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
+ --> $DIR/not-enough-args.rs:6:5
+ |
+LL | f::<[u8]>("a", b"a");
+ | ^ ---- supplied 1 generic argument
+ | |
+ | expected 2 generic arguments
+ |
+note: function defined here, with 2 generic parameters: `T`, `U`
+ --> $DIR/not-enough-args.rs:3:4
+ |
+LL | fn f<T: ?Sized, U: ?Sized>(_: impl AsRef<T>, _: impl AsRef<U>) {}
+ | ^ - -
+help: add missing generic argument
+ |
+LL | f::<[u8], U>("a", b"a");
+ | +++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.stderr b/src/test/ui/impl-trait/impl-generic-mismatch.stderr
index 0e1ccd8..d1a04af 100644
--- a/src/test/ui/impl-trait/impl-generic-mismatch.stderr
+++ b/src/test/ui/impl-trait/impl-generic-mismatch.stderr
@@ -9,8 +9,9 @@
|
help: try removing the generic parameter and using `impl Trait` instead
|
-LL | fn foo(&self, _: &impl Debug) { }
- | -- ^^^^^^^^^^
+LL - fn foo<U: Debug>(&self, _: &U) { }
+LL + fn foo(&self, _: &impl Debug) { }
+ |
error[E0643]: method `bar` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:17:23
@@ -24,14 +25,14 @@
help: try changing the `impl Trait` argument to a generic parameter
|
LL | fn bar<U: Debug>(&self, _: &U) { }
- | ^^^^^^^^^^ ^
+ | ++++++++++ ~
error[E0643]: method `hash` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:28:33
|
LL | fn hash(&self, hasher: &mut impl Hasher) {}
| ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
- |
+ |
::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
LL | fn hash<H: Hasher>(&self, state: &mut H);
diff --git a/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr b/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr
deleted file mode 100644
index 286dd7a..0000000
--- a/src/test/ui/impl-trait/issue-55872-1.full_tait.stderr
+++ /dev/null
@@ -1,57 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-55872-1.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0276]: impl has stricter requirements than trait
- --> $DIR/issue-55872-1.rs:17:5
- |
-LL | fn foo<T>() -> Self::E;
- | ----------------------- definition of `foo` from trait
-...
-LL | fn foo<T: Default>() -> Self::E {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default`
-
-error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
- --> $DIR/issue-55872-1.rs:13:14
- |
-LL | type E = impl Copy;
- | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S`
- |
- = note: required because it appears within the type `(S, T)`
-help: consider further restricting this bound
- |
-LL | impl<S: Default + std::marker::Copy> Bar for S {
- | ^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
- --> $DIR/issue-55872-1.rs:13:14
- |
-LL | type E = impl Copy;
- | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T`
- |
- = note: required because it appears within the type `(S, T)`
-help: consider further restricting this bound
- |
-LL | fn foo<T: Default + std::marker::Copy>() -> Self::E {
- | ^^^^^^^^^^^^^^^^^^^
-
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872-1.rs:17:37
- |
-LL | fn foo<T: Default>() -> Self::E {
- | _____________________________________^
-LL | |
-LL | |
-LL | | (S::default(), T::default())
-LL | | }
- | |_____^
-
-error: aborting due to 4 previous errors; 1 warning emitted
-
-Some errors have detailed explanations: E0276, E0277.
-For more information about an error, try `rustc --explain E0276`.
diff --git a/src/test/ui/impl-trait/issue-55872-1.min_tait.stderr b/src/test/ui/impl-trait/issue-55872-1.min_tait.stderr
deleted file mode 100644
index 653299f..0000000
--- a/src/test/ui/impl-trait/issue-55872-1.min_tait.stderr
+++ /dev/null
@@ -1,48 +0,0 @@
-error[E0276]: impl has stricter requirements than trait
- --> $DIR/issue-55872-1.rs:17:5
- |
-LL | fn foo<T>() -> Self::E;
- | ----------------------- definition of `foo` from trait
-...
-LL | fn foo<T: Default>() -> Self::E {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default`
-
-error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
- --> $DIR/issue-55872-1.rs:13:14
- |
-LL | type E = impl Copy;
- | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S`
- |
- = note: required because it appears within the type `(S, T)`
-help: consider further restricting this bound
- |
-LL | impl<S: Default + std::marker::Copy> Bar for S {
- | ^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
- --> $DIR/issue-55872-1.rs:13:14
- |
-LL | type E = impl Copy;
- | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T`
- |
- = note: required because it appears within the type `(S, T)`
-help: consider further restricting this bound
- |
-LL | fn foo<T: Default + std::marker::Copy>() -> Self::E {
- | ^^^^^^^^^^^^^^^^^^^
-
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872-1.rs:17:37
- |
-LL | fn foo<T: Default>() -> Self::E {
- | _____________________________________^
-LL | |
-LL | |
-LL | | (S::default(), T::default())
-LL | | }
- | |_____^
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0276, E0277.
-For more information about an error, try `rustc --explain E0276`.
diff --git a/src/test/ui/impl-trait/issue-55872-1.rs b/src/test/ui/impl-trait/issue-55872-1.rs
index a9e9c9b..4618863 100644
--- a/src/test/ui/impl-trait/issue-55872-1.rs
+++ b/src/test/ui/impl-trait/issue-55872-1.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub trait Bar {
type E: Copy;
@@ -11,12 +8,12 @@
impl<S: Default> Bar for S {
type E = impl Copy;
- //~^ ERROR the trait bound `S: Copy` is not satisfied in `(S, T)` [E0277]
- //~^^ ERROR the trait bound `T: Copy` is not satisfied in `(S, T)` [E0277]
fn foo<T: Default>() -> Self::E {
//~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
//~| ERROR impl has stricter requirements than trait
+ //~| ERROR the trait bound `S: Copy` is not satisfied in `(S, T)` [E0277]
+ //~| ERROR the trait bound `T: Copy` is not satisfied in `(S, T)` [E0277]
(S::default(), T::default())
}
}
diff --git a/src/test/ui/impl-trait/issue-55872-1.stderr b/src/test/ui/impl-trait/issue-55872-1.stderr
new file mode 100644
index 0000000..e772445
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-55872-1.stderr
@@ -0,0 +1,50 @@
+error[E0276]: impl has stricter requirements than trait
+ --> $DIR/issue-55872-1.rs:12:5
+ |
+LL | fn foo<T>() -> Self::E;
+ | ----------------------- definition of `foo` from trait
+...
+LL | fn foo<T: Default>() -> Self::E {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default`
+
+error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
+ --> $DIR/issue-55872-1.rs:12:29
+ |
+LL | fn foo<T: Default>() -> Self::E {
+ | ^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S`
+ |
+ = note: required because it appears within the type `(S, T)`
+help: consider further restricting this bound
+ |
+LL | impl<S: Default + std::marker::Copy> Bar for S {
+ | +++++++++++++++++++
+
+error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
+ --> $DIR/issue-55872-1.rs:12:29
+ |
+LL | fn foo<T: Default>() -> Self::E {
+ | ^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T`
+ |
+ = note: required because it appears within the type `(S, T)`
+help: consider further restricting this bound
+ |
+LL | fn foo<T: Default + std::marker::Copy>() -> Self::E {
+ | +++++++++++++++++++
+
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ --> $DIR/issue-55872-1.rs:12:37
+ |
+LL | fn foo<T: Default>() -> Self::E {
+ | _____________________________________^
+LL | |
+LL | |
+LL | |
+LL | |
+LL | | (S::default(), T::default())
+LL | | }
+ | |_____^
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0276, E0277.
+For more information about an error, try `rustc --explain E0276`.
diff --git a/src/test/ui/impl-trait/issue-55872-2.full_tait.stderr b/src/test/ui/impl-trait/issue-55872-2.full_tait.stderr
deleted file mode 100644
index a8fc681..0000000
--- a/src/test/ui/impl-trait/issue-55872-2.full_tait.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-55872-2.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0277]: the trait bound `impl Future: Copy` is not satisfied
- --> $DIR/issue-55872-2.rs:16:14
- |
-LL | type E = impl std::marker::Copy;
- | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future`
-
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872-2.rs:18:28
- |
-LL | fn foo<T>() -> Self::E {
- | ____________________________^
-LL | |
-LL | | async {}
-LL | | }
- | |_____^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/impl-trait/issue-55872-2.min_tait.stderr b/src/test/ui/impl-trait/issue-55872-2.min_tait.stderr
deleted file mode 100644
index 57f8144..0000000
--- a/src/test/ui/impl-trait/issue-55872-2.min_tait.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `impl Future: Copy` is not satisfied
- --> $DIR/issue-55872-2.rs:16:14
- |
-LL | type E = impl std::marker::Copy;
- | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future`
-
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872-2.rs:18:28
- |
-LL | fn foo<T>() -> Self::E {
- | ____________________________^
-LL | |
-LL | | async {}
-LL | | }
- | |_____^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/impl-trait/issue-55872-2.rs b/src/test/ui/impl-trait/issue-55872-2.rs
index cd72b2e..9546d01 100644
--- a/src/test/ui/impl-trait/issue-55872-2.rs
+++ b/src/test/ui/impl-trait/issue-55872-2.rs
@@ -1,10 +1,7 @@
// edition:2018
// ignore-compare-mode-chalk
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub trait Bar {
type E: Copy;
@@ -14,9 +11,9 @@
impl<S> Bar for S {
type E = impl std::marker::Copy;
- //~^ ERROR the trait bound `impl Future: Copy` is not satisfied [E0277]
fn foo<T>() -> Self::E {
//~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ //~| ERROR the trait bound `impl Future: Copy` is not satisfied [E0277]
async {}
}
}
diff --git a/src/test/ui/impl-trait/issue-55872-2.stderr b/src/test/ui/impl-trait/issue-55872-2.stderr
new file mode 100644
index 0000000..31b8fbd
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-55872-2.stderr
@@ -0,0 +1,20 @@
+error[E0277]: the trait bound `impl Future: Copy` is not satisfied
+ --> $DIR/issue-55872-2.rs:14:20
+ |
+LL | fn foo<T>() -> Self::E {
+ | ^^^^^^^ the trait `Copy` is not implemented for `impl Future`
+
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ --> $DIR/issue-55872-2.rs:14:28
+ |
+LL | fn foo<T>() -> Self::E {
+ | ____________________________^
+LL | |
+LL | |
+LL | | async {}
+LL | | }
+ | |_____^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/impl-trait/issue-55872.full_tait.stderr b/src/test/ui/impl-trait/issue-55872.full_tait.stderr
deleted file mode 100644
index e549fec..0000000
--- a/src/test/ui/impl-trait/issue-55872.full_tait.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-55872.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872.rs:16:28
- |
-LL | fn foo<T>() -> Self::E {
- | ____________________________^
-LL | |
-LL | | || ()
-LL | | }
- | |_____^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/issue-55872.min_tait.stderr b/src/test/ui/impl-trait/issue-55872.min_tait.stderr
deleted file mode 100644
index 341dba9..0000000
--- a/src/test/ui/impl-trait/issue-55872.min_tait.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872.rs:16:28
- |
-LL | fn foo<T>() -> Self::E {
- | ____________________________^
-LL | |
-LL | | || ()
-LL | | }
- | |_____^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/impl-trait/issue-55872.rs b/src/test/ui/impl-trait/issue-55872.rs
index e3fc523..bbd9402 100644
--- a/src/test/ui/impl-trait/issue-55872.rs
+++ b/src/test/ui/impl-trait/issue-55872.rs
@@ -1,8 +1,5 @@
// ignore-compare-mode-chalk
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub trait Bar {
type E: Copy;
@@ -14,7 +11,7 @@
type E = impl Copy;
fn foo<T>() -> Self::E {
- //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
|| ()
}
}
diff --git a/src/test/ui/impl-trait/issue-55872.stderr b/src/test/ui/impl-trait/issue-55872.stderr
new file mode 100644
index 0000000..60654ec
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-55872.stderr
@@ -0,0 +1,12 @@
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ --> $DIR/issue-55872.rs:13:28
+ |
+LL | fn foo<T>() -> Self::E {
+ | ____________________________^
+LL | |
+LL | | || ()
+LL | | }
+ | |_____^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/impl-trait/issue-86465.rs b/src/test/ui/impl-trait/issue-86465.rs
index 23a3748..a6976da 100644
--- a/src/test/ui/impl-trait/issue-86465.rs
+++ b/src/test/ui/impl-trait/issue-86465.rs
@@ -1,4 +1,4 @@
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
type X<'a, 'b> = impl std::fmt::Debug;
diff --git a/src/test/ui/impl-trait/issue-87450.rs b/src/test/ui/impl-trait/issue-87450.rs
new file mode 100644
index 0000000..983ef7c
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-87450.rs
@@ -0,0 +1,16 @@
+fn bar() -> impl Fn() {
+ wrap(wrap(wrap(wrap(foo()))))
+}
+
+fn foo() -> impl Fn() {
+ //~^ WARNING 5:1: 5:22: function cannot return without recursing [unconditional_recursion]
+ //~| ERROR 5:13: 5:22: cannot resolve opaque type [E0720]
+ wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
+}
+
+fn wrap(f: impl Fn()) -> impl Fn() {
+ move || f()
+}
+
+fn main() {
+}
diff --git a/src/test/ui/impl-trait/issue-87450.stderr b/src/test/ui/impl-trait/issue-87450.stderr
new file mode 100644
index 0000000..83eb33e
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-87450.stderr
@@ -0,0 +1,27 @@
+warning: function cannot return without recursing
+ --> $DIR/issue-87450.rs:5:1
+ |
+LL | fn foo() -> impl Fn() {
+ | ^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
+...
+LL | wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
+ | ----- recursive call site
+ |
+ = note: `#[warn(unconditional_recursion)]` on by default
+ = help: a `loop` may express intention better if this is on purpose
+
+error[E0720]: cannot resolve opaque type
+ --> $DIR/issue-87450.rs:5:13
+ |
+LL | fn foo() -> impl Fn() {
+ | ^^^^^^^^^ recursive opaque type
+...
+LL | wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
+ | ----------------------------------------------- returning here with type `impl Fn<()>`
+...
+LL | fn wrap(f: impl Fn()) -> impl Fn() {
+ | --------- returning this opaque type `impl Fn<()>`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/src/test/ui/impl-trait/issues/issue-53457.full_tait.stderr b/src/test/ui/impl-trait/issues/issue-53457.full_tait.stderr
deleted file mode 100644
index 906578c..0000000
--- a/src/test/ui/impl-trait/issues/issue-53457.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-53457.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/issues/issue-53457.rs b/src/test/ui/impl-trait/issues/issue-53457.rs
index c44e7f0..7b9c2c5 100644
--- a/src/test/ui/impl-trait/issues/issue-53457.rs
+++ b/src/test/ui/impl-trait/issues/issue-53457.rs
@@ -1,10 +1,6 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
-
+#![feature(type_alias_impl_trait)]
type X = impl Clone;
fn bar<F: Fn(&i32) + Clone>(f: F) -> F {
diff --git a/src/test/ui/impl-trait/issues/issue-70877.full_tait.stderr b/src/test/ui/impl-trait/issues/issue-70877.full_tait.stderr
deleted file mode 100644
index 1f4e3f7..0000000
--- a/src/test/ui/impl-trait/issues/issue-70877.full_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0271]: type mismatch resolving `<Bar as Iterator>::Item == Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
- --> $DIR/issue-70877.rs:10:12
- |
-LL | type FooRet = impl std::fmt::Debug;
- | -------------------- the found opaque type
-...
-LL | type Foo = impl Iterator<Item = FooItem>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found opaque type
- |
- = note: expected struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
- found struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> impl Debug + 'static)>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/impl-trait/issues/issue-70877.min_tait.stderr b/src/test/ui/impl-trait/issues/issue-70877.min_tait.stderr
deleted file mode 100644
index 1f4e3f7..0000000
--- a/src/test/ui/impl-trait/issues/issue-70877.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0271]: type mismatch resolving `<Bar as Iterator>::Item == Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
- --> $DIR/issue-70877.rs:10:12
- |
-LL | type FooRet = impl std::fmt::Debug;
- | -------------------- the found opaque type
-...
-LL | type Foo = impl Iterator<Item = FooItem>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found opaque type
- |
- = note: expected struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
- found struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> impl Debug + 'static)>`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/impl-trait/issues/issue-70877.rs b/src/test/ui/impl-trait/issues/issue-70877.rs
index 29aa705..853c2a8 100644
--- a/src/test/ui/impl-trait/issues/issue-70877.rs
+++ b/src/test/ui/impl-trait/issues/issue-70877.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-#![allow(incomplete_features)]
+#![feature(type_alias_impl_trait)]
type FooArg<'a> = &'a dyn ToString;
type FooRet = impl std::fmt::Debug;
diff --git a/src/test/ui/impl-trait/issues/issue-70877.stderr b/src/test/ui/impl-trait/issues/issue-70877.stderr
new file mode 100644
index 0000000..b686103
--- /dev/null
+++ b/src/test/ui/impl-trait/issues/issue-70877.stderr
@@ -0,0 +1,15 @@
+error[E0271]: type mismatch resolving `<Bar as Iterator>::Item == Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
+ --> $DIR/issue-70877.rs:7:12
+ |
+LL | type FooRet = impl std::fmt::Debug;
+ | -------------------- the found opaque type
+...
+LL | type Foo = impl Iterator<Item = FooItem>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found opaque type
+ |
+ = note: expected struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>`
+ found struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> impl Debug + 'static)>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/impl-trait/issues/issue-78722.full_tait.stderr b/src/test/ui/impl-trait/issues/issue-78722.full_tait.stderr
deleted file mode 100644
index 728644f..0000000
--- a/src/test/ui/impl-trait/issues/issue-78722.full_tait.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-78722.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0308]: mismatched types
- --> $DIR/issue-78722.rs:15:20
- |
-LL | type F = impl core::future::Future<Output = u8>;
- | -------------------------------------- the expected opaque type
-...
-LL | let f: F = async { 1 };
- | - ^^^^^^^^^^^ expected opaque type, found a different opaque type
- | |
- | expected due to this
- |
- ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
- |
-LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
- | ------------------------------- the found opaque type
- |
- = note: expected opaque type `impl Future` (opaque type at <$DIR/issue-78722.rs:8:10>)
- found opaque type `impl Future` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
- = note: distinct uses of `impl Trait` result in different opaque types
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/impl-trait/issues/issue-78722.min_tait.stderr b/src/test/ui/impl-trait/issues/issue-78722.min_tait.stderr
deleted file mode 100644
index 221b23a..0000000
--- a/src/test/ui/impl-trait/issues/issue-78722.min_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/issue-78722.rs:15:20
- |
-LL | type F = impl core::future::Future<Output = u8>;
- | -------------------------------------- the expected opaque type
-...
-LL | let f: F = async { 1 };
- | - ^^^^^^^^^^^ expected opaque type, found a different opaque type
- | |
- | expected due to this
- |
- ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
- |
-LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
- | ------------------------------- the found opaque type
- |
- = note: expected opaque type `impl Future` (opaque type at <$DIR/issue-78722.rs:8:10>)
- found opaque type `impl Future` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
- = note: distinct uses of `impl Trait` result in different opaque types
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/impl-trait/issues/issue-78722.rs b/src/test/ui/impl-trait/issues/issue-78722.rs
index 480b55e..bdbd20f 100644
--- a/src/test/ui/impl-trait/issues/issue-78722.rs
+++ b/src/test/ui/impl-trait/issues/issue-78722.rs
@@ -1,9 +1,6 @@
// edition:2018
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type F = impl core::future::Future<Output = u8>;
diff --git a/src/test/ui/impl-trait/issues/issue-78722.stderr b/src/test/ui/impl-trait/issues/issue-78722.stderr
new file mode 100644
index 0000000..5e432e7
--- /dev/null
+++ b/src/test/ui/impl-trait/issues/issue-78722.stderr
@@ -0,0 +1,23 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-78722.rs:12:20
+ |
+LL | type F = impl core::future::Future<Output = u8>;
+ | -------------------------------------- the expected opaque type
+...
+LL | let f: F = async { 1 };
+ | - ^^^^^^^^^^^ expected opaque type, found a different opaque type
+ | |
+ | expected due to this
+ |
+ ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
+ |
+LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
+ | ------------------------------- the found opaque type
+ |
+ = note: expected opaque type `impl Future` (opaque type at <$DIR/issue-78722.rs:5:10>)
+ found opaque type `impl Future` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
+ = note: distinct uses of `impl Trait` result in different opaque types
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/impl-trait/issues/issue-79099.stderr b/src/test/ui/impl-trait/issues/issue-79099.stderr
index 121536d..394b697 100644
--- a/src/test/ui/impl-trait/issues/issue-79099.stderr
+++ b/src/test/ui/impl-trait/issues/issue-79099.stderr
@@ -6,7 +6,7 @@
| |
| `async` blocks are only allowed in Rust 2018 or later
|
- = help: set `edition = "2018"` in `Cargo.toml`
+ = help: set `edition = "2021"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0562]: `impl Trait` not allowed outside of function and method return types
diff --git a/src/test/ui/impl-trait/issues/issue-86201.rs b/src/test/ui/impl-trait/issues/issue-86201.rs
index 8dc76f4..8cc4fef 100644
--- a/src/test/ui/impl-trait/issues/issue-86201.rs
+++ b/src/test/ui/impl-trait/issues/issue-86201.rs
@@ -1,5 +1,5 @@
#![feature(unboxed_closures)]
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
type FunType = impl Fn<()>;
//~^ could not find defining uses
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.full_tait.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.full_tait.stderr
deleted file mode 100644
index b2ebc72..0000000
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/error-handling-2.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
- --> $DIR/error-handling-2.rs:16:60
- |
-LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
- | ^^^^^^^^^
- |
-note: hidden type `*mut &'a i32` captures the lifetime `'a` as defined on the function body at 16:8
- --> $DIR/error-handling-2.rs:16:8
- |
-LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
- | ^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0700`.
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.min_tait.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.min_tait.stderr
deleted file mode 100644
index 53745c2..0000000
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
- --> $DIR/error-handling-2.rs:16:60
- |
-LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
- | ^^^^^^^^^
- |
-note: hidden type `*mut &'a i32` captures the lifetime `'a` as defined on the function body at 16:8
- --> $DIR/error-handling-2.rs:16:8
- |
-LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
- | ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0700`.
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs
index 196ddf9..96d891b 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs
@@ -1,10 +1,7 @@
// compile-flags:-Zborrowck=mir
#![feature(member_constraints)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#[derive(Clone)]
struct CopyIfEq<T, U>(T, U);
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.stderr
new file mode 100644
index 0000000..59105f1
--- /dev/null
+++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.stderr
@@ -0,0 +1,15 @@
+error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
+ --> $DIR/error-handling-2.rs:13:60
+ |
+LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
+ | ^^^^^^^^^
+ |
+note: hidden type `*mut &'a i32` captures the lifetime `'a` as defined on the function body at 13:8
+ --> $DIR/error-handling-2.rs:13:8
+ |
+LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
+ | ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0700`.
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.full_tait.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.full_tait.stderr
deleted file mode 100644
index ff99d03..0000000
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/error-handling.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: lifetime may not live long enough
- --> $DIR/error-handling.rs:25:16
- |
-LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-...
-LL | let _: &'b i32 = *u.0;
- | ^^^^^^^ type annotation requires that `'a` must outlive `'b`
- |
- = help: consider adding the following bound: `'a: 'b`
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.min_tait.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.min_tait.stderr
deleted file mode 100644
index 4b23ba8..0000000
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: lifetime may not live long enough
- --> $DIR/error-handling.rs:25:16
- |
-LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-...
-LL | let _: &'b i32 = *u.0;
- | ^^^^^^^ type annotation requires that `'a` must outlive `'b`
- |
- = help: consider adding the following bound: `'a: 'b`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.polonius.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.polonius.stderr
index 6ce3aaf..ccd0040 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.polonius.stderr
+++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.polonius.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
- --> $DIR/error-handling.rs:23:16
+ --> $DIR/error-handling.rs:22:16
|
LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
| -- -- lifetime `'b` defined here
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
index 1ead78e..6d88f16 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
@@ -1,9 +1,6 @@
// compile-flags:-Zborrowck=mir
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#[derive(Clone)]
struct CopyIfEq<T, U>(T, U);
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr
new file mode 100644
index 0000000..ccd0040
--- /dev/null
+++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr
@@ -0,0 +1,15 @@
+error: lifetime may not live long enough
+ --> $DIR/error-handling.rs:22:16
+ |
+LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+...
+LL | let _: &'b i32 = *u.0;
+ | ^^^^^^^ type annotation requires that `'a` must outlive `'b`
+ |
+ = help: consider adding the following bound: `'a: 'b`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.stderr b/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.stderr
deleted file mode 100644
index 4de872e..0000000
--- a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-warning[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
- --> $DIR/inverse-bounds.rs:16:70
- |
-LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Invert<'a>, b: Invert<'b>) -> impl Trait<'d, 'e>
- | ^^^^^^^^^^^^^^^^^^
- |
- = note: hidden type `Invert<'_>` captures lifetime '_#8r
- = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
- = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
- = note: for more information, try `rustc --explain E0729`
-
-warning: the feature `pin` has been stable since 1.33.0 and no longer requires an attribute to enable
- --> $DIR/inverse-bounds.rs:4:60
- |
-LL | #![feature(arbitrary_self_types, async_await, await_macro, pin)]
- | ^^^
- |
- = note: #[warn(stable_features)] on by default
-
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
index b9857b7..529dcd8 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
@@ -3,7 +3,7 @@
// revisions: migrate mir
//[mir]compile-flags: -Z borrowck=mir
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
trait Trait<'a, 'b> {}
impl<T> Trait<'_, '_> for T {}
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr
index e9d6208..3b75939 100644
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr
+++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr
@@ -9,7 +9,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/must_outlive_least_region_or_bound.rs:5:32
@@ -23,7 +23,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/must_outlive_least_region_or_bound.rs:7:46
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
index b040889..81ba89b 100644
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
+++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
@@ -14,7 +14,7 @@
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
- | ^^^^
+ | ++++
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:5:44
@@ -32,7 +32,7 @@
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
- | ^^^^
+ | ++++
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:7:46
@@ -50,11 +50,11 @@
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:9:55
@@ -72,11 +72,11 @@
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/must_outlive_least_region_or_bound.rs:11:24
@@ -95,11 +95,11 @@
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
- | ^^^^
+ | ++++
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:22:69
@@ -115,11 +115,11 @@
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
- | ^^^^
+ | ++++
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:28:69
@@ -135,11 +135,11 @@
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0623]: lifetime mismatch
--> $DIR/must_outlive_least_region_or_bound.rs:32:61
@@ -169,7 +169,7 @@
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:16:59
@@ -182,7 +182,7 @@
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:18:60
@@ -195,11 +195,11 @@
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided4(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:20:69
@@ -210,11 +210,11 @@
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit4<'a>(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to 14 previous errors
diff --git a/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr b/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr
deleted file mode 100644
index bccbc8c..0000000
--- a/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/negative-reasoning.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
- --> $DIR/negative-reasoning.rs:22:1
- |
-LL | impl<T: std::fmt::Debug> AnotherTrait for T {}
- | ------------------------------------------- first implementation here
-...
-LL | impl AnotherTrait for D<OpaqueType> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
- |
- = note: upstream crates may add a new impl of trait `std::fmt::Debug` for type `impl OpaqueTrait` in future versions
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr b/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr
deleted file mode 100644
index 5727a37..0000000
--- a/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
- --> $DIR/negative-reasoning.rs:22:1
- |
-LL | impl<T: std::fmt::Debug> AnotherTrait for T {}
- | ------------------------------------------- first implementation here
-...
-LL | impl AnotherTrait for D<OpaqueType> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
- |
- = note: upstream crates may add a new impl of trait `std::fmt::Debug` for type `impl OpaqueTrait` in future versions
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/impl-trait/negative-reasoning.rs b/src/test/ui/impl-trait/negative-reasoning.rs
index 7f608cc..d173fe8 100644
--- a/src/test/ui/impl-trait/negative-reasoning.rs
+++ b/src/test/ui/impl-trait/negative-reasoning.rs
@@ -1,9 +1,6 @@
// Tests that we cannot assume that an opaque type does *not* implement some
// other trait
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait OpaqueTrait {}
impl<T> OpaqueTrait for T {}
diff --git a/src/test/ui/impl-trait/negative-reasoning.stderr b/src/test/ui/impl-trait/negative-reasoning.stderr
new file mode 100644
index 0000000..e39a8e5
--- /dev/null
+++ b/src/test/ui/impl-trait/negative-reasoning.stderr
@@ -0,0 +1,14 @@
+error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
+ --> $DIR/negative-reasoning.rs:19:1
+ |
+LL | impl<T: std::fmt::Debug> AnotherTrait for T {}
+ | ------------------------------------------- first implementation here
+...
+LL | impl AnotherTrait for D<OpaqueType> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
+ |
+ = note: upstream crates may add a new impl of trait `std::fmt::Debug` for type `impl OpaqueTrait` in future versions
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.stderr b/src/test/ui/impl-trait/no-method-suggested-traits.stderr
index b993115..30afc86 100644
--- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr
+++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr
@@ -66,7 +66,7 @@
|
LL | 1i32.method();
| ^^^^^^ method not found in `i32`
- |
+ |
::: $DIR/auxiliary/no_method_suggested_traits.rs:8:12
|
LL | fn method(&self) {}
diff --git a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
index 2f3726b..365ecd9 100644
--- a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
+++ b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
@@ -14,11 +14,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) -> Self;
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() -> Self where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0038]: the trait `NotObjectSafe` cannot be made into an object
--> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:28:13
@@ -36,11 +36,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) -> Self;
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() -> Self where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr
index 6604326..357166d 100644
--- a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr
+++ b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr
@@ -35,12 +35,12 @@
help: you could change the return type to be a boxed trait object
|
LL | fn cat() -> Box<dyn ObjectSafe> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(A);
+LL ~ return Box::new(A);
LL | }
-LL | Box::new(B)
+LL ~ Box::new(B)
|
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr b/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr
index eb4dc45..970abad 100644
--- a/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr
+++ b/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr
@@ -17,12 +17,12 @@
help: you could change the return type to be a boxed trait object
|
LL | fn foo() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | }
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: mismatched types
@@ -44,12 +44,12 @@
help: you could change the return type to be a boxed trait object
|
LL | fn bar() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | } else {
-LL | return Box::new(1u32);
+LL ~ return Box::new(1u32);
|
error[E0308]: mismatched types
@@ -71,12 +71,12 @@
help: you could change the return type to be a boxed trait object
|
LL | fn baz() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: `if` and `else` have incompatible types
@@ -94,12 +94,12 @@
help: you could change the return type to be a boxed trait object
|
LL | fn qux() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | Box::new(0i32)
+LL ~ Box::new(0i32)
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: mismatched types
@@ -120,11 +120,11 @@
help: you could change the return type to be a boxed trait object
|
LL | fn bat() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | 0 => return Box::new(0i32),
-LL | _ => Box::new(1u32),
+LL ~ 0 => return Box::new(0i32),
+LL ~ _ => Box::new(1u32),
|
error[E0308]: mismatched types
@@ -147,14 +147,14 @@
help: you could change the return type to be a boxed trait object
|
LL | fn can() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | Box::new(match 13 {
-LL | 0 => return Box::new(0i32),
+LL ~ Box::new(match 13 {
+LL ~ 0 => return Box::new(0i32),
LL | 1 => 1u32,
LL | _ => 2u32,
-LL | })
+LL ~ })
|
error[E0308]: mismatched types
@@ -176,13 +176,13 @@
help: you could change the return type to be a boxed trait object
|
LL | fn cat() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | }
LL | _ => {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: `match` arms have incompatible types
@@ -200,11 +200,11 @@
help: you could change the return type to be a boxed trait object
|
LL | fn dog() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | 0 => Box::new(0i32),
-LL | 1 => Box::new(1u32),
+LL ~ 0 => Box::new(0i32),
+LL ~ 1 => Box::new(1u32),
|
error[E0308]: `if` and `else` have incompatible types
@@ -222,12 +222,12 @@
help: you could change the return type to be a boxed trait object
|
LL | fn apt() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | Box::new(0i32)
+LL ~ Box::new(0i32)
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0746]: return type cannot have an unboxed trait object
@@ -242,10 +242,10 @@
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn hat() -> Box<dyn std::fmt::Display> {
+LL ~ fn hat() -> Box<dyn std::fmt::Display> {
LL | match 13 {
LL | 0 => {
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | }
LL | _ => {
...
@@ -274,11 +274,11 @@
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn pug() -> Box<dyn std::fmt::Display> {
+LL ~ fn pug() -> Box<dyn std::fmt::Display> {
LL | match 13 {
-LL | 0 => Box::new(0i32),
-LL | 1 => Box::new(1u32),
-LL | _ => Box::new(2u32),
+LL ~ 0 => Box::new(0i32),
+LL ~ 1 => Box::new(1u32),
+LL ~ _ => Box::new(2u32),
|
error[E0308]: `if` and `else` have incompatible types
@@ -305,11 +305,11 @@
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn man() -> Box<dyn std::fmt::Display> {
+LL ~ fn man() -> Box<dyn std::fmt::Display> {
LL | if false {
-LL | Box::new(0i32)
+LL ~ Box::new(0i32)
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error: aborting due to 14 previous errors
diff --git a/src/test/ui/type-alias-impl-trait/private_unused.rs b/src/test/ui/impl-trait/private_unused.rs
similarity index 100%
rename from src/test/ui/type-alias-impl-trait/private_unused.rs
rename to src/test/ui/impl-trait/private_unused.rs
diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
index 6c52646..05a9ed1 100644
--- a/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
+++ b/src/test/ui/impl-trait/static-return-lifetime-infered.nll.stderr
@@ -9,7 +9,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/static-return-lifetime-infered.rs:9:37
@@ -23,7 +23,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
index 7c289b3..ebd0b6a 100644
--- a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
+++ b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
@@ -16,7 +16,7 @@
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
- | ^^^^
+ | ++++
error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/static-return-lifetime-infered.rs:10:16
@@ -36,7 +36,7 @@
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-trait/type-alias-generic-param.full_tait.stderr b/src/test/ui/impl-trait/type-alias-generic-param.full_tait.stderr
deleted file mode 100644
index 965e3e4..0000000
--- a/src/test/ui/impl-trait/type-alias-generic-param.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-generic-param.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/type-alias-generic-param.rs b/src/test/ui/impl-trait/type-alias-generic-param.rs
index 733e10e..3499b28 100644
--- a/src/test/ui/impl-trait/type-alias-generic-param.rs
+++ b/src/test/ui/impl-trait/type-alias-generic-param.rs
@@ -3,10 +3,7 @@
// types in 'item' position when generic parameters are involved
//
// run-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Meow {
type MeowType;
@@ -14,7 +11,8 @@
}
impl<T, I> Meow for I
- where I: Iterator<Item = T>
+where
+ I: Iterator<Item = T>,
{
type MeowType = impl Iterator<Item = T>;
fn meow(self) -> Self::MeowType {
diff --git a/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.full_tait.stderr b/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.full_tait.stderr
deleted file mode 100644
index ec939e5..0000000
--- a/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-in-fn-body.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs b/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs
index 32ca4af..91be4ef 100644
--- a/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs
+++ b/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs
@@ -1,9 +1,6 @@
// build-pass (FIXME(62277): could be check-pass?)
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr
index 93a3de6..7f11d30 100644
--- a/src/test/ui/impl-trait/where-allowed.stderr
+++ b/src/test/ui/impl-trait/where-allowed.stderr
@@ -23,7 +23,7 @@
| ^^^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
+ = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/where-allowed.rs:154:23
@@ -32,7 +32,7 @@
| ^^^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
+ = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/where-allowed.rs:157:39
@@ -41,7 +41,7 @@
| ^^^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
+ = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0562]: `impl Trait` not allowed outside of function and method return types
--> $DIR/where-allowed.rs:15:40
diff --git a/src/test/ui/implicit-method-bind.stderr b/src/test/ui/implicit-method-bind.stderr
index c6af478..e0a9685 100644
--- a/src/test/ui/implicit-method-bind.stderr
+++ b/src/test/ui/implicit-method-bind.stderr
@@ -7,7 +7,7 @@
help: use parentheses to call the method
|
LL | let _f = 10i32.abs();
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/imports/double-import.stderr b/src/test/ui/imports/double-import.stderr
index 7a4e8e5..82f5eb8 100644
--- a/src/test/ui/imports/double-import.stderr
+++ b/src/test/ui/imports/double-import.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use sub2::foo as other_foo;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/glob-resolve1.stderr b/src/test/ui/imports/glob-resolve1.stderr
index 7629ced..2c7a8ad 100644
--- a/src/test/ui/imports/glob-resolve1.stderr
+++ b/src/test/ui/imports/glob-resolve1.stderr
@@ -36,7 +36,7 @@
help: you might have meant to use the following enum variant
|
LL | B::B1;
- | ^^^^^
+ | ~~~~~
error[E0425]: cannot find value `C` in this scope
--> $DIR/glob-resolve1.rs:29:5
@@ -72,7 +72,7 @@
help: an enum with a similar name exists
|
LL | foo::<B>();
- | ^
+ | ~
help: consider importing this enum
|
LL | use bar::A;
@@ -90,7 +90,7 @@
help: an enum with a similar name exists
|
LL | foo::<B>();
- | ^
+ | ~
help: consider importing this struct
|
LL | use bar::C;
@@ -108,7 +108,7 @@
help: an enum with a similar name exists
|
LL | foo::<B>();
- | ^
+ | ~
help: consider importing this type alias
|
LL | use bar::D;
diff --git a/src/test/ui/imports/issue-19498.stderr b/src/test/ui/imports/issue-19498.stderr
index cc1d649..9d26022 100644
--- a/src/test/ui/imports/issue-19498.stderr
+++ b/src/test/ui/imports/issue-19498.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use self::A as OtherA;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0255]: the name `B` is defined multiple times
--> $DIR/issue-19498.rs:5:1
@@ -26,7 +26,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use self::B as OtherB;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0255]: the name `D` is defined multiple times
--> $DIR/issue-19498.rs:9:5
@@ -40,7 +40,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use C::D as OtherD;
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/imports/issue-24081.stderr b/src/test/ui/imports/issue-24081.stderr
index 647048c..e5ed6b1 100644
--- a/src/test/ui/imports/issue-24081.stderr
+++ b/src/test/ui/imports/issue-24081.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Add as OtherAdd;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Sub` is defined multiple times
--> $DIR/issue-24081.rs:9:1
@@ -26,7 +26,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Sub as OtherSub;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Mul` is defined multiple times
--> $DIR/issue-24081.rs:11:1
@@ -41,7 +41,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Mul as OtherMul;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Div` is defined multiple times
--> $DIR/issue-24081.rs:13:1
@@ -56,7 +56,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Div as OtherDiv;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Rem` is defined multiple times
--> $DIR/issue-24081.rs:15:1
@@ -71,7 +71,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Rem as OtherRem;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
diff --git a/src/test/ui/imports/issue-25396.stderr b/src/test/ui/imports/issue-25396.stderr
index 38dc9ef..518d2be 100644
--- a/src/test/ui/imports/issue-25396.stderr
+++ b/src/test/ui/imports/issue-25396.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use bar::baz as other_baz;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0252]: the name `Quux` is defined multiple times
--> $DIR/issue-25396.rs:7:5
@@ -24,7 +24,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use bar::Quux as OtherQuux;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0252]: the name `blah` is defined multiple times
--> $DIR/issue-25396.rs:10:5
@@ -38,7 +38,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use bar::blah as other_blah;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0252]: the name `WOMP` is defined multiple times
--> $DIR/issue-25396.rs:13:5
@@ -52,7 +52,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use bar::WOMP as OtherWOMP;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/imports/issue-32354-suggest-import-rename.stderr b/src/test/ui/imports/issue-32354-suggest-import-rename.stderr
index 9668430..4c5875b 100644
--- a/src/test/ui/imports/issue-32354-suggest-import-rename.stderr
+++ b/src/test/ui/imports/issue-32354-suggest-import-rename.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use extension2::ConstructorExtension as OtherConstructorExtension;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/issue-45829/import-self.stderr b/src/test/ui/imports/issue-45829/import-self.stderr
index 158e81c..3301b7d 100644
--- a/src/test/ui/imports/issue-45829/import-self.stderr
+++ b/src/test/ui/imports/issue-45829/import-self.stderr
@@ -12,12 +12,13 @@
|
help: consider importing the module directly
|
-LL | use foo;
- | --
+LL - use foo::self;
+LL + use foo;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::{self};
- | ^ ^
+ | + +
error[E0255]: the name `foo` is defined multiple times
--> $DIR/import-self.rs:6:11
@@ -32,7 +33,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo::{self as other_foo};
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0255]: the name `foo` is defined multiple times
--> $DIR/import-self.rs:12:5
@@ -47,7 +48,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo as other_foo;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0252]: the name `A` is defined multiple times
--> $DIR/import-self.rs:16:11
@@ -61,7 +62,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo::{self as OtherA};
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
diff --git a/src/test/ui/imports/issue-45829/issue-45829.stderr b/src/test/ui/imports/issue-45829/issue-45829.stderr
index a7ebc71..e9a9d47 100644
--- a/src/test/ui/imports/issue-45829/issue-45829.stderr
+++ b/src/test/ui/imports/issue-45829/issue-45829.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo::{A, B as OtherA};
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/issue-45829/rename-use-vs-extern.stderr b/src/test/ui/imports/issue-45829/rename-use-vs-extern.stderr
index 6b917d5..dfb5810 100644
--- a/src/test/ui/imports/issue-45829/rename-use-vs-extern.stderr
+++ b/src/test/ui/imports/issue-45829/rename-use-vs-extern.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std as other_issue_45829_b;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/issue-45829/rename-use-with-tabs.stderr b/src/test/ui/imports/issue-45829/rename-use-with-tabs.stderr
index 3baad6c..5a63af5 100644
--- a/src/test/ui/imports/issue-45829/rename-use-with-tabs.stderr
+++ b/src/test/ui/imports/issue-45829/rename-use-with-tabs.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use foo::{A, bar::B as OtherA};
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/issue-45829/rename-with-path.stderr b/src/test/ui/imports/issue-45829/rename-with-path.stderr
index ba83eea..2d26b08 100644
--- a/src/test/ui/imports/issue-45829/rename-with-path.stderr
+++ b/src/test/ui/imports/issue-45829/rename-with-path.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::{collections::HashMap as A, sync::Arc as OtherA};
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/issue-45829/rename.stderr b/src/test/ui/imports/issue-45829/rename.stderr
index 8f12d92..ed185ae 100644
--- a/src/test/ui/imports/issue-45829/rename.stderr
+++ b/src/test/ui/imports/issue-45829/rename.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std as other_core;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/issue-52891.stderr b/src/test/ui/imports/issue-52891.stderr
index 6e6e42d..7bb1301 100644
--- a/src/test/ui/imports/issue-52891.stderr
+++ b/src/test/ui/imports/issue-52891.stderr
@@ -98,7 +98,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use issue_52891::b::inner as other_inner;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0254]: the name `issue_52891` is defined multiple times
--> $DIR/issue-52891.rs:31:19
diff --git a/src/test/ui/imports/issue-59764.stderr b/src/test/ui/imports/issue-59764.stderr
index f266e90..c2cfc09 100644
--- a/src/test/ui/imports/issue-59764.stderr
+++ b/src/test/ui/imports/issue-59764.stderr
@@ -7,8 +7,9 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{baz}};
- | ^^^^^^^^^ --^^
+LL - use issue_59764::foo::{baz, makro};
+LL + use issue_59764::{makro, foo::{baz}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:21:9
@@ -19,10 +20,10 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
-LL | }};
+LL ~
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -34,10 +35,10 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
-LL | }};
+LL ~
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -49,8 +50,9 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{baz, foobar}};
- | ^^^^^^^^^ -- ^^
+LL - use issue_59764::foo::{baz, makro, foobar};
+LL + use issue_59764::{makro, foo::{baz, foobar}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:40:9
@@ -61,11 +63,11 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
+LL ~
LL | foobar,
-LL | }};
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -77,11 +79,11 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
+LL ~
LL | foobar
-LL | }};
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -93,8 +95,9 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foobaz};
- | ^^^^^^^ --
+LL - use issue_59764::{foobaz, foo::makro};
+LL + use issue_59764::{makro, foobaz};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:59:42
@@ -105,8 +108,9 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foobaz, foo::{baz}};
- | ^^^^^^^ --
+LL - use issue_59764::{foobaz, foo::{baz, makro}};
+LL + use issue_59764::{makro, foobaz, foo::{baz}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:68:13
@@ -117,11 +121,11 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro,
+LL ~ use issue_59764::{makro,
LL | foobaz,
LL | foo::{
LL | baz,
-LL |
+LL ~
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -133,11 +137,11 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro,
+LL ~ use issue_59764::{makro,
LL | foobaz,
LL | foo::{
LL | baz,
-LL |
+LL ~
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -149,8 +153,9 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foobaz, foo::{baz, barbaz::{barfoo}}};
- | ^^^^^^^ --
+LL - use issue_59764::{foobaz, foo::{baz, makro, barbaz::{barfoo}}};
+LL + use issue_59764::{makro, foobaz, foo::{baz, barbaz::{barfoo}}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:93:13
@@ -161,11 +166,11 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro,
+LL ~ use issue_59764::{makro,
LL | foobaz,
LL | foo::{
LL | baz,
-LL |
+LL ~
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -178,7 +183,7 @@
help: a macro with this name exists at the root of the crate
|
LL | use issue_59764::makro as baz;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:107:33
@@ -189,8 +194,9 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro as foobar, foo::{baz}};
- | ^^^^^^^^^^^^^^^^^^^ --^^
+LL - use issue_59764::foo::{baz, makro as foobar};
+LL + use issue_59764::{makro as foobar, foo::{baz}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:120:17
@@ -201,12 +207,12 @@
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | issue_59764::{makro as foobar,
+LL ~ issue_59764::{makro as foobar,
LL |
LL | foobaz,
LL |
LL |
-LL | foo::{baz}
+LL ~ foo::{baz}
|
error[E0432]: unresolved import `issue_59764::foo::makro`
@@ -219,7 +225,7 @@
help: a macro with this name exists at the root of the crate
|
LL | use issue_59764::makro;
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: cannot determine resolution for the macro `makro`
--> $DIR/issue-59764.rs:130:1
diff --git a/src/test/ui/imports/issue-8640.stderr b/src/test/ui/imports/issue-8640.stderr
index 4ce6394..ab44f06 100644
--- a/src/test/ui/imports/issue-8640.stderr
+++ b/src/test/ui/imports/issue-8640.stderr
@@ -10,7 +10,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use baz::bar as other_bar;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/unused-import-issue-87973.fixed b/src/test/ui/imports/unused-import-issue-87973.fixed
new file mode 100644
index 0000000..5c194d1
--- /dev/null
+++ b/src/test/ui/imports/unused-import-issue-87973.fixed
@@ -0,0 +1,8 @@
+// run-rustfix
+#![deny(unused_imports)]
+
+// Check that attributes get removed too. See #87973.
+
+//~^ ERROR unused import
+
+fn main() {}
diff --git a/src/test/ui/imports/unused-import-issue-87973.rs b/src/test/ui/imports/unused-import-issue-87973.rs
new file mode 100644
index 0000000..c31f0f9
--- /dev/null
+++ b/src/test/ui/imports/unused-import-issue-87973.rs
@@ -0,0 +1,11 @@
+// run-rustfix
+#![deny(unused_imports)]
+
+// Check that attributes get removed too. See #87973.
+#[deprecated]
+#[allow(unsafe_code)]
+#[cfg(not(foo))]
+use std::fs;
+//~^ ERROR unused import
+
+fn main() {}
diff --git a/src/test/ui/imports/unused-import-issue-87973.stderr b/src/test/ui/imports/unused-import-issue-87973.stderr
new file mode 100644
index 0000000..81b7ea7
--- /dev/null
+++ b/src/test/ui/imports/unused-import-issue-87973.stderr
@@ -0,0 +1,14 @@
+error: unused import: `std::fs`
+ --> $DIR/unused-import-issue-87973.rs:8:5
+ |
+LL | use std::fs;
+ | ^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/unused-import-issue-87973.rs:2:9
+ |
+LL | #![deny(unused_imports)]
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/in-band-lifetimes/issue-61124-anon-lifetime-in-struct-declaration.stderr b/src/test/ui/in-band-lifetimes/issue-61124-anon-lifetime-in-struct-declaration.stderr
index f2a4150..20369a5 100644
--- a/src/test/ui/in-band-lifetimes/issue-61124-anon-lifetime-in-struct-declaration.stderr
+++ b/src/test/ui/in-band-lifetimes/issue-61124-anon-lifetime-in-struct-declaration.stderr
@@ -7,7 +7,7 @@
help: consider introducing a named lifetime parameter
|
LL | struct Heartbreak<'a>(Betrayal<'a>);
- | ^^^^ ^^^^^^^^^^^^
+ | ++++ ~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
index bd58728..b15efd6 100644
--- a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
+++ b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr
@@ -3,7 +3,7 @@
|
LL | fn deref(&self) -> &dyn Trait {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&Struct) -> &dyn Trait`
- |
+ |
::: $SRC_DIR/core/src/ops/deref.rs:LL:COL
|
LL | fn deref(&self) -> &Self::Target;
diff --git a/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr b/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr
index a43b490..5f0de61 100644
--- a/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr
+++ b/src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr
@@ -16,11 +16,11 @@
help: consider introducing lifetime `'test` here
|
LL | fn bar<'test>() {
- | ^^^^^^^
+ | +++++++
help: consider making the type lifetime-generic with a new `'test` lifetime
|
LL | let y: for<'test> fn(&'test u32) = foo2;
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/indexing-requires-a-uint.stderr b/src/test/ui/indexing-requires-a-uint.stderr
index 3152dec..1bcb89d 100644
--- a/src/test/ui/indexing-requires-a-uint.stderr
+++ b/src/test/ui/indexing-requires-a-uint.stderr
@@ -16,7 +16,7 @@
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | bar::<isize>(i.try_into().unwrap()); // i should not be re-coerced back to an isize
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/inference/cannot-infer-closure.stderr b/src/test/ui/inference/cannot-infer-closure.stderr
index e055d1a..f8026fa 100644
--- a/src/test/ui/inference/cannot-infer-closure.stderr
+++ b/src/test/ui/inference/cannot-infer-closure.stderr
@@ -7,7 +7,7 @@
help: give this closure an explicit return type without `_` placeholders
|
LL | let x = |a: (), b: ()| -> Result<(), _> {
- | ^^^^^^^^^^^^^^^^
+ | ++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/inference/cannot-infer-partial-try-return.stderr b/src/test/ui/inference/cannot-infer-partial-try-return.stderr
index c394f6e..3542eb6 100644
--- a/src/test/ui/inference/cannot-infer-partial-try-return.stderr
+++ b/src/test/ui/inference/cannot-infer-partial-try-return.stderr
@@ -7,7 +7,7 @@
help: give this closure an explicit return type without `_` placeholders
|
LL | let x = || -> Result<(), QualifiedError<_>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/deref-suggestion.rs b/src/test/ui/inference/deref-suggestion.rs
similarity index 100%
rename from src/test/ui/deref-suggestion.rs
rename to src/test/ui/inference/deref-suggestion.rs
diff --git a/src/test/ui/inference/deref-suggestion.stderr b/src/test/ui/inference/deref-suggestion.stderr
new file mode 100644
index 0000000..c5c8b88
--- /dev/null
+++ b/src/test/ui/inference/deref-suggestion.stderr
@@ -0,0 +1,146 @@
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:8:9
+ |
+LL | foo(s);
+ | ^- help: try using a conversion method: `.to_string()`
+ | |
+ | expected struct `String`, found `&String`
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:14:10
+ |
+LL | foo3(u);
+ | ^ expected `u32`, found `&u32`
+ |
+help: consider dereferencing the borrow
+ |
+LL | foo3(*u);
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:30:9
+ |
+LL | foo(&"aaa".to_owned());
+ | ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+ |
+help: consider removing the borrow
+ |
+LL - foo(&"aaa".to_owned());
+LL + foo("aaa".to_owned());
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:32:9
+ |
+LL | foo(&mut "aaa".to_owned());
+ | ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+ |
+help: consider removing the borrow
+ |
+LL - foo(&mut "aaa".to_owned());
+LL + foo("aaa".to_owned());
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:2:20
+ |
+LL | ($x:expr) => { &$x }
+ | ^^^ expected `u32`, found `&{integer}`
+...
+LL | foo3(borrow!(0));
+ | ---------- in this macro invocation
+ |
+ = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:36:5
+ |
+LL | assert_eq!(3i32, &3i32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
+ |
+ = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:39:17
+ |
+LL | let s = S { u };
+ | ^
+ | |
+ | expected `&u32`, found integer
+ | help: consider borrowing here: `u: &u`
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:41:20
+ |
+LL | let s = S { u: u };
+ | ^
+ | |
+ | expected `&u32`, found integer
+ | help: consider borrowing here: `&u`
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:44:17
+ |
+LL | let r = R { i };
+ | ^ expected `u32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | let r = R { i: *i };
+ | ~~~~~
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:46:20
+ |
+LL | let r = R { i: i };
+ | ^ expected `u32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | let r = R { i: *i };
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:55:9
+ |
+LL | b
+ | ^ expected `i32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | *b
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/deref-suggestion.rs:63:9
+ |
+LL | b
+ | ^ expected `i32`, found `&{integer}`
+ |
+help: consider dereferencing the borrow
+ |
+LL | *b
+ | +
+
+error[E0308]: `if` and `else` have incompatible types
+ --> $DIR/deref-suggestion.rs:68:12
+ |
+LL | let val = if true {
+ | _______________-
+LL | | *a
+ | | -- expected because of this
+LL | | } else if true {
+ | |____________^
+LL | ||
+LL | || b
+LL | || } else {
+LL | || &0
+LL | || };
+ | || ^
+ | ||_____|
+ | |______`if` and `else` have incompatible types
+ | expected `i32`, found `&{integer}`
+
+error: aborting due to 13 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/inference/infer-arg-test.rs b/src/test/ui/inference/infer-arg-test.rs
new file mode 100644
index 0000000..1b67ccd
--- /dev/null
+++ b/src/test/ui/inference/infer-arg-test.rs
@@ -0,0 +1,24 @@
+#![feature(generic_arg_infer)]
+
+struct All<'a, T, const N: usize> {
+ v: &'a T,
+}
+
+struct BadInfer<_>;
+//~^ ERROR expected identifier
+//~| ERROR parameter `_` is never used
+
+fn all_fn<'a, T, const N: usize>() {}
+
+fn bad_infer_fn<_>() {}
+//~^ ERROR expected identifier
+
+
+fn main() {
+ let a: All<_, _, _>;
+ all_fn();
+ let v: [u8; _];
+ //~^ ERROR in expressions
+ let v: [u8; 10] = [0; _];
+ //~^ ERROR in expressions
+}
diff --git a/src/test/ui/inference/infer-arg-test.stderr b/src/test/ui/inference/infer-arg-test.stderr
new file mode 100644
index 0000000..30e171e
--- /dev/null
+++ b/src/test/ui/inference/infer-arg-test.stderr
@@ -0,0 +1,36 @@
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/infer-arg-test.rs:7:17
+ |
+LL | struct BadInfer<_>;
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/infer-arg-test.rs:13:17
+ |
+LL | fn bad_infer_fn<_>() {}
+ | ^ expected identifier, found reserved identifier
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/infer-arg-test.rs:20:15
+ |
+LL | let v: [u8; _];
+ | ^ `_` not allowed here
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/infer-arg-test.rs:22:25
+ |
+LL | let v: [u8; 10] = [0; _];
+ | ^ `_` not allowed here
+
+error[E0392]: parameter `_` is never used
+ --> $DIR/infer-arg-test.rs:7:17
+ |
+LL | struct BadInfer<_>;
+ | ^ unused parameter
+ |
+ = help: consider removing `_`, referring to it in a field, or using a marker such as `PhantomData`
+ = help: if you intended `_` to be a const parameter, use `const _: usize` instead
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0392`.
diff --git a/src/test/ui/inference/inference_unstable_featured.stderr b/src/test/ui/inference/inference_unstable_featured.stderr
index 0dd4baf..4ddede2 100644
--- a/src/test/ui/inference/inference_unstable_featured.stderr
+++ b/src/test/ui/inference/inference_unstable_featured.stderr
@@ -9,11 +9,11 @@
help: disambiguate the associated function for candidate #1
|
LL | assert_eq!(IpuIterator::ipu_flatten(&'x'), 0);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | assert_eq!(IpuItertools::ipu_flatten(&'x'), 0);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/inference/issue-86162-1.rs b/src/test/ui/inference/issue-86162-1.rs
new file mode 100644
index 0000000..5a547eb
--- /dev/null
+++ b/src/test/ui/inference/issue-86162-1.rs
@@ -0,0 +1,9 @@
+// Regression test of #86162.
+
+fn foo(x: impl Clone) {}
+fn gen<T>() -> T { todo!() }
+
+fn main() {
+ foo(gen()); //<- Do not suggest `foo::<impl Clone>()`!
+ //~^ ERROR: type annotations needed
+}
diff --git a/src/test/ui/inference/issue-86162-1.stderr b/src/test/ui/inference/issue-86162-1.stderr
new file mode 100644
index 0000000..8d6f507
--- /dev/null
+++ b/src/test/ui/inference/issue-86162-1.stderr
@@ -0,0 +1,16 @@
+error[E0283]: type annotations needed
+ --> $DIR/issue-86162-1.rs:7:5
+ |
+LL | foo(gen()); //<- Do not suggest `foo::<impl Clone>()`!
+ | ^^^ cannot infer type for type parameter `impl Clone` declared on the function `foo`
+ |
+ = note: cannot satisfy `_: Clone`
+note: required by a bound in `foo`
+ --> $DIR/issue-86162-1.rs:3:16
+ |
+LL | fn foo(x: impl Clone) {}
+ | ^^^^^ required by this bound in `foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/inference/issue-86162-2.rs b/src/test/ui/inference/issue-86162-2.rs
new file mode 100644
index 0000000..b8c75dd
--- /dev/null
+++ b/src/test/ui/inference/issue-86162-2.rs
@@ -0,0 +1,14 @@
+// Regression test of #86162.
+
+fn gen<T>() -> T { todo!() }
+
+struct Foo;
+
+impl Foo {
+ fn bar(x: impl Clone) {}
+}
+
+fn main() {
+ Foo::bar(gen()); //<- Do not suggest `Foo::bar::<impl Clone>()`!
+ //~^ ERROR: type annotations needed
+}
diff --git a/src/test/ui/inference/issue-86162-2.stderr b/src/test/ui/inference/issue-86162-2.stderr
new file mode 100644
index 0000000..5f80c59
--- /dev/null
+++ b/src/test/ui/inference/issue-86162-2.stderr
@@ -0,0 +1,16 @@
+error[E0283]: type annotations needed
+ --> $DIR/issue-86162-2.rs:12:5
+ |
+LL | Foo::bar(gen()); //<- Do not suggest `Foo::bar::<impl Clone>()`!
+ | ^^^^^^^^ cannot infer type for type parameter `impl Clone` declared on the associated function `bar`
+ |
+ = note: cannot satisfy `_: Clone`
+note: required by a bound in `Foo::bar`
+ --> $DIR/issue-86162-2.rs:8:20
+ |
+LL | fn bar(x: impl Clone) {}
+ | ^^^^^ required by this bound in `Foo::bar`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/infinite/infinite-autoderef.stderr b/src/test/ui/infinite/infinite-autoderef.stderr
index e7d90f0..cbefbf8 100644
--- a/src/test/ui/infinite/infinite-autoderef.stderr
+++ b/src/test/ui/infinite/infinite-autoderef.stderr
@@ -2,10 +2,12 @@
--> $DIR/infinite-autoderef.rs:20:13
|
LL | x = box x;
- | ^^^^^
- | |
- | cyclic type of infinite size
- | help: try using a conversion method: `(box x).to_string()`
+ | ^^^^^ cyclic type of infinite size
+ |
+help: try using a conversion method
+ |
+LL | x = (box x).to_string();
+ | + +++++++++++++
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
--> $DIR/infinite-autoderef.rs:25:5
diff --git a/src/test/ui/infinite/infinite-instantiation.polonius.stderr b/src/test/ui/infinite/infinite-instantiation.polonius.stderr
new file mode 100644
index 0000000..29eb8c4
--- /dev/null
+++ b/src/test/ui/infinite/infinite-instantiation.polonius.stderr
@@ -0,0 +1,15 @@
+error: reached the recursion limit while instantiating `function::<Option<Option<Option<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/infinite-instantiation.rs:22:9
+ |
+LL | function(counter - 1, t.to_option());
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: `function` defined here
+ --> $DIR/infinite-instantiation.rs:20:1
+ |
+LL | fn function<T:ToOpt + Clone>(counter: usize, t: T) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: the full type name has been written to '$TEST_BUILD_DIR/infinite/infinite-instantiation.polonius/infinite-instantiation.long-type.txt'
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/infinite/infinite-struct.stderr b/src/test/ui/infinite/infinite-struct.stderr
index d180670..369645f 100644
--- a/src/test/ui/infinite/infinite-struct.stderr
+++ b/src/test/ui/infinite/infinite-struct.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Take` representable
|
LL | struct Take(Box<Take>);
- | ^^^^ ^
+ | ++++ +
error[E0391]: cycle detected when computing drop-check constraints for `Take`
--> $DIR/infinite-struct.rs:1:1
@@ -18,7 +18,7 @@
LL | struct Take(Take);
| ^^^^^^^^^^^^^^^^^^
|
- = note: ...which again requires computing drop-check constraints for `Take`, completing the cycle
+ = note: ...which immediately requires computing drop-check constraints for `Take` again
= note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: Take } }`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/infinite/infinite-tag-type-recursion.stderr b/src/test/ui/infinite/infinite-tag-type-recursion.stderr
index 45322ea..61b5e94 100644
--- a/src/test/ui/infinite/infinite-tag-type-recursion.stderr
+++ b/src/test/ui/infinite/infinite-tag-type-recursion.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `MList` representable
|
LL | enum MList { Cons(isize, Box<MList>), Nil }
- | ^^^^ ^
+ | ++++ +
error[E0391]: cycle detected when computing drop-check constraints for `MList`
--> $DIR/infinite-tag-type-recursion.rs:1:1
@@ -17,7 +17,7 @@
LL | enum MList { Cons(isize, MList), Nil }
| ^^^^^^^^^^
|
- = note: ...which again requires computing drop-check constraints for `MList`, completing the cycle
+ = note: ...which immediately requires computing drop-check constraints for `MList` again
= note: cycle used when computing dropck types for `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: MList } }`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/infinite/infinite-trait-alias-recursion.rs b/src/test/ui/infinite/infinite-trait-alias-recursion.rs
new file mode 100644
index 0000000..ec86744
--- /dev/null
+++ b/src/test/ui/infinite/infinite-trait-alias-recursion.rs
@@ -0,0 +1,10 @@
+#![feature(trait_alias)]
+
+trait T1 = T2;
+//~^ ERROR cycle detected when computing the super predicates of `T1`
+
+trait T2 = T3;
+
+trait T3 = T1 + T3;
+
+fn main() {}
diff --git a/src/test/ui/infinite/infinite-trait-alias-recursion.stderr b/src/test/ui/infinite/infinite-trait-alias-recursion.stderr
new file mode 100644
index 0000000..5ecaedb
--- /dev/null
+++ b/src/test/ui/infinite/infinite-trait-alias-recursion.stderr
@@ -0,0 +1,42 @@
+error[E0391]: cycle detected when computing the super predicates of `T1`
+ --> $DIR/infinite-trait-alias-recursion.rs:3:1
+ |
+LL | trait T1 = T2;
+ | ^^^^^^^^^^^^^^
+ |
+note: ...which requires computing the super traits of `T1`...
+ --> $DIR/infinite-trait-alias-recursion.rs:3:12
+ |
+LL | trait T1 = T2;
+ | ^^
+note: ...which requires computing the super predicates of `T2`...
+ --> $DIR/infinite-trait-alias-recursion.rs:6:1
+ |
+LL | trait T2 = T3;
+ | ^^^^^^^^^^^^^^
+note: ...which requires computing the super traits of `T2`...
+ --> $DIR/infinite-trait-alias-recursion.rs:6:12
+ |
+LL | trait T2 = T3;
+ | ^^
+note: ...which requires computing the super predicates of `T3`...
+ --> $DIR/infinite-trait-alias-recursion.rs:8:1
+ |
+LL | trait T3 = T1 + T3;
+ | ^^^^^^^^^^^^^^^^^^^
+note: ...which requires computing the super traits of `T3`...
+ --> $DIR/infinite-trait-alias-recursion.rs:8:12
+ |
+LL | trait T3 = T1 + T3;
+ | ^^
+ = note: ...which again requires computing the super predicates of `T1`, completing the cycle
+ = note: trait aliases cannot be recursive
+note: cycle used when collecting item types in top-level module
+ --> $DIR/infinite-trait-alias-recursion.rs:3:1
+ |
+LL | trait T1 = T2;
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/infinite/infinite-type-alias-mutual-recursion.rs b/src/test/ui/infinite/infinite-type-alias-mutual-recursion.rs
new file mode 100644
index 0000000..5381eed
--- /dev/null
+++ b/src/test/ui/infinite/infinite-type-alias-mutual-recursion.rs
@@ -0,0 +1,6 @@
+type X1 = X2;
+//~^ ERROR cycle detected when expanding type alias `X1`
+type X2 = X3;
+type X3 = X1;
+
+fn main() {}
diff --git a/src/test/ui/infinite/infinite-type-alias-mutual-recursion.stderr b/src/test/ui/infinite/infinite-type-alias-mutual-recursion.stderr
new file mode 100644
index 0000000..7f82b29
--- /dev/null
+++ b/src/test/ui/infinite/infinite-type-alias-mutual-recursion.stderr
@@ -0,0 +1,34 @@
+error[E0391]: cycle detected when expanding type alias `X1`
+ --> $DIR/infinite-type-alias-mutual-recursion.rs:1:11
+ |
+LL | type X1 = X2;
+ | ^^
+ |
+note: ...which requires expanding type alias `X2`...
+ --> $DIR/infinite-type-alias-mutual-recursion.rs:3:11
+ |
+LL | type X2 = X3;
+ | ^^
+note: ...which requires expanding type alias `X3`...
+ --> $DIR/infinite-type-alias-mutual-recursion.rs:4:11
+ |
+LL | type X3 = X1;
+ | ^^
+ = note: ...which again requires expanding type alias `X1`, completing the cycle
+ = note: type aliases cannot be recursive
+ = help: consider using a struct, enum, or union instead to break the cycle
+ = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
+note: cycle used when collecting item types in top-level module
+ --> $DIR/infinite-type-alias-mutual-recursion.rs:1:1
+ |
+LL | / type X1 = X2;
+LL | |
+LL | | type X2 = X3;
+LL | | type X3 = X1;
+LL | |
+LL | | fn main() {}
+ | |____________^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/infinite/infinite-vec-type-recursion.stderr b/src/test/ui/infinite/infinite-vec-type-recursion.stderr
index 77adefe..1e487a5 100644
--- a/src/test/ui/infinite/infinite-vec-type-recursion.stderr
+++ b/src/test/ui/infinite/infinite-vec-type-recursion.stderr
@@ -1,10 +1,13 @@
-error[E0391]: cycle detected when computing type of `X`
+error[E0391]: cycle detected when expanding type alias `X`
--> $DIR/infinite-vec-type-recursion.rs:1:14
|
LL | type X = Vec<X>;
| ^
|
- = note: ...which again requires computing type of `X`, completing the cycle
+ = note: ...which immediately requires expanding type alias `X` again
+ = note: type aliases cannot be recursive
+ = help: consider using a struct, enum, or union instead to break the cycle
+ = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
note: cycle used when collecting item types in top-level module
--> $DIR/infinite-vec-type-recursion.rs:1:1
|
diff --git a/src/test/ui/inline-const/const-match-pat-generic.rs b/src/test/ui/inline-const/const-match-pat-generic.rs
new file mode 100644
index 0000000..61680d6
--- /dev/null
+++ b/src/test/ui/inline-const/const-match-pat-generic.rs
@@ -0,0 +1,16 @@
+#![allow(incomplete_features)]
+#![feature(inline_const)]
+
+// rust-lang/rust#82518: ICE with inline-const in match referencing const-generic parameter
+
+fn foo<const V: usize>() {
+ match 0 {
+ const { V } => {},
+ //~^ ERROR const parameters cannot be referenced in patterns [E0158]
+ _ => {},
+ }
+}
+
+fn main() {
+ foo::<1>();
+}
diff --git a/src/test/ui/inline-const/const-match-pat-generic.stderr b/src/test/ui/inline-const/const-match-pat-generic.stderr
new file mode 100644
index 0000000..a3ed41a
--- /dev/null
+++ b/src/test/ui/inline-const/const-match-pat-generic.stderr
@@ -0,0 +1,9 @@
+error[E0158]: const parameters cannot be referenced in patterns
+ --> $DIR/const-match-pat-generic.rs:8:11
+ |
+LL | const { V } => {},
+ | ^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0158`.
diff --git a/src/test/ui/integer-literal-suffix-inference.stderr b/src/test/ui/integer-literal-suffix-inference.stderr
index bfb4751..c9cfbc5 100644
--- a/src/test/ui/integer-literal-suffix-inference.stderr
+++ b/src/test/ui/integer-literal-suffix-inference.stderr
@@ -7,7 +7,7 @@
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(a16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:41:11
@@ -18,7 +18,7 @@
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(a32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:44:11
@@ -29,7 +29,7 @@
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:47:11
@@ -40,7 +40,7 @@
help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:51:12
@@ -60,7 +60,7 @@
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(a32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:58:12
@@ -71,7 +71,7 @@
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:61:12
@@ -82,7 +82,7 @@
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:65:12
@@ -111,7 +111,7 @@
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | id_i32(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:75:12
@@ -122,7 +122,7 @@
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
LL | id_i32(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:79:12
@@ -160,7 +160,7 @@
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
LL | id_i64(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:93:14
@@ -189,7 +189,7 @@
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
LL | id_isize(a32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:102:14
@@ -200,7 +200,7 @@
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
LL | id_isize(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:108:11
@@ -211,7 +211,7 @@
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(c16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:111:11
@@ -222,7 +222,7 @@
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(c32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:114:11
@@ -233,7 +233,7 @@
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(c64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:118:12
@@ -253,7 +253,7 @@
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(c32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:125:12
@@ -264,7 +264,7 @@
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(c64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:129:12
@@ -293,7 +293,7 @@
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | id_i32(c64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:140:12
@@ -331,7 +331,7 @@
help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(b16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:155:11
@@ -342,7 +342,7 @@
help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(b32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:158:11
@@ -353,7 +353,7 @@
help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:161:11
@@ -364,7 +364,7 @@
help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:165:12
@@ -384,7 +384,7 @@
help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
|
LL | id_u16(b32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:172:12
@@ -395,7 +395,7 @@
help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit
|
LL | id_u16(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:175:12
@@ -406,7 +406,7 @@
help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit
|
LL | id_u16(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:179:12
@@ -435,7 +435,7 @@
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
LL | id_u32(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:189:12
@@ -446,7 +446,7 @@
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | id_u32(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:193:12
@@ -484,7 +484,7 @@
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | id_u64(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:207:14
@@ -513,7 +513,7 @@
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
LL | id_usize(b32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:216:14
@@ -524,7 +524,7 @@
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
LL | id_usize(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 52 previous errors
diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr
index dd43da1..cb22d5a 100644
--- a/src/test/ui/interior-mutability/interior-mutability.stderr
+++ b/src/test/ui/interior-mutability/interior-mutability.stderr
@@ -3,16 +3,16 @@
|
LL | catch_unwind(|| { x.set(23); });
| ^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- |
- ::: $SRC_DIR/std/src/panic.rs:LL:COL
- |
-LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
- | ---------- required by this bound in `catch_unwind`
|
= help: within `Cell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `Cell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `&Cell<i32>`
= note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35]`
+note: required by a bound in `catch_unwind`
+ --> $SRC_DIR/std/src/panic.rs:LL:COL
+ |
+LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
+ | ^^^^^^^^^^ required by this bound in `catch_unwind`
error: aborting due to previous error
diff --git a/src/test/ui/internal/internal-unstable-const.rs b/src/test/ui/internal/internal-unstable-const.rs
index 470262a..4ec2426 100644
--- a/src/test/ui/internal/internal-unstable-const.rs
+++ b/src/test/ui/internal/internal-unstable-const.rs
@@ -1,14 +1,13 @@
// Don't allow unstable features in stable functions without `allow_internal_unstable`.
#![stable(feature = "rust1", since = "1.0.0")]
-
#![feature(staged_api)]
-#![feature(const_transmute)]
+#![feature(const_fn_floating_point_arithmetic)]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
-pub const fn foo() -> i32 {
- unsafe { std::mem::transmute(4u32) } //~ ERROR `transmute`
+pub const fn foo() -> f32 {
+ 1.0 + 1.0 //~ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
}
fn main() {}
diff --git a/src/test/ui/internal/internal-unstable-const.stderr b/src/test/ui/internal/internal-unstable-const.stderr
index adfb8dc..37d2ea6 100644
--- a/src/test/ui/internal/internal-unstable-const.stderr
+++ b/src/test/ui/internal/internal-unstable-const.stderr
@@ -1,13 +1,17 @@
-error[E0658]: `transmute` is not allowed in constant functions
- --> $DIR/internal-unstable-const.rs:11:14
+error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
+ --> $DIR/internal-unstable-const.rs:10:5
|
-LL | unsafe { std::mem::transmute(4u32) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | 1.0 + 1.0
+ | ^^^^^^^^^
|
- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
- = note: `transmute` is only allowed in constants and statics for now
+help: if it is not part of the public API, make this function unstably const
+ |
+LL | #[rustc_const_unstable(feature = "...", issue = "...")]
+ |
+help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
+ |
+LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
+ |
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/invalid/invalid-plugin-attr.rs b/src/test/ui/invalid/invalid-plugin-attr.rs
index 3ba7389..3080af2 100644
--- a/src/test/ui/invalid/invalid-plugin-attr.rs
+++ b/src/test/ui/invalid/invalid-plugin-attr.rs
@@ -1,8 +1,7 @@
#![deny(unused_attributes)]
#![feature(plugin)]
-#[plugin(bla)] //~ ERROR unused attribute
- //~^ ERROR should be an inner attribute
+#[plugin(bla)] //~ ERROR should be an inner attribute
//~| WARN use of deprecated attribute `plugin`: compiler plugins are deprecated
fn main() {}
diff --git a/src/test/ui/invalid/invalid-plugin-attr.stderr b/src/test/ui/invalid/invalid-plugin-attr.stderr
index c822d90..d3882d3 100644
--- a/src/test/ui/invalid/invalid-plugin-attr.stderr
+++ b/src/test/ui/invalid/invalid-plugin-attr.stderr
@@ -6,7 +6,7 @@
|
= note: `#[warn(deprecated)]` on by default
-error: unused attribute
+error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
--> $DIR/invalid-plugin-attr.rs:4:1
|
LL | #[plugin(bla)]
@@ -18,11 +18,5 @@
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
-error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/invalid-plugin-attr.rs:4:1
- |
-LL | #[plugin(bla)]
- | ^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
+error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/issues/issue-10412.stderr b/src/test/ui/issues/issue-10412.stderr
index 9d181ea..053a93e 100644
--- a/src/test/ui/issues/issue-10412.stderr
+++ b/src/test/ui/issues/issue-10412.stderr
@@ -51,17 +51,19 @@
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/issue-10412.rs:6:13
|
-LL | trait Serializable<'self, T> {
- | - required by this bound in `Serializable`
-...
LL | impl<'self> Serializable<str> for &'self str {
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
+note: required by a bound in `Serializable`
+ --> $DIR/issue-10412.rs:1:27
+ |
+LL | trait Serializable<'self, T> {
+ | ^ required by this bound in `Serializable`
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Serializable<'self, T: ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 9 previous errors
diff --git a/src/test/ui/issues/issue-11515.rs b/src/test/ui/issues/issue-11515.rs
index a7671b9..2072f9c 100644
--- a/src/test/ui/issues/issue-11515.rs
+++ b/src/test/ui/issues/issue-11515.rs
@@ -1,10 +1,10 @@
#![feature(box_syntax)]
struct Test {
- func: Box<dyn FnMut() + 'static>
+ func: Box<dyn FnMut() + 'static>,
}
fn main() {
let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
- let test = box Test { func: closure }; //~ ERROR mismatched types
+ let test = box Test { func: closure }; //~ ERROR trait upcasting coercion is experimental [E0658]
}
diff --git a/src/test/ui/issues/issue-11515.stderr b/src/test/ui/issues/issue-11515.stderr
index 7935615..a70e7c4 100644
--- a/src/test/ui/issues/issue-11515.stderr
+++ b/src/test/ui/issues/issue-11515.stderr
@@ -1,12 +1,12 @@
-error[E0308]: mismatched types
+error[E0658]: trait upcasting coercion is experimental
--> $DIR/issue-11515.rs:9:33
|
LL | let test = box Test { func: closure };
- | ^^^^^^^ expected trait `FnMut`, found trait `Fn`
+ | ^^^^^^^
|
- = note: expected struct `Box<(dyn FnMut() + 'static)>`
- found struct `Box<(dyn Fn() + 'static)>`
+ = note: see issue #65991 <https://github.com/rust-lang/rust/issues/65991> for more information
+ = help: add `#![feature(trait_upcasting)]` to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0308`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/issues/issue-11692-2.stderr b/src/test/ui/issues/issue-11692-2.stderr
index f021943..84746ca 100644
--- a/src/test/ui/issues/issue-11692-2.stderr
+++ b/src/test/ui/issues/issue-11692-2.stderr
@@ -3,6 +3,8 @@
|
LL | concat!(test!());
| ^^^^
+ |
+ = note: `test` is in scope, but it is an attribute: `#[test]`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-13359.stderr b/src/test/ui/issues/issue-13359.stderr
index 115b471..0796ede 100644
--- a/src/test/ui/issues/issue-13359.stderr
+++ b/src/test/ui/issues/issue-13359.stderr
@@ -7,7 +7,7 @@
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
LL | foo((1*(1 as isize)).try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-13359.rs:10:9
@@ -18,7 +18,7 @@
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | bar((1*(1 as usize)).try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-13497.stderr b/src/test/ui/issues/issue-13497.stderr
index a231f73..6521a67 100644
--- a/src/test/ui/issues/issue-13497.stderr
+++ b/src/test/ui/issues/issue-13497.stderr
@@ -8,7 +8,7 @@
help: consider using the `'static` lifetime
|
LL | &'static str
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-1362.stderr b/src/test/ui/issues/issue-1362.stderr
index 6fc2b99..a925fc2 100644
--- a/src/test/ui/issues/issue-1362.stderr
+++ b/src/test/ui/issues/issue-1362.stderr
@@ -9,7 +9,7 @@
help: change the type of the numeric literal from `i32` to `u32`
|
LL | let x: u32 = 20u32;
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-13853-2.stderr b/src/test/ui/issues/issue-13853-2.stderr
index 667ddbc..92068df 100644
--- a/src/test/ui/issues/issue-13853-2.stderr
+++ b/src/test/ui/issues/issue-13853-2.stderr
@@ -7,7 +7,7 @@
help: use parentheses to call the method
|
LL | fn foo(res : Box<dyn ResponseHook>) { res.get() }
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-14091.stderr b/src/test/ui/issues/issue-14091.stderr
index 9e9c7a5..7db4734 100644
--- a/src/test/ui/issues/issue-14091.stderr
+++ b/src/test/ui/issues/issue-14091.stderr
@@ -3,8 +3,6 @@
|
LL | assert!(1,1);
| ^^^^^^^^^^^^^ expected `bool`, found integer
- |
- = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-14092.stderr b/src/test/ui/issues/issue-14092.stderr
index 1aa278b..7928b3f 100644
--- a/src/test/ui/issues/issue-14092.stderr
+++ b/src/test/ui/issues/issue-14092.stderr
@@ -14,7 +14,7 @@
help: add missing generic argument
|
LL | fn fn1(0: Box<T>) {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-1448-2.stderr b/src/test/ui/issues/issue-1448-2.stderr
index 9cf2f09..6bf76c4 100644
--- a/src/test/ui/issues/issue-1448-2.stderr
+++ b/src/test/ui/issues/issue-1448-2.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `i32` to `u32`
|
LL | println!("{}", foo(10u32));
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-16922.stderr b/src/test/ui/issues/issue-16922.stderr
index 6decc75..8b09b7d 100644
--- a/src/test/ui/issues/issue-16922.stderr
+++ b/src/test/ui/issues/issue-16922.stderr
@@ -9,7 +9,7 @@
help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound
|
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any + '_> {
- | ^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17385.rs b/src/test/ui/issues/issue-17385.rs
index 93364d2..7400aad 100644
--- a/src/test/ui/issues/issue-17385.rs
+++ b/src/test/ui/issues/issue-17385.rs
@@ -15,8 +15,8 @@
fn main() {
let foo = X(1);
drop(foo);
- match foo {
- X(1) => (), //~ ERROR use of moved value
+ match foo { //~ ERROR use of moved value
+ X(1) => (),
_ => unreachable!()
}
diff --git a/src/test/ui/issues/issue-17385.stderr b/src/test/ui/issues/issue-17385.stderr
index 28c2226..77aa201 100644
--- a/src/test/ui/issues/issue-17385.stderr
+++ b/src/test/ui/issues/issue-17385.stderr
@@ -1,13 +1,12 @@
error[E0382]: use of moved value: `foo`
- --> $DIR/issue-17385.rs:19:11
+ --> $DIR/issue-17385.rs:18:5
|
LL | let foo = X(1);
| --- move occurs because `foo` has type `X`, which does not implement the `Copy` trait
LL | drop(foo);
| --- value moved here
LL | match foo {
-LL | X(1) => (),
- | ^ value used here after move
+ | ^^^^^^^^^ value used here after move
error[E0382]: use of moved value: `e`
--> $DIR/issue-17385.rs:25:11
diff --git a/src/test/ui/issues/issue-17431-1.stderr b/src/test/ui/issues/issue-17431-1.stderr
index 58d087c..4d739a3 100644
--- a/src/test/ui/issues/issue-17431-1.stderr
+++ b/src/test/ui/issues/issue-17431-1.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { foo: Box<Option<Option<Foo>>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-2.stderr b/src/test/ui/issues/issue-17431-2.stderr
index eba4bf6..e53134c 100644
--- a/src/test/ui/issues/issue-17431-2.stderr
+++ b/src/test/ui/issues/issue-17431-2.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Baz` representable
|
LL | struct Baz { q: Box<Option<Foo>> }
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-17431-2.rs:4:1
@@ -22,7 +22,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { q: Box<Option<Baz>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-17431-3.stderr b/src/test/ui/issues/issue-17431-3.stderr
index f6b15d0..0dde6f3 100644
--- a/src/test/ui/issues/issue-17431-3.stderr
+++ b/src/test/ui/issues/issue-17431-3.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { foo: Box<Mutex<Option<Foo>>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-4.stderr b/src/test/ui/issues/issue-17431-4.stderr
index aa709e1..f5aeeec 100644
--- a/src/test/ui/issues/issue-17431-4.stderr
+++ b/src/test/ui/issues/issue-17431-4.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo<T> { foo: Box<Option<Option<Foo<T>>>>, marker: marker::PhantomData<T> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-5.stderr b/src/test/ui/issues/issue-17431-5.stderr
index 1558cff..a379598 100644
--- a/src/test/ui/issues/issue-17431-5.stderr
+++ b/src/test/ui/issues/issue-17431-5.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
|
LL | struct Bar<T> { x: Box<Bar<Foo>> , marker: marker::PhantomData<T> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-6.stderr b/src/test/ui/issues/issue-17431-6.stderr
index f2aa2a7..fcac420 100644
--- a/src/test/ui/issues/issue-17431-6.stderr
+++ b/src/test/ui/issues/issue-17431-6.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | enum Foo { X(Box<Mutex<Option<Foo>>>) }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-7.stderr b/src/test/ui/issues/issue-17431-7.stderr
index 684c3089..aeaadaa 100644
--- a/src/test/ui/issues/issue-17431-7.stderr
+++ b/src/test/ui/issues/issue-17431-7.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | enum Foo { Voo(Box<Option<Option<Foo>>>) }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr
index 6269ccb..16678c8 100644
--- a/src/test/ui/issues/issue-17546.stderr
+++ b/src/test/ui/issues/issue-17546.stderr
@@ -3,7 +3,7 @@
|
LL | fn new() -> NoResult<MyEnum, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | pub enum Result<T, E> {
@@ -12,11 +12,11 @@
help: try using the variant's enum
|
LL | fn new() -> foo::MyEnum {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: an enum with a similar name exists
|
LL | fn new() -> Result<MyEnum, String> {
- | ^^^^^^
+ | ~~~~~~
error[E0573]: expected type, found variant `Result`
--> $DIR/issue-17546.rs:24:17
@@ -57,7 +57,7 @@
|
LL | fn newer() -> NoResult<foo::MyEnum, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | pub enum Result<T, E> {
@@ -66,11 +66,11 @@
help: try using the variant's enum
|
LL | fn newer() -> foo::MyEnum {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: an enum with a similar name exists
|
LL | fn newer() -> Result<foo::MyEnum, String> {
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/issues/issue-17800.stderr b/src/test/ui/issues/issue-17800.stderr
index 7df86d7..baab675 100644
--- a/src/test/ui/issues/issue-17800.stderr
+++ b/src/test/ui/issues/issue-17800.stderr
@@ -7,7 +7,7 @@
help: use the tuple variant pattern syntax instead
|
LL | MyOption::MySome(42) => (),
- | ^^^^
+ | ~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-18446.stderr b/src/test/ui/issues/issue-18446.stderr
index 11c8cfd..939cf02 100644
--- a/src/test/ui/issues/issue-18446.stderr
+++ b/src/test/ui/issues/issue-18446.stderr
@@ -2,10 +2,7 @@
--> $DIR/issue-18446.rs:18:7
|
LL | x.foo();
- | --^^^--
- | | |
- | | multiple `foo` found
- | help: disambiguate the associated function for candidate #2: `T::foo(&x)`
+ | ^^^ multiple `foo` found
|
note: candidate #1 is defined in an impl for the type `(dyn T + 'a)`
--> $DIR/issue-18446.rs:9:5
@@ -17,6 +14,10 @@
|
LL | fn foo(&self);
| ^^^^^^^^^^^^^^
+help: disambiguate the associated function for candidate #2
+ |
+LL | T::foo(&x);
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-18611.stderr b/src/test/ui/issues/issue-18611.stderr
index 0e942e8..b702196 100644
--- a/src/test/ui/issues/issue-18611.stderr
+++ b/src/test/ui/issues/issue-18611.stderr
@@ -3,9 +3,12 @@
|
LL | fn add_state(op: <isize as HasState>::State) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize`
-...
+ |
+note: required by a bound in `HasState`
+ --> $DIR/issue-18611.rs:5:1
+ |
LL | trait HasState {
- | -------------- required by this bound in `HasState`
+ | ^^^^^^^^^^^^^^ required by this bound in `HasState`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-18919.stderr b/src/test/ui/issues/issue-18919.stderr
index d4b93eb..d7dbb82 100644
--- a/src/test/ui/issues/issue-18919.stderr
+++ b/src/test/ui/issues/issue-18919.stderr
@@ -3,11 +3,13 @@
|
LL | fn ho_func(f: Option<FuncType>) {
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
-...
-LL | enum Option<T> {
- | - required by this bound in `Option`
|
= help: the trait `Sized` is not implemented for `dyn for<'r> Fn(&'r isize) -> isize`
+note: required by a bound in `Option`
+ --> $DIR/issue-18919.rs:7:13
+ |
+LL | enum Option<T> {
+ | ^ required by this bound in `Option`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/issue-18919.rs:7:13
|
diff --git a/src/test/ui/issues/issue-1920-1.stderr b/src/test/ui/issues/issue-1920-1.stderr
index 0a2459c..a546924 100644
--- a/src/test/ui/issues/issue-1920-1.stderr
+++ b/src/test/ui/issues/issue-1920-1.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `S: Clone` is not satisfied
--> $DIR/issue-1920-1.rs:12:20
|
-LL | fn assert_clone<T>() where T : Clone { }
- | ----- required by this bound in `assert_clone`
-...
LL | assert_clone::<foo::issue_1920::S>();
| ^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `S`
+ |
+note: required by a bound in `assert_clone`
+ --> $DIR/issue-1920-1.rs:9:32
+ |
+LL | fn assert_clone<T>() where T : Clone { }
+ | ^^^^^ required by this bound in `assert_clone`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-1920-2.stderr b/src/test/ui/issues/issue-1920-2.stderr
index 06bc78a..1083b01 100644
--- a/src/test/ui/issues/issue-1920-2.stderr
+++ b/src/test/ui/issues/issue-1920-2.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `S: Clone` is not satisfied
--> $DIR/issue-1920-2.rs:10:20
|
-LL | fn assert_clone<T>() where T : Clone { }
- | ----- required by this bound in `assert_clone`
-...
LL | assert_clone::<bar::S>();
| ^^^^^^ the trait `Clone` is not implemented for `S`
+ |
+note: required by a bound in `assert_clone`
+ --> $DIR/issue-1920-2.rs:7:32
+ |
+LL | fn assert_clone<T>() where T : Clone { }
+ | ^^^^^ required by this bound in `assert_clone`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-1920-3.stderr b/src/test/ui/issues/issue-1920-3.stderr
index 48d3105..3f0787c 100644
--- a/src/test/ui/issues/issue-1920-3.stderr
+++ b/src/test/ui/issues/issue-1920-3.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `S: Clone` is not satisfied
--> $DIR/issue-1920-3.rs:14:20
|
-LL | fn assert_clone<T>() where T : Clone { }
- | ----- required by this bound in `assert_clone`
-...
LL | assert_clone::<foo::issue_1920::S>();
| ^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `S`
+ |
+note: required by a bound in `assert_clone`
+ --> $DIR/issue-1920-3.rs:11:32
+ |
+LL | fn assert_clone<T>() where T : Clone { }
+ | ^^^^^ required by this bound in `assert_clone`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-19380.stderr b/src/test/ui/issues/issue-19380.stderr
index 4400b61..b2aeb5e 100644
--- a/src/test/ui/issues/issue-19380.stderr
+++ b/src/test/ui/issues/issue-19380.stderr
@@ -14,11 +14,11 @@
help: consider turning `qiz` into a method by giving it a `&self` argument
|
LL | fn qiz(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `qiz` so it does not apply to trait objects
|
LL | fn qiz() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-19707.stderr b/src/test/ui/issues/issue-19707.stderr
index 337f2f9..18f69bb 100644
--- a/src/test/ui/issues/issue-19707.stderr
+++ b/src/test/ui/issues/issue-19707.stderr
@@ -9,11 +9,11 @@
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | type Foo = for<'a> fn(&'a u8, &'a u8) -> &'a u8;
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ++ ++ ++
help: consider introducing a named lifetime parameter
|
LL | type Foo<'a> = fn(&'a u8, &'a u8) -> &'a u8;
- | ^^^^ ^^^^^^ ^^^^^^ ^^^
+ | ++++ ++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/issue-19707.rs:5:27
@@ -26,11 +26,11 @@
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | fn bar<F: for<'a> Fn(&'a u8, &'a u8) -> &'a u8>(f: &F) {}
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ++ ++ ++
help: consider introducing a named lifetime parameter
|
LL | fn bar<'a, F: Fn(&'a u8, &'a u8) -> &'a u8>(f: &F) {}
- | ^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++ ++ ++ ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-19883.stderr b/src/test/ui/issues/issue-19883.stderr
index e370b2e..bd6a86b 100644
--- a/src/test/ui/issues/issue-19883.stderr
+++ b/src/test/ui/issues/issue-19883.stderr
@@ -1,8 +1,14 @@
error[E0576]: cannot find associated type `Dst` in trait `From`
--> $DIR/issue-19883.rs:9:30
|
+LL | type Output;
+ | ------------ associated type `Output` defined here
+...
LL | <Dst as From<Self>>::Dst
- | ^^^ not found in `From`
+ | ^^^
+ | |
+ | not found in `From`
+ | help: maybe you meant this associated type: `Output`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-20413.stderr b/src/test/ui/issues/issue-20413.stderr
index 6bcff7a..572c8ee 100644
--- a/src/test/ui/issues/issue-20413.stderr
+++ b/src/test/ui/issues/issue-20413.stderr
@@ -10,9 +10,6 @@
error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo`
--> $DIR/issue-20413.rs:8:36
|
-LL | trait Foo {
- | --------- required by this bound in `Foo`
-...
LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^
|
@@ -24,59 +21,15 @@
| ^^^ ^
= note: 127 redundant requirements hidden
= note: required because of the requirements on the impl of `Foo` for `NoData<T>`
-
-error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Baz`
- --> $DIR/issue-20413.rs:28:42
+note: required by a bound in `Foo`
+ --> $DIR/issue-20413.rs:1:1
|
-LL | trait Baz {
- | --------- required by this bound in `Baz`
-...
-LL | impl<T> Bar for T where EvenLessData<T>: Baz {
- | ^^^
- |
- = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
-note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
- --> $DIR/issue-20413.rs:28:9
- |
-LL | impl<T> Bar for T where EvenLessData<T>: Baz {
- | ^^^ ^
-note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
- --> $DIR/issue-20413.rs:36:9
- |
-LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
- | ^^^ ^
- = note: 126 redundant requirements hidden
- = note: required because of the requirements on the impl of `Baz` for `EvenLessData<T>`
-
-error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Bar`
- --> $DIR/issue-20413.rs:36:42
- |
-LL | trait Bar {
- | --------- required by this bound in `Bar`
-...
-LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
- | ^^^
- |
- = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
-note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
- --> $DIR/issue-20413.rs:36:9
- |
-LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
- | ^^^ ^
-note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
- --> $DIR/issue-20413.rs:28:9
- |
-LL | impl<T> Bar for T where EvenLessData<T>: Baz {
- | ^^^ ^
- = note: 126 redundant requirements hidden
- = note: required because of the requirements on the impl of `Bar` for `AlmostNoData<T>`
+LL | trait Foo {
+ | ^^^^^^^^^ required by this bound in `Foo`
error[E0275]: overflow evaluating the requirement `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Foo`
--> $DIR/issue-20413.rs:8:36
|
-LL | trait Foo {
- | --------- required by this bound in `Foo`
-...
LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^
|
@@ -88,13 +41,15 @@
| ^^^ ^
= note: 127 redundant requirements hidden
= note: required because of the requirements on the impl of `Foo` for `NoData<T>`
+note: required by a bound in `Foo`
+ --> $DIR/issue-20413.rs:1:1
+ |
+LL | trait Foo {
+ | ^^^^^^^^^ required by this bound in `Foo`
error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Baz`
--> $DIR/issue-20413.rs:28:42
|
-LL | trait Baz {
- | --------- required by this bound in `Baz`
-...
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^
|
@@ -111,13 +66,40 @@
| ^^^ ^
= note: 126 redundant requirements hidden
= note: required because of the requirements on the impl of `Baz` for `EvenLessData<T>`
+note: required by a bound in `Baz`
+ --> $DIR/issue-20413.rs:20:1
+ |
+LL | trait Baz {
+ | ^^^^^^^^^ required by this bound in `Baz`
+
+error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Baz`
+ --> $DIR/issue-20413.rs:28:42
+ |
+LL | impl<T> Bar for T where EvenLessData<T>: Baz {
+ | ^^^
+ |
+ = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
+note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/issue-20413.rs:28:9
+ |
+LL | impl<T> Bar for T where EvenLessData<T>: Baz {
+ | ^^^ ^
+note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/issue-20413.rs:36:9
+ |
+LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
+ | ^^^ ^
+ = note: 126 redundant requirements hidden
+ = note: required because of the requirements on the impl of `Baz` for `EvenLessData<T>`
+note: required by a bound in `Baz`
+ --> $DIR/issue-20413.rs:20:1
+ |
+LL | trait Baz {
+ | ^^^^^^^^^ required by this bound in `Baz`
error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Bar`
--> $DIR/issue-20413.rs:36:42
|
-LL | trait Bar {
- | --------- required by this bound in `Bar`
-...
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^
|
@@ -134,6 +116,36 @@
| ^^^ ^
= note: 126 redundant requirements hidden
= note: required because of the requirements on the impl of `Bar` for `AlmostNoData<T>`
+note: required by a bound in `Bar`
+ --> $DIR/issue-20413.rs:16:1
+ |
+LL | trait Bar {
+ | ^^^^^^^^^ required by this bound in `Bar`
+
+error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Bar`
+ --> $DIR/issue-20413.rs:36:42
+ |
+LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
+ | ^^^
+ |
+ = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_20413`)
+note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/issue-20413.rs:36:9
+ |
+LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
+ | ^^^ ^
+note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/issue-20413.rs:28:9
+ |
+LL | impl<T> Bar for T where EvenLessData<T>: Baz {
+ | ^^^ ^
+ = note: 126 redundant requirements hidden
+ = note: required because of the requirements on the impl of `Bar` for `AlmostNoData<T>`
+note: required by a bound in `Bar`
+ --> $DIR/issue-20413.rs:16:1
+ |
+LL | trait Bar {
+ | ^^^^^^^^^ required by this bound in `Bar`
error: aborting due to 7 previous errors
diff --git a/src/test/ui/issues/issue-20433.stderr b/src/test/ui/issues/issue-20433.stderr
index 5fed021..9d3bb8b 100644
--- a/src/test/ui/issues/issue-20433.stderr
+++ b/src/test/ui/issues/issue-20433.stderr
@@ -3,13 +3,13 @@
|
LL | fn iceman(c: Vec<[i32]>) {}
| ^^^^^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- |
-LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
- | - required by this bound in `Vec`
|
= help: the trait `Sized` is not implemented for `[i32]`
+note: required by a bound in `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ |
+LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
+ | ^ required by this bound in `Vec`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-20772.stderr b/src/test/ui/issues/issue-20772.stderr
index 4aecc7e..c964dc4 100644
--- a/src/test/ui/issues/issue-20772.stderr
+++ b/src/test/ui/issues/issue-20772.stderr
@@ -6,7 +6,7 @@
LL | | {}
| |__^
|
- = note: ...which again requires computing the super traits of `T` with associated type name `Item`, completing the cycle
+ = note: ...which immediately requires computing the super traits of `T` with associated type name `Item` again
note: cycle used when computing the super traits of `T`
--> $DIR/issue-20772.rs:1:1
|
diff --git a/src/test/ui/issues/issue-20825.stderr b/src/test/ui/issues/issue-20825.stderr
index ccbe06d..be2bbd4 100644
--- a/src/test/ui/issues/issue-20825.stderr
+++ b/src/test/ui/issues/issue-20825.stderr
@@ -4,7 +4,7 @@
LL | pub trait Processor: Subscriber<Input = Self::Input> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: ...which again requires computing the super traits of `Processor` with associated type name `Input`, completing the cycle
+ = note: ...which immediately requires computing the super traits of `Processor` with associated type name `Input` again
note: cycle used when computing the super traits of `Processor`
--> $DIR/issue-20825.rs:5:1
|
diff --git a/src/test/ui/issues/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr
index c864381..92742b5 100644
--- a/src/test/ui/issues/issue-21160.stderr
+++ b/src/test/ui/issues/issue-21160.stderr
@@ -5,12 +5,12 @@
| ---- in this derive macro expansion
LL | struct Foo(Bar);
| ^^^ the trait `Hash` is not implemented for `Bar`
- |
- ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
+ |
+note: required by a bound in `std::hash::Hash::hash`
+ --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
LL | fn hash<H: Hasher>(&self, state: &mut H);
- | - required by this bound in `std::hash::Hash::hash`
- |
+ | ^ required by this bound in `std::hash::Hash::hash`
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-21177.stderr b/src/test/ui/issues/issue-21177.stderr
index 59cc655..6877a18 100644
--- a/src/test/ui/issues/issue-21177.stderr
+++ b/src/test/ui/issues/issue-21177.stderr
@@ -4,7 +4,7 @@
LL | fn foo<T: Trait<A = T::B>>() { }
| ^^^^
|
- = note: ...which again requires computing the bounds for type parameter `T`, completing the cycle
+ = note: ...which immediately requires computing the bounds for type parameter `T` again
note: cycle used when computing explicit predicates of `foo`
--> $DIR/issue-21177.rs:6:21
|
diff --git a/src/test/ui/issues/issue-21202.stderr b/src/test/ui/issues/issue-21202.stderr
index 47f28d7..1d2816f 100644
--- a/src/test/ui/issues/issue-21202.stderr
+++ b/src/test/ui/issues/issue-21202.stderr
@@ -3,7 +3,7 @@
|
LL | Foo::foo(&f);
| ^^^ private associated function
- |
+ |
::: $DIR/auxiliary/issue-21202.rs:4:9
|
LL | fn foo(&self) { }
diff --git a/src/test/ui/issues/issue-21763.stderr b/src/test/ui/issues/issue-21763.stderr
index 4d27f50..b8b38c0 100644
--- a/src/test/ui/issues/issue-21763.stderr
+++ b/src/test/ui/issues/issue-21763.stderr
@@ -1,9 +1,6 @@
error[E0277]: `Rc<()>` cannot be sent between threads safely
--> $DIR/issue-21763.rs:9:5
|
-LL | fn foo<T: Send>() {}
- | ---- required by this bound in `foo`
-...
LL | foo::<HashMap<Rc<()>, Rc<()>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
|
@@ -12,6 +9,11 @@
= note: required because of the requirements on the impl of `Send` for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>`
= note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
= note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
+note: required by a bound in `foo`
+ --> $DIR/issue-21763.rs:6:11
+ |
+LL | fn foo<T: Send>() {}
+ | ^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-21837.stderr b/src/test/ui/issues/issue-21837.stderr
index 27e5c60..3d38526 100644
--- a/src/test/ui/issues/issue-21837.stderr
+++ b/src/test/ui/issues/issue-21837.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Bound` is not satisfied
--> $DIR/issue-21837.rs:8:20
|
-LL | pub struct Foo<T: Bound>(T);
- | ----- required by this bound in `Foo`
-...
LL | impl<T> Trait2 for Foo<T> {}
| ^^^^^^ the trait `Bound` is not implemented for `T`
|
+note: required by a bound in `Foo`
+ --> $DIR/issue-21837.rs:2:19
+ |
+LL | pub struct Foo<T: Bound>(T);
+ | ^^^^^ required by this bound in `Foo`
help: consider restricting type parameter `T`
|
LL | impl<T: Bound> Trait2 for Foo<T> {}
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-21946.stderr b/src/test/ui/issues/issue-21946.stderr
index 0497bd2..67f6b30 100644
--- a/src/test/ui/issues/issue-21946.stderr
+++ b/src/test/ui/issues/issue-21946.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::A == _`
- --> $DIR/issue-21946.rs:8:5
+ --> $DIR/issue-21946.rs:8:14
|
LL | type A = <FooStruct as Foo>::A;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-21974.stderr b/src/test/ui/issues/issue-21974.stderr
index fea2c7d..3b66635 100644
--- a/src/test/ui/issues/issue-21974.stderr
+++ b/src/test/ui/issues/issue-21974.stderr
@@ -1,13 +1,15 @@
error[E0283]: type annotations needed
--> $DIR/issue-21974.rs:11:19
|
-LL | trait Foo {
- | --------- required by this bound in `Foo`
-...
LL | where &'a T : Foo,
| ^^^ cannot infer type for reference `&'a T`
|
= note: cannot satisfy `&'a T: Foo`
+note: required by a bound in `Foo`
+ --> $DIR/issue-21974.rs:6:1
+ |
+LL | trait Foo {
+ | ^^^^^^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-22289.stderr b/src/test/ui/issues/issue-22289.stderr
index f90e89e..b594e8b 100644
--- a/src/test/ui/issues/issue-22289.stderr
+++ b/src/test/ui/issues/issue-22289.stderr
@@ -7,7 +7,7 @@
help: consider borrowing the value
|
LL | &0 as &dyn std::any::Any;
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-22312.stderr b/src/test/ui/issues/issue-22312.stderr
index 47ee544..da15c09 100644
--- a/src/test/ui/issues/issue-22312.stderr
+++ b/src/test/ui/issues/issue-22312.stderr
@@ -7,7 +7,7 @@
help: consider borrowing the value
|
LL | let indexer = &(&*self as &dyn Index<usize, Output = <Self as Index<usize>>::Output>);
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-22638.polonius.stderr b/src/test/ui/issues/issue-22638.polonius.stderr
new file mode 100644
index 0000000..87a7c00
--- /dev/null
+++ b/src/test/ui/issues/issue-22638.polonius.stderr
@@ -0,0 +1,15 @@
+error: reached the recursion limit while instantiating `A::matches::$CLOSURE`
+ --> $DIR/issue-22638.rs:56:9
+ |
+LL | a.matches(f)
+ | ^^^^^^^^^^^^
+ |
+note: `A::matches` defined here
+ --> $DIR/issue-22638.rs:15:5
+ |
+LL | pub fn matches<F: Fn()>(&self, f: &F) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-22638.polonius/issue-22638.long-type.txt'
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/issues/issue-22644.stderr b/src/test/ui/issues/issue-22644.stderr
index 1be2694..6bec981 100644
--- a/src/test/ui/issues/issue-22644.stderr
+++ b/src/test/ui/issues/issue-22644.stderr
@@ -2,46 +2,66 @@
--> $DIR/issue-22644.rs:8:31
|
LL | println!("{}", a as usize < long_name);
- | ---------- ^ --------- interpreted as generic arguments
- | | |
- | | not interpreted as comparison
- | help: try comparing the cast value: `(a as usize)`
+ | ^ --------- interpreted as generic arguments
+ | |
+ | not interpreted as comparison
+ |
+help: try comparing the cast value
+ |
+LL | println!("{}", (a as usize) < long_name);
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:9:33
|
LL | println!("{}{}", a as usize < long_name, long_name);
- | ---------- ^ -------------------- interpreted as generic arguments
- | | |
- | | not interpreted as comparison
- | help: try comparing the cast value: `(a as usize)`
+ | ^ -------------------- interpreted as generic arguments
+ | |
+ | not interpreted as comparison
+ |
+help: try comparing the cast value
+ |
+LL | println!("{}{}", (a as usize) < long_name, long_name);
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:11:31
|
LL | println!("{}", a as usize < 4);
- | ---------- ^ - interpreted as generic arguments
- | | |
- | | not interpreted as comparison
- | help: try comparing the cast value: `(a as usize)`
+ | ^ - interpreted as generic arguments
+ | |
+ | not interpreted as comparison
+ |
+help: try comparing the cast value
+ |
+LL | println!("{}", (a as usize) < 4);
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:13:31
|
LL | println!("{}{}", a: usize < long_name, long_name);
- | -------- ^ -------------------- interpreted as generic arguments
- | | |
- | | not interpreted as comparison
- | help: try comparing the cast value: `(a: usize)`
+ | ^ -------------------- interpreted as generic arguments
+ | |
+ | not interpreted as comparison
+ |
+help: try comparing the cast value
+ |
+LL | println!("{}{}", (a: usize) < long_name, long_name);
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:15:29
|
LL | println!("{}", a: usize < 4);
- | -------- ^ - interpreted as generic arguments
- | | |
- | | not interpreted as comparison
- | help: try comparing the cast value: `(a: usize)`
+ | ^ - interpreted as generic arguments
+ | |
+ | not interpreted as comparison
+ |
+help: try comparing the cast value
+ |
+LL | println!("{}", (a: usize) < 4);
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:20:20
@@ -53,9 +73,9 @@
|
help: try comparing the cast value
|
-LL | println!("{}", (a
+LL ~ println!("{}", (a
LL | as
-LL | usize)
+LL ~ usize)
|
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
@@ -68,7 +88,7 @@
|
help: try comparing the cast value
|
-LL | println!("{}", (a
+LL ~ println!("{}", (a
LL |
LL |
LL | as
@@ -80,10 +100,14 @@
--> $DIR/issue-22644.rs:32:31
|
LL | println!("{}", a as usize << long_name);
- | ---------- ^^ --------- interpreted as generic arguments
- | | |
- | | not interpreted as shift
- | help: try shifting the cast value: `(a as usize)`
+ | ^^ --------- interpreted as generic arguments
+ | |
+ | not interpreted as shift
+ |
+help: try shifting the cast value
+ |
+LL | println!("{}", (a as usize) << long_name);
+ | + +
error: expected type, found `4`
--> $DIR/issue-22644.rs:34:28
diff --git a/src/test/ui/issues/issue-22872.stderr b/src/test/ui/issues/issue-22872.stderr
index fd3db95..cd96646 100644
--- a/src/test/ui/issues/issue-22872.stderr
+++ b/src/test/ui/issues/issue-22872.stderr
@@ -14,7 +14,7 @@
help: consider further restricting the associated type
|
LL | fn push_process<P>(process: P) where P: Process<'static>, <P as Process<'_>>::Item: Iterator {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr
index 5d7ffeb..7a4d90b 100644
--- a/src/test/ui/issues/issue-23024.stderr
+++ b/src/test/ui/issues/issue-23024.stderr
@@ -21,7 +21,7 @@
help: add missing generic argument
|
LL | println!("{:?}",(vfnfer[0] as dyn Fn<Args>)(3));
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0191]: the value of the associated type `Output` (from trait `FnOnce`) must be specified
--> $DIR/issue-23024.rs:9:39
diff --git a/src/test/ui/issues/issue-23122-1.stderr b/src/test/ui/issues/issue-23122-1.stderr
index 8613c1e..0b568b3 100644
--- a/src/test/ui/issues/issue-23122-1.stderr
+++ b/src/test/ui/issues/issue-23122-1.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next == _`
- --> $DIR/issue-23122-1.rs:10:5
+ --> $DIR/issue-23122-1.rs:10:17
|
LL | type Next = <GetNext<T> as Next>::Next;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-23122-2.stderr b/src/test/ui/issues/issue-23122-2.stderr
index 5008a49..68a95dc 100644
--- a/src/test/ui/issues/issue-23122-2.stderr
+++ b/src/test/ui/issues/issue-23122-2.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized`
- --> $DIR/issue-23122-2.rs:9:5
+ --> $DIR/issue-23122-2.rs:9:17
|
LL | type Next = <GetNext<T::Next> as Next>::Next;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_23122_2`)
note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>`
diff --git a/src/test/ui/issues/issue-23281.stderr b/src/test/ui/issues/issue-23281.stderr
index a3d2583..804334c 100644
--- a/src/test/ui/issues/issue-23281.stderr
+++ b/src/test/ui/issues/issue-23281.stderr
@@ -3,11 +3,13 @@
|
LL | pub fn function(funs: Vec<dyn Fn() -> ()>) {}
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
-...
-LL | struct Vec<T> {
- | - required by this bound in `Vec`
|
= help: the trait `Sized` is not implemented for `(dyn Fn() + 'static)`
+note: required by a bound in `Vec`
+ --> $DIR/issue-23281.rs:8:12
+ |
+LL | struct Vec<T> {
+ | ^ required by this bound in `Vec`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/issue-23281.rs:8:12
|
diff --git a/src/test/ui/issues/issue-23458.rs b/src/test/ui/issues/issue-23458.rs
index 1762d21..d640828 100644
--- a/src/test/ui/issues/issue-23458.rs
+++ b/src/test/ui/issues/issue-23458.rs
@@ -1,4 +1,5 @@
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
// compile-flags: -Ccodegen-units=1
// build-fail
// only-x86_64
diff --git a/src/test/ui/issues/issue-23458.stderr b/src/test/ui/issues/issue-23458.stderr
index a6500b9..69e458f 100644
--- a/src/test/ui/issues/issue-23458.stderr
+++ b/src/test/ui/issues/issue-23458.stderr
@@ -1,11 +1,11 @@
error: invalid operand in inline asm: 'int $3'
- --> $DIR/issue-23458.rs:8:9
+ --> $DIR/issue-23458.rs:9:9
|
LL | llvm_asm!("int $3");
| ^
error: too few operands for instruction
- --> $DIR/issue-23458.rs:8:9
+ --> $DIR/issue-23458.rs:9:9
|
LL | llvm_asm!("int $3");
| ^
diff --git a/src/test/ui/issues/issue-24424.stderr b/src/test/ui/issues/issue-24424.stderr
index 9f5e934..4896006 100644
--- a/src/test/ui/issues/issue-24424.stderr
+++ b/src/test/ui/issues/issue-24424.stderr
@@ -1,13 +1,15 @@
error[E0283]: type annotations needed
--> $DIR/issue-24424.rs:4:57
|
-LL | trait Trait0<'l0> {}
- | ----------------- required by this bound in `Trait0`
-LL |
LL | impl <'l0, 'l1, T0> Trait1<'l0, T0> for bool where T0 : Trait0<'l0>, T0 : Trait0<'l1> {}
| ^^^^^^^^^^^ cannot infer type for type parameter `T0`
|
= note: cannot satisfy `T0: Trait0<'l0>`
+note: required by a bound in `Trait0`
+ --> $DIR/issue-24424.rs:2:1
+ |
+LL | trait Trait0<'l0> {}
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `Trait0`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-25076.stderr b/src/test/ui/issues/issue-25076.stderr
index 27c577a..ece9959 100644
--- a/src/test/ui/issues/issue-25076.stderr
+++ b/src/test/ui/issues/issue-25076.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `(): InOut<_>` is not satisfied
--> $DIR/issue-25076.rs:10:20
|
-LL | fn do_fold<B, F: InOut<B, Out=B>>(init: B, f: F) {}
- | --------------- required by this bound in `do_fold`
-...
LL | do_fold(bot(), ());
| ^^ the trait `InOut<_>` is not implemented for `()`
+ |
+note: required by a bound in `do_fold`
+ --> $DIR/issue-25076.rs:5:18
+ |
+LL | fn do_fold<B, F: InOut<B, Out=B>>(init: B, f: F) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `do_fold`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-26472.stderr b/src/test/ui/issues/issue-26472.stderr
index 8e95b2f..d7134bf 100644
--- a/src/test/ui/issues/issue-26472.stderr
+++ b/src/test/ui/issues/issue-26472.stderr
@@ -7,7 +7,7 @@
help: a method `len` also exists, call it with parentheses
|
LL | let v = s.len();
- | ^^
+ | ++
error[E0616]: field `len` of struct `S` is private
--> $DIR/issue-26472.rs:12:7
diff --git a/src/test/ui/issues/issue-26638.stderr b/src/test/ui/issues/issue-26638.stderr
index 3df58d6..bb7cdcb 100644
--- a/src/test/ui/issues/issue-26638.stderr
+++ b/src/test/ui/issues/issue-26638.stderr
@@ -8,7 +8,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn parse_type<'a>(iter: Box<dyn Iterator<Item=&str>+'static>) -> &'a str { iter.next() }
- | ^^^^ ^^^
+ | ++++ ++
error[E0106]: missing lifetime specifier
--> $DIR/issue-26638.rs:4:40
@@ -20,7 +20,7 @@
help: consider using the `'static` lifetime
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &'static str { iter() }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/issue-26638.rs:7:22
@@ -32,7 +32,7 @@
help: consider using the `'static` lifetime
|
LL | fn parse_type_3() -> &'static str { unimplemented!() }
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/issues/issue-27033.stderr b/src/test/ui/issues/issue-27033.stderr
index fa42611..9a38d49 100644
--- a/src/test/ui/issues/issue-27033.stderr
+++ b/src/test/ui/issues/issue-27033.stderr
@@ -3,7 +3,7 @@
|
LL | None @ _ => {}
| ^^^^ cannot be named the same as a unit variant
- |
+ |
::: $SRC_DIR/std/src/prelude/mod.rs:LL:COL
|
LL | pub use super::v1::*;
diff --git a/src/test/ui/issues/issue-27078.stderr b/src/test/ui/issues/issue-27078.stderr
index 021a086..98cec1b 100644
--- a/src/test/ui/issues/issue-27078.stderr
+++ b/src/test/ui/issues/issue-27078.stderr
@@ -8,11 +8,11 @@
help: consider further restricting `Self`
|
LL | fn foo(self) -> &'static i32 where Self: Sized {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(&self) -> &'static i32 {
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-2718-a.stderr b/src/test/ui/issues/issue-2718-a.stderr
index 5c6c99a..4aec27f 100644
--- a/src/test/ui/issues/issue-2718-a.stderr
+++ b/src/test/ui/issues/issue-2718-a.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Pong` representable
|
LL | pub struct Pong(Box<SendPacket<Ping>>);
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-29181.stderr b/src/test/ui/issues/issue-29181.stderr
index b66dcb8..53addf2f 100644
--- a/src/test/ui/issues/issue-29181.stderr
+++ b/src/test/ui/issues/issue-29181.stderr
@@ -13,7 +13,7 @@
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let _ = |x: f64| x * 2.0_f32.exp();
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-2995.stderr b/src/test/ui/issues/issue-2995.stderr
index b08fe8c..455d32e 100644
--- a/src/test/ui/issues/issue-2995.stderr
+++ b/src/test/ui/issues/issue-2995.stderr
@@ -7,7 +7,7 @@
help: consider borrowing the value
|
LL | let _q: &isize = &*p as &isize;
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-3008-1.stderr b/src/test/ui/issues/issue-3008-1.stderr
index 87ee36d..e49d8e6 100644
--- a/src/test/ui/issues/issue-3008-1.stderr
+++ b/src/test/ui/issues/issue-3008-1.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
|
LL | BarSome(Box<Bar>)
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-3008-2.stderr b/src/test/ui/issues/issue-3008-2.stderr
index 369a19d..b3ce6e4 100644
--- a/src/test/ui/issues/issue-3008-2.stderr
+++ b/src/test/ui/issues/issue-3008-2.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
|
LL | struct Bar { x: Box<Bar> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-3008-3.stderr b/src/test/ui/issues/issue-3008-3.stderr
index 0b162ef..c1c043e 100644
--- a/src/test/ui/issues/issue-3008-3.stderr
+++ b/src/test/ui/issues/issue-3008-3.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `E2` representable
|
LL | enum E2<T> { V2(Box<E2<E1>>, marker::PhantomData<T>), }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-30255.stderr b/src/test/ui/issues/issue-30255.stderr
index ab43d4a..e5f492a 100644
--- a/src/test/ui/issues/issue-30255.stderr
+++ b/src/test/ui/issues/issue-30255.stderr
@@ -8,7 +8,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn f<'a>(a: &'a S, b: i32) -> &'a i32 {
- | ^^^^ ^^^^^ ^^^
+ | ++++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/issue-30255.rs:14:34
@@ -20,7 +20,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn g<'a>(a: &'a S, b: bool, c: &'a i32) -> &'a i32 {
- | ^^^^ ^^^^^ ^^^^^^^ ^^^
+ | ++++ ++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/issue-30255.rs:19:44
@@ -32,7 +32,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn h<'a>(a: &'a bool, b: bool, c: &'a S, d: &'a i32) -> &'a i32 {
- | ^^^^ ^^^^^^^^ ^^^^^ ^^^^^^^ ^^^
+ | ++++ ++ ++ ++ ++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr
index 0b7ffc3..8b7871c 100644
--- a/src/test/ui/issues/issue-31173.stderr
+++ b/src/test/ui/issues/issue-31173.stderr
@@ -12,12 +12,12 @@
|
LL | .collect();
| ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` due to unsatisfied trait bounds
- |
+ |
::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
|
LL | pub struct Cloned<I> {
| -------------------- doesn't satisfy `_: Iterator`
- |
+ |
::: $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL
|
LL | pub struct TakeWhile<I, P> {
diff --git a/src/test/ui/issues/issue-32004.stderr b/src/test/ui/issues/issue-32004.stderr
index bf125a8..2d2ed5a 100644
--- a/src/test/ui/issues/issue-32004.stderr
+++ b/src/test/ui/issues/issue-32004.stderr
@@ -12,11 +12,11 @@
help: use the tuple variant pattern syntax instead
|
LL | Foo::Bar(_) => {}
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: a unit variant with a similar name exists
|
LL | Foo::Baz => {}
- | ^^^
+ | ~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `S`
--> $DIR/issue-32004.rs:16:9
diff --git a/src/test/ui/issues/issue-32122-1.stderr b/src/test/ui/issues/issue-32122-1.stderr
index dfbd322..10b0c09 100644
--- a/src/test/ui/issues/issue-32122-1.stderr
+++ b/src/test/ui/issues/issue-32122-1.stderr
@@ -2,14 +2,16 @@
--> $DIR/issue-32122-1.rs:16:24
|
LL | let _: *const u8 = &a;
- | --------- ^^
- | | |
- | | expected `u8`, found struct `Foo`
- | | help: consider dereferencing: `&*a`
+ | --------- ^^ expected `u8`, found struct `Foo`
+ | |
| expected due to this
|
= note: expected raw pointer `*const u8`
found reference `&Foo`
+help: consider dereferencing
+ |
+LL | let _: *const u8 = &*a;
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-32122-2.stderr b/src/test/ui/issues/issue-32122-2.stderr
index 2e199e2..5c3dade 100644
--- a/src/test/ui/issues/issue-32122-2.stderr
+++ b/src/test/ui/issues/issue-32122-2.stderr
@@ -2,14 +2,16 @@
--> $DIR/issue-32122-2.rs:27:24
|
LL | let _: *const u8 = &a;
- | --------- ^^
- | | |
- | | expected `u8`, found struct `Emm`
- | | help: consider dereferencing: `&***a`
+ | --------- ^^ expected `u8`, found struct `Emm`
+ | |
| expected due to this
|
= note: expected raw pointer `*const u8`
found reference `&Emm`
+help: consider dereferencing
+ |
+LL | let _: *const u8 = &***a;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-32323.stderr b/src/test/ui/issues/issue-32323.stderr
index 369f56b..8212c60 100644
--- a/src/test/ui/issues/issue-32323.stderr
+++ b/src/test/ui/issues/issue-32323.stderr
@@ -11,7 +11,7 @@
help: consider constraining the associated type `<T as Tr<'a>>::Out` to `()`
|
LL | pub fn f<'a, T: Tr<'a, Out = ()>>() -> <T as Tr<'a>>::Out {}
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-32326.stderr b/src/test/ui/issues/issue-32326.stderr
index 0f3d369..cea7658 100644
--- a/src/test/ui/issues/issue-32326.stderr
+++ b/src/test/ui/issues/issue-32326.stderr
@@ -11,7 +11,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Expr` representable
|
LL | Plus(Box<Expr>, Box<Expr>),
- | ^^^^ ^ ^^^^ ^
+ | ++++ + ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-32963.stderr b/src/test/ui/issues/issue-32963.stderr
index 76c62c1..b5aa7b1 100644
--- a/src/test/ui/issues/issue-32963.stderr
+++ b/src/test/ui/issues/issue-32963.stderr
@@ -23,11 +23,14 @@
error[E0277]: the trait bound `dyn Misc: Copy` is not satisfied
--> $DIR/issue-32963.rs:8:5
|
-LL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
- | ---- required by this bound in `size_of_copy`
-...
LL | size_of_copy::<dyn Misc + Copy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `dyn Misc`
+ |
+note: required by a bound in `size_of_copy`
+ --> $DIR/issue-32963.rs:5:20
+ |
+LL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
+ | ^^^^ required by this bound in `size_of_copy`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/issues/issue-34373.stderr b/src/test/ui/issues/issue-34373.stderr
index e8c1e8f..8be3cfa 100644
--- a/src/test/ui/issues/issue-34373.stderr
+++ b/src/test/ui/issues/issue-34373.stderr
@@ -4,7 +4,7 @@
LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;
| ^^^^^^^^^^
|
-note: ...which requires computing type of `DefaultFoo`...
+note: ...which requires expanding type alias `DefaultFoo`...
--> $DIR/issue-34373.rs:8:19
|
LL | type DefaultFoo = Foo;
diff --git a/src/test/ui/issues/issue-34721.stderr b/src/test/ui/issues/issue-34721.stderr
index b14faff..0458190 100644
--- a/src/test/ui/issues/issue-34721.stderr
+++ b/src/test/ui/issues/issue-34721.stderr
@@ -21,7 +21,7 @@
help: consider further restricting this bound
|
LL | pub fn baz<T: Foo + Copy>(x: T) -> T {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-35075.stderr b/src/test/ui/issues/issue-35075.stderr
index 85acbfb..08bdaa7 100644
--- a/src/test/ui/issues/issue-35075.stderr
+++ b/src/test/ui/issues/issue-35075.stderr
@@ -7,7 +7,7 @@
help: there is an enum variant `Baz::Foo`; try using the variant's enum
|
LL | inner: Baz
- | ^^^
+ | ~~~
error[E0412]: cannot find type `Foo` in this scope
--> $DIR/issue-35075.rs:6:9
@@ -18,7 +18,7 @@
help: there is an enum variant `Baz::Foo`; try using the variant's enum
|
LL | Foo(Baz)
- | ^^^
+ | ~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr
index b6045c9..4e89f59 100644
--- a/src/test/ui/issues/issue-35241.stderr
+++ b/src/test/ui/issues/issue-35241.stderr
@@ -14,7 +14,7 @@
help: use parentheses to instantiate this tuple struct
|
LL | fn test() -> Foo { Foo(_) }
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-35570.rs b/src/test/ui/issues/issue-35570.rs
index fafef79..42cef9a 100644
--- a/src/test/ui/issues/issue-35570.rs
+++ b/src/test/ui/issues/issue-35570.rs
@@ -1,5 +1,3 @@
-// check-pass
-
use std::mem;
trait Trait1<T> {}
@@ -8,6 +6,7 @@
}
fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
+//~^ the trait bound `for<'a> (): Trait2<'a>` is not satisfied
let _e: (usize, usize) = unsafe{mem::transmute(param)};
}
diff --git a/src/test/ui/issues/issue-35570.stderr b/src/test/ui/issues/issue-35570.stderr
new file mode 100644
index 0000000..dda6145
--- /dev/null
+++ b/src/test/ui/issues/issue-35570.stderr
@@ -0,0 +1,9 @@
+error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
+ --> $DIR/issue-35570.rs:8:4
+ |
+LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
+ | ^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/issues/issue-35668.stderr b/src/test/ui/issues/issue-35668.stderr
index 81a2bb8..04faea9 100644
--- a/src/test/ui/issues/issue-35668.stderr
+++ b/src/test/ui/issues/issue-35668.stderr
@@ -9,7 +9,7 @@
help: consider restricting type parameter `T`
|
LL | fn func<'a, T: std::ops::Mul<Output = &T>>(a: &'a [T]) -> impl Iterator<Item=&'a T> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-35675.stderr b/src/test/ui/issues/issue-35675.stderr
index 8637e57..4a06196 100644
--- a/src/test/ui/issues/issue-35675.stderr
+++ b/src/test/ui/issues/issue-35675.stderr
@@ -7,7 +7,7 @@
help: there is an enum variant `Fruit::Apple`; try using the variant's enum
|
LL | fn should_return_fruit() -> Fruit {
- | ^^^^^
+ | ~~~~~
error[E0425]: cannot find function, tuple struct or tuple variant `Apple` in this scope
--> $DIR/issue-35675.rs:9:5
@@ -58,7 +58,7 @@
help: there is an enum variant `x::Enum::Variant3`; try using the variant's enum
|
LL | fn bar() -> x::Enum {
- | ^^^^^^^
+ | ~~~~~~~
error[E0573]: expected type, found variant `Some`
--> $DIR/issue-35675.rs:28:13
diff --git a/src/test/ui/issues/issue-35988.stderr b/src/test/ui/issues/issue-35988.stderr
index 2e03acc..5598884 100644
--- a/src/test/ui/issues/issue-35988.stderr
+++ b/src/test/ui/issues/issue-35988.stderr
@@ -10,11 +10,11 @@
help: borrowed types always have a statically known size
|
LL | V(&[Box<E>]),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | V(Box<[Box<E>]>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-3702-2.stderr b/src/test/ui/issues/issue-3702-2.stderr
index 6d8d172..1fd64ca 100644
--- a/src/test/ui/issues/issue-3702-2.stderr
+++ b/src/test/ui/issues/issue-3702-2.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | ToPrimitive::to_int(&self) + other.to_int()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | Add::to_int(&self) + other.to_int()
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-37131.stderr b/src/test/ui/issues/issue-37131.stderr
index 660a693..b45574f 100644
--- a/src/test/ui/issues/issue-37131.stderr
+++ b/src/test/ui/issues/issue-37131.stderr
@@ -1,6 +1,8 @@
error[E0463]: can't find crate for `std`
|
= note: the `thumbv6m-none-eabi` target may not be installed
+ = help: consider downloading the target with `rustup target add thumbv6m-none-eabi`
+ = help: consider building the standard library from source with `cargo build -Zbuild-std`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.polonius.stderr b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.polonius.stderr
new file mode 100644
index 0000000..3a1c0b8
--- /dev/null
+++ b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.polonius.stderr
@@ -0,0 +1,15 @@
+error: reached the recursion limit while instantiating `<(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(.....), ...), ...) as Foo>::recurse`
+ --> $DIR/issue-37311.rs:17:9
+ |
+LL | (self, self).recurse();
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: `<T as Foo>::recurse` defined here
+ --> $DIR/issue-37311.rs:16:5
+ |
+LL | fn recurse(&self) {
+ | ^^^^^^^^^^^^^^^^^
+ = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-37311-type-length-limit/issue-37311.polonius/issue-37311.long-type.txt'
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/issues/issue-37366.rs b/src/test/ui/issues/issue-37366.rs
index be9b4af..acc2f3e 100644
--- a/src/test/ui/issues/issue-37366.rs
+++ b/src/test/ui/issues/issue-37366.rs
@@ -2,6 +2,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
macro_rules! interrupt_handler {
() => {
diff --git a/src/test/ui/issues/issue-37433.rs b/src/test/ui/issues/issue-37433.rs
index 2ea9703..1c362e8 100644
--- a/src/test/ui/issues/issue-37433.rs
+++ b/src/test/ui/issues/issue-37433.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no llvm_asm! support
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/issues/issue-37433.stderr b/src/test/ui/issues/issue-37433.stderr
index ff6965a..44a8eb3 100644
--- a/src/test/ui/issues/issue-37433.stderr
+++ b/src/test/ui/issues/issue-37433.stderr
@@ -1,5 +1,5 @@
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/issue-37433.rs:8:29
+ --> $DIR/issue-37433.rs:9:29
|
LL | llvm_asm!("" :: "r"(""));
| ^^
diff --git a/src/test/ui/issues/issue-3779.stderr b/src/test/ui/issues/issue-3779.stderr
index 7b17e91..6a21472 100644
--- a/src/test/ui/issues/issue-3779.stderr
+++ b/src/test/ui/issues/issue-3779.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `S` representable
|
LL | element: Box<Option<S>>
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-38954.stderr b/src/test/ui/issues/issue-38954.stderr
index f76063f..ab15bb1 100644
--- a/src/test/ui/issues/issue-38954.stderr
+++ b/src/test/ui/issues/issue-38954.stderr
@@ -9,7 +9,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn _test(ref _p: &str) {}
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-39559.stderr b/src/test/ui/issues/issue-39559.stderr
index 91e31ca..7626f82 100644
--- a/src/test/ui/issues/issue-39559.stderr
+++ b/src/test/ui/issues/issue-39559.stderr
@@ -5,7 +5,7 @@
| ^^^^^^ cannot perform const operation using `D`
|
= note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-40000.nll.stderr b/src/test/ui/issues/issue-40000.nll.stderr
index 4e2bde0..e6f0b5f 100644
--- a/src/test/ui/issues/issue-40000.nll.stderr
+++ b/src/test/ui/issues/issue-40000.nll.stderr
@@ -1,14 +1,21 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/issue-40000.rs:6:9
|
LL | foo(bar);
- | ^^^
+ | ^^^ one type is more general than the other
+ |
+ = note: expected trait object `dyn for<'r> Fn(&'r i32)`
+ found trait object `dyn Fn(&i32)`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/issue-40000.rs:6:9
|
LL | foo(bar);
- | ^^^
+ | ^^^ one type is more general than the other
+ |
+ = note: expected trait object `dyn for<'r> Fn(&'r i32)`
+ found trait object `dyn Fn(&i32)`
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/issues/issue-40827.stderr b/src/test/ui/issues/issue-40827.stderr
index 38c3af9..3b2d232 100644
--- a/src/test/ui/issues/issue-40827.stderr
+++ b/src/test/ui/issues/issue-40827.stderr
@@ -1,9 +1,6 @@
error[E0277]: `Rc<Foo>` cannot be shared between threads safely
--> $DIR/issue-40827.rs:14:5
|
-LL | fn f<T: Send>(_: T) {}
- | ---- required by this bound in `f`
-...
LL | f(Foo(Arc::new(Bar::B(None))));
| ^ `Rc<Foo>` cannot be shared between threads safely
|
@@ -19,13 +16,15 @@
|
LL | struct Foo(Arc<Bar>);
| ^^^
+note: required by a bound in `f`
+ --> $DIR/issue-40827.rs:11:9
+ |
+LL | fn f<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `f`
error[E0277]: `Rc<Foo>` cannot be sent between threads safely
--> $DIR/issue-40827.rs:14:5
|
-LL | fn f<T: Send>(_: T) {}
- | ---- required by this bound in `f`
-...
LL | f(Foo(Arc::new(Bar::B(None))));
| ^ `Rc<Foo>` cannot be sent between threads safely
|
@@ -41,6 +40,11 @@
|
LL | struct Foo(Arc<Bar>);
| ^^^
+note: required by a bound in `f`
+ --> $DIR/issue-40827.rs:11:9
+ |
+LL | fn f<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `f`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-41229-ref-str.stderr b/src/test/ui/issues/issue-41229-ref-str.stderr
index 8b37e5e..31fdf3b 100644
--- a/src/test/ui/issues/issue-41229-ref-str.stderr
+++ b/src/test/ui/issues/issue-41229-ref-str.stderr
@@ -9,7 +9,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | pub fn example(ref s: &str) {}
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-41652/issue-41652.stderr b/src/test/ui/issues/issue-41652/issue-41652.stderr
index f7107d6..1618f0f 100644
--- a/src/test/ui/issues/issue-41652/issue-41652.stderr
+++ b/src/test/ui/issues/issue-41652/issue-41652.stderr
@@ -7,7 +7,7 @@
help: you must specify a concrete type for this numeric value, like `i32`
|
LL | 3_i32.f()
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-42312.stderr b/src/test/ui/issues/issue-42312.stderr
index f69c2a9..6fe1516 100644
--- a/src/test/ui/issues/issue-42312.stderr
+++ b/src/test/ui/issues/issue-42312.stderr
@@ -9,11 +9,11 @@
help: consider further restricting the associated type
|
LL | fn baz(_: Self::Target) where Self: Deref, <Self as Deref>::Target: Sized {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn baz(_: &Self::Target) where Self: Deref {}
- | ^
+ | +
error[E0277]: the size for values of type `(dyn ToString + 'static)` cannot be known at compilation time
--> $DIR/issue-42312.rs:8:10
@@ -26,7 +26,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | pub fn f(_: &dyn ToString) {}
- | ^
+ | +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-42954.stderr b/src/test/ui/issues/issue-42954.stderr
index 8227f8d..d00fd4a 100644
--- a/src/test/ui/issues/issue-42954.stderr
+++ b/src/test/ui/issues/issue-42954.stderr
@@ -2,15 +2,18 @@
--> $DIR/issue-42954.rs:7:19
|
LL | $i as u32 < 0
- | --------- ^ - interpreted as generic arguments
- | | |
- | | not interpreted as comparison
- | help: try comparing the cast value: `($i as u32)`
+ | ^ - interpreted as generic arguments
+ | |
+ | not interpreted as comparison
...
LL | is_plainly_printable!(c);
| ------------------------- in this macro invocation
|
= note: this error originates in the macro `is_plainly_printable` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: try comparing the cast value
+ |
+LL | ($i as u32) < 0
+ | + +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-43189.stderr b/src/test/ui/issues/issue-43189.stderr
index 3a3767c..caf7530 100644
--- a/src/test/ui/issues/issue-43189.stderr
+++ b/src/test/ui/issues/issue-43189.stderr
@@ -3,7 +3,7 @@
|
LL | ().a();
| ^ method not found in `()`
- |
+ |
::: $DIR/auxiliary/xcrate-issue-43189-a.rs:5:8
|
LL | fn a(&self) {}
diff --git a/src/test/ui/issues/issue-43623.rs b/src/test/ui/issues/issue-43623.rs
index 99cae46..cedcf7c 100644
--- a/src/test/ui/issues/issue-43623.rs
+++ b/src/test/ui/issues/issue-43623.rs
@@ -1,3 +1,5 @@
+// check-pass
+
pub trait Trait<'a> {
type Assoc;
}
@@ -14,7 +16,6 @@
F: for<'b> FnMut(<T as Trait<'b>>::Assoc),
{
break_me::<Type, fn(_)>;
- //~^ ERROR: type mismatch in function arguments
}
fn main() {}
diff --git a/src/test/ui/issues/issue-43623.stderr b/src/test/ui/issues/issue-43623.stderr
deleted file mode 100644
index 4bc5eb0..0000000
--- a/src/test/ui/issues/issue-43623.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0631]: type mismatch in function arguments
- --> $DIR/issue-43623.rs:16:5
- |
-LL | pub fn break_me<T, F>(f: F)
- | -------- required by a bound in this
-...
-LL | F: for<'b> FnMut(<T as Trait<'b>>::Assoc),
- | ------------------------------ required by this bound in `break_me`
-LL | {
-LL | break_me::<Type, fn(_)>;
- | ^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | expected signature of `for<'b> fn(<Type as Trait<'b>>::Assoc) -> _`
- | found signature of `fn(()) -> _`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0631`.
diff --git a/src/test/ui/issues/issue-43784-supertrait.stderr b/src/test/ui/issues/issue-43784-supertrait.stderr
index 45a2350..bb890cb 100644
--- a/src/test/ui/issues/issue-43784-supertrait.stderr
+++ b/src/test/ui/issues/issue-43784-supertrait.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-43784-supertrait.rs:8:9
|
-LL | pub trait Complete: Partial {
- | ------- required by this bound in `Complete`
-...
LL | impl<T> Complete for T {}
| ^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `Complete`
+ --> $DIR/issue-43784-supertrait.rs:4:21
+ |
+LL | pub trait Complete: Partial {
+ | ^^^^^^^ required by this bound in `Complete`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Complete for T {}
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-44005.rs b/src/test/ui/issues/issue-44005.rs
index 041fcdb..ab3b921 100644
--- a/src/test/ui/issues/issue-44005.rs
+++ b/src/test/ui/issues/issue-44005.rs
@@ -1,4 +1,3 @@
-// build-pass
pub trait Foo<'a> {
type Bar;
fn foo(&'a self) -> Self::Bar;
@@ -12,8 +11,9 @@
}
pub fn uncallable<T, F>(x: T, f: F)
- where T: for<'a> Foo<'a>,
- F: for<'a> Fn(<T as Foo<'a>>::Bar)
+where
+ T: for<'a> Foo<'a>,
+ F: for<'a> Fn(<T as Foo<'a>>::Bar),
{
f(x.foo());
}
@@ -24,6 +24,7 @@
pub fn broken<F: Fn(&i32)>(x: &i32, f: F) {
uncallable(x, |y| f(y));
+ //~^ type mismatch
}
-fn main() { }
+fn main() {}
diff --git a/src/test/ui/issues/issue-44005.stderr b/src/test/ui/issues/issue-44005.stderr
new file mode 100644
index 0000000..307e444
--- /dev/null
+++ b/src/test/ui/issues/issue-44005.stderr
@@ -0,0 +1,20 @@
+error[E0631]: type mismatch in closure arguments
+ --> $DIR/issue-44005.rs:26:5
+ |
+LL | uncallable(x, |y| f(y));
+ | ^^^^^^^^^^ -------- found signature of `for<'r> fn(&'r i32) -> _`
+ | |
+ | expected signature of `for<'a> fn(<&i32 as Foo<'a>>::Bar) -> _`
+ |
+note: required by a bound in `uncallable`
+ --> $DIR/issue-44005.rs:16:8
+ |
+LL | pub fn uncallable<T, F>(x: T, f: F)
+ | ---------- required by a bound in this
+...
+LL | F: for<'a> Fn(<T as Foo<'a>>::Bar),
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `uncallable`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0631`.
diff --git a/src/test/ui/issues/issue-47377.stderr b/src/test/ui/issues/issue-47377.stderr
index 5f78567..a7b8b1c 100644
--- a/src/test/ui/issues/issue-47377.stderr
+++ b/src/test/ui/issues/issue-47377.stderr
@@ -10,7 +10,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _a = b.to_owned() + ", World!";
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-47380.stderr b/src/test/ui/issues/issue-47380.stderr
index 216e32d..f6222c7 100644
--- a/src/test/ui/issues/issue-47380.stderr
+++ b/src/test/ui/issues/issue-47380.stderr
@@ -10,7 +10,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-47486.stderr b/src/test/ui/issues/issue-47486.stderr
index cf95d30..a029948 100644
--- a/src/test/ui/issues/issue-47486.stderr
+++ b/src/test/ui/issues/issue-47486.stderr
@@ -1,15 +1,15 @@
+error[E0282]: type annotations needed
+ --> $DIR/issue-47486.rs:3:31
+ |
+LL | [0u8; std::mem::size_of::<_>()];
+ | ^ cannot infer type
+
error[E0308]: mismatched types
--> $DIR/issue-47486.rs:2:10
|
LL | () < std::mem::size_of::<_>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize`
-error[E0282]: type annotations needed
- --> $DIR/issue-47486.rs:3:11
- |
-LL | [0u8; std::mem::size_of::<_>()];
- | ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
-
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0282, E0308.
diff --git a/src/test/ui/issues/issue-47706.stderr b/src/test/ui/issues/issue-47706.stderr
index c84d8ec..d9680a2 100644
--- a/src/test/ui/issues/issue-47706.stderr
+++ b/src/test/ui/issues/issue-47706.stderr
@@ -13,14 +13,17 @@
LL | Bar(i32),
| -------- takes 1 argument
...
+LL | foo(Qux::Bar);
+ | ^^^^^^^^ expected function that takes 0 arguments
+ |
+note: required by a bound in `foo`
+ --> $DIR/issue-47706.rs:22:8
+ |
LL | fn foo<F>(f: F)
| --- required by a bound in this
LL | where
LL | F: Fn(),
- | ---- required by this bound in `foo`
-...
-LL | foo(Qux::Bar);
- | ^^^^^^^^ expected function that takes 0 arguments
+ | ^^^^ required by this bound in `foo`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-49257.stderr b/src/test/ui/issues/issue-49257.stderr
index b9d96dc..a14a666 100644
--- a/src/test/ui/issues/issue-49257.stderr
+++ b/src/test/ui/issues/issue-49257.stderr
@@ -9,8 +9,9 @@
|
help: move the `..` to the end of the field list
|
-LL | let Point { y, .. } = p;
- | -- ^^^^
+LL - let Point { .., y, } = p;
+LL + let Point { y, .. } = p;
+ |
error: expected `}`, found `,`
--> $DIR/issue-49257.rs:11:19
@@ -23,8 +24,9 @@
|
help: move the `..` to the end of the field list
|
-LL | let Point { y , .. } = p;
- | -- ^^^^^^
+LL - let Point { .., y } = p;
+LL + let Point { y , .. } = p;
+ |
error: expected `}`, found `,`
--> $DIR/issue-49257.rs:12:19
diff --git a/src/test/ui/issues/issue-49851/compiler-builtins-error.stderr b/src/test/ui/issues/issue-49851/compiler-builtins-error.stderr
index 7e23e0f..d963c07 100644
--- a/src/test/ui/issues/issue-49851/compiler-builtins-error.stderr
+++ b/src/test/ui/issues/issue-49851/compiler-builtins-error.stderr
@@ -1,6 +1,8 @@
error[E0463]: can't find crate for `core`
|
= note: the `thumbv7em-none-eabihf` target may not be installed
+ = help: consider downloading the target with `rustup target add thumbv7em-none-eabihf`
+ = help: consider building the standard library from source with `cargo build -Zbuild-std`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-50571.stderr b/src/test/ui/issues/issue-50571.stderr
index ed01362..f69963b 100644
--- a/src/test/ui/issues/issue-50571.stderr
+++ b/src/test/ui/issues/issue-50571.stderr
@@ -7,7 +7,7 @@
help: give this argument a name or use an underscore to ignore it
|
LL | fn foo(_: [i32; 2]) {}
- | ^
+ | ~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-50582.stderr b/src/test/ui/issues/issue-50582.stderr
index 4f53146..465fb9b 100644
--- a/src/test/ui/issues/issue-50582.stderr
+++ b/src/test/ui/issues/issue-50582.stderr
@@ -1,8 +1,11 @@
-error[E0744]: `for` is not allowed in a `const`
+error[E0658]: `for` is not allowed in a `const`
--> $DIR/issue-50582.rs:2:20
|
LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
| ^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
+ = help: add `#![feature(const_for)]` to the crate attributes to enable
error[E0277]: cannot add `()` to `{integer}`
--> $DIR/issue-50582.rs:2:18
@@ -14,5 +17,5 @@
error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0277, E0744.
+Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/issues/issue-50585.stderr b/src/test/ui/issues/issue-50585.stderr
index c2630b66..e43cc20 100644
--- a/src/test/ui/issues/issue-50585.stderr
+++ b/src/test/ui/issues/issue-50585.stderr
@@ -1,8 +1,11 @@
-error[E0744]: `for` is not allowed in a `const`
+error[E0658]: `for` is not allowed in a `const`
--> $DIR/issue-50585.rs:2:18
|
LL | |y: Vec<[(); for x in 0..2 {}]>| {};
| ^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
+ = help: add `#![feature(const_for)]` to the crate attributes to enable
error[E0308]: mismatched types
--> $DIR/issue-50585.rs:2:18
@@ -12,5 +15,5 @@
error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0308, E0744.
+Some errors have detailed explanations: E0308, E0658.
For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/issues/issue-50687-ice-on-borrow.stderr b/src/test/ui/issues/issue-50687-ice-on-borrow.stderr
index f6adfc8..e6a0eda 100644
--- a/src/test/ui/issues/issue-50687-ice-on-borrow.stderr
+++ b/src/test/ui/issues/issue-50687-ice-on-borrow.stderr
@@ -2,14 +2,16 @@
--> $DIR/issue-50687-ice-on-borrow.rs:40:17
|
LL | let _: () = Borrow::borrow(&owned);
- | -- ^^^^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected `()`, found reference
- | | help: consider dereferencing the borrow: `*Borrow::borrow(&owned)`
+ | -- ^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found reference
+ | |
| expected due to this
|
= note: expected unit type `()`
found reference `&_`
+help: consider dereferencing the borrow
+ |
+LL | let _: () = *Borrow::borrow(&owned);
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-5099.stderr b/src/test/ui/issues/issue-5099.stderr
index b39c4a9..e9b2a9c 100644
--- a/src/test/ui/issues/issue-5099.stderr
+++ b/src/test/ui/issues/issue-5099.stderr
@@ -7,11 +7,11 @@
help: you might have meant to use `self` here instead
|
LL | self.a
- | ^^^^
+ | ~~~~
help: if you meant to use `self`, you are also missing a `self` receiver argument
|
LL | fn a(&self) -> A {
- | ^^^^^
+ | +++++
error[E0425]: cannot find value `this` in this scope
--> $DIR/issue-5099.rs:6:9
@@ -22,11 +22,11 @@
help: you might have meant to use `self` here instead
|
LL | self.b(x);
- | ^^^^
+ | ~~~~
help: if you meant to use `self`, you are also missing a `self` receiver argument
|
LL | fn b(&self, x: i32) {
- | ^^^^^^
+ | ++++++
error[E0425]: cannot find value `this` in this scope
--> $DIR/issue-5099.rs:9:20
@@ -37,11 +37,11 @@
help: you might have meant to use `self` here instead
|
LL | let _ = || self.a;
- | ^^^^
+ | ~~~~
help: if you meant to use `self`, you are also missing a `self` receiver argument
|
LL | fn c(&self) {
- | ^^^^^
+ | +++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr
index 554ac7e..2c821aa 100644
--- a/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr
+++ b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr
@@ -8,8 +8,9 @@
found type `isize`
help: try removing this `?`
|
-LL | missing_discourses()
- | --
+LL - missing_discourses()?
+LL + missing_discourses()
+ |
help: try using a variant of the expected enum
|
LL | Ok(missing_discourses()?)
diff --git a/src/test/ui/issues/issue-51874.stderr b/src/test/ui/issues/issue-51874.stderr
index c7c4843..b39159a 100644
--- a/src/test/ui/issues/issue-51874.stderr
+++ b/src/test/ui/issues/issue-51874.stderr
@@ -7,7 +7,7 @@
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let a = (1.0_f32).pow(1.0);
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-5239-1.stderr b/src/test/ui/issues/issue-5239-1.stderr
index 078a7ef..b743f0d 100644
--- a/src/test/ui/issues/issue-5239-1.stderr
+++ b/src/test/ui/issues/issue-5239-1.stderr
@@ -9,7 +9,7 @@
help: `+=` can be used on `isize`, you can dereference `x`
|
LL | let x = |ref x: isize| { *x += 1; };
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-53787-inline-assembler-macro.rs b/src/test/ui/issues/issue-53787-inline-assembler-macro.rs
index 38591b0..d9fe7ca 100644
--- a/src/test/ui/issues/issue-53787-inline-assembler-macro.rs
+++ b/src/test/ui/issues/issue-53787-inline-assembler-macro.rs
@@ -4,6 +4,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
macro_rules! fake_jump {
($id:expr) => {
diff --git a/src/test/ui/issues/issue-53787-inline-assembler-macro.stderr b/src/test/ui/issues/issue-53787-inline-assembler-macro.stderr
index b066474..fd755e3 100644
--- a/src/test/ui/issues/issue-53787-inline-assembler-macro.stderr
+++ b/src/test/ui/issues/issue-53787-inline-assembler-macro.stderr
@@ -1,5 +1,5 @@
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/issue-53787-inline-assembler-macro.rs:24:16
+ --> $DIR/issue-53787-inline-assembler-macro.rs:25:16
|
LL | fake_jump!("FirstFunc");
| ^^^^^^^^^^^
diff --git a/src/test/ui/issues/issue-54302-cases.nll.stderr b/src/test/ui/issues/issue-54302-cases.nll.stderr
index 7463a3f..6e8b69c 100644
--- a/src/test/ui/issues/issue-54302-cases.nll.stderr
+++ b/src/test/ui/issues/issue-54302-cases.nll.stderr
@@ -1,26 +1,38 @@
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/issue-54302-cases.rs:63:5
|
LL | <u32 as RefFoo<u32>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, u32>` would have to be implemented for the type `&'0 u32`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, u32>` is actually implemented for the type `&'1 u32`, for some specific lifetime `'1`
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/issue-54302-cases.rs:69:5
|
LL | <i32 as RefFoo<i32>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, i32>` would have to be implemented for the type `&'0 i32`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, i32>` is actually implemented for the type `&'1 i32`, for some specific lifetime `'1`
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/issue-54302-cases.rs:75:5
|
LL | <u64 as RefFoo<u64>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, u64>` would have to be implemented for the type `&'0 u64`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, u64>` is actually implemented for the type `&'1 u64`, for some specific lifetime `'1`
-error: higher-ranked subtype error
+error: implementation of `Foo` is not general enough
--> $DIR/issue-54302-cases.rs:81:5
|
LL | <i64 as RefFoo<i64>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
+ |
+ = note: `Foo<'static, i64>` would have to be implemented for the type `&'0 i64`, for any lifetime `'0`...
+ = note: ...but `Foo<'_, i64>` is actually implemented for the type `&'1 i64`, for some specific lifetime `'1`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/issues/issue-54302.nll.stderr b/src/test/ui/issues/issue-54302.nll.stderr
deleted file mode 100644
index e68de03..0000000
--- a/src/test/ui/issues/issue-54302.nll.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: higher-ranked subtype error
- --> $DIR/issue-54302.rs:13:5
- |
-LL | assert_deserialize_owned::<&'static str>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/issues/issue-54943.stderr b/src/test/ui/issues/issue-54943.stderr
index 62aacee..e917958 100644
--- a/src/test/ui/issues/issue-54943.stderr
+++ b/src/test/ui/issues/issue-54943.stderr
@@ -4,7 +4,11 @@
LL | let x = foo::<&'a u32>();
| ^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/issue-54943.rs:1:11
+ |
+LL | fn foo<T: 'static>() { }
+ | ^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-54954.stderr b/src/test/ui/issues/issue-54954.stderr
index 9de58d8..df76a98 100644
--- a/src/test/ui/issues/issue-54954.stderr
+++ b/src/test/ui/issues/issue-54954.stderr
@@ -9,11 +9,13 @@
|
LL | const ARR_LEN: usize = Tt::const_val::<[i8; 123]>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
-...
-LL | const fn const_val<T: Sized>() -> usize {
- | - required by this bound in `Tt::const_val`
|
= note: cannot satisfy `_: Tt`
+note: required by a bound in `Tt::const_val`
+ --> $DIR/issue-54954.rs:5:24
+ |
+LL | const fn const_val<T: Sized>() -> usize {
+ | ^ required by this bound in `Tt::const_val`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-55731.nll.stderr b/src/test/ui/issues/issue-55731.nll.stderr
index dd38bb6..97fd667 100644
--- a/src/test/ui/issues/issue-55731.nll.stderr
+++ b/src/test/ui/issues/issue-55731.nll.stderr
@@ -1,11 +1,14 @@
-error: higher-ranked subtype error
+error: implementation of `DistributedIteratorMulti` is not general enough
--> $DIR/issue-55731.rs:48:5
|
LL | / multi(Map {
LL | | i: Cloned(PhantomData),
LL | | f: X,
LL | | });
- | |______^
+ | |______^ implementation of `DistributedIteratorMulti` is not general enough
+ |
+ = note: `DistributedIteratorMulti<&'0 ()>` would have to be implemented for the type `Cloned<&()>`, for any lifetime `'0`...
+ = note: ...but `DistributedIteratorMulti<&'1 ()>` is actually implemented for the type `Cloned<&'1 ()>`, for some specific lifetime `'1`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-56175.stderr b/src/test/ui/issues/issue-56175.stderr
index e6b0fff..013a440 100644
--- a/src/test/ui/issues/issue-56175.stderr
+++ b/src/test/ui/issues/issue-56175.stderr
@@ -3,7 +3,7 @@
|
LL | reexported_trait::FooStruct.trait_method();
| ^^^^^^^^^^^^ method not found in `FooStruct`
- |
+ |
::: $DIR/auxiliary/reexported-trait.rs:3:12
|
LL | fn trait_method(&self) {
@@ -20,7 +20,7 @@
|
LL | reexported_trait::FooStruct.trait_method_b();
| ^^^^^^^^^^^^^^ method not found in `FooStruct`
- |
+ |
::: $DIR/auxiliary/reexported-trait.rs:7:12
|
LL | fn trait_method_b(&self) {
diff --git a/src/test/ui/issues/issue-56685.stderr b/src/test/ui/issues/issue-56685.stderr
index eccb710..ccf357d 100644
--- a/src/test/ui/issues/issue-56685.stderr
+++ b/src/test/ui/issues/issue-56685.stderr
@@ -12,7 +12,7 @@
help: if this is intentional, prefix it with an underscore
|
LL | E::A(_x) | E::B(_x) => {}
- | ^^ ^^
+ | ~~ ~~
error: unused variable: `x`
--> $DIR/issue-56685.rs:25:14
@@ -23,7 +23,7 @@
help: if this is intentional, prefix it with an underscore
|
LL | F::A(_x, y) | F::B(_x, y) => { y },
- | ^^ ^^
+ | ~~ ~~
error: unused variable: `a`
--> $DIR/issue-56685.rs:27:14
@@ -46,7 +46,7 @@
help: if this is intentional, prefix it with an underscore
|
LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
- | ^^ ^^
+ | ~~ ~~
error: unused variable: `x`
--> $DIR/issue-56685.rs:39:20
@@ -57,7 +57,7 @@
help: if this is intentional, prefix it with an underscore
|
LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
- | ^^ ^^
+ | ~~ ~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/issues/issue-57271.stderr b/src/test/ui/issues/issue-57271.stderr
index b7c799e..8250096 100644
--- a/src/test/ui/issues/issue-57271.stderr
+++ b/src/test/ui/issues/issue-57271.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ObjectType` representable
|
LL | Array(Box<TypeSignature>),
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `TypeSignature` has infinite size
--> $DIR/issue-57271.rs:19:1
@@ -24,7 +24,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `TypeSignature` representable
|
LL | Object(Box<ObjectType>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-57843.nll.stderr b/src/test/ui/issues/issue-57843.nll.stderr
deleted file mode 100644
index 70d16cc..0000000
--- a/src/test/ui/issues/issue-57843.nll.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: higher-ranked subtype error
- --> $DIR/issue-57843.rs:25:9
- |
-LL | Foo(Box::new(|_| ()));
- | ^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/issues/issue-5883.stderr b/src/test/ui/issues/issue-5883.stderr
index de598a7..8a20a60 100644
--- a/src/test/ui/issues/issue-5883.stderr
+++ b/src/test/ui/issues/issue-5883.stderr
@@ -9,7 +9,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | r: &dyn A + 'static
- | ^
+ | +
error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
--> $DIR/issue-5883.rs:9:6
diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr
index 46d1f99..7789ee3 100644
--- a/src/test/ui/issues/issue-59488.stderr
+++ b/src/test/ui/issues/issue-59488.stderr
@@ -45,11 +45,11 @@
help: you might have forgotten to call this function
|
LL | foo() > foo;
- | ^^^^^
+ | ~~~~~
help: you might have forgotten to call this function
|
LL | foo > foo();
- | ^^^^^
+ | ~~~~~
error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
--> $DIR/issue-59488.rs:25:9
diff --git a/src/test/ui/issues/issue-59494.stderr b/src/test/ui/issues/issue-59494.stderr
index e2ac5d9..90af47d 100644
--- a/src/test/ui/issues/issue-59494.stderr
+++ b/src/test/ui/issues/issue-59494.stderr
@@ -1,13 +1,15 @@
error[E0277]: expected a `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
--> $DIR/issue-59494.rs:21:22
|
-LL | fn t8n<A, B, C>(f: impl Fn(A) -> B, g: impl Fn(A) -> C) -> impl Fn(A) -> (B, C)
- | ---------- required by this bound in `t8n`
-...
LL | let t8 = t8n(t7, t7p(f, g));
| ^^^^^^^^^ expected an `Fn<(_,)>` closure, found `impl Fn<(((_, _), _),)>`
|
= help: the trait `Fn<(_,)>` is not implemented for `impl Fn<(((_, _), _),)>`
+note: required by a bound in `t8n`
+ --> $DIR/issue-59494.rs:5:45
+ |
+LL | fn t8n<A, B, C>(f: impl Fn(A) -> B, g: impl Fn(A) -> C) -> impl Fn(A) -> (B, C)
+ | ^^^^^^^^^^ required by this bound in `t8n`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-59508-1.rs b/src/test/ui/issues/issue-59508-1.rs
index a687a9e..6376c42 100644
--- a/src/test/ui/issues/issue-59508-1.rs
+++ b/src/test/ui/issues/issue-59508-1.rs
@@ -1,9 +1,8 @@
#![allow(dead_code)]
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
+#![feature(const_generics_defaults)]
// This test checks that generic parameter re-ordering diagnostic suggestions mention that
-// consts come after types and lifetimes when the `const_generics` feature is enabled.
+// consts come after types and lifetimes when the `const_generics_defaults` feature is enabled.
// We cannot run rustfix on this test because of the above const generics warning.
struct A;
diff --git a/src/test/ui/issues/issue-59508-1.stderr b/src/test/ui/issues/issue-59508-1.stderr
index 5e97339..df244f0 100644
--- a/src/test/ui/issues/issue-59508-1.stderr
+++ b/src/test/ui/issues/issue-59508-1.stderr
@@ -1,17 +1,8 @@
error: lifetime parameters must be declared prior to type parameters
- --> $DIR/issue-59508-1.rs:12:25
+ --> $DIR/issue-59508-1.rs:11:25
|
LL | pub fn do_things<T, 'a, 'b: 'a>() {
| ----^^--^^----- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b: 'a, T>`
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-59508-1.rs:2:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-60218.stderr b/src/test/ui/issues/issue-60218.stderr
index a2b2fdd..ac33cfd 100644
--- a/src/test/ui/issues/issue-60218.stderr
+++ b/src/test/ui/issues/issue-60218.stderr
@@ -1,14 +1,17 @@
-error[E0277]: the trait bound `for<'t> <Map<<&'t _ as IntoIterator>::IntoIter, _> as Iterator>::Item: Foo` is not satisfied
+error[E0277]: the trait bound `&u32: Foo` is not satisfied
--> $DIR/issue-60218.rs:18:5
|
+LL | trigger_error(vec![], |x: &u32| x)
+ | ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `&u32`
+ |
+note: required by a bound in `trigger_error`
+ --> $DIR/issue-60218.rs:13:72
+ |
LL | pub fn trigger_error<I, F>(iterable: I, functor: F)
| ------------- required by a bound in this
...
LL | for<'t> <Map<<&'t I as IntoIterator>::IntoIter, F> as Iterator>::Item: Foo,
- | --- required by this bound in `trigger_error`
-...
-LL | trigger_error(vec![], |x: &u32| x)
- | ^^^^^^^^^^^^^ the trait `for<'t> Foo` is not implemented for `<Map<<&'t _ as IntoIterator>::IntoIter, _> as Iterator>::Item`
+ | ^^^ required by this bound in `trigger_error`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-60283.stderr b/src/test/ui/issues/issue-60283.stderr
index 149562f..2ee5510 100644
--- a/src/test/ui/issues/issue-60283.stderr
+++ b/src/test/ui/issues/issue-60283.stderr
@@ -1,34 +1,37 @@
error[E0631]: type mismatch in function arguments
--> $DIR/issue-60283.rs:17:13
|
-LL | pub fn foo<T, F>(_: T, _: F)
- | --- required by a bound in this
-...
-LL | F: for<'a> FnMut(<T as Trait<'a>>::Item),
- | ----------------------------- required by this bound in `foo`
-...
LL | foo((), drop)
| ^^^^
| |
| expected signature of `for<'a> fn(<() as Trait<'a>>::Item) -> _`
| found signature of `fn(()) -> _`
+ |
+note: required by a bound in `foo`
+ --> $DIR/issue-60283.rs:12:16
+ |
+LL | pub fn foo<T, F>(_: T, _: F)
+ | --- required by a bound in this
+...
+LL | F: for<'a> FnMut(<T as Trait<'a>>::Item),
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `foo`
error[E0277]: the size for values of type `<() as Trait<'_>>::Item` cannot be known at compilation time
--> $DIR/issue-60283.rs:17:13
|
LL | foo((), drop)
| ^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
-LL | pub fn drop<T>(_x: T) {}
- | - required by this bound in `std::mem::drop`
|
= help: the trait `Sized` is not implemented for `<() as Trait<'_>>::Item`
+note: required by a bound in `std::mem::drop`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+LL | pub fn drop<T>(_x: T) {}
+ | ^ required by this bound in `std::mem::drop`
help: consider further restricting the associated type
|
LL | fn main() where <() as Trait<'_>>::Item: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-60662.full_tait.stderr b/src/test/ui/issues/issue-60662.full_tait.stderr
deleted file mode 100644
index a448f85..0000000
--- a/src/test/ui/issues/issue-60662.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-60662.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/issues/issue-60662.full_tait.stdout b/src/test/ui/issues/issue-60662.full_tait.stdout
deleted file mode 100644
index 9ee4434..0000000
--- a/src/test/ui/issues/issue-60662.full_tait.stdout
+++ /dev/null
@@ -1,16 +0,0 @@
-// check-pass
-// compile-flags: -Z unpretty=hir
-
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![feature(type_alias_impl_trait)]
-#[prelude_import]
-use ::std::prelude::rust_2015::*;
-#[macro_use]
-extern crate std;
-
-trait Animal { }
-
-fn main() {
- pub type ServeFut = /*impl Trait*/;
- }
diff --git a/src/test/ui/issues/issue-60662.min_tait.stdout b/src/test/ui/issues/issue-60662.min_tait.stdout
deleted file mode 100644
index d0db578..0000000
--- a/src/test/ui/issues/issue-60662.min_tait.stdout
+++ /dev/null
@@ -1,15 +0,0 @@
-// check-pass
-// compile-flags: -Z unpretty=hir
-
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#[prelude_import]
-use ::std::prelude::rust_2015::*;
-#[macro_use]
-extern crate std;
-
-trait Animal { }
-
-fn main() {
- pub type ServeFut = /*impl Trait*/;
- }
diff --git a/src/test/ui/issues/issue-60662.rs b/src/test/ui/issues/issue-60662.rs
index 1320d2b..b9faa66 100644
--- a/src/test/ui/issues/issue-60662.rs
+++ b/src/test/ui/issues/issue-60662.rs
@@ -1,13 +1,9 @@
// check-pass
// compile-flags: -Z unpretty=hir
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
-trait Animal {
-}
+trait Animal {}
fn main() {
pub type ServeFut = impl Animal;
diff --git a/src/test/ui/issues/issue-60662.stdout b/src/test/ui/issues/issue-60662.stdout
new file mode 100644
index 0000000..14a49f2
--- /dev/null
+++ b/src/test/ui/issues/issue-60662.stdout
@@ -0,0 +1,14 @@
+// check-pass
+// compile-flags: -Z unpretty=hir
+
+#![feature(type_alias_impl_trait)]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+
+trait Animal { }
+
+fn main() {
+ pub type ServeFut = /*impl Trait*/;
+ }
diff --git a/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr b/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr
index de0e78a..68ccf5c 100644
--- a/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr
+++ b/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | async::r#struct(&r#fn {});
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | await::r#struct(&r#fn {});
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr b/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr
index 036a930..733456a 100644
--- a/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr
+++ b/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr
@@ -4,8 +4,8 @@
LL | let _ = Pin::new(Apple) == Rc::pin(Apple);
| ^^ expected struct `Apple`, found struct `Rc`
|
- = note: expected type `Apple`
- found struct `Rc<Apple>`
+ = note: expected struct `Apple`
+ found struct `Rc<Apple>`
= note: required because of the requirements on the impl of `PartialEq<Pin<Rc<Apple>>>` for `Pin<Apple>`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-6738.stderr b/src/test/ui/issues/issue-6738.stderr
index a428ff7..f97d899 100644
--- a/src/test/ui/issues/issue-6738.stderr
+++ b/src/test/ui/issues/issue-6738.stderr
@@ -9,7 +9,7 @@
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::AddAssign> Foo<T> {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-67552.polonius.stderr b/src/test/ui/issues/issue-67552.polonius.stderr
new file mode 100644
index 0000000..9ab77d3
--- /dev/null
+++ b/src/test/ui/issues/issue-67552.polonius.stderr
@@ -0,0 +1,17 @@
+error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &... &mut &mut &mut &mut &mut Empty>`
+ --> $DIR/issue-67552.rs:28:9
+ |
+LL | rec(identity(&mut it))
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: `rec` defined here
+ --> $DIR/issue-67552.rs:21:1
+ |
+LL | / fn rec<T>(mut it: T)
+LL | | where
+LL | | T: Iterator,
+ | |________________^
+ = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-67552.polonius/issue-67552.long-type.txt'
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/issues/issue-69130.stderr b/src/test/ui/issues/issue-69130.stderr
index a4700a5..e67cc29 100644
--- a/src/test/ui/issues/issue-69130.stderr
+++ b/src/test/ui/issues/issue-69130.stderr
@@ -12,8 +12,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | enum F<'a> {
-LL | M (§&'a u8)}
+LL ~ enum F<'a> {
+LL ~ M (§&'a u8)}
|
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-69725.stderr b/src/test/ui/issues/issue-69725.stderr
index 4dd6b4b..b1ba89f 100644
--- a/src/test/ui/issues/issue-69725.stderr
+++ b/src/test/ui/issues/issue-69725.stderr
@@ -3,7 +3,7 @@
|
LL | let _ = Struct::<A>::new().clone();
| ^^^^^ method cannot be called on `Struct<A>` due to unsatisfied trait bounds
- |
+ |
::: $DIR/auxiliary/issue-69725.rs:2:1
|
LL | pub struct Struct<A>(A);
diff --git a/src/test/ui/issues/issue-71676-1.stderr b/src/test/ui/issues/issue-71676-1.stderr
index bbabc22..2104634 100644
--- a/src/test/ui/issues/issue-71676-1.stderr
+++ b/src/test/ui/issues/issue-71676-1.stderr
@@ -2,53 +2,61 @@
--> $DIR/issue-71676-1.rs:43:24
|
LL | let _: *const u8 = &a;
- | --------- ^^
- | | |
- | | expected `u8`, found struct `Emm`
- | | help: consider dereferencing: `&***a`
+ | --------- ^^ expected `u8`, found struct `Emm`
+ | |
| expected due to this
|
= note: expected raw pointer `*const u8`
found reference `&Emm`
+help: consider dereferencing
+ |
+LL | let _: *const u8 = &***a;
+ | +++
error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:46:22
|
LL | let _: *mut u8 = &a;
- | ------- ^^
- | | |
- | | types differ in mutability
- | | help: consider dereferencing: `&mut ***a`
+ | ------- ^^ types differ in mutability
+ | |
| expected due to this
|
= note: expected raw pointer `*mut u8`
found reference `&Emm`
+help: consider dereferencing
+ |
+LL | let _: *mut u8 = &mut ***a;
+ | +++++++
error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:49:24
|
LL | let _: *const u8 = &mut a;
- | --------- ^^^^^^
- | | |
- | | expected `u8`, found struct `Emm`
- | | help: consider dereferencing: `&***a`
+ | --------- ^^^^^^ expected `u8`, found struct `Emm`
+ | |
| expected due to this
|
= note: expected raw pointer `*const u8`
found mutable reference `&mut Emm`
+help: consider dereferencing
+ |
+LL | let _: *const u8 = &***a;
+ | ~~~
error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:52:22
|
LL | let _: *mut u8 = &mut a;
- | ------- ^^^^^^
- | | |
- | | expected `u8`, found struct `Emm`
- | | help: consider dereferencing: `&mut ***a`
+ | ------- ^^^^^^ expected `u8`, found struct `Emm`
+ | |
| expected due to this
|
= note: expected raw pointer `*mut u8`
found mutable reference `&mut Emm`
+help: consider dereferencing
+ |
+LL | let _: *mut u8 = &mut ***a;
+ | +++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/issues/issue-71676-2.stderr b/src/test/ui/issues/issue-71676-2.stderr
index ebdd345..80fb4ae 100644
--- a/src/test/ui/issues/issue-71676-2.stderr
+++ b/src/test/ui/issues/issue-71676-2.stderr
@@ -2,14 +2,16 @@
--> $DIR/issue-71676-2.rs:41:22
|
LL | let _: *mut u8 = &a;
- | ------- ^^
- | | |
- | | types differ in mutability
- | | help: consider dereferencing: `&mut ***a`
+ | ------- ^^ types differ in mutability
+ | |
| expected due to this
|
= note: expected raw pointer `*mut u8`
found reference `&Emm`
+help: consider dereferencing
+ |
+LL | let _: *mut u8 = &mut ***a;
+ | +++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-72554.stderr b/src/test/ui/issues/issue-72554.stderr
index 9de94c3..a6e44be 100644
--- a/src/test/ui/issues/issue-72554.stderr
+++ b/src/test/ui/issues/issue-72554.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ElemDerived` representable
|
LL | A(Box<ElemDerived>)
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-72574-1.stderr b/src/test/ui/issues/issue-72574-1.stderr
index 92ebb45..653869a 100644
--- a/src/test/ui/issues/issue-72574-1.stderr
+++ b/src/test/ui/issues/issue-72574-1.stderr
@@ -8,7 +8,7 @@
help: if you don't need to use the contents of _x, discard the tuple's remaining fields
|
LL | (_a, ..) => {}
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-72574-1.rs:4:19
diff --git a/src/test/ui/issues/issue-72574-2.stderr b/src/test/ui/issues/issue-72574-2.stderr
index a1e8ec1..05650f0 100644
--- a/src/test/ui/issues/issue-72574-2.stderr
+++ b/src/test/ui/issues/issue-72574-2.stderr
@@ -8,7 +8,7 @@
help: if you don't need to use the contents of _x, discard the tuple's remaining fields
|
LL | Binder(_a, ..) => {}
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-72574-2.rs:6:25
@@ -19,18 +19,18 @@
= note: only allowed in tuple, tuple struct, and slice patterns
error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 3 fields
- --> $DIR/issue-72574-2.rs:6:9
+ --> $DIR/issue-72574-2.rs:6:16
|
LL | struct Binder(i32, i32, i32);
- | ----------------------------- tuple struct defined here
+ | --- --- --- tuple struct has 3 fields
...
LL | Binder(_a, _x @ ..) => {}
- | ^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
+ | ^^ ^^^^^^^ expected 3 fields, found 2
|
help: use `_` to explicitly ignore each field
|
LL | Binder(_a, _x @ .., _) => {}
- | ^^^
+ | +++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/issues/issue-73427.stderr b/src/test/ui/issues/issue-73427.stderr
index 4b5f65b..54df7fc 100644
--- a/src/test/ui/issues/issue-73427.stderr
+++ b/src/test/ui/issues/issue-73427.stderr
@@ -18,17 +18,17 @@
help: you might have meant to use one of the following enum variants
|
LL | (A::Struct {}).foo();
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
LL | (A::Tuple()).foo();
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
LL | A::Unit.foo();
- | ^^^^^^^
+ | ~~~~~~~
help: the following enum variants are available
|
LL | (A::StructWithFields { /* fields */ }).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | (A::TupleWithFields(/* fields */)).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `B`
--> $DIR/issue-73427.rs:31:5
@@ -47,9 +47,9 @@
help: the following enum variants are available
|
LL | (B::StructWithFields { /* fields */ }).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | (B::TupleWithFields(/* fields */)).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `C`
--> $DIR/issue-73427.rs:33:5
@@ -69,13 +69,13 @@
help: you might have meant to use the following enum variant
|
LL | C::Unit.foo();
- | ^^^^^^^
+ | ~~~~~~~
help: the following enum variants are available
|
LL | (C::StructWithFields { /* fields */ }).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | (C::TupleWithFields(/* fields */)).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `D`
--> $DIR/issue-73427.rs:35:5
@@ -94,11 +94,11 @@
help: you might have meant to use the following enum variant
|
LL | D::Unit.foo();
- | ^^^^^^^
+ | ~~~~~~~
help: the following enum variant is available
|
LL | (D::TupleWithFields(/* fields */)).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected function, tuple struct or tuple variant, found enum `A`
--> $DIR/issue-73427.rs:40:13
@@ -121,9 +121,9 @@
help: try to construct one of the enum's variants
|
LL | let x = A::TupleWithFields(3);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
LL | let x = A::Tuple(3);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found enum `A`
--> $DIR/issue-73427.rs:42:12
@@ -146,9 +146,9 @@
help: try to match against one of the enum's variants
|
LL | if let A::TupleWithFields(3) = x { }
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
LL | if let A::Tuple(3) = x { }
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/issues/issue-7607-1.stderr b/src/test/ui/issues/issue-7607-1.stderr
index 0520ead..ecff8b4 100644
--- a/src/test/ui/issues/issue-7607-1.stderr
+++ b/src/test/ui/issues/issue-7607-1.stderr
@@ -3,7 +3,7 @@
|
LL | impl Fo {
| ^^ help: a trait with a similar name exists: `Fn`
- |
+ |
::: $SRC_DIR/core/src/ops/function.rs:LL:COL
|
LL | pub trait Fn<Args>: FnMut<Args> {
diff --git a/src/test/ui/issues/issue-76077-1.stderr b/src/test/ui/issues/issue-76077-1.stderr
index 4557595..8e77662 100644
--- a/src/test/ui/issues/issue-76077-1.stderr
+++ b/src/test/ui/issues/issue-76077-1.stderr
@@ -7,7 +7,7 @@
help: ignore the inaccessible and unused fields
|
LL | let foo::Foo { .. } = foo::Foo::default();
- | ^^^^^^
+ | ~~~~~~
error: pattern requires `..` due to inaccessible fields
--> $DIR/issue-76077-1.rs:16:9
@@ -18,7 +18,7 @@
help: ignore the inaccessible and unused fields
|
LL | let foo::Bar { visible, .. } = foo::Bar::default();
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-76191.stderr b/src/test/ui/issues/issue-76191.stderr
index bdcd2fe..fb8ed43 100644
--- a/src/test/ui/issues/issue-76191.stderr
+++ b/src/test/ui/issues/issue-76191.stderr
@@ -17,7 +17,7 @@
help: you may want to move the range into the match block
|
LL | 0..=255 => {}
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-76191.rs:15:9
diff --git a/src/test/ui/issues/issue-77218.stderr b/src/test/ui/issues/issue-77218.stderr
index 4f6fbaa..ce70c01 100644
--- a/src/test/ui/issues/issue-77218.stderr
+++ b/src/test/ui/issues/issue-77218.stderr
@@ -21,10 +21,12 @@
--> $DIR/issue-77218.rs:3:16
|
LL | while Some(0) = value.get(0) {
- | ^
- | |
- | expected integer, found `&u8`
- | help: consider dereferencing the borrow: `*0`
+ | ^ expected integer, found `&u8`
+ |
+help: consider dereferencing the borrow
+ |
+LL | while Some(*0) = value.get(0) {
+ | +
error[E0308]: mismatched types
--> $DIR/issue-77218.rs:3:11
diff --git a/src/test/ui/issues/issue-78720.stderr b/src/test/ui/issues/issue-78720.stderr
index ee15826..3dd1387 100644
--- a/src/test/ui/issues/issue-78720.stderr
+++ b/src/test/ui/issues/issue-78720.stderr
@@ -9,7 +9,7 @@
|
LL | _func: F,
| ^
- |
+ |
::: $SRC_DIR/core/src/ops/function.rs:LL:COL
|
LL | pub trait Fn<Args>: FnMut<Args> {
@@ -18,11 +18,11 @@
help: a trait with a similar name exists
|
LL | _func: Fn,
- | ^^
+ | ~~
help: you might be missing a type parameter
|
LL | struct Map2<Segment2, F> {
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/issue-78720.rs:7:39
@@ -43,11 +43,11 @@
help: consider further restricting `Self`
|
LL | fn map2<F>(self, f: F) -> Map2<F> where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn map2<F>(&self, f: F) -> Map2<F> {}
- | ^
+ | +
error: aborting due to 4 previous errors
diff --git a/src/test/ui/issues/issue-83190.rs b/src/test/ui/issues/issue-83190.rs
new file mode 100644
index 0000000..da931c3
--- /dev/null
+++ b/src/test/ui/issues/issue-83190.rs
@@ -0,0 +1,49 @@
+// check-pass
+
+// Regression test for issue #83190, triggering an ICE in borrowck.
+
+pub trait Any {}
+impl<T> Any for T {}
+
+pub trait StreamOnce {
+ type Range;
+}
+
+pub trait Parser<Input>: Sized {
+ type Output;
+ type PartialState;
+ fn map(self) -> Map<Self> {
+ todo!()
+ }
+}
+
+pub struct Map<P>(P);
+impl<I, P: Parser<I, Output = ()>> Parser<I> for Map<P> {
+ type Output = ();
+ type PartialState = P::PartialState;
+}
+
+struct TakeWhile1<Input>(Input);
+impl<I: StreamOnce> Parser<I> for TakeWhile1<I> {
+ type Output = I::Range;
+ type PartialState = ();
+}
+impl<I> TakeWhile1<I> {
+ fn new() -> Self {
+ todo!()
+ }
+}
+
+impl<I, A: Parser<I>> Parser<I> for (A,) {
+ type Output = ();
+ type PartialState = Map<A::Output>;
+}
+
+pub fn metric_stream_parser<'a, I>() -> impl Parser<I, Output = (), PartialState = impl Any + 'a>
+where
+ I: StreamOnce<Range = &'a [()]>,
+{
+ (TakeWhile1::new(),).map()
+}
+
+fn main() {}
diff --git a/src/test/ui/issues/issue-83924.stderr b/src/test/ui/issues/issue-83924.stderr
index 682bc32..767571c 100644
--- a/src/test/ui/issues/issue-83924.stderr
+++ b/src/test/ui/issues/issue-83924.stderr
@@ -18,7 +18,7 @@
help: consider creating a fresh reborrow of `v` here
|
LL | for n in &mut *v {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-86756.rs b/src/test/ui/issues/issue-86756.rs
new file mode 100644
index 0000000..7f864eb
--- /dev/null
+++ b/src/test/ui/issues/issue-86756.rs
@@ -0,0 +1,12 @@
+trait Foo<T, T = T> {}
+//~^ ERROR the name `T` is already used for a generic parameter in this item's generic parameters
+
+fn eq<A, B>() {
+ eq::<dyn, Foo>
+ //~^ ERROR cannot find type `dyn` in this scope
+ //~| ERROR missing generics for trait `Foo`
+ //~| WARN trait objects without an explicit `dyn` are deprecated
+ //~| WARN this is accepted in the current edition
+}
+
+fn main() {}
diff --git a/src/test/ui/issues/issue-86756.stderr b/src/test/ui/issues/issue-86756.stderr
new file mode 100644
index 0000000..0d57690
--- /dev/null
+++ b/src/test/ui/issues/issue-86756.stderr
@@ -0,0 +1,46 @@
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+ --> $DIR/issue-86756.rs:1:14
+ |
+LL | trait Foo<T, T = T> {}
+ | - ^ already used
+ | |
+ | first use of `T`
+
+error[E0412]: cannot find type `dyn` in this scope
+ --> $DIR/issue-86756.rs:5:10
+ |
+LL | fn eq<A, B>() {
+ | - help: you might be missing a type parameter: `, dyn`
+LL | eq::<dyn, Foo>
+ | ^^^ not found in this scope
+
+warning: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/issue-86756.rs:5:15
+ |
+LL | eq::<dyn, Foo>
+ | ^^^ help: use `dyn`: `dyn Foo`
+ |
+ = note: `#[warn(bare_trait_objects)]` on by default
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+error[E0107]: missing generics for trait `Foo`
+ --> $DIR/issue-86756.rs:5:15
+ |
+LL | eq::<dyn, Foo>
+ | ^^^ expected at least 1 generic argument
+ |
+note: trait defined here, with at least 1 generic parameter: `T`
+ --> $DIR/issue-86756.rs:1:7
+ |
+LL | trait Foo<T, T = T> {}
+ | ^^^ -
+help: add missing generic argument
+ |
+LL | eq::<dyn, Foo<T>>
+ | ~~~~~~
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0107, E0403, E0412.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/issues/issue-87199.stderr b/src/test/ui/issues/issue-87199.stderr
index e3a8e82..fc9418b 100644
--- a/src/test/ui/issues/issue-87199.stderr
+++ b/src/test/ui/issues/issue-87199.stderr
@@ -19,17 +19,19 @@
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/issue-87199.rs:18:22
|
-LL | fn ref_arg<T: ?Send>(_: &T) {}
- | - required by this bound in `ref_arg`
-...
LL | ref_arg::<[i32]>(&[5]);
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[i32]`
+note: required by a bound in `ref_arg`
+ --> $DIR/issue-87199.rs:10:12
+ |
+LL | fn ref_arg<T: ?Send>(_: &T) {}
+ | ^ required by this bound in `ref_arg`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn ref_arg<T: ?Send + ?Sized>(_: &T) {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error; 3 warnings emitted
diff --git a/src/test/ui/issues/issue-8727.polonius.stderr b/src/test/ui/issues/issue-8727.polonius.stderr
new file mode 100644
index 0000000..283c01b
--- /dev/null
+++ b/src/test/ui/issues/issue-8727.polonius.stderr
@@ -0,0 +1,26 @@
+warning: function cannot return without recursing
+ --> $DIR/issue-8727.rs:7:1
+ |
+LL | fn generic<T>() {
+ | ^^^^^^^^^^^^^^^ cannot return without recursing
+LL | generic::<Option<T>>();
+ | ---------------------- recursive call site
+ |
+ = note: `#[warn(unconditional_recursion)]` on by default
+ = help: a `loop` may express intention better if this is on purpose
+
+error: reached the recursion limit while instantiating `generic::<Option<Option<Option<O...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/issue-8727.rs:8:5
+ |
+LL | generic::<Option<T>>();
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: `generic` defined here
+ --> $DIR/issue-8727.rs:7:1
+ |
+LL | fn generic<T>() {
+ | ^^^^^^^^^^^^^^^
+ = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-8727.polonius/issue-8727.long-type.txt'
+
+error: aborting due to previous error; 1 warning emitted
+
diff --git a/src/test/ui/issues/issue-8761.stderr b/src/test/ui/issues/issue-8761.stderr
index 836520a..4c67dbf 100644
--- a/src/test/ui/issues/issue-8761.stderr
+++ b/src/test/ui/issues/issue-8761.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `i64` to `isize`
|
LL | A = 1isize,
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-8761.rs:5:9
@@ -18,7 +18,7 @@
help: change the type of the numeric literal from `u8` to `isize`
|
LL | B = 2isize
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-9129.rs b/src/test/ui/issues/issue-9129.rs
index 9a0376a..825fed5 100644
--- a/src/test/ui/issues/issue-9129.rs
+++ b/src/test/ui/issues/issue-9129.rs
@@ -2,6 +2,7 @@
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
+#![allow(deprecated)] // llvm_asm!
// ignore-pretty unreported
#![feature(box_syntax)]
diff --git a/src/test/ui/iterators/bound.stderr b/src/test/ui/iterators/bound.stderr
index eaf2e66..cc7ded49 100644
--- a/src/test/ui/iterators/bound.stderr
+++ b/src/test/ui/iterators/bound.stderr
@@ -1,13 +1,16 @@
error[E0277]: `u8` is not an iterator
--> $DIR/bound.rs:2:10
|
-LL | struct S<I: Iterator>(I);
- | -------- required by this bound in `S`
LL | struct T(S<u8>);
| ^^^^^ `u8` is not an iterator
|
= help: the trait `Iterator` is not implemented for `u8`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
+note: required by a bound in `S`
+ --> $DIR/bound.rs:1:13
+ |
+LL | struct S<I: Iterator>(I);
+ | ^^^^^^^^ required by this bound in `S`
error: aborting due to previous error
diff --git a/src/test/ui/iterators/into-iter-on-arrays-2018.rs b/src/test/ui/iterators/into-iter-on-arrays-2018.rs
index e56c295..6099517 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-2018.rs
+++ b/src/test/ui/iterators/into-iter-on-arrays-2018.rs
@@ -19,9 +19,12 @@
//~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
//~| WARNING this changes meaning
- // The `array_into_iter` lint doesn't cover other wrappers that deref to an array.
let _: Iter<'_, i32> = Rc::new(array).into_iter();
+ //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
+ //~| WARNING this changes meaning
let _: Iter<'_, i32> = Array(array).into_iter();
+ //~^ WARNING this method call resolves to `<&[T; N] as IntoIterator>::into_iter`
+ //~| WARNING this changes meaning
// But you can always use the trait method explicitly as an array.
let _: IntoIter<i32, 10> = IntoIterator::into_iter(array);
diff --git a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
index 3bd3ca6..bc08fdc 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
+++ b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
@@ -6,49 +6,60 @@
|
= note: `#[warn(array_into_iter)]` on by default
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | let _: Iter<'_, i32> = array.iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | let _: Iter<'_, i32> = IntoIterator::into_iter(array);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-2018.rs:18:44
|
LL | let _: Iter<'_, i32> = Box::new(array).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | let _: Iter<'_, i32> = Box::new(array).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | let _: Iter<'_, i32> = IntoIterator::into_iter(Box::new(array));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
- --> $DIR/into-iter-on-arrays-2018.rs:29:24
+ --> $DIR/into-iter-on-arrays-2018.rs:22:43
+ |
+LL | let _: Iter<'_, i32> = Rc::new(array).into_iter();
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+ |
+ = warning: this changes meaning in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
+ --> $DIR/into-iter-on-arrays-2018.rs:25:41
+ |
+LL | let _: Iter<'_, i32> = Array(array).into_iter();
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
+ |
+ = warning: this changes meaning in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+
+warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
+ --> $DIR/into-iter-on-arrays-2018.rs:32:24
|
LL | for _ in [1, 2, 3].into_iter() {}
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | for _ in [1, 2, 3].iter() {}
- | ^^^^
+ | ~~~~
help: or remove `.into_iter()` to iterate by value
|
-LL | for _ in [1, 2, 3] {}
- | --
+LL - for _ in [1, 2, 3].into_iter() {}
+LL + for _ in [1, 2, 3] {}
+ |
-warning: 3 warnings emitted
+warning: 5 warnings emitted
diff --git a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
index 01789e0..2df1a06 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
+++ b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
@@ -6,15 +6,15 @@
|
= note: `#[warn(array_into_iter)]` on by default
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | small.iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(small);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:13:12
@@ -23,15 +23,15 @@
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | [1, 2].iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter([1, 2]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:16:9
@@ -40,15 +40,15 @@
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | big.iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(big);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:19:15
@@ -57,151 +57,87 @@
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | [0u8; 33].iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter([0u8; 33]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:23:21
|
LL | Box::new(small).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new(small).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new(small));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:26:22
|
LL | Box::new([1, 2]).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new([1, 2]).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new([1, 2]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:29:19
|
LL | Box::new(big).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new(big).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new(big));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:32:25
|
LL | Box::new([0u8; 33]).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new([0u8; 33]).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new([0u8; 33]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:36:31
|
LL | Box::new(Box::new(small)).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new(Box::new(small)).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new(Box::new(small)));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:39:32
|
LL | Box::new(Box::new([1, 2])).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new(Box::new([1, 2])).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new(Box::new([1, 2])));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:42:29
|
LL | Box::new(Box::new(big)).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new(Box::new(big)).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new(Box::new(big)));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:45:35
|
LL | Box::new(Box::new([0u8; 33])).into_iter();
- | ^^^^^^^^^
+ | ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
-help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
- |
-LL | Box::new(Box::new([0u8; 33])).iter();
- | ^^^^
-help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
- |
-LL | IntoIterator::into_iter(Box::new(Box::new([0u8; 33])));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: 12 warnings emitted
diff --git a/src/test/ui/json-bom-plus-crlf-multifile.stderr b/src/test/ui/json-bom-plus-crlf-multifile.stderr
index da8849a..02f3bc6 100644
--- a/src/test/ui/json-bom-plus-crlf-multifile.stderr
+++ b/src/test/ui/json-bom-plus-crlf-multifile.stderr
@@ -24,7 +24,7 @@
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":622,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
"}
{"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
@@ -52,7 +52,7 @@
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":682,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
"}
{"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
@@ -80,7 +80,7 @@
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":746,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
"}
{"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
diff --git a/src/test/ui/json-bom-plus-crlf.stderr b/src/test/ui/json-bom-plus-crlf.stderr
index 811206f..df6bd72 100644
--- a/src/test/ui/json-bom-plus-crlf.stderr
+++ b/src/test/ui/json-bom-plus-crlf.stderr
@@ -24,7 +24,7 @@
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":607,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
"}
{"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
@@ -52,7 +52,7 @@
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":667,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
"}
{"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
@@ -80,7 +80,7 @@
expected an expression of a different type. It can occur in several cases, the
most common being when calling a function and passing an argument which has a
different type than the matching type in the function declaration.
-"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
+"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":" let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":731,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
"}
{"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr b/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr
index 5f5297b..b353523 100644
--- a/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr
+++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-pat.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#extern = 0;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr b/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
index edbb364..a5787d6 100644
--- a/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
+++ b/src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | use r#extern::foo;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0432]: unresolved import `r#extern`
--> $DIR/keyword-extern-as-identifier-use.rs:1:5
diff --git a/src/test/ui/kindck/kindck-copy.stderr b/src/test/ui/kindck/kindck-copy.stderr
index 1194304..6977804 100644
--- a/src/test/ui/kindck/kindck-copy.stderr
+++ b/src/test/ui/kindck/kindck-copy.stderr
@@ -1,107 +1,138 @@
error[E0277]: the trait bound `&'static mut isize: Copy` is not satisfied
--> $DIR/kindck-copy.rs:27:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<&'static mut isize>();
| ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'static mut isize`
|
= help: the following implementations were found:
<isize as Copy>
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `&'a mut isize: Copy` is not satisfied
--> $DIR/kindck-copy.rs:28:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<&'a mut isize>();
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'a mut isize`
|
= help: the following implementations were found:
<isize as Copy>
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `Box<isize>: Copy` is not satisfied
--> $DIR/kindck-copy.rs:31:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<Box<isize>>();
| ^^^^^^^^^^ the trait `Copy` is not implemented for `Box<isize>`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/kindck-copy.rs:32:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<String>();
| ^^^^^^ the trait `Copy` is not implemented for `String`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `Vec<isize>: Copy` is not satisfied
--> $DIR/kindck-copy.rs:33:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<Vec<isize> >();
| ^^^^^^^^^^ the trait `Copy` is not implemented for `Vec<isize>`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `Box<&'a mut isize>: Copy` is not satisfied
--> $DIR/kindck-copy.rs:34:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<Box<&'a mut isize>>();
| ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<&'a mut isize>`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `Box<dyn Dummy>: Copy` is not satisfied
--> $DIR/kindck-copy.rs:42:5
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<Box<dyn Dummy>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<dyn Dummy>`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `Box<dyn Dummy + Send>: Copy` is not satisfied
--> $DIR/kindck-copy.rs:43:5
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<Box<dyn Dummy + Send>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<dyn Dummy + Send>`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `&'a mut (dyn Dummy + Send + 'a): Copy` is not satisfied
--> $DIR/kindck-copy.rs:46:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<&'a mut (dyn Dummy + Send)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'a mut (dyn Dummy + Send + 'a)`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `MyNoncopyStruct: Copy` is not satisfied
--> $DIR/kindck-copy.rs:64:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<MyNoncopyStruct>();
| ^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `MyNoncopyStruct`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error[E0277]: the trait bound `Rc<isize>: Copy` is not satisfied
--> $DIR/kindck-copy.rs:67:19
|
-LL | fn assert_copy<T:Copy>() { }
- | ---- required by this bound in `assert_copy`
-...
LL | assert_copy::<Rc<isize>>();
| ^^^^^^^^^ the trait `Copy` is not implemented for `Rc<isize>`
+ |
+note: required by a bound in `assert_copy`
+ --> $DIR/kindck-copy.rs:5:18
+ |
+LL | fn assert_copy<T:Copy>() { }
+ | ^^^^ required by this bound in `assert_copy`
error: aborting due to 11 previous errors
diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.stderr b/src/test/ui/kindck/kindck-impl-type-params-2.stderr
index c635ebd..60ad68c 100644
--- a/src/test/ui/kindck/kindck-impl-type-params-2.stderr
+++ b/src/test/ui/kindck/kindck-impl-type-params-2.stderr
@@ -1,9 +1,6 @@
error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
--> $DIR/kindck-impl-type-params-2.rs:13:16
|
-LL | fn take_param<T:Foo>(foo: &T) { }
- | --- required by this bound in `take_param`
-...
LL | take_param(&x);
| ^^ the trait `Copy` is not implemented for `Box<{integer}>`
|
@@ -12,6 +9,11 @@
|
LL | impl<T:Copy> Foo for T {
| ^^^ ^
+note: required by a bound in `take_param`
+ --> $DIR/kindck-impl-type-params-2.rs:9:17
+ |
+LL | fn take_param<T:Foo>(foo: &T) { }
+ | ^^^ required by this bound in `take_param`
error: aborting due to previous error
diff --git a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr b/src/test/ui/kindck/kindck-impl-type-params.nll.stderr
index 0355010..7129bad 100644
--- a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr
+++ b/src/test/ui/kindck/kindck-impl-type-params.nll.stderr
@@ -13,7 +13,7 @@
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:18:13
@@ -30,7 +30,7 @@
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:25:31
@@ -47,7 +47,7 @@
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:25:31
@@ -64,7 +64,7 @@
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:38:13
diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr
index 241fe36..3558f0c 100644
--- a/src/test/ui/kindck/kindck-impl-type-params.stderr
+++ b/src/test/ui/kindck/kindck-impl-type-params.stderr
@@ -13,7 +13,7 @@
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:18:13
@@ -30,7 +30,7 @@
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:25:31
@@ -47,7 +47,7 @@
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:25:31
@@ -64,7 +64,7 @@
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0477]: the type `&'a isize` does not fulfill the required lifetime
--> $DIR/kindck-impl-type-params.rs:32:13
diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr
index 86eaca8..ac43c54 100644
--- a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr
+++ b/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr
@@ -1,9 +1,6 @@
error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
--> $DIR/kindck-inherited-copy-bound.rs:21:16
|
-LL | fn take_param<T:Foo>(foo: &T) { }
- | --- required by this bound in `take_param`
-...
LL | take_param(&x);
| ^^ the trait `Copy` is not implemented for `Box<{integer}>`
|
@@ -12,6 +9,11 @@
|
LL | impl<T:Copy> Foo for T {
| ^^^ ^
+note: required by a bound in `take_param`
+ --> $DIR/kindck-inherited-copy-bound.rs:17:17
+ |
+LL | fn take_param<T:Foo>(foo: &T) { }
+ | ^^^ required by this bound in `take_param`
error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/kindck-inherited-copy-bound.rs:28:19
diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
index 49c5cd4..a486ab1 100644
--- a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
+++ b/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
@@ -1,9 +1,6 @@
error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
--> $DIR/kindck-inherited-copy-bound.rs:21:16
|
-LL | fn take_param<T:Foo>(foo: &T) { }
- | --- required by this bound in `take_param`
-...
LL | take_param(&x);
| ^^ the trait `Copy` is not implemented for `Box<{integer}>`
|
@@ -12,6 +9,11 @@
|
LL | impl<T:Copy> Foo for T {
| ^^^ ^
+note: required by a bound in `take_param`
+ --> $DIR/kindck-inherited-copy-bound.rs:17:17
+ |
+LL | fn take_param<T:Foo>(foo: &T) { }
+ | ^^^ required by this bound in `take_param`
error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/kindck-inherited-copy-bound.rs:28:13
diff --git a/src/test/ui/kindck/kindck-nonsendable-1.stderr b/src/test/ui/kindck/kindck-nonsendable-1.stderr
index c7d67a9..b3ebe7f 100644
--- a/src/test/ui/kindck/kindck-nonsendable-1.stderr
+++ b/src/test/ui/kindck/kindck-nonsendable-1.stderr
@@ -1,9 +1,6 @@
error[E0277]: `Rc<usize>` cannot be sent between threads safely
--> $DIR/kindck-nonsendable-1.rs:9:5
|
-LL | fn bar<F:FnOnce() + Send>(_: F) { }
- | ---- required by this bound in `bar`
-...
LL | bar(move|| foo(x));
| ^^^ ------------- within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`
| |
@@ -11,6 +8,11 @@
|
= help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`, the trait `Send` is not implemented for `Rc<usize>`
= note: required because it appears within the type `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:22]`
+note: required by a bound in `bar`
+ --> $DIR/kindck-nonsendable-1.rs:5:21
+ |
+LL | fn bar<F:FnOnce() + Send>(_: F) { }
+ | ^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/kindck/kindck-send-object.stderr b/src/test/ui/kindck/kindck-send-object.stderr
index 0df7df8..f14983a 100644
--- a/src/test/ui/kindck/kindck-send-object.stderr
+++ b/src/test/ui/kindck/kindck-send-object.stderr
@@ -1,27 +1,31 @@
error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely
--> $DIR/kindck-send-object.rs:12:5
|
-LL | fn assert_send<T:Send>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<&'static (dyn Dummy + 'static)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)`
= note: required because of the requirements on the impl of `Send` for `&'static (dyn Dummy + 'static)`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object.rs:5:18
+ |
+LL | fn assert_send<T:Send>() { }
+ | ^^^^ required by this bound in `assert_send`
error[E0277]: `dyn Dummy` cannot be sent between threads safely
--> $DIR/kindck-send-object.rs:17:5
|
-LL | fn assert_send<T:Send>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<Box<dyn Dummy>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `dyn Dummy`
= note: required because of the requirements on the impl of `Send` for `Unique<dyn Dummy>`
= note: required because it appears within the type `Box<dyn Dummy>`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object.rs:5:18
+ |
+LL | fn assert_send<T:Send>() { }
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/kindck/kindck-send-object1.nll.stderr b/src/test/ui/kindck/kindck-send-object1.nll.stderr
index 4792914..fa19044 100644
--- a/src/test/ui/kindck/kindck-send-object1.nll.stderr
+++ b/src/test/ui/kindck/kindck-send-object1.nll.stderr
@@ -1,27 +1,31 @@
error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely
--> $DIR/kindck-send-object1.rs:10:5
|
-LL | fn assert_send<T:Send+'static>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<&'a dyn Dummy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)`
= note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object1.rs:5:18
+ |
+LL | fn assert_send<T:Send+'static>() { }
+ | ^^^^ required by this bound in `assert_send`
error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely
--> $DIR/kindck-send-object1.rs:29:5
|
-LL | fn assert_send<T:Send+'static>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<Box<dyn Dummy + 'a>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `(dyn Dummy + 'a)`
= note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>`
= note: required because it appears within the type `Box<(dyn Dummy + 'a)>`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object1.rs:5:18
+ |
+LL | fn assert_send<T:Send+'static>() { }
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/kindck/kindck-send-object1.stderr b/src/test/ui/kindck/kindck-send-object1.stderr
index aa72fda..58397b7 100644
--- a/src/test/ui/kindck/kindck-send-object1.stderr
+++ b/src/test/ui/kindck/kindck-send-object1.stderr
@@ -1,14 +1,16 @@
error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely
--> $DIR/kindck-send-object1.rs:10:5
|
-LL | fn assert_send<T:Send+'static>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<&'a dyn Dummy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)`
= note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object1.rs:5:18
+ |
+LL | fn assert_send<T:Send+'static>() { }
+ | ^^^^ required by this bound in `assert_send`
error[E0477]: the type `&'a (dyn Dummy + Sync + 'a)` does not fulfill the required lifetime
--> $DIR/kindck-send-object1.rs:14:5
@@ -16,20 +18,26 @@
LL | assert_send::<&'a (dyn Dummy + Sync)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/kindck-send-object1.rs:5:23
+ |
+LL | fn assert_send<T:Send+'static>() { }
+ | ^^^^^^^
error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely
--> $DIR/kindck-send-object1.rs:29:5
|
-LL | fn assert_send<T:Send+'static>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<Box<dyn Dummy + 'a>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `(dyn Dummy + 'a)`
= note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>`
= note: required because it appears within the type `Box<(dyn Dummy + 'a)>`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object1.rs:5:18
+ |
+LL | fn assert_send<T:Send+'static>() { }
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/kindck/kindck-send-object2.stderr b/src/test/ui/kindck/kindck-send-object2.stderr
index f7fb32a..527127e 100644
--- a/src/test/ui/kindck/kindck-send-object2.stderr
+++ b/src/test/ui/kindck/kindck-send-object2.stderr
@@ -1,27 +1,31 @@
error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely
--> $DIR/kindck-send-object2.rs:7:5
|
-LL | fn assert_send<T:Send>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<&'static dyn Dummy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)`
= note: required because of the requirements on the impl of `Send` for `&'static (dyn Dummy + 'static)`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object2.rs:3:18
+ |
+LL | fn assert_send<T:Send>() { }
+ | ^^^^ required by this bound in `assert_send`
error[E0277]: `dyn Dummy` cannot be sent between threads safely
--> $DIR/kindck-send-object2.rs:12:5
|
-LL | fn assert_send<T:Send>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<Box<dyn Dummy>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `dyn Dummy`
= note: required because of the requirements on the impl of `Send` for `Unique<dyn Dummy>`
= note: required because it appears within the type `Box<dyn Dummy>`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-object2.rs:3:18
+ |
+LL | fn assert_send<T:Send>() { }
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/kindck/kindck-send-owned.stderr b/src/test/ui/kindck/kindck-send-owned.stderr
index d6664ec..454291a 100644
--- a/src/test/ui/kindck/kindck-send-owned.stderr
+++ b/src/test/ui/kindck/kindck-send-owned.stderr
@@ -1,15 +1,17 @@
error[E0277]: `*mut u8` cannot be sent between threads safely
--> $DIR/kindck-send-owned.rs:12:5
|
-LL | fn assert_send<T:Send>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<Box<*mut u8>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `*mut u8`
= note: required because of the requirements on the impl of `Send` for `Unique<*mut u8>`
= note: required because it appears within the type `Box<*mut u8>`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-owned.rs:3:18
+ |
+LL | fn assert_send<T:Send>() { }
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to previous error
diff --git a/src/test/ui/kindck/kindck-send-unsafe.stderr b/src/test/ui/kindck/kindck-send-unsafe.stderr
index 069e8dc..ceed005 100644
--- a/src/test/ui/kindck/kindck-send-unsafe.stderr
+++ b/src/test/ui/kindck/kindck-send-unsafe.stderr
@@ -1,13 +1,15 @@
error[E0277]: `*mut &'a isize` cannot be sent between threads safely
--> $DIR/kindck-send-unsafe.rs:6:19
|
-LL | fn assert_send<T:Send>() { }
- | ---- required by this bound in `assert_send`
-...
LL | assert_send::<*mut &'a isize>();
| ^^^^^^^^^^^^^^ `*mut &'a isize` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `*mut &'a isize`
+note: required by a bound in `assert_send`
+ --> $DIR/kindck-send-unsafe.rs:3:18
+ |
+LL | fn assert_send<T:Send>() { }
+ | ^^^^ required by this bound in `assert_send`
error: aborting due to previous error
diff --git a/src/test/ui/label/label_misspelled.stderr b/src/test/ui/label/label_misspelled.stderr
index b096957..4b5b9e9 100644
--- a/src/test/ui/label/label_misspelled.stderr
+++ b/src/test/ui/label/label_misspelled.stderr
@@ -158,11 +158,11 @@
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'while_loop;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/label_misspelled.rs:54:9
@@ -176,11 +176,11 @@
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'while_let;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/label_misspelled.rs:59:9
@@ -194,11 +194,11 @@
help: use `break` on its own without a value inside this `for` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'for_loop;
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: aborting due to 11 previous errors; 10 warnings emitted
diff --git a/src/test/ui/lang-items/lang-item-correct-generics.rs b/src/test/ui/lang-items/lang-item-correct-generics.rs
new file mode 100644
index 0000000..a3287db
--- /dev/null
+++ b/src/test/ui/lang-items/lang-item-correct-generics.rs
@@ -0,0 +1,28 @@
+// build-pass
+
+#![feature(lang_items,no_core)]
+#![no_core]
+#![crate_type="lib"]
+
+#[lang = "sized"]
+trait MySized {}
+
+#[lang = "copy"]
+trait MyCopy {}
+
+#[lang = "drop"]
+trait MyDrop<T> {}
+
+struct S;
+
+impl<T> MyDrop<T> for S {}
+
+#[lang = "i32"]
+impl<'a> i32 {
+ fn foo() {}
+}
+
+fn bar() {
+ i32::foo();
+ S;
+}
diff --git a/src/test/ui/lang-items/lang-item-generic-requirements.rs b/src/test/ui/lang-items/lang-item-generic-requirements.rs
new file mode 100644
index 0000000..d785749
--- /dev/null
+++ b/src/test/ui/lang-items/lang-item-generic-requirements.rs
@@ -0,0 +1,44 @@
+// Checks whether declaring a lang item with the wrong number
+// of generic arguments crashes the compiler (issue #83893, #87573, and part of #9307).
+
+#![feature(lang_items, no_core)]
+#![no_core]
+#![crate_type = "lib"]
+
+#[lang = "sized"]
+trait MySized {}
+
+#[lang = "add"]
+trait MyAdd<'a, T> {}
+//~^^ ERROR: `add` language item must be applied to a trait with 1 generic argument [E0718]
+
+#[lang = "drop_in_place"]
+//~^ ERROR `drop_in_place` language item must be applied to a function with at least 1 generic
+fn my_ptr_drop() {}
+
+#[lang = "index"]
+trait MyIndex<'a, T> {}
+//~^^ ERROR: `index` language item must be applied to a trait with 1 generic argument [E0718]
+
+#[lang = "phantom_data"]
+//~^ ERROR `phantom_data` language item must be applied to a struct with 1 generic argument
+struct MyPhantomData<T, U>;
+//~^ ERROR parameter `T` is never used
+//~| ERROR parameter `U` is never used
+
+fn ice() {
+ // Use add
+ let r = 5;
+ let a = 6;
+ r + a;
+
+ // Use drop in place
+ my_ptr_drop();
+
+ // Use index
+ let arr = [0; 5];
+ let _ = arr[2];
+
+ // Use phantomdata
+ let _ = MyPhantomData::<(), i32>;
+}
diff --git a/src/test/ui/lang-items/lang-item-generic-requirements.stderr b/src/test/ui/lang-items/lang-item-generic-requirements.stderr
new file mode 100644
index 0000000..add5938
--- /dev/null
+++ b/src/test/ui/lang-items/lang-item-generic-requirements.stderr
@@ -0,0 +1,56 @@
+error[E0718]: `add` language item must be applied to a trait with 1 generic argument
+ --> $DIR/lang-item-generic-requirements.rs:11:1
+ |
+LL | #[lang = "add"]
+ | ^^^^^^^^^^^^^^^
+LL | trait MyAdd<'a, T> {}
+ | ------- this trait has 2 generic arguments
+
+error[E0718]: `drop_in_place` language item must be applied to a function with at least 1 generic argument
+ --> $DIR/lang-item-generic-requirements.rs:15:1
+ |
+LL | #[lang = "drop_in_place"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | fn my_ptr_drop() {}
+ | - this function has 0 generic arguments
+
+error[E0718]: `index` language item must be applied to a trait with 1 generic argument
+ --> $DIR/lang-item-generic-requirements.rs:19:1
+ |
+LL | #[lang = "index"]
+ | ^^^^^^^^^^^^^^^^^
+LL | trait MyIndex<'a, T> {}
+ | ------- this trait has 2 generic arguments
+
+error[E0718]: `phantom_data` language item must be applied to a struct with 1 generic argument
+ --> $DIR/lang-item-generic-requirements.rs:23:1
+ |
+LL | #[lang = "phantom_data"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | struct MyPhantomData<T, U>;
+ | ------ this struct has 2 generic arguments
+
+error[E0392]: parameter `T` is never used
+ --> $DIR/lang-item-generic-requirements.rs:25:22
+ |
+LL | struct MyPhantomData<T, U>;
+ | ^ unused parameter
+ |
+ = help: consider removing `T` or referring to it in a field
+ = help: if you intended `T` to be a const parameter, use `const T: usize` instead
+
+error[E0392]: parameter `U` is never used
+ --> $DIR/lang-item-generic-requirements.rs:25:25
+ |
+LL | struct MyPhantomData<T, U>;
+ | ^ unused parameter
+ |
+ = help: consider removing `U` or referring to it in a field
+ = help: if you intended `U` to be a const parameter, use `const U: usize` instead
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0392, E0718.
+For more information about an error, try `rustc --explain E0392`.
diff --git a/src/test/ui/lang-items/wrong-number-generic-args-add.rs b/src/test/ui/lang-items/wrong-number-generic-args-add.rs
deleted file mode 100644
index 9f4f246..0000000
--- a/src/test/ui/lang-items/wrong-number-generic-args-add.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Checks whether declaring a lang item with the wrong number
-// of generic arguments crashes the compiler (issue #83893).
-
-#![feature(lang_items,no_core)]
-#![no_core]
-#![crate_type="lib"]
-
-#[lang = "sized"]
-trait MySized {}
-
-#[lang = "add"]
-trait MyAdd<'a, T> {}
-//~^^ ERROR: `add` language item must be applied to a trait with 1 generic argument [E0718]
-
-fn ice() {
- let r = 5;
- let a = 6;
- r + a
- //~^ ERROR: cannot add `{integer}` to `{integer}` [E0369]
-}
diff --git a/src/test/ui/lang-items/wrong-number-generic-args-add.stderr b/src/test/ui/lang-items/wrong-number-generic-args-add.stderr
deleted file mode 100644
index 6f89441..0000000
--- a/src/test/ui/lang-items/wrong-number-generic-args-add.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0718]: `add` language item must be applied to a trait with 1 generic argument
- --> $DIR/wrong-number-generic-args-add.rs:11:1
- |
-LL | #[lang = "add"]
- | ^^^^^^^^^^^^^^^
-LL | trait MyAdd<'a, T> {}
- | ------- this trait has 2 generic arguments, not 1
-
-error[E0369]: cannot add `{integer}` to `{integer}`
- --> $DIR/wrong-number-generic-args-add.rs:18:7
- |
-LL | r + a
- | - ^ - {integer}
- | |
- | {integer}
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0369, E0718.
-For more information about an error, try `rustc --explain E0369`.
diff --git a/src/test/ui/lang-items/wrong-number-generic-args-index.rs b/src/test/ui/lang-items/wrong-number-generic-args-index.rs
deleted file mode 100644
index 1d90e63..0000000
--- a/src/test/ui/lang-items/wrong-number-generic-args-index.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Checks whether declaring a lang item with the wrong number
-// of generic arguments crashes the compiler (issue #83893).
-
-#![feature(lang_items,no_core)]
-#![no_core]
-#![crate_type="lib"]
-
-#[lang = "sized"]
-trait MySized {}
-
-#[lang = "index"]
-trait MyIndex<'a, T> {}
-//~^^ ERROR: `index` language item must be applied to a trait with 1 generic argument [E0718]
-
-fn ice() {
- let arr = [0; 5];
- let _ = arr[2];
- //~^ ERROR: cannot index into a value of type `[{integer}; 5]` [E0608]
-}
diff --git a/src/test/ui/lang-items/wrong-number-generic-args-index.stderr b/src/test/ui/lang-items/wrong-number-generic-args-index.stderr
deleted file mode 100644
index bc3f19f..0000000
--- a/src/test/ui/lang-items/wrong-number-generic-args-index.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error[E0718]: `index` language item must be applied to a trait with 1 generic argument
- --> $DIR/wrong-number-generic-args-index.rs:11:1
- |
-LL | #[lang = "index"]
- | ^^^^^^^^^^^^^^^^^
-LL | trait MyIndex<'a, T> {}
- | ------- this trait has 2 generic arguments, not 1
-
-error[E0608]: cannot index into a value of type `[{integer}; 5]`
- --> $DIR/wrong-number-generic-args-index.rs:17:13
- |
-LL | let _ = arr[2];
- | ^^^^^^
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0608, E0718.
-For more information about an error, try `rustc --explain E0608`.
diff --git a/src/test/ui/layout/debug.rs b/src/test/ui/layout/debug.rs
index 317955f..299151d 100644
--- a/src/test/ui/layout/debug.rs
+++ b/src/test/ui/layout/debug.rs
@@ -1,5 +1,5 @@
// normalize-stderr-test "pref: Align \{\n *pow2: [1-3],\n *\}" -> "pref: $$PREF_ALIGN"
-#![feature(never_type, rustc_attrs, min_type_alias_impl_trait)]
+#![feature(never_type, rustc_attrs, type_alias_impl_trait)]
#![crate_type = "lib"]
#[rustc_layout(debug)]
diff --git a/src/test/ui/layout/thumb-enum.rs b/src/test/ui/layout/thumb-enum.rs
new file mode 100644
index 0000000..3b43b1b
--- /dev/null
+++ b/src/test/ui/layout/thumb-enum.rs
@@ -0,0 +1,34 @@
+// compile-flags: --target thumbv8m.main-none-eabihf
+// needs-llvm-components: arm
+//
+// Verify that thumb targets implement the repr(C) for enums correctly.
+//
+// See #87917
+#![feature(never_type, rustc_attrs, no_core, lang_items)]
+#![crate_type = "lib"]
+#![no_core]
+
+#[lang="sized"]
+trait Sized {}
+
+#[rustc_layout(debug)]
+#[repr(C)]
+enum A { Apple } //~ ERROR: layout_of
+
+#[rustc_layout(debug)]
+#[repr(C)]
+enum B { Banana = 255, } //~ ERROR: layout_of
+
+#[rustc_layout(debug)]
+#[repr(C)]
+enum C { Chaenomeles = 256, } //~ ERROR: layout_of
+
+#[rustc_layout(debug)]
+#[repr(C)]
+enum P { Peach = 0x1000_0000isize, } //~ ERROR: layout_of
+
+const TANGERINE: usize = 0x8100_0000; // hack to get negative numbers without negation operator!
+
+#[rustc_layout(debug)]
+#[repr(C)]
+enum T { Tangerine = TANGERINE as isize } //~ ERROR: layout_of
diff --git a/src/test/ui/layout/thumb-enum.stderr b/src/test/ui/layout/thumb-enum.stderr
new file mode 100644
index 0000000..898a61b
--- /dev/null
+++ b/src/test/ui/layout/thumb-enum.stderr
@@ -0,0 +1,442 @@
+error: layout_of(A) = Layout {
+ fields: Arbitrary {
+ offsets: [
+ Size {
+ raw: 0,
+ },
+ ],
+ memory_index: [
+ 0,
+ ],
+ },
+ variants: Multiple {
+ tag: Scalar {
+ value: Int(
+ I8,
+ false,
+ ),
+ valid_range: 0..=0,
+ },
+ tag_encoding: Direct,
+ tag_field: 0,
+ variants: [
+ Layout {
+ fields: Arbitrary {
+ offsets: [],
+ memory_index: [],
+ },
+ variants: Single {
+ index: 0,
+ },
+ abi: Aggregate {
+ sized: true,
+ },
+ largest_niche: None,
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 0,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 1,
+ },
+ },
+ ],
+ },
+ abi: Scalar(
+ Scalar {
+ value: Int(
+ I8,
+ false,
+ ),
+ valid_range: 0..=0,
+ },
+ ),
+ largest_niche: Some(
+ Niche {
+ offset: Size {
+ raw: 0,
+ },
+ scalar: Scalar {
+ value: Int(
+ I8,
+ false,
+ ),
+ valid_range: 0..=0,
+ },
+ },
+ ),
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 0,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 1,
+ },
+}
+ --> $DIR/thumb-enum.rs:16:1
+ |
+LL | enum A { Apple }
+ | ^^^^^^^^^^^^^^^^
+
+error: layout_of(B) = Layout {
+ fields: Arbitrary {
+ offsets: [
+ Size {
+ raw: 0,
+ },
+ ],
+ memory_index: [
+ 0,
+ ],
+ },
+ variants: Multiple {
+ tag: Scalar {
+ value: Int(
+ I8,
+ false,
+ ),
+ valid_range: 255..=255,
+ },
+ tag_encoding: Direct,
+ tag_field: 0,
+ variants: [
+ Layout {
+ fields: Arbitrary {
+ offsets: [],
+ memory_index: [],
+ },
+ variants: Single {
+ index: 0,
+ },
+ abi: Aggregate {
+ sized: true,
+ },
+ largest_niche: None,
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 0,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 1,
+ },
+ },
+ ],
+ },
+ abi: Scalar(
+ Scalar {
+ value: Int(
+ I8,
+ false,
+ ),
+ valid_range: 255..=255,
+ },
+ ),
+ largest_niche: Some(
+ Niche {
+ offset: Size {
+ raw: 0,
+ },
+ scalar: Scalar {
+ value: Int(
+ I8,
+ false,
+ ),
+ valid_range: 255..=255,
+ },
+ },
+ ),
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 0,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 1,
+ },
+}
+ --> $DIR/thumb-enum.rs:20:1
+ |
+LL | enum B { Banana = 255, }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: layout_of(C) = Layout {
+ fields: Arbitrary {
+ offsets: [
+ Size {
+ raw: 0,
+ },
+ ],
+ memory_index: [
+ 0,
+ ],
+ },
+ variants: Multiple {
+ tag: Scalar {
+ value: Int(
+ I16,
+ false,
+ ),
+ valid_range: 256..=256,
+ },
+ tag_encoding: Direct,
+ tag_field: 0,
+ variants: [
+ Layout {
+ fields: Arbitrary {
+ offsets: [],
+ memory_index: [],
+ },
+ variants: Single {
+ index: 0,
+ },
+ abi: Aggregate {
+ sized: true,
+ },
+ largest_niche: None,
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 1,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 2,
+ },
+ },
+ ],
+ },
+ abi: Scalar(
+ Scalar {
+ value: Int(
+ I16,
+ false,
+ ),
+ valid_range: 256..=256,
+ },
+ ),
+ largest_niche: Some(
+ Niche {
+ offset: Size {
+ raw: 0,
+ },
+ scalar: Scalar {
+ value: Int(
+ I16,
+ false,
+ ),
+ valid_range: 256..=256,
+ },
+ },
+ ),
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 1,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 2,
+ },
+}
+ --> $DIR/thumb-enum.rs:24:1
+ |
+LL | enum C { Chaenomeles = 256, }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: layout_of(P) = Layout {
+ fields: Arbitrary {
+ offsets: [
+ Size {
+ raw: 0,
+ },
+ ],
+ memory_index: [
+ 0,
+ ],
+ },
+ variants: Multiple {
+ tag: Scalar {
+ value: Int(
+ I32,
+ false,
+ ),
+ valid_range: 268435456..=268435456,
+ },
+ tag_encoding: Direct,
+ tag_field: 0,
+ variants: [
+ Layout {
+ fields: Arbitrary {
+ offsets: [],
+ memory_index: [],
+ },
+ variants: Single {
+ index: 0,
+ },
+ abi: Aggregate {
+ sized: true,
+ },
+ largest_niche: None,
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 2,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 4,
+ },
+ },
+ ],
+ },
+ abi: Scalar(
+ Scalar {
+ value: Int(
+ I32,
+ false,
+ ),
+ valid_range: 268435456..=268435456,
+ },
+ ),
+ largest_niche: Some(
+ Niche {
+ offset: Size {
+ raw: 0,
+ },
+ scalar: Scalar {
+ value: Int(
+ I32,
+ false,
+ ),
+ valid_range: 268435456..=268435456,
+ },
+ },
+ ),
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 2,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 4,
+ },
+}
+ --> $DIR/thumb-enum.rs:28:1
+ |
+LL | enum P { Peach = 0x1000_0000isize, }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: layout_of(T) = Layout {
+ fields: Arbitrary {
+ offsets: [
+ Size {
+ raw: 0,
+ },
+ ],
+ memory_index: [
+ 0,
+ ],
+ },
+ variants: Multiple {
+ tag: Scalar {
+ value: Int(
+ I32,
+ true,
+ ),
+ valid_range: 2164260864..=2164260864,
+ },
+ tag_encoding: Direct,
+ tag_field: 0,
+ variants: [
+ Layout {
+ fields: Arbitrary {
+ offsets: [],
+ memory_index: [],
+ },
+ variants: Single {
+ index: 0,
+ },
+ abi: Aggregate {
+ sized: true,
+ },
+ largest_niche: None,
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 2,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 4,
+ },
+ },
+ ],
+ },
+ abi: Scalar(
+ Scalar {
+ value: Int(
+ I32,
+ true,
+ ),
+ valid_range: 2164260864..=2164260864,
+ },
+ ),
+ largest_niche: Some(
+ Niche {
+ offset: Size {
+ raw: 0,
+ },
+ scalar: Scalar {
+ value: Int(
+ I32,
+ true,
+ ),
+ valid_range: 2164260864..=2164260864,
+ },
+ },
+ ),
+ align: AbiAndPrefAlign {
+ abi: Align {
+ pow2: 2,
+ },
+ pref: Align {
+ pow2: 2,
+ },
+ },
+ size: Size {
+ raw: 4,
+ },
+}
+ --> $DIR/thumb-enum.rs:34:1
+ |
+LL | enum T { Tangerine = TANGERINE as isize }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 5 previous errors
+
diff --git a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs b/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs
deleted file mode 100644
index 46ae940..0000000
--- a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-pub const fn sof<T>() -> usize {
- 10
-}
-
-fn test<T>() {
- let _: [u8; sof::<T>()];
- //~^ ERROR generic parameters may not be used in const operations
-}
-
-fn main() {}
diff --git a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr b/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr
deleted file mode 100644
index 5c167ea..0000000
--- a/src/test/ui/lazy_normalization_consts/feature-gate-lazy_normalization_consts.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: generic parameters may not be used in const operations
- --> $DIR/feature-gate-lazy_normalization_consts.rs:6:23
- |
-LL | let _: [u8; sof::<T>()];
- | ^ cannot perform const operation using `T`
- |
- = note: type parameters may not be used in const expressions
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lazy_normalization_consts/issue-47814.rs b/src/test/ui/lazy_normalization_consts/issue-47814.rs
deleted file mode 100644
index 1fd0c45..0000000
--- a/src/test/ui/lazy_normalization_consts/issue-47814.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// check-pass
-#![feature(lazy_normalization_consts)]
-#![allow(incomplete_features)]
-pub struct ArpIPv4<'a> {
- _s: &'a u8
-}
-
-impl<'a> ArpIPv4<'a> {
- const LENGTH: usize = 20;
-
- pub fn to_buffer() -> [u8; Self::LENGTH] {
- unimplemented!()
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/lazy_normalization_consts/issue-57739.rs b/src/test/ui/lazy_normalization_consts/issue-57739.rs
deleted file mode 100644
index 4607f3e..0000000
--- a/src/test/ui/lazy_normalization_consts/issue-57739.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-#![feature(lazy_normalization_consts)]
-//~^ WARN the feature `lazy_normalization_consts` is incomplete
-trait ArraySizeTrait {
- const SIZE: usize = 0;
-}
-
-impl<T: ?Sized> ArraySizeTrait for T {
- const SIZE: usize = 1;
-}
-
-struct SomeArray<T: ArraySizeTrait> {
- array: [u8; T::SIZE],
- //~^ ERROR constant expression depends on a generic parameter
- phantom: std::marker::PhantomData<T>,
-}
-
-fn main() {}
diff --git a/src/test/ui/lazy_normalization_consts/issue-57739.stderr b/src/test/ui/lazy_normalization_consts/issue-57739.stderr
deleted file mode 100644
index ce0495d..0000000
--- a/src/test/ui/lazy_normalization_consts/issue-57739.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-warning: the feature `lazy_normalization_consts` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-57739.rs:1:12
- |
-LL | #![feature(lazy_normalization_consts)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #72219 <https://github.com/rust-lang/rust/issues/72219> for more information
-
-error: constant expression depends on a generic parameter
- --> $DIR/issue-57739.rs:12:12
- |
-LL | array: [u8; T::SIZE],
- | ^^^^^^^^^^^^^
- |
- = note: this may fail depending on what value the parameter takes
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/lazy_normalization_consts/issue-73980.rs b/src/test/ui/lazy_normalization_consts/issue-73980.rs
deleted file mode 100644
index e100406..0000000
--- a/src/test/ui/lazy_normalization_consts/issue-73980.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// check-pass
-#![feature(lazy_normalization_consts)]
-#![allow(incomplete_features)]
-
-pub struct X<P, Q>(P, Q);
-pub struct L<T: ?Sized>(T);
-
-impl<T: ?Sized> L<T> {
- const S: usize = 1;
-}
-
-impl<T> X<T, [u8; L::<T>::S]> {}
-//~^ WARN cannot use constants which depend on generic parameters
-//~| WARN this was previously accepted by the compiler but is being phased out
-
-fn main() {}
diff --git a/src/test/ui/lazy_normalization_consts/issue-73980.stderr b/src/test/ui/lazy_normalization_consts/issue-73980.stderr
deleted file mode 100644
index 5ed1ca3..0000000
--- a/src/test/ui/lazy_normalization_consts/issue-73980.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-warning: cannot use constants which depend on generic parameters in types
- --> $DIR/issue-73980.rs:12:9
- |
-LL | impl<T> X<T, [u8; L::<T>::S]> {}
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/legacy-const-generics-bad.stderr b/src/test/ui/legacy-const-generics-bad.stderr
index 5a44b8e..3c78dd6 100644
--- a/src/test/ui/legacy-const-generics-bad.stderr
+++ b/src/test/ui/legacy-const-generics-bad.stderr
@@ -13,7 +13,7 @@
| ^ cannot perform const operation using `N`
|
= help: const parameters may only be used as standalone arguments, i.e. `N`
- = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
+ = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors
diff --git a/src/test/ui/let-else/let-else-bool-binop-init.fixed b/src/test/ui/let-else/let-else-bool-binop-init.fixed
new file mode 100644
index 0000000..e47f7f2
--- /dev/null
+++ b/src/test/ui/let-else/let-else-bool-binop-init.fixed
@@ -0,0 +1,8 @@
+// run-rustfix
+
+#![feature(let_else)]
+
+fn main() {
+ let true = (true && false) else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else`
+ let true = (true || false) else { return }; //~ ERROR a `||` expression cannot be directly assigned in `let...else`
+}
diff --git a/src/test/ui/let-else/let-else-bool-binop-init.rs b/src/test/ui/let-else/let-else-bool-binop-init.rs
new file mode 100644
index 0000000..e443fb0
--- /dev/null
+++ b/src/test/ui/let-else/let-else-bool-binop-init.rs
@@ -0,0 +1,8 @@
+// run-rustfix
+
+#![feature(let_else)]
+
+fn main() {
+ let true = true && false else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else`
+ let true = true || false else { return }; //~ ERROR a `||` expression cannot be directly assigned in `let...else`
+}
diff --git a/src/test/ui/let-else/let-else-bool-binop-init.stderr b/src/test/ui/let-else/let-else-bool-binop-init.stderr
new file mode 100644
index 0000000..6551e24
--- /dev/null
+++ b/src/test/ui/let-else/let-else-bool-binop-init.stderr
@@ -0,0 +1,24 @@
+error: a `&&` expression cannot be directly assigned in `let...else`
+ --> $DIR/let-else-bool-binop-init.rs:6:16
+ |
+LL | let true = true && false else { return };
+ | ^^^^^^^^^^^^^
+ |
+help: wrap the expression in parenthesis
+ |
+LL | let true = (true && false) else { return };
+ | + +
+
+error: a `||` expression cannot be directly assigned in `let...else`
+ --> $DIR/let-else-bool-binop-init.rs:7:16
+ |
+LL | let true = true || false else { return };
+ | ^^^^^^^^^^^^^
+ |
+help: wrap the expression in parenthesis
+ |
+LL | let true = (true || false) else { return };
+ | + +
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/let-else/let-else-brace-before-else.fixed b/src/test/ui/let-else/let-else-brace-before-else.fixed
new file mode 100644
index 0000000..fb4fd77
--- /dev/null
+++ b/src/test/ui/let-else/let-else-brace-before-else.fixed
@@ -0,0 +1,26 @@
+// run-rustfix
+
+#![feature(let_else)]
+
+fn main() {
+ let Some(1) = ({ Some(1) }) else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+ let Some(1) = (loop { break Some(1) }) else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+ let 2 = 1 + (match 1 { n => n }) else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+ let Some(1) = (unsafe { unsafe_fn() }) else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+}
+
+unsafe fn unsafe_fn<T>() -> T {
+ unimplemented!();
+}
diff --git a/src/test/ui/let-else/let-else-brace-before-else.rs b/src/test/ui/let-else/let-else-brace-before-else.rs
new file mode 100644
index 0000000..c4c5a1c
--- /dev/null
+++ b/src/test/ui/let-else/let-else-brace-before-else.rs
@@ -0,0 +1,26 @@
+// run-rustfix
+
+#![feature(let_else)]
+
+fn main() {
+ let Some(1) = { Some(1) } else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+ let Some(1) = loop { break Some(1) } else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+ let 2 = 1 + match 1 { n => n } else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+ let Some(1) = unsafe { unsafe_fn() } else {
+ //~^ ERROR right curly brace `}` before `else` in a `let...else` statement not allowed
+ return;
+ };
+}
+
+unsafe fn unsafe_fn<T>() -> T {
+ unimplemented!();
+}
diff --git a/src/test/ui/let-else/let-else-brace-before-else.stderr b/src/test/ui/let-else/let-else-brace-before-else.stderr
new file mode 100644
index 0000000..eac029c
--- /dev/null
+++ b/src/test/ui/let-else/let-else-brace-before-else.stderr
@@ -0,0 +1,46 @@
+error: right curly brace `}` before `else` in a `let...else` statement not allowed
+ --> $DIR/let-else-brace-before-else.rs:6:29
+ |
+LL | let Some(1) = { Some(1) } else {
+ | ^
+ |
+help: try wrapping the expression in parenthesis
+ |
+LL | let Some(1) = ({ Some(1) }) else {
+ | + +
+
+error: right curly brace `}` before `else` in a `let...else` statement not allowed
+ --> $DIR/let-else-brace-before-else.rs:10:40
+ |
+LL | let Some(1) = loop { break Some(1) } else {
+ | ^
+ |
+help: try wrapping the expression in parenthesis
+ |
+LL | let Some(1) = (loop { break Some(1) }) else {
+ | + +
+
+error: right curly brace `}` before `else` in a `let...else` statement not allowed
+ --> $DIR/let-else-brace-before-else.rs:14:34
+ |
+LL | let 2 = 1 + match 1 { n => n } else {
+ | ^
+ |
+help: try wrapping the expression in parenthesis
+ |
+LL | let 2 = 1 + (match 1 { n => n }) else {
+ | + +
+
+error: right curly brace `}` before `else` in a `let...else` statement not allowed
+ --> $DIR/let-else-brace-before-else.rs:18:40
+ |
+LL | let Some(1) = unsafe { unsafe_fn() } else {
+ | ^
+ |
+help: try wrapping the expression in parenthesis
+ |
+LL | let Some(1) = (unsafe { unsafe_fn() }) else {
+ | + +
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/let-else/let-else-check.rs b/src/test/ui/let-else/let-else-check.rs
new file mode 100644
index 0000000..ab76344
--- /dev/null
+++ b/src/test/ui/let-else/let-else-check.rs
@@ -0,0 +1,14 @@
+#![feature(let_else)]
+
+#![deny(unused_variables)]
+
+fn main() {
+ // type annotation, attributes
+ #[allow(unused_variables)]
+ let Some(_): Option<u32> = Some(Default::default()) else {
+ let x = 1; // OK
+ return;
+ };
+
+ let x = 1; //~ ERROR unused variable: `x`
+}
diff --git a/src/test/ui/let-else/let-else-check.stderr b/src/test/ui/let-else/let-else-check.stderr
new file mode 100644
index 0000000..50e54d3
--- /dev/null
+++ b/src/test/ui/let-else/let-else-check.stderr
@@ -0,0 +1,14 @@
+error: unused variable: `x`
+ --> $DIR/let-else-check.rs:13:9
+ |
+LL | let x = 1;
+ | ^ help: if this is intentional, prefix it with an underscore: `_x`
+ |
+note: the lint level is defined here
+ --> $DIR/let-else-check.rs:3:9
+ |
+LL | #![deny(unused_variables)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/let-else/let-else-irrefutable.rs b/src/test/ui/let-else/let-else-irrefutable.rs
new file mode 100644
index 0000000..b1e09a1
--- /dev/null
+++ b/src/test/ui/let-else/let-else-irrefutable.rs
@@ -0,0 +1,7 @@
+// check-pass
+
+#![feature(let_else)]
+
+fn main() {
+ let x = 1 else { return }; //~ WARN irrefutable `let...else` pattern
+}
diff --git a/src/test/ui/let-else/let-else-irrefutable.stderr b/src/test/ui/let-else/let-else-irrefutable.stderr
new file mode 100644
index 0000000..e030c50
--- /dev/null
+++ b/src/test/ui/let-else/let-else-irrefutable.stderr
@@ -0,0 +1,12 @@
+warning: irrefutable `let...else` pattern
+ --> $DIR/let-else-irrefutable.rs:6:5
+ |
+LL | let x = 1 else { return };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
+ = note: this pattern will always match, so the `else` clause is useless
+ = help: consider removing the `else` clause
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/let-else/let-else-missing-semicolon.rs b/src/test/ui/let-else/let-else-missing-semicolon.rs
new file mode 100644
index 0000000..ed9d79f
--- /dev/null
+++ b/src/test/ui/let-else/let-else-missing-semicolon.rs
@@ -0,0 +1,11 @@
+#![feature(let_else)]
+
+fn main() {
+ let Some(x) = Some(1) else {
+ return;
+ } //~ ERROR expected `;`, found keyword `let`
+ let _ = "";
+ let Some(x) = Some(1) else {
+ panic!();
+ } //~ ERROR expected `;`, found `}`
+}
diff --git a/src/test/ui/let-else/let-else-missing-semicolon.stderr b/src/test/ui/let-else/let-else-missing-semicolon.stderr
new file mode 100644
index 0000000..1818a0b
--- /dev/null
+++ b/src/test/ui/let-else/let-else-missing-semicolon.stderr
@@ -0,0 +1,18 @@
+error: expected `;`, found keyword `let`
+ --> $DIR/let-else-missing-semicolon.rs:6:6
+ |
+LL | }
+ | ^ help: add `;` here
+LL | let _ = "";
+ | --- unexpected token
+
+error: expected `;`, found `}`
+ --> $DIR/let-else-missing-semicolon.rs:10:6
+ |
+LL | }
+ | ^ help: add `;` here
+LL | }
+ | - unexpected token
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/let-else/let-else-non-diverging.rs b/src/test/ui/let-else/let-else-non-diverging.rs
new file mode 100644
index 0000000..a1cee33
--- /dev/null
+++ b/src/test/ui/let-else/let-else-non-diverging.rs
@@ -0,0 +1,13 @@
+#![feature(let_else)]
+
+fn main() {
+ let Some(x) = Some(1) else { //~ ERROR does not diverge
+ Some(2)
+ };
+ let Some(x) = Some(1) else { //~ ERROR does not diverge
+ if 1 == 1 {
+ panic!();
+ }
+ };
+ let Some(x) = Some(1) else { Some(2) }; //~ ERROR does not diverge
+}
diff --git a/src/test/ui/let-else/let-else-non-diverging.stderr b/src/test/ui/let-else/let-else-non-diverging.stderr
new file mode 100644
index 0000000..fd5a18c
--- /dev/null
+++ b/src/test/ui/let-else/let-else-non-diverging.stderr
@@ -0,0 +1,44 @@
+error[E0308]: `else` clause of `let...else` does not diverge
+ --> $DIR/let-else-non-diverging.rs:12:32
+ |
+LL | let Some(x) = Some(1) else { Some(2) };
+ | ^^^^^^^^^^^ expected `!`, found enum `Option`
+ |
+ = note: expected type `!`
+ found type `Option<{integer}>`
+ = help: try adding a diverging expression, such as `return` or `panic!(..)`
+ = help: ...or use `match` instead of `let...else`
+
+error[E0308]: `else` clause of `let...else` does not diverge
+ --> $DIR/let-else-non-diverging.rs:7:32
+ |
+LL | let Some(x) = Some(1) else {
+ | ________________________________^
+LL | | if 1 == 1 {
+LL | | panic!();
+LL | | }
+LL | | };
+ | |_____^ expected `!`, found `()`
+ |
+ = note: expected type `!`
+ found type `()`
+ = help: try adding a diverging expression, such as `return` or `panic!(..)`
+ = help: ...or use `match` instead of `let...else`
+
+error[E0308]: `else` clause of `let...else` does not diverge
+ --> $DIR/let-else-non-diverging.rs:4:32
+ |
+LL | let Some(x) = Some(1) else {
+ | ________________________________^
+LL | | Some(2)
+LL | | };
+ | |_____^ expected `!`, found enum `Option`
+ |
+ = note: expected type `!`
+ found type `Option<{integer}>`
+ = help: try adding a diverging expression, such as `return` or `panic!(..)`
+ = help: ...or use `match` instead of `let...else`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/let-else/let-else-run-pass.rs b/src/test/ui/let-else/let-else-run-pass.rs
new file mode 100644
index 0000000..5d96623
--- /dev/null
+++ b/src/test/ui/let-else/let-else-run-pass.rs
@@ -0,0 +1,35 @@
+// run-pass
+
+#![feature(let_else)]
+
+fn main() {
+ #[allow(dead_code)]
+ enum MyEnum {
+ A(String),
+ B { f: String },
+ C,
+ }
+ // ref binding to non-copy value and or-pattern
+ let (MyEnum::A(ref x) | MyEnum::B { f: ref x }) = (MyEnum::B { f: String::new() }) else {
+ panic!();
+ };
+ assert_eq!(x, "");
+
+ // nested let-else
+ let mut x = 1;
+ loop {
+ let 4 = x else {
+ let 3 = x else {
+ x += 1;
+ continue;
+ };
+ break;
+ };
+ panic!();
+ }
+ assert_eq!(x, 3);
+
+ // else return
+ let Some(1) = Some(2) else { return };
+ panic!();
+}
diff --git a/src/test/ui/let-else/let-else-scope.rs b/src/test/ui/let-else/let-else-scope.rs
new file mode 100644
index 0000000..f17682d
--- /dev/null
+++ b/src/test/ui/let-else/let-else-scope.rs
@@ -0,0 +1,7 @@
+#![feature(let_else)]
+
+fn main() {
+ let Some(x) = Some(2) else {
+ panic!("{}", x); //~ ERROR cannot find value `x` in this scope
+ };
+}
diff --git a/src/test/ui/let-else/let-else-scope.stderr b/src/test/ui/let-else/let-else-scope.stderr
new file mode 100644
index 0000000..4b3936e
--- /dev/null
+++ b/src/test/ui/let-else/let-else-scope.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/let-else-scope.rs:5:22
+ |
+LL | panic!("{}", x);
+ | ^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/lifetimes/issue-34979.stderr b/src/test/ui/lifetimes/issue-34979.stderr
index 04ad0d1..b76d71a 100644
--- a/src/test/ui/lifetimes/issue-34979.stderr
+++ b/src/test/ui/lifetimes/issue-34979.stderr
@@ -1,13 +1,15 @@
error[E0283]: type annotations needed
--> $DIR/issue-34979.rs:6:13
|
-LL | trait Foo {}
- | --------- required by this bound in `Foo`
-...
LL | &'a (): Foo,
| ^^^ cannot infer type for reference `&'a ()`
|
= note: cannot satisfy `&'a (): Foo`
+note: required by a bound in `Foo`
+ --> $DIR/issue-34979.rs:1:1
+ |
+LL | trait Foo {}
+ | ^^^^^^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/lifetimes/issue-79187-2.nll.stderr b/src/test/ui/lifetimes/issue-79187-2.nll.stderr
index 4970c57..907b43d 100644
--- a/src/test/ui/lifetimes/issue-79187-2.nll.stderr
+++ b/src/test/ui/lifetimes/issue-79187-2.nll.stderr
@@ -16,29 +16,47 @@
| | let's call the lifetime of this reference `'2`
| let's call the lifetime of this reference `'1`
-error: higher-ranked subtype error
+error: implementation of `FnOnce` is not general enough
--> $DIR/issue-79187-2.rs:8:5
|
LL | take_foo(|a| a);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
+ |
+ = note: closure with signature `fn(&'2 i32) -> &i32` must implement `FnOnce<(&'1 i32,)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&'2 i32,)>`, for some specific lifetime `'2`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/issue-79187-2.rs:8:5
|
LL | take_foo(|a| a);
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected type `for<'r> Fn<(&'r i32,)>`
+ found type `Fn<(&i32,)>`
+note: this closure does not fulfill the lifetime requirements
+ --> $DIR/issue-79187-2.rs:8:14
+ |
+LL | take_foo(|a| a);
+ | ^^^^^
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/issue-79187-2.rs:9:5
|
LL | take_foo(|a: &i32| a);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected reference `&i32`
+ found reference `&i32`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/issue-79187-2.rs:10:5
|
LL | take_foo(|a: &i32| -> &i32 { a });
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected reference `&i32`
+ found reference `&i32`
error: aborting due to 6 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lifetimes/issue-79187.nll.stderr b/src/test/ui/lifetimes/issue-79187.nll.stderr
index aa8809d..725b132 100644
--- a/src/test/ui/lifetimes/issue-79187.nll.stderr
+++ b/src/test/ui/lifetimes/issue-79187.nll.stderr
@@ -1,14 +1,26 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/issue-79187.rs:5:5
|
LL | thing(f);
- | ^^^^^^^^
+ | ^^^^^^^^ one type is more general than the other
+ |
+ = note: expected type `for<'r> FnOnce<(&'r u32,)>`
+ found type `FnOnce<(&u32,)>`
+note: this closure does not fulfill the lifetime requirements
+ --> $DIR/issue-79187.rs:4:13
+ |
+LL | let f = |_| ();
+ | ^^^^^^
-error: higher-ranked subtype error
+error: implementation of `FnOnce` is not general enough
--> $DIR/issue-79187.rs:5:5
|
LL | thing(f);
- | ^^^^^^^^
+ | ^^^^^^^^ implementation of `FnOnce` is not general enough
+ |
+ = note: closure with signature `fn(&'2 u32)` must implement `FnOnce<(&'1 u32,)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&'2 u32,)>`, for some specific lifetime `'2`
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
index 5809b5b..0e69cd5 100644
--- a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
+++ b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
@@ -8,7 +8,7 @@
help: consider using the `'static` lifetime
|
LL | fn f() -> &'static isize {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:7:33
@@ -20,7 +20,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn g<'a>(_x: &'a isize, _y: &'a isize) -> &'a isize {
- | ^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^
+ | ++++ ++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:17:19
@@ -32,7 +32,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn h<'a>(_x: &'a Foo) -> &'a isize {
- | ^^^^ ^^^^^^^ ^^^
+ | ++++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:21:20
@@ -44,7 +44,7 @@
help: consider using the `'static` lifetime
|
LL | fn i(_x: isize) -> &'static isize {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:34:24
@@ -56,7 +56,7 @@
help: consider using the `'static` lifetime
|
LL | fn j(_x: StaticStr) -> &'static isize {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:40:49
@@ -68,7 +68,7 @@
help: consider using the `'a` lifetime
|
LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
- | ^^^
+ | ~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr
index c1fcab2..bcc3e95 100644
--- a/src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr
@@ -8,7 +8,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | ++++ ++ ++ ++
error: aborting due to previous error
diff --git a/src/test/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr b/src/test/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr
index 16333a7c..8c87f6d 100644
--- a/src/test/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr
+++ b/src/test/ui/lifetimes/undeclared-lifetime-used-in-debug-macro-issue-70152.stderr
@@ -18,11 +18,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b> T for Test {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn foo<'b>(&'b self) {}
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/undeclared-lifetime-used-in-debug-macro-issue-70152.rs:3:9
diff --git a/src/test/ui/lifetimes/unnamed-closure-doesnt-life-long-enough-issue-67634.stderr b/src/test/ui/lifetimes/unnamed-closure-doesnt-life-long-enough-issue-67634.stderr
index 3447011..4399045 100644
--- a/src/test/ui/lifetimes/unnamed-closure-doesnt-life-long-enough-issue-67634.stderr
+++ b/src/test/ui/lifetimes/unnamed-closure-doesnt-life-long-enough-issue-67634.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `a` (and any other referenced variables), use the `move` keyword
|
LL | [0].iter().flat_map(|a| [0].iter().map(move |_| &a));
- | ^^^^^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/limits/issue-55878.stderr b/src/test/ui/limits/issue-55878.stderr
index a0e8fc7..a7e3824 100644
--- a/src/test/ui/limits/issue-55878.stderr
+++ b/src/test/ui/limits/issue-55878.stderr
@@ -3,7 +3,7 @@
|
LL | intrinsics::size_of::<T>()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ inside `std::mem::size_of::<[u8; SIZE]>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
+ |
::: $DIR/issue-55878.rs:7:26
|
LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
diff --git a/src/test/ui/lint/bare-trait-objects-path.stderr b/src/test/ui/lint/bare-trait-objects-path.stderr
index 40fafc4..3477b01 100644
--- a/src/test/ui/lint/bare-trait-objects-path.stderr
+++ b/src/test/ui/lint/bare-trait-objects-path.stderr
@@ -12,7 +12,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/bare-trait-objects-path.rs:17:5
@@ -21,7 +21,7 @@
| ^^^^^ help: use `dyn`: `<dyn (::Dyn)>`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/bare-trait-objects-path.rs:20:5
@@ -30,7 +30,7 @@
| ^^^ help: use `dyn`: `<dyn Dyn>`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 3 warnings emitted
diff --git a/src/test/ui/lint/cli-lint-override.rs b/src/test/ui/lint/cli-lint-override.rs
index a0a96d0..7d762b0 100644
--- a/src/test/ui/lint/cli-lint-override.rs
+++ b/src/test/ui/lint/cli-lint-override.rs
@@ -5,7 +5,7 @@
//
//[warn_deny] compile-flags: --warn missing_abi --deny missing_abi
//[forbid_warn] compile-flags: --warn missing_abi --forbid missing_abi
-//[force_warn_deny] compile-flags: -Z unstable-options --force-warn missing_abi --allow missing_abi
+//[force_warn_deny] compile-flags: --force-warn missing_abi --allow missing_abi
//[force_warn_deny] check-pass
diff --git a/src/test/ui/lint/cli-unknown-force-warn.rs b/src/test/ui/lint/cli-unknown-force-warn.rs
index 55544cc..f3dea87 100644
--- a/src/test/ui/lint/cli-unknown-force-warn.rs
+++ b/src/test/ui/lint/cli-unknown-force-warn.rs
@@ -1,7 +1,7 @@
// Checks that rustc correctly errors when passed an invalid lint with
// `--force-warn`. This is a regression test for issue #86958.
//
-// compile-flags: -Z unstable-options --force-warn foo-qux
+// compile-flags: --force-warn foo-qux
// error-pattern: unknown lint: `foo_qux`
fn main() {}
diff --git a/src/test/ui/lint/cli-unknown-force-warn.stderr b/src/test/ui/lint/cli-unknown-force-warn.stderr
index 4367c3b..9ce9f40 100644
--- a/src/test/ui/lint/cli-unknown-force-warn.stderr
+++ b/src/test/ui/lint/cli-unknown-force-warn.stderr
@@ -6,10 +6,6 @@
|
= note: requested on the command line with `--force-warn foo_qux`
-error[E0602]: unknown lint: `foo_qux`
- |
- = note: requested on the command line with `--force-warn foo_qux`
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0602`.
diff --git a/src/test/ui/lint/dead-code/anon-const-in-pat.rs b/src/test/ui/lint/dead-code/anon-const-in-pat.rs
new file mode 100644
index 0000000..4c6211a
--- /dev/null
+++ b/src/test/ui/lint/dead-code/anon-const-in-pat.rs
@@ -0,0 +1,45 @@
+// check-pass
+#![feature(inline_const)]
+#![allow(incomplete_features)]
+#![deny(dead_code)]
+
+const fn one() -> i32 {
+ 1
+}
+
+const fn two() -> i32 {
+ 2
+}
+
+const fn three() -> i32 {
+ 3
+}
+
+fn inline_const() {
+ // rust-lang/rust#78171: dead_code lint triggers even though function is used in const pattern
+ match 1 {
+ const { one() } => {}
+ _ => {}
+ }
+}
+
+fn inline_const_range() {
+ match 1 {
+ 1 ..= const { two() } => {}
+ _ => {}
+ }
+}
+
+struct S<const C: i32>;
+
+fn const_generic_arg() {
+ match S::<3> {
+ S::<{three()}> => {}
+ }
+}
+
+fn main() {
+ inline_const();
+ inline_const_range();
+ const_generic_arg();
+}
diff --git a/src/test/ui/lint/dead-code/issue-85071-2.rs b/src/test/ui/lint/dead-code/issue-85071-2.rs
new file mode 100644
index 0000000..f063993
--- /dev/null
+++ b/src/test/ui/lint/dead-code/issue-85071-2.rs
@@ -0,0 +1,22 @@
+// A slight variation of issue-85071.rs. Here, a method is called instead
+// of a function, and the warning is about an unreachable definition
+// instead of an unreachable expression.
+
+// check-pass
+
+#![warn(unused_variables,unreachable_code)]
+
+enum Foo {}
+
+struct S;
+impl S {
+ fn f(&self) -> Foo {todo!()}
+}
+
+fn main() {
+ let s = S;
+ let x = s.f();
+ //~^ WARNING: unused variable: `x`
+ let _y = x;
+ //~^ WARNING: unreachable definition
+}
diff --git a/src/test/ui/lint/dead-code/issue-85071-2.stderr b/src/test/ui/lint/dead-code/issue-85071-2.stderr
new file mode 100644
index 0000000..86fbd1d
--- /dev/null
+++ b/src/test/ui/lint/dead-code/issue-85071-2.stderr
@@ -0,0 +1,34 @@
+warning: unreachable definition
+ --> $DIR/issue-85071-2.rs:20:9
+ |
+LL | let x = s.f();
+ | ----- any code following this expression is unreachable
+LL |
+LL | let _y = x;
+ | ^^ unreachable definition
+ |
+note: the lint level is defined here
+ --> $DIR/issue-85071-2.rs:7:26
+ |
+LL | #![warn(unused_variables,unreachable_code)]
+ | ^^^^^^^^^^^^^^^^
+note: this expression has type `Foo`, which is uninhabited
+ --> $DIR/issue-85071-2.rs:18:13
+ |
+LL | let x = s.f();
+ | ^^^^^
+
+warning: unused variable: `x`
+ --> $DIR/issue-85071-2.rs:18:9
+ |
+LL | let x = s.f();
+ | ^ help: if this is intentional, prefix it with an underscore: `_x`
+ |
+note: the lint level is defined here
+ --> $DIR/issue-85071-2.rs:7:9
+ |
+LL | #![warn(unused_variables,unreachable_code)]
+ | ^^^^^^^^^^^^^^^^
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/lint/dead-code/issue-85071.rs b/src/test/ui/lint/dead-code/issue-85071.rs
new file mode 100644
index 0000000..d696932
--- /dev/null
+++ b/src/test/ui/lint/dead-code/issue-85071.rs
@@ -0,0 +1,19 @@
+// Checks that an unreachable code warning is emitted when an expression is
+// preceded by an expression with an uninhabited type. Previously, the
+// variable liveness analysis was "smarter" than the reachability analysis
+// in this regard, which led to confusing "unused variable" warnings
+// without an accompanying explanatory "unreachable expression" warning.
+
+// check-pass
+
+#![warn(unused_variables,unreachable_code)]
+
+enum Foo {}
+fn f() -> Foo {todo!()}
+
+fn main() {
+ let x = f();
+ //~^ WARNING: unused variable: `x`
+ let _ = x;
+ //~^ WARNING: unreachable expression
+}
diff --git a/src/test/ui/lint/dead-code/issue-85071.stderr b/src/test/ui/lint/dead-code/issue-85071.stderr
new file mode 100644
index 0000000..49555fd
--- /dev/null
+++ b/src/test/ui/lint/dead-code/issue-85071.stderr
@@ -0,0 +1,34 @@
+warning: unreachable expression
+ --> $DIR/issue-85071.rs:17:13
+ |
+LL | let x = f();
+ | --- any code following this expression is unreachable
+LL |
+LL | let _ = x;
+ | ^ unreachable expression
+ |
+note: the lint level is defined here
+ --> $DIR/issue-85071.rs:9:26
+ |
+LL | #![warn(unused_variables,unreachable_code)]
+ | ^^^^^^^^^^^^^^^^
+note: this expression has type `Foo`, which is uninhabited
+ --> $DIR/issue-85071.rs:15:13
+ |
+LL | let x = f();
+ | ^^^
+
+warning: unused variable: `x`
+ --> $DIR/issue-85071.rs:15:9
+ |
+LL | let x = f();
+ | ^ help: if this is intentional, prefix it with an underscore: `_x`
+ |
+note: the lint level is defined here
+ --> $DIR/issue-85071.rs:9:9
+ |
+LL | #![warn(unused_variables,unreachable_code)]
+ | ^^^^^^^^^^^^^^^^
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/lint/fn_must_use.stderr b/src/test/ui/lint/fn_must_use.stderr
index d6b1cf3..61b7993 100644
--- a/src/test/ui/lint/fn_must_use.stderr
+++ b/src/test/ui/lint/fn_must_use.stderr
@@ -47,13 +47,23 @@
--> $DIR/fn_must_use.rs:74:5
|
LL | 2 == 3;
- | ^^^^^^
+ | ^^^^^^ the comparison produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 2 == 3;
+ | +++++++
warning: unused comparison that must be used
--> $DIR/fn_must_use.rs:75:5
|
LL | m == n;
- | ^^^^^^
+ | ^^^^^^ the comparison produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = m == n;
+ | +++++++
warning: 8 warnings emitted
diff --git a/src/test/ui/lint/force-warn/allow-warnings.rs b/src/test/ui/lint/force-warn/allow-warnings.rs
new file mode 100644
index 0000000..adcefc7
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allow-warnings.rs
@@ -0,0 +1,11 @@
+// --force-warn $LINT causes $LINT (which is warn-by-default) to warn
+// despite allowing all warnings in module
+// compile-flags: --force-warn dead_code
+// check-pass
+
+#![allow(warnings)]
+
+fn dead_function() {}
+//~^ WARN function is never used
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/allow-warnings.stderr b/src/test/ui/lint/force-warn/allow-warnings.stderr
new file mode 100644
index 0000000..cac2b4e
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allow-warnings.stderr
@@ -0,0 +1,10 @@
+warning: function is never used: `dead_function`
+ --> $DIR/allow-warnings.rs:8:4
+ |
+LL | fn dead_function() {}
+ | ^^^^^^^^^^^^^
+ |
+ = note: requested on the command line with `--force-warn dead-code`
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/allowed-by-default-lint.rs b/src/test/ui/lint/force-warn/allowed-by-default-lint.rs
new file mode 100644
index 0000000..b24ab82
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-by-default-lint.rs
@@ -0,0 +1,12 @@
+// --force-warn $LINT causes $LINT (which is allow-by-default) to warn
+// compile-flags: --force-warn elided_lifetimes_in_paths
+// check-pass
+
+struct Foo<'a> {
+ x: &'a u32,
+}
+
+fn foo(x: &Foo) {}
+//~^ WARN hidden lifetime parameters in types are deprecated
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/allowed-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-by-default-lint.stderr
new file mode 100644
index 0000000..baa47cb
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-by-default-lint.stderr
@@ -0,0 +1,10 @@
+warning: hidden lifetime parameters in types are deprecated
+ --> $DIR/allowed-by-default-lint.rs:9:12
+ |
+LL | fn foo(x: &Foo) {}
+ | ^^^- help: indicate the anonymous lifetime: `<'_>`
+ |
+ = note: requested on the command line with `--force-warn elided-lifetimes-in-paths`
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs
new file mode 100644
index 0000000..3fab914
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs
@@ -0,0 +1,10 @@
+// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
+// despite $LINT being allowed on command line
+// compile-flags: -A const_err --force-warn const_err -Zunstable-options
+// check-pass
+
+const C: i32 = 1 / 0;
+//~^ WARN any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr
new file mode 100644
index 0000000..af6308f
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr
@@ -0,0 +1,14 @@
+warning: any use of this value will cause an error
+ --> $DIR/allowed-cli-deny-by-default-lint.rs:6:16
+ |
+LL | const C: i32 = 1 / 0;
+ | ---------------^^^^^-
+ | |
+ | attempt to divide `1_i32` by zero
+ |
+ = note: requested on the command line with `--force-warn const-err`
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs
new file mode 100644
index 0000000..08e75a7
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs
@@ -0,0 +1,11 @@
+// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
+// despite $LINT being allowed in module
+// compile-flags: --force-warn const_err
+// check-pass
+
+#![allow(const_err)]
+const C: i32 = 1 / 0;
+//~^ WARN any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr
new file mode 100644
index 0000000..05656af
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr
@@ -0,0 +1,14 @@
+warning: any use of this value will cause an error
+ --> $DIR/allowed-deny-by-default-lint.rs:7:16
+ |
+LL | const C: i32 = 1 / 0;
+ | ---------------^^^^^-
+ | |
+ | attempt to divide `1_i32` by zero
+ |
+ = note: requested on the command line with `--force-warn const-err`
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.rs b/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.rs
new file mode 100644
index 0000000..9b1edba
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.rs
@@ -0,0 +1,14 @@
+// --force-warn $LINT causes $LINT (which is warn-by-default) to warn
+// despite $LINT_GROUP (which contains $LINT) being allowed
+// compile-flags: --force-warn bare_trait_objects
+// check-pass
+
+#![allow(rust_2018_idioms)]
+
+pub trait SomeTrait {}
+
+pub fn function(_x: Box<SomeTrait>) {}
+//~^ WARN trait objects without an explicit `dyn` are deprecated
+//~| WARN this is accepted in the current edition
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr
new file mode 100644
index 0000000..d945cc3
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr
@@ -0,0 +1,12 @@
+warning: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/allowed-group-warn-by-default-lint.rs:10:25
+ |
+LL | pub fn function(_x: Box<SomeTrait>) {}
+ | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
+ |
+ = note: requested on the command line with `--force-warn bare-trait-objects`
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/allowed-warn-by-default-lint.rs b/src/test/ui/lint/force-warn/allowed-warn-by-default-lint.rs
new file mode 100644
index 0000000..4ac29ff
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-warn-by-default-lint.rs
@@ -0,0 +1,11 @@
+// --force-warn $LINT causes $LINT (which is warn-by-default) to warn
+// despite $LINT being allowed in module
+// compile-flags: --force-warn dead_code
+// check-pass
+
+#![allow(dead_code)]
+
+fn dead_function() {}
+//~^ WARN function is never used
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/allowed-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-warn-by-default-lint.stderr
new file mode 100644
index 0000000..c46d740
--- /dev/null
+++ b/src/test/ui/lint/force-warn/allowed-warn-by-default-lint.stderr
@@ -0,0 +1,10 @@
+warning: function is never used: `dead_function`
+ --> $DIR/allowed-warn-by-default-lint.rs:8:4
+ |
+LL | fn dead_function() {}
+ | ^^^^^^^^^^^^^
+ |
+ = note: requested on the command line with `--force-warn dead-code`
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/cap-lints-allow.rs b/src/test/ui/lint/force-warn/cap-lints-allow.rs
new file mode 100644
index 0000000..9609ea9
--- /dev/null
+++ b/src/test/ui/lint/force-warn/cap-lints-allow.rs
@@ -0,0 +1,12 @@
+// --force-warn $LINT casuses $LINT to warn despite --cap-lints
+// set to allow
+// compile-flags: --cap-lints allow --force-warn bare_trait_objects
+// check-pass
+
+pub trait SomeTrait {}
+
+pub fn function(_x: Box<SomeTrait>) {}
+//~^ WARN trait objects without an explicit `dyn` are deprecated
+//~| WARN this is accepted in the current edition
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/cap-lints-allow.stderr b/src/test/ui/lint/force-warn/cap-lints-allow.stderr
new file mode 100644
index 0000000..f3ae16b
--- /dev/null
+++ b/src/test/ui/lint/force-warn/cap-lints-allow.stderr
@@ -0,0 +1,12 @@
+warning: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/cap-lints-allow.rs:8:25
+ |
+LL | pub fn function(_x: Box<SomeTrait>) {}
+ | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
+ |
+ = note: requested on the command line with `--force-warn bare-trait-objects`
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.rs b/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.rs
new file mode 100644
index 0000000..e65f156
--- /dev/null
+++ b/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.rs
@@ -0,0 +1,17 @@
+// --force-warn $LINT_GROUP causes $LINT to warn despite $LINT being
+// allowed in module and cap-lints set to warn
+// compile-flags: --cap-lints warn --force-warn rust-2021-compatibility
+// check-pass
+#![allow(ellipsis_inclusive_range_patterns)]
+
+pub fn f() -> bool {
+ let x = 123;
+ match x {
+ 0...100 => true,
+ //~^ WARN range patterns are deprecated
+ //~| WARN this is accepted in the current edition
+ _ => false,
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
new file mode 100644
index 0000000..3dafaf7
--- /dev/null
+++ b/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
@@ -0,0 +1,12 @@
+warning: `...` range patterns are deprecated
+ --> $DIR/cap-lints-warn-allowed-warn-by-default-lint.rs:10:10
+ |
+LL | 0...100 => true,
+ | ^^^ help: use `..=` for an inclusive range
+ |
+ = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility`
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/deny-by-default-lint.rs b/src/test/ui/lint/force-warn/deny-by-default-lint.rs
new file mode 100644
index 0000000..e371029
--- /dev/null
+++ b/src/test/ui/lint/force-warn/deny-by-default-lint.rs
@@ -0,0 +1,9 @@
+// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
+// compile-flags: --force-warn const_err
+// check-pass
+
+const C: i32 = 1 / 0;
+//~^ WARN any use of this value will cause an error
+//~| WARN this was previously accepted by the compiler
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr
new file mode 100644
index 0000000..ef295f9
--- /dev/null
+++ b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr
@@ -0,0 +1,14 @@
+warning: any use of this value will cause an error
+ --> $DIR/deny-by-default-lint.rs:5:16
+ |
+LL | const C: i32 = 1 / 0;
+ | ---------------^^^^^-
+ | |
+ | attempt to divide `1_i32` by zero
+ |
+ = note: requested on the command line with `--force-warn const-err`
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs
deleted file mode 100644
index 4799429..0000000
--- a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// compile-flags: --force-warn elided_lifetimes_in_paths -Zunstable-options
-// check-pass
-
-struct Foo<'a> {
- x: &'a u32,
-}
-
-fn foo(x: &Foo) {}
-//~^ WARN hidden lifetime parameters in types are deprecated
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr b/src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr
deleted file mode 100644
index 05513de..0000000
--- a/src/test/ui/lint/force-warn/force-allowed-by-default-lint.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-warning: hidden lifetime parameters in types are deprecated
- --> $DIR/force-allowed-by-default-lint.rs:8:12
- |
-LL | fn foo(x: &Foo) {}
- | ^^^- help: indicate the anonymous lifetime: `<'_>`
- |
- = note: requested on the command line with `--force-warn elided-lifetimes-in-paths`
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs
deleted file mode 100644
index d066feb..0000000
--- a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// compile-flags: --force-warn const_err -Zunstable-options
-// check-pass
-
-#![allow(const_err)]
-const C: i32 = 1 / 0;
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr
deleted file mode 100644
index dd4f88a..0000000
--- a/src/test/ui/lint/force-warn/force-allowed-deny-by-default-lint.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-warning: any use of this value will cause an error
- --> $DIR/force-allowed-deny-by-default-lint.rs:5:16
- |
-LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
- |
- = note: requested on the command line with `--force-warn const-err`
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-allowed-warning.rs b/src/test/ui/lint/force-warn/force-allowed-warning.rs
deleted file mode 100644
index 280de50..0000000
--- a/src/test/ui/lint/force-warn/force-allowed-warning.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// compile-flags: --force-warn dead_code -Zunstable-options
-// check-pass
-
-#![allow(dead_code)]
-
-fn dead_function() {}
-//~^ WARN function is never used
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-allowed-warning.stderr b/src/test/ui/lint/force-warn/force-allowed-warning.stderr
deleted file mode 100644
index fced147..0000000
--- a/src/test/ui/lint/force-warn/force-allowed-warning.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-warning: function is never used: `dead_function`
- --> $DIR/force-allowed-warning.rs:6:4
- |
-LL | fn dead_function() {}
- | ^^^^^^^^^^^^^
- |
- = note: requested on the command line with `--force-warn dead-code`
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs
deleted file mode 100644
index 8331df0..0000000
--- a/src/test/ui/lint/force-warn/force-deny-by-default-lint.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// compile-flags: --force-warn const_err -Zunstable-options
-// check-pass
-
-const C: i32 = 1 / 0;
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr
deleted file mode 100644
index 68cd3a3..0000000
--- a/src/test/ui/lint/force-warn/force-deny-by-default-lint.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-warning: any use of this value will cause an error
- --> $DIR/force-deny-by-default-lint.rs:4:16
- |
-LL | const C: i32 = 1 / 0;
- | ---------------^^^^^-
- | |
- | attempt to divide `1_i32` by zero
- |
- = note: requested on the command line with `--force-warn const-err`
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs
deleted file mode 100644
index 0e8a65a..0000000
--- a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// compile-flags: --force-warn dead_code -Zunstable-options
-// check-pass
-
-#![allow(warnings)]
-
-fn dead_function() {}
-//~^ WARN function is never used
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr b/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr
deleted file mode 100644
index 3305f2c..0000000
--- a/src/test/ui/lint/force-warn/force-lint-allow-all-warnings.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-warning: function is never used: `dead_function`
- --> $DIR/force-lint-allow-all-warnings.rs:6:4
- |
-LL | fn dead_function() {}
- | ^^^^^^^^^^^^^
- |
- = note: requested on the command line with `--force-warn dead-code`
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs
deleted file mode 100644
index aaca59a..0000000
--- a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-// compile-flags: --force-warn nonstandard_style -Zunstable-options
-// check-pass
-
-#![allow(warnings)]
-
-pub fn FUNCTION() {}
-//~^ WARN function `FUNCTION` should have a snake case name
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr b/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr
deleted file mode 100644
index 065a8f6..0000000
--- a/src/test/ui/lint/force-warn/force-lint-group-allow-all-warnings.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-warning: function `FUNCTION` should have a snake case name
- --> $DIR/force-lint-group-allow-all-warnings.rs:6:8
- |
-LL | pub fn FUNCTION() {}
- | ^^^^^^^^ help: convert the identifier to snake case: `function`
- |
- = note: `--force-warn non-snake-case` implied by `--force-warn nonstandard-style`
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs
deleted file mode 100644
index d8447bd..0000000
--- a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// compile-flags: --force-warn bare_trait_objects -Zunstable-options
-// check-pass
-
-#![allow(rust_2018_idioms)]
-
-pub trait SomeTrait {}
-
-pub fn function(_x: Box<SomeTrait>) {}
-//~^ WARN trait objects without an explicit `dyn` are deprecated
-//~| WARN this is accepted in the current edition
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr
deleted file mode 100644
index 185c0e8..0000000
--- a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-warning: trait objects without an explicit `dyn` are deprecated
- --> $DIR/force-lint-in-allowed-group.rs:8:25
- |
-LL | pub fn function(_x: Box<SomeTrait>) {}
- | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
- |
- = note: requested on the command line with `--force-warn bare-trait-objects`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.rs b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.rs
deleted file mode 100644
index e10d161..0000000
--- a/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// compile-flags: --cap-lints allow --force-warn bare_trait_objects -Zunstable-options
-// check-pass
-
-pub trait SomeTrait {}
-
-pub fn function(_x: Box<SomeTrait>) {}
-//~^ WARN trait objects without an explicit `dyn` are deprecated
-//~| WARN this is accepted in the current edition
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr
deleted file mode 100644
index a899705..0000000
--- a/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-warning: trait objects without an explicit `dyn` are deprecated
- --> $DIR/force-warn-cap-lints-allow.rs:6:25
- |
-LL | pub fn function(_x: Box<SomeTrait>) {}
- | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
- |
- = note: requested on the command line with `--force-warn bare-trait-objects`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs
deleted file mode 100644
index 4afc086..0000000
--- a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// compile-flags: --cap-lints warn --force-warn rust-2021-compatibility -Zunstable-options
-// check-pass
-#![allow(ellipsis_inclusive_range_patterns)]
-
-pub fn f() -> bool {
- let x = 123;
- match x {
- 0...100 => true,
- //~^ WARN range patterns are deprecated
- //~| WARN this is accepted in the current edition
- _ => false,
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr
deleted file mode 100644
index 1d5f880..0000000
--- a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-warning: `...` range patterns are deprecated
- --> $DIR/force-warn-cap-lints-warn.rs:8:10
- |
-LL | 0...100 => true,
- | ^^^ help: use `..=` for an inclusive range
- |
- = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs
deleted file mode 100644
index 193ba2b..0000000
--- a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// compile-flags: --force-warn rust-2018-idioms -Zunstable-options
-// check-pass
-
-#![allow(bare_trait_objects)]
-
-pub trait SomeTrait {}
-
-pub fn function(_x: Box<SomeTrait>) {}
-//~^ WARN trait objects without an explicit `dyn` are deprecated
-//~| WARN this is accepted in the current edition
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr
deleted file mode 100644
index d242ef2..0000000
--- a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-warning: trait objects without an explicit `dyn` are deprecated
- --> $DIR/force-warn-group-allow-warning.rs:8:25
- |
-LL | pub fn function(_x: Box<SomeTrait>) {}
- | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
- |
- = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/force-warn-group.rs b/src/test/ui/lint/force-warn/force-warn-group.rs
deleted file mode 100644
index 0198610..0000000
--- a/src/test/ui/lint/force-warn/force-warn-group.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// compile-flags: --force-warn rust_2018_idioms -Zunstable-options
-// check-pass
-
-#![allow(rust_2018_idioms)]
-
-pub trait SomeTrait {}
-
-pub fn function(_x: Box<SomeTrait>) {}
-//~^ WARN trait objects without an explicit `dyn` are deprecated
-//~| WARN this is accepted in the current edition
-
-fn main() {}
diff --git a/src/test/ui/lint/force-warn/force-warn-group.stderr b/src/test/ui/lint/force-warn/force-warn-group.stderr
deleted file mode 100644
index 180dff8..0000000
--- a/src/test/ui/lint/force-warn/force-warn-group.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-warning: trait objects without an explicit `dyn` are deprecated
- --> $DIR/force-warn-group.rs:8:25
- |
-LL | pub fn function(_x: Box<SomeTrait>) {}
- | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
- |
- = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/force-warn/lint-group-allow-warnings.rs b/src/test/ui/lint/force-warn/lint-group-allow-warnings.rs
new file mode 100644
index 0000000..4b95f4d
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allow-warnings.rs
@@ -0,0 +1,12 @@
+// --force-warn $LINT_GROUP causes $LINT in $LINT_GROUP to warn
+// despite all warnings being allowed in module
+// warn-by-default lint to warn
+// compile-flags: --force-warn nonstandard_style
+// check-pass
+
+#![allow(warnings)]
+
+pub fn FUNCTION() {}
+//~^ WARN function `FUNCTION` should have a snake case name
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/lint-group-allow-warnings.stderr b/src/test/ui/lint/force-warn/lint-group-allow-warnings.stderr
new file mode 100644
index 0000000..dc7b1b7
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allow-warnings.stderr
@@ -0,0 +1,10 @@
+warning: function `FUNCTION` should have a snake case name
+ --> $DIR/lint-group-allow-warnings.rs:9:8
+ |
+LL | pub fn FUNCTION() {}
+ | ^^^^^^^^ help: convert the identifier to snake case: `function`
+ |
+ = note: `--force-warn non-snake-case` implied by `--force-warn nonstandard-style`
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.rs b/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.rs
new file mode 100644
index 0000000..4eb05b538
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.rs
@@ -0,0 +1,12 @@
+// --force-warn $LINT_GROUP causes $LINT (which is warn-by-default) to warn
+// despite $LINT being allowed on command line
+// compile-flags: -A bare-trait-objects --force-warn rust-2018-idioms -Zunstable-options
+// check-pass
+
+pub trait SomeTrait {}
+
+pub fn function(_x: Box<SomeTrait>) {}
+//~^ WARN trait objects without an explicit `dyn` are deprecated
+//~| WARN this is accepted in the current edition
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
new file mode 100644
index 0000000..dc62521
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
@@ -0,0 +1,12 @@
+warning: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/lint-group-allowed-cli-warn-by-default-lint.rs:8:25
+ |
+LL | pub fn function(_x: Box<SomeTrait>) {}
+ | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
+ |
+ = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.rs b/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.rs
new file mode 100644
index 0000000..99cad61
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.rs
@@ -0,0 +1,14 @@
+// --force-warn $LINT_GROUP causes $LINT to warn despite
+// $LINT_GROUP being allowed in module
+// compile-flags: --force-warn rust_2018_idioms
+// check-pass
+
+#![allow(rust_2018_idioms)]
+
+pub trait SomeTrait {}
+
+pub fn function(_x: Box<SomeTrait>) {}
+//~^ WARN trait objects without an explicit `dyn` are deprecated
+//~| WARN this is accepted in the current edition
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr b/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
new file mode 100644
index 0000000..fcbae02
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
@@ -0,0 +1,12 @@
+warning: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/lint-group-allowed-lint-group.rs:10:25
+ |
+LL | pub fn function(_x: Box<SomeTrait>) {}
+ | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
+ |
+ = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.rs b/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.rs
new file mode 100644
index 0000000..f0aacd7
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.rs
@@ -0,0 +1,14 @@
+// --force-warn $LINT_GROUP causes $LINT (which is warn-by-default) to warn
+// despite $LINT being allowed in module
+// compile-flags: --force-warn rust-2018-idioms
+// check-pass
+
+#![allow(bare_trait_objects)]
+
+pub trait SomeTrait {}
+
+pub fn function(_x: Box<SomeTrait>) {}
+//~^ WARN trait objects without an explicit `dyn` are deprecated
+//~| WARN this is accepted in the current edition
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
new file mode 100644
index 0000000..1212ae0
--- /dev/null
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
@@ -0,0 +1,12 @@
+warning: trait objects without an explicit `dyn` are deprecated
+ --> $DIR/lint-group-allowed-warn-by-default-lint.rs:10:25
+ |
+LL | pub fn function(_x: Box<SomeTrait>) {}
+ | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
+ |
+ = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/force-warn/warn-by-default-lint-two-modules.rs b/src/test/ui/lint/force-warn/warn-by-default-lint-two-modules.rs
new file mode 100644
index 0000000..d2cb341
--- /dev/null
+++ b/src/test/ui/lint/force-warn/warn-by-default-lint-two-modules.rs
@@ -0,0 +1,18 @@
+// --force-warn $LINT causes $LINT (which is warn-by-default) to warn
+// despite being allowed in one submodule (but not the other)
+// compile-flags: --force-warn dead_code -Zunstable-options
+// check-pass
+
+mod one {
+ #![allow(dead_code)]
+
+ fn dead_function() {}
+ //~^ WARN function is never used
+}
+
+mod two {
+ fn dead_function() {}
+ //~^ WARN function is never used
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/warn-by-default-lint-two-modules.stderr b/src/test/ui/lint/force-warn/warn-by-default-lint-two-modules.stderr
new file mode 100644
index 0000000..2a3cf85
--- /dev/null
+++ b/src/test/ui/lint/force-warn/warn-by-default-lint-two-modules.stderr
@@ -0,0 +1,16 @@
+warning: function is never used: `dead_function`
+ --> $DIR/warn-by-default-lint-two-modules.rs:9:8
+ |
+LL | fn dead_function() {}
+ | ^^^^^^^^^^^^^
+ |
+ = note: requested on the command line with `--force-warn dead-code`
+
+warning: function is never used: `dead_function`
+ --> $DIR/warn-by-default-lint-two-modules.rs:14:8
+ |
+LL | fn dead_function() {}
+ | ^^^^^^^^^^^^^
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/lint/force-warn/warnings-lint-group.rs b/src/test/ui/lint/force-warn/warnings-lint-group.rs
new file mode 100644
index 0000000..fa25a1f
--- /dev/null
+++ b/src/test/ui/lint/force-warn/warnings-lint-group.rs
@@ -0,0 +1,5 @@
+// --force-warn warnings is an error
+// compile-flags: --force-warn warnings -Zunstable-options
+// error-pattern: `warnings` lint group is not supported
+
+fn main() {}
diff --git a/src/test/ui/lint/force-warn/warnings-lint-group.stderr b/src/test/ui/lint/force-warn/warnings-lint-group.stderr
new file mode 100644
index 0000000..03f5788
--- /dev/null
+++ b/src/test/ui/lint/force-warn/warnings-lint-group.stderr
@@ -0,0 +1,9 @@
+error[E0602]: `warnings` lint group is not supported with ´--force-warn´
+
+error[E0602]: `warnings` lint group is not supported with ´--force-warn´
+
+error[E0602]: `warnings` lint group is not supported with ´--force-warn´
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0602`.
diff --git a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr
index efa684a..91b8d2b 100644
--- a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr
+++ b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr
@@ -10,7 +10,7 @@
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: `...` range patterns are deprecated
--> $DIR/inclusive-range-pattern-syntax.rs:16:9
@@ -19,7 +19,7 @@
| ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: 2 warnings emitted
diff --git a/src/test/ui/lint/inert-attr-macro.rs b/src/test/ui/lint/inert-attr-macro.rs
new file mode 100644
index 0000000..dc0bb8a
--- /dev/null
+++ b/src/test/ui/lint/inert-attr-macro.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+#![warn(unused)]
+
+macro_rules! foo {
+ () => {}
+}
+
+fn main() {
+ #[inline] foo!(); //~ WARN unused attribute `inline`
+
+ // This does nothing, since `#[allow(warnings)]` is itself
+ // an inert attribute on a macro call
+ #[allow(warnings)] #[inline] foo!(); //~ WARN unused attribute `allow`
+ //~^ WARN unused attribute `inline`
+
+ // This does work, since the attribute is on a parent
+ // of the macro invocation.
+ #[allow(warnings)] { #[inline] foo!(); }
+}
diff --git a/src/test/ui/lint/inert-attr-macro.stderr b/src/test/ui/lint/inert-attr-macro.stderr
new file mode 100644
index 0000000..3b3aa5d
--- /dev/null
+++ b/src/test/ui/lint/inert-attr-macro.stderr
@@ -0,0 +1,44 @@
+warning: unused attribute `inline`
+ --> $DIR/inert-attr-macro.rs:10:5
+ |
+LL | #[inline] foo!();
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/inert-attr-macro.rs:3:9
+ |
+LL | #![warn(unused)]
+ | ^^^^^^
+ = note: `#[warn(unused_attributes)]` implied by `#[warn(unused)]`
+note: the built-in attribute `inline` will be ignored, since it's applied to the macro invocation `foo`
+ --> $DIR/inert-attr-macro.rs:10:15
+ |
+LL | #[inline] foo!();
+ | ^^^
+
+warning: unused attribute `allow`
+ --> $DIR/inert-attr-macro.rs:14:5
+ |
+LL | #[allow(warnings)] #[inline] foo!();
+ | ^^^^^^^^^^^^^^^^^^
+ |
+note: the built-in attribute `allow` will be ignored, since it's applied to the macro invocation `foo`
+ --> $DIR/inert-attr-macro.rs:14:34
+ |
+LL | #[allow(warnings)] #[inline] foo!();
+ | ^^^
+
+warning: unused attribute `inline`
+ --> $DIR/inert-attr-macro.rs:14:24
+ |
+LL | #[allow(warnings)] #[inline] foo!();
+ | ^^^^^^^^^
+ |
+note: the built-in attribute `inline` will be ignored, since it's applied to the macro invocation `foo`
+ --> $DIR/inert-attr-macro.rs:14:34
+ |
+LL | #[allow(warnings)] #[inline] foo!();
+ | ^^^
+
+warning: 3 warnings emitted
+
diff --git a/src/test/ui/lint/inline-trait-and-foreign-items.full_tait.stderr b/src/test/ui/lint/inline-trait-and-foreign-items.full_tait.stderr
deleted file mode 100644
index 65b4631..0000000
--- a/src/test/ui/lint/inline-trait-and-foreign-items.full_tait.stderr
+++ /dev/null
@@ -1,81 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/inline-trait-and-foreign-items.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: `#[inline]` is ignored on constants
- --> $DIR/inline-trait-and-foreign-items.rs:10:5
- |
-LL | #[inline]
- | ^^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/inline-trait-and-foreign-items.rs:7:9
- |
-LL | #![warn(unused_attributes)]
- | ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:14:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type T;
- | ------- not a function or closure
-
-warning: `#[inline]` is ignored on constants
- --> $DIR/inline-trait-and-foreign-items.rs:21:5
- |
-LL | #[inline]
- | ^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:25:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type T = Self;
- | -------------- not a function or closure
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:28:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type U = impl Trait;
- | -------------------- not a function or closure
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:33:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | static X: u32;
- | -------------- not a function or closure
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:36:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type T;
- | ------- not a function or closure
-
-error: could not find defining uses
- --> $DIR/inline-trait-and-foreign-items.rs:29:14
- |
-LL | type U = impl Trait;
- | ^^^^^^^^^^
-
-error: aborting due to 6 previous errors; 3 warnings emitted
-
-For more information about this error, try `rustc --explain E0518`.
diff --git a/src/test/ui/lint/inline-trait-and-foreign-items.min_tait.stderr b/src/test/ui/lint/inline-trait-and-foreign-items.min_tait.stderr
deleted file mode 100644
index b9f1239..0000000
--- a/src/test/ui/lint/inline-trait-and-foreign-items.min_tait.stderr
+++ /dev/null
@@ -1,72 +0,0 @@
-warning: `#[inline]` is ignored on constants
- --> $DIR/inline-trait-and-foreign-items.rs:10:5
- |
-LL | #[inline]
- | ^^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/inline-trait-and-foreign-items.rs:7:9
- |
-LL | #![warn(unused_attributes)]
- | ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:14:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type T;
- | ------- not a function or closure
-
-warning: `#[inline]` is ignored on constants
- --> $DIR/inline-trait-and-foreign-items.rs:21:5
- |
-LL | #[inline]
- | ^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:25:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type T = Self;
- | -------------- not a function or closure
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:28:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type U = impl Trait;
- | -------------------- not a function or closure
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:33:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | static X: u32;
- | -------------- not a function or closure
-
-error[E0518]: attribute should be applied to function or closure
- --> $DIR/inline-trait-and-foreign-items.rs:36:5
- |
-LL | #[inline]
- | ^^^^^^^^^
-LL | type T;
- | ------- not a function or closure
-
-error: could not find defining uses
- --> $DIR/inline-trait-and-foreign-items.rs:29:14
- |
-LL | type U = impl Trait;
- | ^^^^^^^^^^
-
-error: aborting due to 6 previous errors; 2 warnings emitted
-
-For more information about this error, try `rustc --explain E0518`.
diff --git a/src/test/ui/lint/inline-trait-and-foreign-items.rs b/src/test/ui/lint/inline-trait-and-foreign-items.rs
index 3103cc9..6321b3c 100644
--- a/src/test/ui/lint/inline-trait-and-foreign-items.rs
+++ b/src/test/ui/lint/inline-trait-and-foreign-items.rs
@@ -1,8 +1,5 @@
#![feature(extern_types)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![warn(unused_attributes)]
diff --git a/src/test/ui/lint/inline-trait-and-foreign-items.stderr b/src/test/ui/lint/inline-trait-and-foreign-items.stderr
new file mode 100644
index 0000000..6ac884c
--- /dev/null
+++ b/src/test/ui/lint/inline-trait-and-foreign-items.stderr
@@ -0,0 +1,72 @@
+warning: `#[inline]` is ignored on constants
+ --> $DIR/inline-trait-and-foreign-items.rs:7:5
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/inline-trait-and-foreign-items.rs:4:9
+ |
+LL | #![warn(unused_attributes)]
+ | ^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
+
+error[E0518]: attribute should be applied to function or closure
+ --> $DIR/inline-trait-and-foreign-items.rs:11:5
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+LL | type T;
+ | ------- not a function or closure
+
+warning: `#[inline]` is ignored on constants
+ --> $DIR/inline-trait-and-foreign-items.rs:18:5
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
+
+error[E0518]: attribute should be applied to function or closure
+ --> $DIR/inline-trait-and-foreign-items.rs:22:5
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+LL | type T = Self;
+ | -------------- not a function or closure
+
+error[E0518]: attribute should be applied to function or closure
+ --> $DIR/inline-trait-and-foreign-items.rs:25:5
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+LL | type U = impl Trait;
+ | -------------------- not a function or closure
+
+error[E0518]: attribute should be applied to function or closure
+ --> $DIR/inline-trait-and-foreign-items.rs:30:5
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+LL | static X: u32;
+ | -------------- not a function or closure
+
+error[E0518]: attribute should be applied to function or closure
+ --> $DIR/inline-trait-and-foreign-items.rs:33:5
+ |
+LL | #[inline]
+ | ^^^^^^^^^
+LL | type T;
+ | ------- not a function or closure
+
+error: could not find defining uses
+ --> $DIR/inline-trait-and-foreign-items.rs:26:14
+ |
+LL | type U = impl Trait;
+ | ^^^^^^^^^^
+
+error: aborting due to 6 previous errors; 2 warnings emitted
+
+For more information about this error, try `rustc --explain E0518`.
diff --git a/src/test/ui/lint/issue-31924-non-snake-ffi.rs b/src/test/ui/lint/issue-31924-non-snake-ffi.rs
index 63e42b48..5b9faca 100644
--- a/src/test/ui/lint/issue-31924-non-snake-ffi.rs
+++ b/src/test/ui/lint/issue-31924-non-snake-ffi.rs
@@ -5,4 +5,11 @@
#[no_mangle]
pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
+pub struct Foo;
+
+impl Foo {
+ #[no_mangle]
+ pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
+}
+
fn main() {}
diff --git a/src/test/ui/lint/issue-67691-unused-field-in-or-pattern.stderr b/src/test/ui/lint/issue-67691-unused-field-in-or-pattern.stderr
deleted file mode 100644
index 8aefe24..0000000
--- a/src/test/ui/lint/issue-67691-unused-field-in-or-pattern.stderr
+++ /dev/null
@@ -1,74 +0,0 @@
-error: unused variable: `j`
- --> $DIR/issue-67691-unused-field-in-or-pattern.rs:20:16
- |
-LL | A { i, j } | B { i, j } => {
- | ^ ^
- |
-note: the lint level is defined here
- --> $DIR/issue-67691-unused-field-in-or-pattern.rs:4:9
- |
-LL | #![deny(unused)]
- | ^^^^^^
- = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
-help: try ignoring the field
- |
-LL | A { i, j: _ } | B { i, j: _ } => {
- | ^^^^ ^^^^
-
-error: unused variable: `j`
- --> $DIR/issue-67691-unused-field-in-or-pattern.rs:30:16
- |
-LL | A { i, ref j } | B { i, ref j } => {
- | ^^^^^ ^^^^^
- |
-help: try ignoring the field
- |
-LL | A { i, j: _ } | B { i, j: _ } => {
- | ^^^^ ^^^^
-
-error: unused variable: `j`
- --> $DIR/issue-67691-unused-field-in-or-pattern.rs:40:21
- |
-LL | Some(A { i, j } | B { i, j }) => {
- | ^ ^
- |
-help: try ignoring the field
- |
-LL | Some(A { i, j: _ } | B { i, j: _ }) => {
- | ^^^^ ^^^^
-
-error: unused variable: `j`
- --> $DIR/issue-67691-unused-field-in-or-pattern.rs:52:21
- |
-LL | Some(A { i, ref j } | B { i, ref j }) => {
- | ^^^^^ ^^^^^
- |
-help: try ignoring the field
- |
-LL | Some(A { i, j: _ } | B { i, j: _ }) => {
- | ^^^^ ^^^^
-
-error: unused variable: `i`
- --> $DIR/issue-67691-unused-field-in-or-pattern.rs:62:24
- |
-LL | MixedEnum::A { i } | MixedEnum::B(i) => {
- | ^ ^
- |
-help: try ignoring the field
- |
-LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => {
- | ^^^^ ^
-
-error: unused variable: `i`
- --> $DIR/issue-67691-unused-field-in-or-pattern.rs:70:24
- |
-LL | MixedEnum::A { ref i } | MixedEnum::B(ref i) => {
- | ^^^^^ ^^^^^
- |
-help: try ignoring the field
- |
-LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => {
- | ^^^^ ^
-
-error: aborting due to 6 previous errors
-
diff --git a/src/test/ui/lint/lint-ctypes-73249-2.full_tait.stderr b/src/test/ui/lint/lint-ctypes-73249-2.full_tait.stderr
deleted file mode 100644
index 619ca15..0000000
--- a/src/test/ui/lint/lint-ctypes-73249-2.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/lint-ctypes-73249-2.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73249-2.rs:29:25
- |
-LL | pub fn lint_me() -> A<()>;
- | ^^^^^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73249-2.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/lint/lint-ctypes-73249-2.min_tait.stderr b/src/test/ui/lint/lint-ctypes-73249-2.min_tait.stderr
deleted file mode 100644
index 479bd57..0000000
--- a/src/test/ui/lint/lint-ctypes-73249-2.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73249-2.rs:29:25
- |
-LL | pub fn lint_me() -> A<()>;
- | ^^^^^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73249-2.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lint/lint-ctypes-73249-2.rs b/src/test/ui/lint/lint-ctypes-73249-2.rs
index f3313f8..fe578f5 100644
--- a/src/test/ui/lint/lint-ctypes-73249-2.rs
+++ b/src/test/ui/lint/lint-ctypes-73249-2.rs
@@ -1,12 +1,9 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
-pub trait Baz { }
+pub trait Baz {}
-impl Baz for () { }
+impl Baz for () {}
type Qux = impl Baz;
diff --git a/src/test/ui/lint/lint-ctypes-73249-2.stderr b/src/test/ui/lint/lint-ctypes-73249-2.stderr
new file mode 100644
index 0000000..36dbe32
--- /dev/null
+++ b/src/test/ui/lint/lint-ctypes-73249-2.stderr
@@ -0,0 +1,15 @@
+error: `extern` block uses type `impl Baz`, which is not FFI-safe
+ --> $DIR/lint-ctypes-73249-2.rs:26:25
+ |
+LL | pub fn lint_me() -> A<()>;
+ | ^^^^^ not FFI-safe
+ |
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-73249-2.rs:2:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
+ = note: opaque types have no C equivalent
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/lint-ctypes-73249-3.full_tait.stderr b/src/test/ui/lint/lint-ctypes-73249-3.full_tait.stderr
deleted file mode 100644
index af0f26a..0000000
--- a/src/test/ui/lint/lint-ctypes-73249-3.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/lint-ctypes-73249-3.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73249-3.rs:21:25
- |
-LL | pub fn lint_me() -> A;
- | ^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73249-3.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/lint/lint-ctypes-73249-3.min_tait.stderr b/src/test/ui/lint/lint-ctypes-73249-3.min_tait.stderr
deleted file mode 100644
index 880581f..0000000
--- a/src/test/ui/lint/lint-ctypes-73249-3.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73249-3.rs:21:25
- |
-LL | pub fn lint_me() -> A;
- | ^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73249-3.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lint/lint-ctypes-73249-3.rs b/src/test/ui/lint/lint-ctypes-73249-3.rs
index 966c7d5..ec12de0 100644
--- a/src/test/ui/lint/lint-ctypes-73249-3.rs
+++ b/src/test/ui/lint/lint-ctypes-73249-3.rs
@@ -1,16 +1,15 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
-pub trait Baz { }
+pub trait Baz {}
-impl Baz for u32 { }
+impl Baz for u32 {}
type Qux = impl Baz;
-fn assign() -> Qux { 3 }
+fn assign() -> Qux {
+ 3
+}
#[repr(C)]
pub struct A {
diff --git a/src/test/ui/lint/lint-ctypes-73249-3.stderr b/src/test/ui/lint/lint-ctypes-73249-3.stderr
new file mode 100644
index 0000000..e987ec9
--- /dev/null
+++ b/src/test/ui/lint/lint-ctypes-73249-3.stderr
@@ -0,0 +1,15 @@
+error: `extern` block uses type `impl Baz`, which is not FFI-safe
+ --> $DIR/lint-ctypes-73249-3.rs:20:25
+ |
+LL | pub fn lint_me() -> A;
+ | ^ not FFI-safe
+ |
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-73249-3.rs:2:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
+ = note: opaque types have no C equivalent
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/lint-ctypes-73249-5.full_tait.stderr b/src/test/ui/lint/lint-ctypes-73249-5.full_tait.stderr
deleted file mode 100644
index b80084f..0000000
--- a/src/test/ui/lint/lint-ctypes-73249-5.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/lint-ctypes-73249-5.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73249-5.rs:21:25
- |
-LL | pub fn lint_me() -> A;
- | ^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73249-5.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/lint/lint-ctypes-73249-5.min_tait.stderr b/src/test/ui/lint/lint-ctypes-73249-5.min_tait.stderr
deleted file mode 100644
index f42549d..0000000
--- a/src/test/ui/lint/lint-ctypes-73249-5.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73249-5.rs:21:25
- |
-LL | pub fn lint_me() -> A;
- | ^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73249-5.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lint/lint-ctypes-73249-5.rs b/src/test/ui/lint/lint-ctypes-73249-5.rs
index 81979a9..58c2d7a 100644
--- a/src/test/ui/lint/lint-ctypes-73249-5.rs
+++ b/src/test/ui/lint/lint-ctypes-73249-5.rs
@@ -1,16 +1,15 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
-pub trait Baz { }
+pub trait Baz {}
-impl Baz for u32 { }
+impl Baz for u32 {}
type Qux = impl Baz;
-fn assign() -> Qux { 3 }
+fn assign() -> Qux {
+ 3
+}
#[repr(transparent)]
pub struct A {
diff --git a/src/test/ui/lint/lint-ctypes-73249-5.stderr b/src/test/ui/lint/lint-ctypes-73249-5.stderr
new file mode 100644
index 0000000..749714c
--- /dev/null
+++ b/src/test/ui/lint/lint-ctypes-73249-5.stderr
@@ -0,0 +1,15 @@
+error: `extern` block uses type `impl Baz`, which is not FFI-safe
+ --> $DIR/lint-ctypes-73249-5.rs:20:25
+ |
+LL | pub fn lint_me() -> A;
+ | ^ not FFI-safe
+ |
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-73249-5.rs:2:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
+ = note: opaque types have no C equivalent
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/lint-ctypes-73251-1.full_tait.stderr b/src/test/ui/lint/lint-ctypes-73251-1.full_tait.stderr
deleted file mode 100644
index 5610230..0000000
--- a/src/test/ui/lint/lint-ctypes-73251-1.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/lint-ctypes-73251-1.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73251-1.rs:24:25
- |
-LL | pub fn lint_me() -> <u32 as Foo>::Assoc;
- | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73251-1.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/lint/lint-ctypes-73251-1.min_tait.stderr b/src/test/ui/lint/lint-ctypes-73251-1.min_tait.stderr
deleted file mode 100644
index 5b00fc4..0000000
--- a/src/test/ui/lint/lint-ctypes-73251-1.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: `extern` block uses type `impl Baz`, which is not FFI-safe
- --> $DIR/lint-ctypes-73251-1.rs:24:25
- |
-LL | pub fn lint_me() -> <u32 as Foo>::Assoc;
- | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73251-1.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lint/lint-ctypes-73251-1.rs b/src/test/ui/lint/lint-ctypes-73251-1.rs
index 3f15a2f..dc4c7ef 100644
--- a/src/test/ui/lint/lint-ctypes-73251-1.rs
+++ b/src/test/ui/lint/lint-ctypes-73251-1.rs
@@ -1,12 +1,9 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
-pub trait Baz { }
+pub trait Baz {}
-impl Baz for u32 { }
+impl Baz for u32 {}
type Qux = impl Baz;
@@ -18,7 +15,9 @@
type Assoc = Qux;
}
-fn assign() -> Qux { 1 }
+fn assign() -> Qux {
+ 1
+}
extern "C" {
pub fn lint_me() -> <u32 as Foo>::Assoc; //~ ERROR: uses type `impl Baz`
diff --git a/src/test/ui/lint/lint-ctypes-73251-1.stderr b/src/test/ui/lint/lint-ctypes-73251-1.stderr
new file mode 100644
index 0000000..505ccd5
--- /dev/null
+++ b/src/test/ui/lint/lint-ctypes-73251-1.stderr
@@ -0,0 +1,15 @@
+error: `extern` block uses type `impl Baz`, which is not FFI-safe
+ --> $DIR/lint-ctypes-73251-1.rs:23:25
+ |
+LL | pub fn lint_me() -> <u32 as Foo>::Assoc;
+ | ^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-73251-1.rs:2:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
+ = note: opaque types have no C equivalent
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/lint-ctypes-73251-2.full_tait.stderr b/src/test/ui/lint/lint-ctypes-73251-2.full_tait.stderr
deleted file mode 100644
index 1991126..0000000
--- a/src/test/ui/lint/lint-ctypes-73251-2.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/lint-ctypes-73251-2.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `extern` block uses type `impl TraitA`, which is not FFI-safe
- --> $DIR/lint-ctypes-73251-2.rs:32:25
- |
-LL | pub fn lint_me() -> <AliasB as TraitB>::Assoc;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73251-2.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/lint/lint-ctypes-73251-2.min_tait.stderr b/src/test/ui/lint/lint-ctypes-73251-2.min_tait.stderr
deleted file mode 100644
index 4130ee7..0000000
--- a/src/test/ui/lint/lint-ctypes-73251-2.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: `extern` block uses type `impl TraitA`, which is not FFI-safe
- --> $DIR/lint-ctypes-73251-2.rs:32:25
- |
-LL | pub fn lint_me() -> <AliasB as TraitB>::Assoc;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/lint-ctypes-73251-2.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lint/lint-ctypes-73251-2.rs b/src/test/ui/lint/lint-ctypes-73251-2.rs
index 888671d..79effd0 100644
--- a/src/test/ui/lint/lint-ctypes-73251-2.rs
+++ b/src/test/ui/lint/lint-ctypes-73251-2.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
pub trait TraitA {
@@ -16,7 +13,10 @@
type Assoc;
}
-impl<T> TraitB for T where T: TraitA {
+impl<T> TraitB for T
+where
+ T: TraitA,
+{
type Assoc = <T as TraitA>::Assoc;
}
@@ -24,9 +24,13 @@
type AliasB = impl TraitB<Assoc = AliasA>;
-fn use_of_a() -> AliasA { 3 }
+fn use_of_a() -> AliasA {
+ 3
+}
-fn use_of_b() -> AliasB { 3 }
+fn use_of_b() -> AliasB {
+ 3
+}
extern "C" {
pub fn lint_me() -> <AliasB as TraitB>::Assoc; //~ ERROR: uses type `impl TraitA`
diff --git a/src/test/ui/lint/lint-ctypes-73251-2.stderr b/src/test/ui/lint/lint-ctypes-73251-2.stderr
new file mode 100644
index 0000000..94ee95d
--- /dev/null
+++ b/src/test/ui/lint/lint-ctypes-73251-2.stderr
@@ -0,0 +1,15 @@
+error: `extern` block uses type `impl TraitA`, which is not FFI-safe
+ --> $DIR/lint-ctypes-73251-2.rs:36:25
+ |
+LL | pub fn lint_me() -> <AliasB as TraitB>::Assoc;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
+ |
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-73251-2.rs:2:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
+ = note: opaque types have no C equivalent
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/lint-ctypes-73251.full_tait.stderr b/src/test/ui/lint/lint-ctypes-73251.full_tait.stderr
deleted file mode 100644
index 577cf6c..0000000
--- a/src/test/ui/lint/lint-ctypes-73251.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/lint-ctypes-73251.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/lint/lint-ctypes-73251.rs b/src/test/ui/lint/lint-ctypes-73251.rs
index 36e5416..ebc2ca7 100644
--- a/src/test/ui/lint/lint-ctypes-73251.rs
+++ b/src/test/ui/lint/lint-ctypes-73251.rs
@@ -1,9 +1,6 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
pub trait Foo {
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-bool.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-bool.rs
new file mode 100644
index 0000000..15ceb61
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-bool.rs
@@ -0,0 +1,28 @@
+// only-x86_64
+use std::sync::atomic::{AtomicBool, Ordering};
+
+fn main() {
+ let x = AtomicBool::new(true);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Allowed store ordering modes
+ x.store(false, Ordering::Release);
+ x.store(false, Ordering::SeqCst);
+ x.store(false, Ordering::Relaxed);
+
+ // Disallowed store ordering modes
+ x.store(false, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(false, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr
new file mode 100644
index 0000000..2a1847b
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr
@@ -0,0 +1,35 @@
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-bool.rs:13:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-bool.rs:15:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-bool.rs:24:20
+ |
+LL | x.store(false, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-bool.rs:26:20
+ |
+LL | x.store(false, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.rs
new file mode 100644
index 0000000..c79c1da
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.rs
@@ -0,0 +1,62 @@
+// only-x86_64
+use std::sync::atomic::{AtomicPtr, Ordering};
+
+fn main() {
+ let ptr = &mut 5;
+ let ptr2 = &mut 10;
+ // `compare_exchange_weak` testing
+ let x = AtomicPtr::new(ptr);
+
+ // Allowed ordering combos
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Relaxed);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Acquire);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Relaxed);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Release, Ordering::Relaxed);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Acquire);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Relaxed);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Relaxed);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Acquire);
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::SeqCst);
+
+ // AcqRel is always forbidden as a failure ordering
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Relaxed, Ordering::AcqRel);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::AcqRel);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::AcqRel);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::AcqRel);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::SeqCst, Ordering::AcqRel);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+
+ // Release is always forbidden as a failure ordering
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Release);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Release);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Release, Ordering::Release);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Release);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Release);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+
+ // Release success order forbids failure order of Acquire or SeqCst
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::Acquire);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be stronger
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::SeqCst);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be stronger
+
+ // Relaxed success order also forbids failure order of Acquire or SeqCst
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::SeqCst);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be stronger
+ let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Acquire);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be stronger
+
+ // Acquire/AcqRel forbids failure order of SeqCst
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::SeqCst);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be stronger
+ let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::SeqCst);
+ //~^ ERROR compare_exchange_weak's failure ordering may not be stronger
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr
new file mode 100644
index 0000000..13350ab
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr
@@ -0,0 +1,131 @@
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:22:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Relaxed, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:24:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:26:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:28:66
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:30:66
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::SeqCst, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:34:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:36:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Acquire, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:38:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Release, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:40:66
+ |
+LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::AcqRel, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:42:66
+ |
+LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::SeqCst, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be stronger than the success ordering of `Release`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:46:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be stronger than the success ordering of `Release`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:48:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Release, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be stronger than the success ordering of `Relaxed`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:52:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be stronger than the success ordering of `Relaxed`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:54:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr, ptr2, Ordering::Relaxed, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be stronger than the success ordering of `Acquire`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:58:67
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Acquire, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange_weak's failure ordering may not be stronger than the success ordering of `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:60:66
+ |
+LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::AcqRel, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: aborting due to 16 previous errors
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.rs
new file mode 100644
index 0000000..8ef3a40
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.rs
@@ -0,0 +1,60 @@
+// only-x86_64
+use std::sync::atomic::{AtomicUsize, Ordering};
+
+fn main() {
+ // `compare_exchange` (not weak) testing
+ let x = AtomicUsize::new(0);
+
+ // Allowed ordering combos
+ let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Relaxed);
+ let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Acquire);
+ let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Relaxed);
+ let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Relaxed);
+ let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Acquire);
+ let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Relaxed);
+ let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Relaxed);
+ let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Acquire);
+ let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::SeqCst);
+
+ // AcqRel is always forbidden as a failure ordering
+ let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::AcqRel);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::AcqRel);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::AcqRel);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::AcqRel);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::AcqRel);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+
+ // Release is always forbidden as a failure ordering
+ let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Release);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Release);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Release);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Release);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Release);
+ //~^ ERROR compare_exchange's failure ordering may not be `Release` or `AcqRel`
+
+ // Release success order forbids failure order of Acquire or SeqCst
+ let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Acquire);
+ //~^ ERROR compare_exchange's failure ordering may not be stronger
+ let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::SeqCst);
+ //~^ ERROR compare_exchange's failure ordering may not be stronger
+
+ // Relaxed success order also forbids failure order of Acquire or SeqCst
+ let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::SeqCst);
+ //~^ ERROR compare_exchange's failure ordering may not be stronger
+ let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Acquire);
+ //~^ ERROR compare_exchange's failure ordering may not be stronger
+
+ // Acquire/AcqRel forbids failure order of SeqCst
+ let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::SeqCst);
+ //~^ ERROR compare_exchange's failure ordering may not be stronger
+ let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::SeqCst);
+ //~^ ERROR compare_exchange's failure ordering may not be stronger
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr
new file mode 100644
index 0000000..daedfec
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr
@@ -0,0 +1,131 @@
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:20:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:22:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:24:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:26:56
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:28:56
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:32:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:34:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:36:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:38:56
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:40:56
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::SeqCst, Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be stronger than the success ordering of `Release`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:44:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be stronger than the success ordering of `Release`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:46:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Release, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be stronger than the success ordering of `Relaxed`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:50:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be stronger than the success ordering of `Relaxed`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:52:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be stronger than the success ordering of `Acquire`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:56:57
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::Acquire, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: compare_exchange's failure ordering may not be stronger than the success ordering of `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-exchange.rs:58:56
+ |
+LL | let _ = x.compare_exchange(0, 0, Ordering::AcqRel, Ordering::SeqCst);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: aborting due to 16 previous errors
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-false-positive.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-false-positive.rs
new file mode 100644
index 0000000..4fb8605
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-false-positive.rs
@@ -0,0 +1,18 @@
+// only-x86_64
+// check-pass
+use std::sync::atomic::{AtomicUsize, Ordering};
+
+trait Foo {
+ fn store(self, ordering: Ordering);
+}
+
+impl Foo for AtomicUsize {
+ fn store(self, _ordering: Ordering) {
+ AtomicUsize::store(&self, 4, Ordering::SeqCst);
+ }
+}
+
+fn main() {
+ let x = AtomicUsize::new(3);
+ x.store(Ordering::Acquire);
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-fence.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-fence.rs
new file mode 100644
index 0000000..2203447
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-fence.rs
@@ -0,0 +1,21 @@
+// only-x86_64
+use std::sync::atomic::{compiler_fence, fence, Ordering};
+
+fn main() {
+ // Allowed ordering modes
+ fence(Ordering::Acquire);
+ fence(Ordering::Release);
+ fence(Ordering::AcqRel);
+ fence(Ordering::SeqCst);
+
+ compiler_fence(Ordering::Acquire);
+ compiler_fence(Ordering::Release);
+ compiler_fence(Ordering::AcqRel);
+ compiler_fence(Ordering::SeqCst);
+
+ // Disallowed ordering modes
+ fence(Ordering::Relaxed);
+ //~^ ERROR memory fences cannot have `Relaxed` ordering
+ compiler_fence(Ordering::Relaxed);
+ //~^ ERROR memory fences cannot have `Relaxed` ordering
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr
new file mode 100644
index 0000000..e0741ff
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr
@@ -0,0 +1,19 @@
+error: memory fences cannot have `Relaxed` ordering
+ --> $DIR/lint-invalid-atomic-ordering-fence.rs:17:11
+ |
+LL | fence(Ordering::Relaxed);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering modes `Acquire`, `Release`, `AcqRel` or `SeqCst`
+
+error: memory fences cannot have `Relaxed` ordering
+ --> $DIR/lint-invalid-atomic-ordering-fence.rs:19:20
+ |
+LL | compiler_fence(Ordering::Relaxed);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `Release`, `AcqRel` or `SeqCst`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.rs
new file mode 100644
index 0000000..938ca03
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.rs
@@ -0,0 +1,60 @@
+// only-x86_64
+use std::sync::atomic::{AtomicIsize, Ordering};
+
+fn main() {
+ // `fetch_update` testing
+ let x = AtomicIsize::new(0);
+
+ // Allowed ordering combos
+ let _ = x.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::Acquire, Ordering::Acquire, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::Acquire, Ordering::Relaxed, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::Release, Ordering::Relaxed, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::AcqRel, Ordering::Acquire, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::AcqRel, Ordering::Relaxed, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::SeqCst, Ordering::Relaxed, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::SeqCst, Ordering::Acquire, |old| Some(old + 1));
+ let _ = x.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |old| Some(old + 1));
+
+ // AcqRel is always forbidden as a failure ordering
+ let _ = x.fetch_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::Release, Ordering::AcqRel, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+
+ // Release is always forbidden as a failure ordering
+ let _ = x.fetch_update(Ordering::Relaxed, Ordering::Release, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::Acquire, Ordering::Release, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::Release, Ordering::Release, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::AcqRel, Ordering::Release, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+ let _ = x.fetch_update(Ordering::SeqCst, Ordering::Release, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be `Release` or `AcqRel`
+
+ // Release success order forbids failure order of Acquire or SeqCst
+ let _ = x.fetch_update(Ordering::Release, Ordering::Acquire, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be stronger
+ let _ = x.fetch_update(Ordering::Release, Ordering::SeqCst, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be stronger
+
+ // Relaxed success order also forbids failure order of Acquire or SeqCst
+ let _ = x.fetch_update(Ordering::Relaxed, Ordering::SeqCst, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be stronger
+ let _ = x.fetch_update(Ordering::Relaxed, Ordering::Acquire, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be stronger
+
+ // Acquire/AcqRel forbids failure order of SeqCst
+ let _ = x.fetch_update(Ordering::Acquire, Ordering::SeqCst, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be stronger
+ let _ = x.fetch_update(Ordering::AcqRel, Ordering::SeqCst, |old| Some(old + 1));
+ //~^ ERROR fetch_update's failure ordering may not be stronger
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr
new file mode 100644
index 0000000..dabc1da
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr
@@ -0,0 +1,131 @@
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:20:47
+ |
+LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:22:47
+ |
+LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::AcqRel, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:24:47
+ |
+LL | let _ = x.fetch_update(Ordering::Release, Ordering::AcqRel, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:26:46
+ |
+LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::AcqRel, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:28:46
+ |
+LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::AcqRel, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:32:47
+ |
+LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::Release, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:34:47
+ |
+LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::Release, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:36:47
+ |
+LL | let _ = x.fetch_update(Ordering::Release, Ordering::Release, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:38:46
+ |
+LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::Release, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: fetch_update's failure ordering may not be `Release` or `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:40:46
+ |
+LL | let _ = x.fetch_update(Ordering::SeqCst, Ordering::Release, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed` instead
+
+error: fetch_update's failure ordering may not be stronger than the success ordering of `Release`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:44:47
+ |
+LL | let _ = x.fetch_update(Ordering::Release, Ordering::Acquire, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be stronger than the success ordering of `Release`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:46:47
+ |
+LL | let _ = x.fetch_update(Ordering::Release, Ordering::SeqCst, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be stronger than the success ordering of `Relaxed`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:50:47
+ |
+LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::SeqCst, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be stronger than the success ordering of `Relaxed`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:52:47
+ |
+LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::Acquire, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering mode `Relaxed` instead
+
+error: fetch_update's failure ordering may not be stronger than the success ordering of `Acquire`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:56:47
+ |
+LL | let _ = x.fetch_update(Ordering::Acquire, Ordering::SeqCst, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: fetch_update's failure ordering may not be stronger than the success ordering of `AcqRel`
+ --> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:58:46
+ |
+LL | let _ = x.fetch_update(Ordering::AcqRel, Ordering::SeqCst, |old| Some(old + 1));
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire` or `Relaxed` instead
+
+error: aborting due to 16 previous errors
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-int.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-int.rs
new file mode 100644
index 0000000..462c967
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-int.rs
@@ -0,0 +1,130 @@
+// FIXME: add support for `// only-atomic` to compiletest/header.rs
+// only-x86_64
+use std::sync::atomic::{AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, Ordering};
+
+fn main() {
+ // `AtomicI8` test cases
+ let x = AtomicI8::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicI16` test cases
+ let x = AtomicI16::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicI32` test cases
+ let x = AtomicI32::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicI64` test cases
+ let x = AtomicI64::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicIsize` test cases
+ let x = AtomicIsize::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr
new file mode 100644
index 0000000..dfd9990
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr
@@ -0,0 +1,163 @@
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:20:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:22:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:26:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:28:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:45:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:47:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:51:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:53:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:70:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:72:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:76:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:78:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:95:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:97:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:101:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:103:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:120:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:122:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:126:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-int.rs:128:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: aborting due to 20 previous errors
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.rs
new file mode 100644
index 0000000..984f7ed
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.rs
@@ -0,0 +1,30 @@
+// only-x86_64
+use std::sync::atomic::{AtomicPtr, Ordering};
+
+fn main() {
+ let ptr = &mut 5;
+ let other_ptr = &mut 10;
+ let x = AtomicPtr::new(ptr);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Allowed store ordering modes
+ x.store(other_ptr, Ordering::Release);
+ x.store(other_ptr, Ordering::SeqCst);
+ x.store(other_ptr, Ordering::Relaxed);
+
+ // Disallowed store ordering modes
+ x.store(other_ptr, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(other_ptr, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr
new file mode 100644
index 0000000..f00cb8e
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr
@@ -0,0 +1,35 @@
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-ptr.rs:15:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-ptr.rs:17:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-ptr.rs:26:24
+ |
+LL | x.store(other_ptr, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-ptr.rs:28:24
+ |
+LL | x.store(other_ptr, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-uint.rs b/src/test/ui/lint/lint-invalid-atomic-ordering-uint.rs
new file mode 100644
index 0000000..80ec3b9
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-uint.rs
@@ -0,0 +1,129 @@
+// only-x86_64
+use std::sync::atomic::{AtomicU16, AtomicU32, AtomicU64, AtomicU8, AtomicUsize, Ordering};
+
+fn main() {
+ // `AtomicU8` test cases
+ let x = AtomicU8::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicU16` test cases
+ let x = AtomicU16::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicU32` test cases
+ let x = AtomicU32::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicU64` test cases
+ let x = AtomicU64::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+
+ // `AtomicUsize` test cases
+ let x = AtomicUsize::new(0);
+
+ // Allowed load ordering modes
+ let _ = x.load(Ordering::Acquire);
+ let _ = x.load(Ordering::SeqCst);
+ let _ = x.load(Ordering::Relaxed);
+
+ // Allowed store ordering modes
+ x.store(1, Ordering::Release);
+ x.store(1, Ordering::SeqCst);
+ x.store(1, Ordering::Relaxed);
+
+ // Disallowed load ordering modes
+ let _ = x.load(Ordering::Release);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+ let _ = x.load(Ordering::AcqRel);
+ //~^ ERROR atomic loads cannot have `Release` or `AcqRel` ordering
+
+ // Disallowed store ordering modes
+ x.store(1, Ordering::Acquire);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+ x.store(1, Ordering::AcqRel);
+ //~^ ERROR atomic stores cannot have `Acquire` or `AcqRel` ordering
+}
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr
new file mode 100644
index 0000000..36672e4
--- /dev/null
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr
@@ -0,0 +1,163 @@
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:19:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:21:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:25:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:27:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:44:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:46:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:50:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:52:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:69:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:71:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:75:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:77:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:94:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:96:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:100:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:102:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:119:20
+ |
+LL | let _ = x.load(Ordering::Release);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic loads cannot have `Release` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:121:20
+ |
+LL | let _ = x.load(Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:125:16
+ |
+LL | x.store(1, Ordering::Acquire);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: atomic stores cannot have `Acquire` or `AcqRel` ordering
+ --> $DIR/lint-invalid-atomic-ordering-uint.rs:127:16
+ |
+LL | x.store(1, Ordering::AcqRel);
+ | ^^^^^^^^^^^^^^^^
+ |
+ = help: consider using ordering modes `Release`, `SeqCst` or `Relaxed`
+
+error: aborting due to 20 previous errors
+
diff --git a/src/test/ui/lint/lint-level-macro-def-mod.rs b/src/test/ui/lint/lint-level-macro-def-mod.rs
new file mode 100644
index 0000000..79f7d12
--- /dev/null
+++ b/src/test/ui/lint/lint-level-macro-def-mod.rs
@@ -0,0 +1,17 @@
+// This checks that exported macros lint as part of their module of origin, not
+// the root module.
+//
+// check-pass
+
+//! Top level documentation
+#![deny(missing_docs)]
+
+#[allow(missing_docs)]
+mod module {
+ #[macro_export]
+ macro_rules! hello {
+ () => ()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/lint-level-macro-def.rs b/src/test/ui/lint/lint-level-macro-def.rs
new file mode 100644
index 0000000..720f4b4
--- /dev/null
+++ b/src/test/ui/lint/lint-level-macro-def.rs
@@ -0,0 +1,17 @@
+// Checks that you can set a lint level specficially for a macro definition.
+//
+// This is a regression test for issue #59306.
+//
+// check-pass
+
+
+#[deny(missing_docs)]
+mod module {
+ #[allow(missing_docs)]
+ #[macro_export]
+ macro_rules! hello {
+ () => ()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/lint-misplaced-attr.rs b/src/test/ui/lint/lint-misplaced-attr.rs
index e5ad7a5..d06917e 100644
--- a/src/test/ui/lint/lint-misplaced-attr.rs
+++ b/src/test/ui/lint/lint-misplaced-attr.rs
@@ -4,9 +4,7 @@
#![deny(unused_attributes)]
mod a {
- #![crate_type = "bin"] //~ ERROR unused attribute
- //~^ ERROR should be in the root module
+ #![crate_type = "bin"] //~ ERROR should be in the root module
}
-#[crate_type = "bin"] fn main() {} //~ ERROR unused attribute
- //~^ ERROR should be an inner
+#[crate_type = "bin"] fn main() {} //~ ERROR should be an inner
diff --git a/src/test/ui/lint/lint-misplaced-attr.stderr b/src/test/ui/lint/lint-misplaced-attr.stderr
index 3a7ca2f..abaf462 100644
--- a/src/test/ui/lint/lint-misplaced-attr.stderr
+++ b/src/test/ui/lint/lint-misplaced-attr.stderr
@@ -1,4 +1,4 @@
-error: unused attribute
+error: crate-level attribute should be in the root module
--> $DIR/lint-misplaced-attr.rs:7:5
|
LL | #![crate_type = "bin"]
@@ -10,23 +10,11 @@
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
-error: crate-level attribute should be in the root module
- --> $DIR/lint-misplaced-attr.rs:7:5
- |
-LL | #![crate_type = "bin"]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/lint-misplaced-attr.rs:11:1
- |
-LL | #[crate_type = "bin"] fn main() {}
- | ^^^^^^^^^^^^^^^^^^^^^
-
error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/lint-misplaced-attr.rs:11:1
+ --> $DIR/lint-misplaced-attr.rs:10:1
|
LL | #[crate_type = "bin"] fn main() {}
| ^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.stderr b/src/test/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.stderr
index c179f4a..2841815 100644
--- a/src/test/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.stderr
+++ b/src/test/ui/lint/lint-non-snake-case-identifiers-suggestion-reserved.stderr
@@ -31,7 +31,7 @@
help: rename the identifier or convert it to a snake case raw identifier
|
LL | mod r#impl {}
- | ^^^^^^
+ | ~~~~~~
error: function `While` should have a snake case name
--> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4
@@ -42,7 +42,7 @@
help: rename the identifier or convert it to a snake case raw identifier
|
LL | fn r#while() {}
- | ^^^^^^^
+ | ~~~~~~~
error: variable `Mod` should have a snake case name
--> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9
@@ -53,7 +53,7 @@
help: rename the identifier or convert it to a snake case raw identifier
|
LL | let r#mod: usize = 0;
- | ^^^^^
+ | ~~~~~
error: variable `Super` should have a snake case name
--> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9
diff --git a/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs b/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs
index 527d0ea..7c45c09 100644
--- a/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs
+++ b/src/test/ui/lint/lint-nonstandard-style-unicode-1.rs
@@ -30,7 +30,7 @@
struct ヒ__χ;
//~^ ERROR type `ヒ__χ` should have an upper camel case name
-// also cannot have lowercase letter next to a underscore.
+// also cannot have lowercase letter next to an underscore.
// so this triggers the lint:
struct Hello_你好;
diff --git a/src/test/ui/lint/lint-unsafe-code.rs b/src/test/ui/lint/lint-unsafe-code.rs
index 4ac02b5..c30f21b 100644
--- a/src/test/ui/lint/lint-unsafe-code.rs
+++ b/src/test/ui/lint/lint-unsafe-code.rs
@@ -31,9 +31,33 @@
#[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` function
#[no_mangle] static FOO: u32 = 5; //~ ERROR: declaration of a `no_mangle` static
+trait AssocFnTrait {
+ fn foo();
+}
+
+struct AssocFnFoo;
+
+impl AssocFnFoo {
+ #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` method
+}
+
+impl AssocFnTrait for AssocFnFoo {
+ #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` method
+}
+
#[export_name = "bar"] fn bar() {} //~ ERROR: declaration of a function with `export_name`
#[export_name = "BAR"] static BAR: u32 = 5; //~ ERROR: declaration of a static with `export_name`
+struct AssocFnBar;
+
+impl AssocFnBar {
+ #[export_name = "bar"] fn bar() {} //~ ERROR: declaration of a method with `export_name`
+}
+
+impl AssocFnTrait for AssocFnBar {
+ #[export_name = "bar"] fn foo() {} //~ ERROR: declaration of a method with `export_name`
+}
+
unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function
unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait
unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
diff --git a/src/test/ui/lint/lint-unsafe-code.stderr b/src/test/ui/lint/lint-unsafe-code.stderr
index fc6e6c2..b6895ac 100644
--- a/src/test/ui/lint/lint-unsafe-code.stderr
+++ b/src/test/ui/lint/lint-unsafe-code.stderr
@@ -19,8 +19,24 @@
|
= note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
+error: declaration of a `no_mangle` method
+ --> $DIR/lint-unsafe-code.rs:41:5
+ |
+LL | #[no_mangle] fn foo() {}
+ | ^^^^^^^^^^^^
+ |
+ = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
+
+error: declaration of a `no_mangle` method
+ --> $DIR/lint-unsafe-code.rs:45:5
+ |
+LL | #[no_mangle] fn foo() {}
+ | ^^^^^^^^^^^^
+ |
+ = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
+
error: declaration of a function with `export_name`
- --> $DIR/lint-unsafe-code.rs:34:1
+ --> $DIR/lint-unsafe-code.rs:48:1
|
LL | #[export_name = "bar"] fn bar() {}
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -28,87 +44,103 @@
= note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
error: declaration of a static with `export_name`
- --> $DIR/lint-unsafe-code.rs:35:1
+ --> $DIR/lint-unsafe-code.rs:49:1
|
LL | #[export_name = "BAR"] static BAR: u32 = 5;
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
+error: declaration of a method with `export_name`
+ --> $DIR/lint-unsafe-code.rs:54:5
+ |
+LL | #[export_name = "bar"] fn bar() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
+
+error: declaration of a method with `export_name`
+ --> $DIR/lint-unsafe-code.rs:58:5
+ |
+LL | #[export_name = "bar"] fn foo() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
+
error: declaration of an `unsafe` function
- --> $DIR/lint-unsafe-code.rs:37:1
+ --> $DIR/lint-unsafe-code.rs:61:1
|
LL | unsafe fn baz() {}
| ^^^^^^^^^^^^^^^^^^
error: declaration of an `unsafe` trait
- --> $DIR/lint-unsafe-code.rs:38:1
+ --> $DIR/lint-unsafe-code.rs:62:1
|
LL | unsafe trait Foo {}
| ^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` trait
- --> $DIR/lint-unsafe-code.rs:39:1
+ --> $DIR/lint-unsafe-code.rs:63:1
|
LL | unsafe impl Foo for Bar {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: declaration of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:42:5
+ --> $DIR/lint-unsafe-code.rs:66:5
|
LL | unsafe fn baz(&self);
| ^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:43:5
+ --> $DIR/lint-unsafe-code.rs:67:5
|
LL | unsafe fn provided(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:44:5
- |
-LL | unsafe fn provided_override(&self) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: implementation of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:48:5
- |
-LL | unsafe fn baz(&self) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error: implementation of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:49:5
- |
-LL | unsafe fn provided_override(&self) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: implementation of an `unsafe` method
--> $DIR/lint-unsafe-code.rs:68:5
|
LL | unsafe fn provided_override(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:79:5
+ --> $DIR/lint-unsafe-code.rs:72:5
+ |
+LL | unsafe fn baz(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+
+error: implementation of an `unsafe` method
+ --> $DIR/lint-unsafe-code.rs:73:5
+ |
+LL | unsafe fn provided_override(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: implementation of an `unsafe` method
+ --> $DIR/lint-unsafe-code.rs:92:5
+ |
+LL | unsafe fn provided_override(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: implementation of an `unsafe` method
+ --> $DIR/lint-unsafe-code.rs:103:5
|
LL | unsafe fn provided(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:85:5
+ --> $DIR/lint-unsafe-code.rs:109:5
|
LL | unsafe fn provided(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: implementation of an `unsafe` method
- --> $DIR/lint-unsafe-code.rs:89:5
+ --> $DIR/lint-unsafe-code.rs:113:5
|
LL | unsafe fn baz(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^
error: usage of an `unsafe` block
- --> $DIR/lint-unsafe-code.rs:100:5
+ --> $DIR/lint-unsafe-code.rs:124:5
|
LL | unsafe {}
| ^^^^^^^^^
@@ -172,5 +204,5 @@
|
= note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 22 previous errors
+error: aborting due to 26 previous errors
diff --git a/src/test/ui/lint/missing-doc-private-macro.rs b/src/test/ui/lint/missing-doc-private-macro.rs
index 8d1d5c5..0d4332e 100644
--- a/src/test/ui/lint/missing-doc-private-macro.rs
+++ b/src/test/ui/lint/missing-doc-private-macro.rs
@@ -29,13 +29,13 @@
#[macro_export]
macro_rules! exported_to_top_level {
- //~^ ERROR missing documentation for macro
+ //~^ ERROR missing documentation for a macro
() => ()
}
}
pub macro top_level_pub_macro {
- //~^ ERROR missing documentation for macro
+ //~^ ERROR missing documentation for a macro
() => ()
}
diff --git a/src/test/ui/lint/missing-doc-private-macro.stderr b/src/test/ui/lint/missing-doc-private-macro.stderr
index a5d39fa..979b007 100644
--- a/src/test/ui/lint/missing-doc-private-macro.stderr
+++ b/src/test/ui/lint/missing-doc-private-macro.stderr
@@ -1,4 +1,4 @@
-error: missing documentation for macro
+error: missing documentation for a macro
--> $DIR/missing-doc-private-macro.rs:31:5
|
LL | macro_rules! exported_to_top_level {
@@ -10,7 +10,7 @@
LL | #![deny(missing_docs)]
| ^^^^^^^^^^^^
-error: missing documentation for macro
+error: missing documentation for a macro
--> $DIR/missing-doc-private-macro.rs:37:1
|
LL | pub macro top_level_pub_macro {
diff --git a/src/test/ui/lint/must-use-ops.stderr b/src/test/ui/lint/must-use-ops.stderr
deleted file mode 100644
index 3fb80f7..0000000
--- a/src/test/ui/lint/must-use-ops.stderr
+++ /dev/null
@@ -1,134 +0,0 @@
-warning: unused comparison that must be used
- --> $DIR/must-use-ops.rs:12:5
- |
-LL | val == 1;
- | ^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/must-use-ops.rs:5:9
- |
-LL | #![warn(unused_must_use)]
- | ^^^^^^^^^^^^^^^
-
-warning: unused comparison that must be used
- --> $DIR/must-use-ops.rs:13:5
- |
-LL | val < 1;
- | ^^^^^^^
-
-warning: unused comparison that must be used
- --> $DIR/must-use-ops.rs:14:5
- |
-LL | val <= 1;
- | ^^^^^^^^
-
-warning: unused comparison that must be used
- --> $DIR/must-use-ops.rs:15:5
- |
-LL | val != 1;
- | ^^^^^^^^
-
-warning: unused comparison that must be used
- --> $DIR/must-use-ops.rs:16:5
- |
-LL | val >= 1;
- | ^^^^^^^^
-
-warning: unused comparison that must be used
- --> $DIR/must-use-ops.rs:17:5
- |
-LL | val > 1;
- | ^^^^^^^
-
-warning: unused arithmetic operation that must be used
- --> $DIR/must-use-ops.rs:20:5
- |
-LL | val + 2;
- | ^^^^^^^
-
-warning: unused arithmetic operation that must be used
- --> $DIR/must-use-ops.rs:21:5
- |
-LL | val - 2;
- | ^^^^^^^
-
-warning: unused arithmetic operation that must be used
- --> $DIR/must-use-ops.rs:22:5
- |
-LL | val / 2;
- | ^^^^^^^
-
-warning: unused arithmetic operation that must be used
- --> $DIR/must-use-ops.rs:23:5
- |
-LL | val * 2;
- | ^^^^^^^
-
-warning: unused arithmetic operation that must be used
- --> $DIR/must-use-ops.rs:24:5
- |
-LL | val % 2;
- | ^^^^^^^
-
-warning: unused logical operation that must be used
- --> $DIR/must-use-ops.rs:27:5
- |
-LL | true && true;
- | ^^^^^^^^^^^^
-
-warning: unused logical operation that must be used
- --> $DIR/must-use-ops.rs:28:5
- |
-LL | false || true;
- | ^^^^^^^^^^^^^
-
-warning: unused bitwise operation that must be used
- --> $DIR/must-use-ops.rs:31:5
- |
-LL | 5 ^ val;
- | ^^^^^^^
-
-warning: unused bitwise operation that must be used
- --> $DIR/must-use-ops.rs:32:5
- |
-LL | 5 & val;
- | ^^^^^^^
-
-warning: unused bitwise operation that must be used
- --> $DIR/must-use-ops.rs:33:5
- |
-LL | 5 | val;
- | ^^^^^^^
-
-warning: unused bitwise operation that must be used
- --> $DIR/must-use-ops.rs:34:5
- |
-LL | 5 << val;
- | ^^^^^^^^
-
-warning: unused bitwise operation that must be used
- --> $DIR/must-use-ops.rs:35:5
- |
-LL | 5 >> val;
- | ^^^^^^^^
-
-warning: unused unary operation that must be used
- --> $DIR/must-use-ops.rs:38:5
- |
-LL | !val;
- | ^^^^
-
-warning: unused unary operation that must be used
- --> $DIR/must-use-ops.rs:39:5
- |
-LL | -val;
- | ^^^^
-
-warning: unused unary operation that must be used
- --> $DIR/must-use-ops.rs:40:5
- |
-LL | *val_pointer;
- | ^^^^^^^^^^^^
-
-warning: 21 warnings emitted
-
diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.full_tait.stderr b/src/test/ui/lint/opaque-ty-ffi-unsafe.full_tait.stderr
deleted file mode 100644
index 5433d6e..0000000
--- a/src/test/ui/lint/opaque-ty-ffi-unsafe.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/opaque-ty-ffi-unsafe.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `extern` block uses type `impl Fn<()>`, which is not FFI-safe
- --> $DIR/opaque-ty-ffi-unsafe.rs:14:17
- |
-LL | pub fn a(_: A);
- | ^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/opaque-ty-ffi-unsafe.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.min_tait.stderr b/src/test/ui/lint/opaque-ty-ffi-unsafe.min_tait.stderr
deleted file mode 100644
index 2f20912..0000000
--- a/src/test/ui/lint/opaque-ty-ffi-unsafe.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error: `extern` block uses type `impl Fn<()>`, which is not FFI-safe
- --> $DIR/opaque-ty-ffi-unsafe.rs:14:17
- |
-LL | pub fn a(_: A);
- | ^ not FFI-safe
- |
-note: the lint level is defined here
- --> $DIR/opaque-ty-ffi-unsafe.rs:5:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.rs b/src/test/ui/lint/opaque-ty-ffi-unsafe.rs
index 0e9df91..fadb747 100644
--- a/src/test/ui/lint/opaque-ty-ffi-unsafe.rs
+++ b/src/test/ui/lint/opaque-ty-ffi-unsafe.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
type A = impl Fn();
@@ -12,7 +9,7 @@
extern "C" {
pub fn a(_: A);
-//~^ ERROR `extern` block uses type `impl Fn<()>`, which is not FFI-safe
+ //~^ ERROR `extern` block uses type `impl Fn<()>`, which is not FFI-safe
}
fn main() {}
diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr b/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr
new file mode 100644
index 0000000..9d46f6d
--- /dev/null
+++ b/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr
@@ -0,0 +1,15 @@
+error: `extern` block uses type `impl Fn<()>`, which is not FFI-safe
+ --> $DIR/opaque-ty-ffi-unsafe.rs:11:17
+ |
+LL | pub fn a(_: A);
+ | ^ not FFI-safe
+ |
+note: the lint level is defined here
+ --> $DIR/opaque-ty-ffi-unsafe.rs:2:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
+ = note: opaque types have no C equivalent
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/recommend-literal.stderr b/src/test/ui/lint/recommend-literal.stderr
index b01073b..0ebcfb4 100644
--- a/src/test/ui/lint/recommend-literal.stderr
+++ b/src/test/ui/lint/recommend-literal.stderr
@@ -52,11 +52,11 @@
help: perhaps you intended to use this type
|
LL | depth: Option<i32>,
- | ^^^
+ | ~~~
help: you might be missing a type parameter
|
LL | struct Data<int> {
- | ^^^^^
+ | +++++
error[E0412]: cannot find type `short` in this scope
--> $DIR/recommend-literal.rs:33:16
diff --git a/src/test/ui/lint/renamed-lints-still-apply.stderr b/src/test/ui/lint/renamed-lints-still-apply.stderr
index 33e5a03..00ed5c8 100644
--- a/src/test/ui/lint/renamed-lints-still-apply.stderr
+++ b/src/test/ui/lint/renamed-lints-still-apply.stderr
@@ -21,8 +21,9 @@
| ^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn _foo(_x: &u32) {}
- | -- --
+LL - fn _foo<'a>(_x: &'a u32) {}
+LL + fn _foo(_x: &u32) {}
+ |
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/allow-semicolon-in-expressions-from-macros.rs b/src/test/ui/lint/semicolon-in-expressions-from-macros/allow-semicolon-in-expressions-from-macros.rs
deleted file mode 100644
index 6f9e6ec..0000000
--- a/src/test/ui/lint/semicolon-in-expressions-from-macros/allow-semicolon-in-expressions-from-macros.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// check-pass
-// Ensure that trailing semicolons are allowed by default
-
-macro_rules! foo {
- () => {
- true;
- }
-}
-
-fn main() {
- let val = match true {
- true => false,
- _ => foo!()
- };
-}
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/auxiliary/foreign-crate.rs b/src/test/ui/lint/semicolon-in-expressions-from-macros/auxiliary/foreign-crate.rs
new file mode 100644
index 0000000..781391c
--- /dev/null
+++ b/src/test/ui/lint/semicolon-in-expressions-from-macros/auxiliary/foreign-crate.rs
@@ -0,0 +1,4 @@
+#[macro_export]
+macro_rules! my_macro {
+ () => { true; }
+}
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/foreign-crate.rs b/src/test/ui/lint/semicolon-in-expressions-from-macros/foreign-crate.rs
new file mode 100644
index 0000000..3745063
--- /dev/null
+++ b/src/test/ui/lint/semicolon-in-expressions-from-macros/foreign-crate.rs
@@ -0,0 +1,9 @@
+// aux-build:foreign-crate.rs
+// check-pass
+
+extern crate foreign_crate;
+
+// Test that we do not lint for a macro in a foreign crate
+fn main() {
+ let _ = foreign_crate::my_macro!();
+}
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr b/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr
index c00c3d7..84ad32b 100644
--- a/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr
+++ b/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr
@@ -14,6 +14,8 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: macro invocations at the end of a block are treated as expressions
+ = note: to ignore the value produced by the macro, add a semicolon after the invocation of `foo`
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: trailing semicolon in macro used in expression position
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.rs b/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.rs
new file mode 100644
index 0000000..2c63311
--- /dev/null
+++ b/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.rs
@@ -0,0 +1,16 @@
+// check-pass
+// Ensure that trailing semicolons cause warnings by default
+
+macro_rules! foo {
+ () => {
+ true; //~ WARN trailing semicolon in macro
+ //~| WARN this was previously
+ }
+}
+
+fn main() {
+ let _val = match true {
+ true => false,
+ _ => foo!()
+ };
+}
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr b/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr
new file mode 100644
index 0000000..d770a8c
--- /dev/null
+++ b/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr
@@ -0,0 +1,16 @@
+warning: trailing semicolon in macro used in expression position
+ --> $DIR/warn-semicolon-in-expressions-from-macros.rs:6:13
+ |
+LL | true;
+ | ^
+...
+LL | _ => foo!()
+ | ------ in this macro invocation
+ |
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/unused-borrows.stderr b/src/test/ui/lint/unused-borrows.stderr
index 24899fe..d8dd2b5 100644
--- a/src/test/ui/lint/unused-borrows.stderr
+++ b/src/test/ui/lint/unused-borrows.stderr
@@ -2,43 +2,72 @@
--> $DIR/unused-borrows.rs:6:5
|
LL | &42;
- | ^^^
+ | ^^^ the borrow produces a value
|
note: the lint level is defined here
--> $DIR/unused-borrows.rs:1:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = &42;
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:9:5
|
LL | &mut foo(42);
- | ^^^^^^^^^^^^
+ | ^^^^^^^^^^^^ the borrow produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = &mut foo(42);
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:12:5
|
LL | &&42;
- | ^^^^
+ | ^^^^ the borrow produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = &&42;
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:15:5
|
LL | &&mut 42;
- | ^^^^^^^^
+ | ^^^^^^^^ the borrow produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = &&mut 42;
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:18:5
|
LL | &mut &42;
- | ^^^^^^^^
+ | ^^^^^^^^ the borrow produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = &mut &42;
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:23:5
|
LL | && foo(42);
- | ^^^^^^^^^^
+ | ^^^^^^^^^^ the borrow produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = && foo(42);
+ | +++++++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/lint/auxiliary/lint_unused_extern_crate.rs b/src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate.rs
similarity index 100%
rename from src/test/ui/lint/auxiliary/lint_unused_extern_crate.rs
rename to src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate.rs
diff --git a/src/test/ui/lint/auxiliary/lint_unused_extern_crate2.rs b/src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate2.rs
similarity index 100%
rename from src/test/ui/lint/auxiliary/lint_unused_extern_crate2.rs
rename to src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate2.rs
diff --git a/src/test/ui/lint/auxiliary/lint_unused_extern_crate3.rs b/src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate3.rs
similarity index 100%
rename from src/test/ui/lint/auxiliary/lint_unused_extern_crate3.rs
rename to src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate3.rs
diff --git a/src/test/ui/lint/auxiliary/lint_unused_extern_crate4.rs b/src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate4.rs
similarity index 100%
rename from src/test/ui/lint/auxiliary/lint_unused_extern_crate4.rs
rename to src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate4.rs
diff --git a/src/test/ui/lint/auxiliary/lint_unused_extern_crate5.rs b/src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate5.rs
similarity index 100%
rename from src/test/ui/lint/auxiliary/lint_unused_extern_crate5.rs
rename to src/test/ui/lint/unused/auxiliary/lint_unused_extern_crate5.rs
diff --git a/src/test/ui/unused/issue-30730.rs b/src/test/ui/lint/unused/issue-30730.rs
similarity index 100%
rename from src/test/ui/unused/issue-30730.rs
rename to src/test/ui/lint/unused/issue-30730.rs
diff --git a/src/test/ui/unused/issue-30730.stderr b/src/test/ui/lint/unused/issue-30730.stderr
similarity index 100%
rename from src/test/ui/unused/issue-30730.stderr
rename to src/test/ui/lint/unused/issue-30730.stderr
diff --git a/src/test/ui/unused/issue-46576.rs b/src/test/ui/lint/unused/issue-46576.rs
similarity index 100%
rename from src/test/ui/unused/issue-46576.rs
rename to src/test/ui/lint/unused/issue-46576.rs
diff --git a/src/test/ui/unused/issue-46576.stderr b/src/test/ui/lint/unused/issue-46576.stderr
similarity index 100%
rename from src/test/ui/unused/issue-46576.stderr
rename to src/test/ui/lint/unused/issue-46576.stderr
diff --git a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs b/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.rs
similarity index 100%
rename from src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs
rename to src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.rs
diff --git a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.stderr b/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
similarity index 100%
rename from src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.stderr
rename to src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
diff --git a/src/test/ui/lint/issue-54180-unused-ref-field.fixed b/src/test/ui/lint/unused/issue-54180-unused-ref-field.fixed
similarity index 100%
rename from src/test/ui/lint/issue-54180-unused-ref-field.fixed
rename to src/test/ui/lint/unused/issue-54180-unused-ref-field.fixed
diff --git a/src/test/ui/lint/issue-54180-unused-ref-field.rs b/src/test/ui/lint/unused/issue-54180-unused-ref-field.rs
similarity index 100%
rename from src/test/ui/lint/issue-54180-unused-ref-field.rs
rename to src/test/ui/lint/unused/issue-54180-unused-ref-field.rs
diff --git a/src/test/ui/lint/issue-54180-unused-ref-field.stderr b/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr
similarity index 100%
rename from src/test/ui/lint/issue-54180-unused-ref-field.stderr
rename to src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr
diff --git a/src/test/ui/lint/issue-54538-unused-parens-lint.fixed b/src/test/ui/lint/unused/issue-54538-unused-parens-lint.fixed
similarity index 100%
rename from src/test/ui/lint/issue-54538-unused-parens-lint.fixed
rename to src/test/ui/lint/unused/issue-54538-unused-parens-lint.fixed
diff --git a/src/test/ui/lint/issue-54538-unused-parens-lint.rs b/src/test/ui/lint/unused/issue-54538-unused-parens-lint.rs
similarity index 100%
rename from src/test/ui/lint/issue-54538-unused-parens-lint.rs
rename to src/test/ui/lint/unused/issue-54538-unused-parens-lint.rs
diff --git a/src/test/ui/lint/issue-54538-unused-parens-lint.stderr b/src/test/ui/lint/unused/issue-54538-unused-parens-lint.stderr
similarity index 100%
rename from src/test/ui/lint/issue-54538-unused-parens-lint.stderr
rename to src/test/ui/lint/unused/issue-54538-unused-parens-lint.stderr
diff --git a/src/test/ui/unused/issue-59896.rs b/src/test/ui/lint/unused/issue-59896.rs
similarity index 100%
rename from src/test/ui/unused/issue-59896.rs
rename to src/test/ui/lint/unused/issue-59896.rs
diff --git a/src/test/ui/unused/issue-59896.stderr b/src/test/ui/lint/unused/issue-59896.stderr
similarity index 100%
rename from src/test/ui/unused/issue-59896.stderr
rename to src/test/ui/lint/unused/issue-59896.stderr
diff --git a/src/test/ui/lint/issue-67691-unused-field-in-or-pattern.rs b/src/test/ui/lint/unused/issue-67691-unused-field-in-or-pattern.rs
similarity index 100%
rename from src/test/ui/lint/issue-67691-unused-field-in-or-pattern.rs
rename to src/test/ui/lint/unused/issue-67691-unused-field-in-or-pattern.rs
diff --git a/src/test/ui/lint/unused/issue-67691-unused-field-in-or-pattern.stderr b/src/test/ui/lint/unused/issue-67691-unused-field-in-or-pattern.stderr
new file mode 100644
index 0000000..8fc2d1b
--- /dev/null
+++ b/src/test/ui/lint/unused/issue-67691-unused-field-in-or-pattern.stderr
@@ -0,0 +1,74 @@
+error: unused variable: `j`
+ --> $DIR/issue-67691-unused-field-in-or-pattern.rs:20:16
+ |
+LL | A { i, j } | B { i, j } => {
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/issue-67691-unused-field-in-or-pattern.rs:4:9
+ |
+LL | #![deny(unused)]
+ | ^^^^^^
+ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
+help: try ignoring the field
+ |
+LL | A { i, j: _ } | B { i, j: _ } => {
+ | ~~~~ ~~~~
+
+error: unused variable: `j`
+ --> $DIR/issue-67691-unused-field-in-or-pattern.rs:30:16
+ |
+LL | A { i, ref j } | B { i, ref j } => {
+ | ^^^^^ ^^^^^
+ |
+help: try ignoring the field
+ |
+LL | A { i, j: _ } | B { i, j: _ } => {
+ | ~~~~ ~~~~
+
+error: unused variable: `j`
+ --> $DIR/issue-67691-unused-field-in-or-pattern.rs:40:21
+ |
+LL | Some(A { i, j } | B { i, j }) => {
+ | ^ ^
+ |
+help: try ignoring the field
+ |
+LL | Some(A { i, j: _ } | B { i, j: _ }) => {
+ | ~~~~ ~~~~
+
+error: unused variable: `j`
+ --> $DIR/issue-67691-unused-field-in-or-pattern.rs:52:21
+ |
+LL | Some(A { i, ref j } | B { i, ref j }) => {
+ | ^^^^^ ^^^^^
+ |
+help: try ignoring the field
+ |
+LL | Some(A { i, j: _ } | B { i, j: _ }) => {
+ | ~~~~ ~~~~
+
+error: unused variable: `i`
+ --> $DIR/issue-67691-unused-field-in-or-pattern.rs:62:24
+ |
+LL | MixedEnum::A { i } | MixedEnum::B(i) => {
+ | ^ ^
+ |
+help: try ignoring the field
+ |
+LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => {
+ | ~~~~ ~
+
+error: unused variable: `i`
+ --> $DIR/issue-67691-unused-field-in-or-pattern.rs:70:24
+ |
+LL | MixedEnum::A { ref i } | MixedEnum::B(ref i) => {
+ | ^^^^^ ^^^^^
+ |
+help: try ignoring the field
+ |
+LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => {
+ | ~~~~ ~
+
+error: aborting due to 6 previous errors
+
diff --git a/src/test/ui/unused/issue-70041.rs b/src/test/ui/lint/unused/issue-70041.rs
similarity index 100%
rename from src/test/ui/unused/issue-70041.rs
rename to src/test/ui/lint/unused/issue-70041.rs
diff --git a/src/test/ui/unused/issue-70041.stderr b/src/test/ui/lint/unused/issue-70041.stderr
similarity index 100%
rename from src/test/ui/unused/issue-70041.stderr
rename to src/test/ui/lint/unused/issue-70041.stderr
diff --git a/src/test/ui/lint/issue-71290-unused-paren-binop.rs b/src/test/ui/lint/unused/issue-71290-unused-paren-binop.rs
similarity index 100%
rename from src/test/ui/lint/issue-71290-unused-paren-binop.rs
rename to src/test/ui/lint/unused/issue-71290-unused-paren-binop.rs
diff --git a/src/test/ui/lint/issue-74883-unused-paren-baren-yield.rs b/src/test/ui/lint/unused/issue-74883-unused-paren-baren-yield.rs
similarity index 100%
rename from src/test/ui/lint/issue-74883-unused-paren-baren-yield.rs
rename to src/test/ui/lint/unused/issue-74883-unused-paren-baren-yield.rs
diff --git a/src/test/ui/lint/issue-74883-unused-paren-baren-yield.stderr b/src/test/ui/lint/unused/issue-74883-unused-paren-baren-yield.stderr
similarity index 100%
rename from src/test/ui/lint/issue-74883-unused-paren-baren-yield.stderr
rename to src/test/ui/lint/unused/issue-74883-unused-paren-baren-yield.stderr
diff --git a/src/test/ui/lint/issue-81314-unused-span-ident.fixed b/src/test/ui/lint/unused/issue-81314-unused-span-ident.fixed
similarity index 100%
rename from src/test/ui/lint/issue-81314-unused-span-ident.fixed
rename to src/test/ui/lint/unused/issue-81314-unused-span-ident.fixed
diff --git a/src/test/ui/lint/issue-81314-unused-span-ident.rs b/src/test/ui/lint/unused/issue-81314-unused-span-ident.rs
similarity index 100%
rename from src/test/ui/lint/issue-81314-unused-span-ident.rs
rename to src/test/ui/lint/unused/issue-81314-unused-span-ident.rs
diff --git a/src/test/ui/lint/issue-81314-unused-span-ident.stderr b/src/test/ui/lint/unused/issue-81314-unused-span-ident.stderr
similarity index 100%
rename from src/test/ui/lint/issue-81314-unused-span-ident.stderr
rename to src/test/ui/lint/unused/issue-81314-unused-span-ident.stderr
diff --git a/src/test/ui/lint/unused/issue-85913.rs b/src/test/ui/lint/unused/issue-85913.rs
new file mode 100644
index 0000000..7f3817b6
--- /dev/null
+++ b/src/test/ui/lint/unused/issue-85913.rs
@@ -0,0 +1,13 @@
+#![deny(unused_must_use)]
+
+pub fn fun() -> i32 {
+ function() && return 1;
+ //~^ ERROR: unused logical operation that must be used
+ return 0;
+}
+
+fn function() -> bool {
+ true
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/unused/issue-85913.stderr b/src/test/ui/lint/unused/issue-85913.stderr
new file mode 100644
index 0000000..8234ed3
--- /dev/null
+++ b/src/test/ui/lint/unused/issue-85913.stderr
@@ -0,0 +1,18 @@
+error: unused logical operation that must be used
+ --> $DIR/issue-85913.rs:4:5
+ |
+LL | function() && return 1;
+ | ^^^^^^^^^^^^^^^^^^^^^^ the logical operation produces a value
+ |
+note: the lint level is defined here
+ --> $DIR/issue-85913.rs:1:9
+ |
+LL | #![deny(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = function() && return 1;
+ | +++++++
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/lint-unused-extern-crate.rs b/src/test/ui/lint/unused/lint-unused-extern-crate.rs
similarity index 100%
rename from src/test/ui/lint/lint-unused-extern-crate.rs
rename to src/test/ui/lint/unused/lint-unused-extern-crate.rs
diff --git a/src/test/ui/lint/lint-unused-extern-crate.stderr b/src/test/ui/lint/unused/lint-unused-extern-crate.stderr
similarity index 100%
rename from src/test/ui/lint/lint-unused-extern-crate.stderr
rename to src/test/ui/lint/unused/lint-unused-extern-crate.stderr
diff --git a/src/test/ui/lint/lint-unused-imports.rs b/src/test/ui/lint/unused/lint-unused-imports.rs
similarity index 100%
rename from src/test/ui/lint/lint-unused-imports.rs
rename to src/test/ui/lint/unused/lint-unused-imports.rs
diff --git a/src/test/ui/lint/lint-unused-imports.stderr b/src/test/ui/lint/unused/lint-unused-imports.stderr
similarity index 100%
rename from src/test/ui/lint/lint-unused-imports.stderr
rename to src/test/ui/lint/unused/lint-unused-imports.stderr
diff --git a/src/test/ui/lint/lint-unused-mut-self.fixed b/src/test/ui/lint/unused/lint-unused-mut-self.fixed
similarity index 100%
rename from src/test/ui/lint/lint-unused-mut-self.fixed
rename to src/test/ui/lint/unused/lint-unused-mut-self.fixed
diff --git a/src/test/ui/lint/lint-unused-mut-self.rs b/src/test/ui/lint/unused/lint-unused-mut-self.rs
similarity index 100%
rename from src/test/ui/lint/lint-unused-mut-self.rs
rename to src/test/ui/lint/unused/lint-unused-mut-self.rs
diff --git a/src/test/ui/lint/lint-unused-mut-self.stderr b/src/test/ui/lint/unused/lint-unused-mut-self.stderr
similarity index 100%
rename from src/test/ui/lint/lint-unused-mut-self.stderr
rename to src/test/ui/lint/unused/lint-unused-mut-self.stderr
diff --git a/src/test/ui/lint/lint-unused-mut-variables.rs b/src/test/ui/lint/unused/lint-unused-mut-variables.rs
similarity index 100%
rename from src/test/ui/lint/lint-unused-mut-variables.rs
rename to src/test/ui/lint/unused/lint-unused-mut-variables.rs
diff --git a/src/test/ui/lint/lint-unused-mut-variables.stderr b/src/test/ui/lint/unused/lint-unused-mut-variables.stderr
similarity index 100%
rename from src/test/ui/lint/lint-unused-mut-variables.stderr
rename to src/test/ui/lint/unused/lint-unused-mut-variables.stderr
diff --git a/src/test/ui/lint/lint-unused-variables.rs b/src/test/ui/lint/unused/lint-unused-variables.rs
similarity index 100%
rename from src/test/ui/lint/lint-unused-variables.rs
rename to src/test/ui/lint/unused/lint-unused-variables.rs
diff --git a/src/test/ui/lint/lint-unused-variables.stderr b/src/test/ui/lint/unused/lint-unused-variables.stderr
similarity index 100%
rename from src/test/ui/lint/lint-unused-variables.stderr
rename to src/test/ui/lint/unused/lint-unused-variables.stderr
diff --git a/src/test/ui/lint/must-use-ops.rs b/src/test/ui/lint/unused/must-use-ops.rs
similarity index 100%
rename from src/test/ui/lint/must-use-ops.rs
rename to src/test/ui/lint/unused/must-use-ops.rs
diff --git a/src/test/ui/lint/unused/must-use-ops.stderr b/src/test/ui/lint/unused/must-use-ops.stderr
new file mode 100644
index 0000000..b248dd0
--- /dev/null
+++ b/src/test/ui/lint/unused/must-use-ops.stderr
@@ -0,0 +1,238 @@
+warning: unused comparison that must be used
+ --> $DIR/must-use-ops.rs:12:5
+ |
+LL | val == 1;
+ | ^^^^^^^^ the comparison produces a value
+ |
+note: the lint level is defined here
+ --> $DIR/must-use-ops.rs:5:9
+ |
+LL | #![warn(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val == 1;
+ | +++++++
+
+warning: unused comparison that must be used
+ --> $DIR/must-use-ops.rs:13:5
+ |
+LL | val < 1;
+ | ^^^^^^^ the comparison produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val < 1;
+ | +++++++
+
+warning: unused comparison that must be used
+ --> $DIR/must-use-ops.rs:14:5
+ |
+LL | val <= 1;
+ | ^^^^^^^^ the comparison produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val <= 1;
+ | +++++++
+
+warning: unused comparison that must be used
+ --> $DIR/must-use-ops.rs:15:5
+ |
+LL | val != 1;
+ | ^^^^^^^^ the comparison produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val != 1;
+ | +++++++
+
+warning: unused comparison that must be used
+ --> $DIR/must-use-ops.rs:16:5
+ |
+LL | val >= 1;
+ | ^^^^^^^^ the comparison produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val >= 1;
+ | +++++++
+
+warning: unused comparison that must be used
+ --> $DIR/must-use-ops.rs:17:5
+ |
+LL | val > 1;
+ | ^^^^^^^ the comparison produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val > 1;
+ | +++++++
+
+warning: unused arithmetic operation that must be used
+ --> $DIR/must-use-ops.rs:20:5
+ |
+LL | val + 2;
+ | ^^^^^^^ the arithmetic operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val + 2;
+ | +++++++
+
+warning: unused arithmetic operation that must be used
+ --> $DIR/must-use-ops.rs:21:5
+ |
+LL | val - 2;
+ | ^^^^^^^ the arithmetic operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val - 2;
+ | +++++++
+
+warning: unused arithmetic operation that must be used
+ --> $DIR/must-use-ops.rs:22:5
+ |
+LL | val / 2;
+ | ^^^^^^^ the arithmetic operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val / 2;
+ | +++++++
+
+warning: unused arithmetic operation that must be used
+ --> $DIR/must-use-ops.rs:23:5
+ |
+LL | val * 2;
+ | ^^^^^^^ the arithmetic operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val * 2;
+ | +++++++
+
+warning: unused arithmetic operation that must be used
+ --> $DIR/must-use-ops.rs:24:5
+ |
+LL | val % 2;
+ | ^^^^^^^ the arithmetic operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = val % 2;
+ | +++++++
+
+warning: unused logical operation that must be used
+ --> $DIR/must-use-ops.rs:27:5
+ |
+LL | true && true;
+ | ^^^^^^^^^^^^ the logical operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = true && true;
+ | +++++++
+
+warning: unused logical operation that must be used
+ --> $DIR/must-use-ops.rs:28:5
+ |
+LL | false || true;
+ | ^^^^^^^^^^^^^ the logical operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = false || true;
+ | +++++++
+
+warning: unused bitwise operation that must be used
+ --> $DIR/must-use-ops.rs:31:5
+ |
+LL | 5 ^ val;
+ | ^^^^^^^ the bitwise operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 5 ^ val;
+ | +++++++
+
+warning: unused bitwise operation that must be used
+ --> $DIR/must-use-ops.rs:32:5
+ |
+LL | 5 & val;
+ | ^^^^^^^ the bitwise operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 5 & val;
+ | +++++++
+
+warning: unused bitwise operation that must be used
+ --> $DIR/must-use-ops.rs:33:5
+ |
+LL | 5 | val;
+ | ^^^^^^^ the bitwise operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 5 | val;
+ | +++++++
+
+warning: unused bitwise operation that must be used
+ --> $DIR/must-use-ops.rs:34:5
+ |
+LL | 5 << val;
+ | ^^^^^^^^ the bitwise operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 5 << val;
+ | +++++++
+
+warning: unused bitwise operation that must be used
+ --> $DIR/must-use-ops.rs:35:5
+ |
+LL | 5 >> val;
+ | ^^^^^^^^ the bitwise operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = 5 >> val;
+ | +++++++
+
+warning: unused unary operation that must be used
+ --> $DIR/must-use-ops.rs:38:5
+ |
+LL | !val;
+ | ^^^^ the unary operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = !val;
+ | +++++++
+
+warning: unused unary operation that must be used
+ --> $DIR/must-use-ops.rs:39:5
+ |
+LL | -val;
+ | ^^^^ the unary operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = -val;
+ | +++++++
+
+warning: unused unary operation that must be used
+ --> $DIR/must-use-ops.rs:40:5
+ |
+LL | *val_pointer;
+ | ^^^^^^^^^^^^ the unary operation produces a value
+ |
+help: use `let _ = ...` to ignore the resulting value
+ |
+LL | let _ = *val_pointer;
+ | +++++++
+
+warning: 21 warnings emitted
+
diff --git a/src/test/ui/lint/must_use-array.rs b/src/test/ui/lint/unused/must_use-array.rs
similarity index 100%
rename from src/test/ui/lint/must_use-array.rs
rename to src/test/ui/lint/unused/must_use-array.rs
diff --git a/src/test/ui/lint/must_use-array.stderr b/src/test/ui/lint/unused/must_use-array.stderr
similarity index 100%
rename from src/test/ui/lint/must_use-array.stderr
rename to src/test/ui/lint/unused/must_use-array.stderr
diff --git a/src/test/ui/lint/must_use-in-stdlib-traits.rs b/src/test/ui/lint/unused/must_use-in-stdlib-traits.rs
similarity index 100%
rename from src/test/ui/lint/must_use-in-stdlib-traits.rs
rename to src/test/ui/lint/unused/must_use-in-stdlib-traits.rs
diff --git a/src/test/ui/lint/must_use-in-stdlib-traits.stderr b/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
similarity index 100%
rename from src/test/ui/lint/must_use-in-stdlib-traits.stderr
rename to src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
diff --git a/src/test/ui/lint/must_use-trait.rs b/src/test/ui/lint/unused/must_use-trait.rs
similarity index 100%
rename from src/test/ui/lint/must_use-trait.rs
rename to src/test/ui/lint/unused/must_use-trait.rs
diff --git a/src/test/ui/lint/must_use-trait.stderr b/src/test/ui/lint/unused/must_use-trait.stderr
similarity index 100%
rename from src/test/ui/lint/must_use-trait.stderr
rename to src/test/ui/lint/unused/must_use-trait.stderr
diff --git a/src/test/ui/lint/must_use-tuple.rs b/src/test/ui/lint/unused/must_use-tuple.rs
similarity index 100%
rename from src/test/ui/lint/must_use-tuple.rs
rename to src/test/ui/lint/unused/must_use-tuple.rs
diff --git a/src/test/ui/lint/must_use-tuple.stderr b/src/test/ui/lint/unused/must_use-tuple.stderr
similarity index 100%
rename from src/test/ui/lint/must_use-tuple.stderr
rename to src/test/ui/lint/unused/must_use-tuple.stderr
diff --git a/src/test/ui/lint/must_use-unit.rs b/src/test/ui/lint/unused/must_use-unit.rs
similarity index 100%
rename from src/test/ui/lint/must_use-unit.rs
rename to src/test/ui/lint/unused/must_use-unit.rs
diff --git a/src/test/ui/lint/must_use-unit.stderr b/src/test/ui/lint/unused/must_use-unit.stderr
similarity index 100%
rename from src/test/ui/lint/must_use-unit.stderr
rename to src/test/ui/lint/unused/must_use-unit.stderr
diff --git a/src/test/ui/lint/no-unused-parens-return-block.rs b/src/test/ui/lint/unused/no-unused-parens-return-block.rs
similarity index 100%
rename from src/test/ui/lint/no-unused-parens-return-block.rs
rename to src/test/ui/lint/unused/no-unused-parens-return-block.rs
diff --git a/src/test/ui/lint/unused/unused-attr-macro-rules.rs b/src/test/ui/lint/unused/unused-attr-macro-rules.rs
new file mode 100644
index 0000000..c0fc280
--- /dev/null
+++ b/src/test/ui/lint/unused/unused-attr-macro-rules.rs
@@ -0,0 +1,33 @@
+#![deny(unused_attributes)]
+// Unused attributes on macro_rules requires special handling since the
+// macro_rules definition does not survive towards HIR.
+
+// A sample of various built-in attributes.
+#[macro_export]
+#[macro_use] //~ ERROR `#[macro_use]` only has an effect
+#[path="foo"] //~ ERROR #[path]` only has an effect
+#[recursion_limit="1"] //~ ERROR crate-level attribute should be an inner attribute
+macro_rules! foo {
+ () => {};
+}
+
+// The following should not warn about unused attributes.
+#[allow(unused)]
+macro_rules! foo2 {
+ () => {};
+}
+
+#[cfg(FALSE)]
+macro_rules! foo {
+ () => {};
+}
+
+/// Some docs
+#[deprecated]
+#[doc = "more docs"]
+#[macro_export]
+macro_rules! bar {
+ () => {};
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/unused/unused-attr-macro-rules.stderr b/src/test/ui/lint/unused/unused-attr-macro-rules.stderr
new file mode 100644
index 0000000..e3ca90d
--- /dev/null
+++ b/src/test/ui/lint/unused/unused-attr-macro-rules.stderr
@@ -0,0 +1,26 @@
+error: `#[macro_use]` only has an effect on `extern crate` and modules
+ --> $DIR/unused-attr-macro-rules.rs:7:1
+ |
+LL | #[macro_use]
+ | ^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/unused-attr-macro-rules.rs:1:9
+ |
+LL | #![deny(unused_attributes)]
+ | ^^^^^^^^^^^^^^^^^
+
+error: `#[path]` only has an effect on modules
+ --> $DIR/unused-attr-macro-rules.rs:8:1
+ |
+LL | #[path="foo"]
+ | ^^^^^^^^^^^^^
+
+error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
+ --> $DIR/unused-attr-macro-rules.rs:9:1
+ |
+LL | #[recursion_limit="1"]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/unused/unused-closure.rs b/src/test/ui/lint/unused/unused-closure.rs
similarity index 100%
rename from src/test/ui/unused/unused-closure.rs
rename to src/test/ui/lint/unused/unused-closure.rs
diff --git a/src/test/ui/unused/unused-closure.stderr b/src/test/ui/lint/unused/unused-closure.stderr
similarity index 100%
rename from src/test/ui/unused/unused-closure.stderr
rename to src/test/ui/lint/unused/unused-closure.stderr
diff --git a/src/test/ui/unused/unused-doc-comments-edge-cases.rs b/src/test/ui/lint/unused/unused-doc-comments-edge-cases.rs
similarity index 100%
rename from src/test/ui/unused/unused-doc-comments-edge-cases.rs
rename to src/test/ui/lint/unused/unused-doc-comments-edge-cases.rs
diff --git a/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr b/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
new file mode 100644
index 0000000..4033670
--- /dev/null
+++ b/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
@@ -0,0 +1,61 @@
+error: expected expression, found keyword `else`
+ --> $DIR/unused-doc-comments-edge-cases.rs:17:5
+ |
+LL | else {
+ | ^^^^ expected expression
+
+error[E0658]: attributes on expressions are experimental
+ --> $DIR/unused-doc-comments-edge-cases.rs:23:5
+ |
+LL | /// useless doc comment
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
+ = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
+ = help: `///` is for documentation comments. For a plain comment, use `//`.
+
+error: unused doc comment
+ --> $DIR/unused-doc-comments-edge-cases.rs:6:9
+ |
+LL | /// useless doc comment
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | _ => false,
+ | ---------- rustdoc does not generate documentation for match arms
+ |
+note: the lint level is defined here
+ --> $DIR/unused-doc-comments-edge-cases.rs:1:9
+ |
+LL | #![deny(unused_doc_comments)]
+ | ^^^^^^^^^^^^^^^^^^^
+ = help: use `//` for a plain comment
+
+error: unused doc comment
+ --> $DIR/unused-doc-comments-edge-cases.rs:23:5
+ |
+LL | /// useless doc comment
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | num == 3
+ | --- rustdoc does not generate documentation for expressions
+ |
+ = help: use `//` for a plain comment
+
+error[E0308]: mismatched types
+ --> $DIR/unused-doc-comments-edge-cases.rs:14:9
+ |
+LL | / if num == 3 {
+LL | | true
+ | | ^^^^ expected `()`, found `bool`
+LL | | }
+ | |_____- expected this to be `()`
+ |
+help: you might have meant to return this value
+ |
+LL | return true;
+ | ++++++ +
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0308, E0658.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/unused/unused-doc-comments-for-macros.rs b/src/test/ui/lint/unused/unused-doc-comments-for-macros.rs
similarity index 100%
rename from src/test/ui/unused/unused-doc-comments-for-macros.rs
rename to src/test/ui/lint/unused/unused-doc-comments-for-macros.rs
diff --git a/src/test/ui/unused/unused-doc-comments-for-macros.stderr b/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
similarity index 100%
rename from src/test/ui/unused/unused-doc-comments-for-macros.stderr
rename to src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
diff --git a/src/test/ui/unused/unused-macro-rules.rs b/src/test/ui/lint/unused/unused-macro-rules.rs
similarity index 100%
rename from src/test/ui/unused/unused-macro-rules.rs
rename to src/test/ui/lint/unused/unused-macro-rules.rs
diff --git a/src/test/ui/unused/unused-macro-rules.stderr b/src/test/ui/lint/unused/unused-macro-rules.stderr
similarity index 100%
rename from src/test/ui/unused/unused-macro-rules.stderr
rename to src/test/ui/lint/unused/unused-macro-rules.stderr
diff --git a/src/test/ui/unused/unused-macro-with-bad-frag-spec.rs b/src/test/ui/lint/unused/unused-macro-with-bad-frag-spec.rs
similarity index 100%
rename from src/test/ui/unused/unused-macro-with-bad-frag-spec.rs
rename to src/test/ui/lint/unused/unused-macro-with-bad-frag-spec.rs
diff --git a/src/test/ui/unused/unused-macro-with-bad-frag-spec.stderr b/src/test/ui/lint/unused/unused-macro-with-bad-frag-spec.stderr
similarity index 100%
rename from src/test/ui/unused/unused-macro-with-bad-frag-spec.stderr
rename to src/test/ui/lint/unused/unused-macro-with-bad-frag-spec.stderr
diff --git a/src/test/ui/unused/unused-macro-with-follow-violation.rs b/src/test/ui/lint/unused/unused-macro-with-follow-violation.rs
similarity index 100%
rename from src/test/ui/unused/unused-macro-with-follow-violation.rs
rename to src/test/ui/lint/unused/unused-macro-with-follow-violation.rs
diff --git a/src/test/ui/unused/unused-macro-with-follow-violation.stderr b/src/test/ui/lint/unused/unused-macro-with-follow-violation.stderr
similarity index 100%
rename from src/test/ui/unused/unused-macro-with-follow-violation.stderr
rename to src/test/ui/lint/unused/unused-macro-with-follow-violation.stderr
diff --git a/src/test/ui/unused/unused-macro.rs b/src/test/ui/lint/unused/unused-macro.rs
similarity index 100%
rename from src/test/ui/unused/unused-macro.rs
rename to src/test/ui/lint/unused/unused-macro.rs
diff --git a/src/test/ui/unused/unused-macro.stderr b/src/test/ui/lint/unused/unused-macro.stderr
similarity index 100%
rename from src/test/ui/unused/unused-macro.stderr
rename to src/test/ui/lint/unused/unused-macro.stderr
diff --git a/src/test/ui/unused/unused-mut-warning-captured-var.fixed b/src/test/ui/lint/unused/unused-mut-warning-captured-var.fixed
similarity index 100%
rename from src/test/ui/unused/unused-mut-warning-captured-var.fixed
rename to src/test/ui/lint/unused/unused-mut-warning-captured-var.fixed
diff --git a/src/test/ui/unused/unused-mut-warning-captured-var.rs b/src/test/ui/lint/unused/unused-mut-warning-captured-var.rs
similarity index 100%
rename from src/test/ui/unused/unused-mut-warning-captured-var.rs
rename to src/test/ui/lint/unused/unused-mut-warning-captured-var.rs
diff --git a/src/test/ui/unused/unused-mut-warning-captured-var.stderr b/src/test/ui/lint/unused/unused-mut-warning-captured-var.stderr
similarity index 100%
rename from src/test/ui/unused/unused-mut-warning-captured-var.stderr
rename to src/test/ui/lint/unused/unused-mut-warning-captured-var.stderr
diff --git a/src/test/ui/unused/unused-result.rs b/src/test/ui/lint/unused/unused-result.rs
similarity index 100%
rename from src/test/ui/unused/unused-result.rs
rename to src/test/ui/lint/unused/unused-result.rs
diff --git a/src/test/ui/unused/unused-result.stderr b/src/test/ui/lint/unused/unused-result.stderr
similarity index 100%
rename from src/test/ui/unused/unused-result.stderr
rename to src/test/ui/lint/unused/unused-result.stderr
diff --git a/src/test/ui/unused/useless-comment.rs b/src/test/ui/lint/unused/useless-comment.rs
similarity index 100%
rename from src/test/ui/unused/useless-comment.rs
rename to src/test/ui/lint/unused/useless-comment.rs
diff --git a/src/test/ui/unused/useless-comment.stderr b/src/test/ui/lint/unused/useless-comment.stderr
similarity index 100%
rename from src/test/ui/unused/useless-comment.stderr
rename to src/test/ui/lint/unused/useless-comment.stderr
diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
index d08fbac..d9dac5d 100644
--- a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
+++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
@@ -1,18 +1,4 @@
error[E0308]: mismatched types
- --> $DIR/liveness-return-last-stmt-semi.rs:4:41
- |
-LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
- | --- ^^^ - help: consider removing this semicolon
- | | |
- | | expected `i32`, found `()`
- | implicitly returns `()` as its body has no tail or `return` expression
-...
-LL | test!();
- | -------- in this macro invocation
- |
- = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0308]: mismatched types
--> $DIR/liveness-return-last-stmt-semi.rs:7:19
|
LL | fn no_return() -> i32 {}
@@ -38,6 +24,20 @@
| |
| implicitly returns `()` as its body has no tail or `return` expression
+error[E0308]: mismatched types
+ --> $DIR/liveness-return-last-stmt-semi.rs:4:41
+ |
+LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
+ | --- ^^^ - help: consider removing this semicolon
+ | | |
+ | | expected `i32`, found `()`
+ | implicitly returns `()` as its body has no tail or `return` expression
+...
+LL | test!();
+ | -------- in this macro invocation
+ |
+ = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/liveness/liveness-upvars.rs b/src/test/ui/liveness/liveness-upvars.rs
index 98ea4d7..d446d57 100644
--- a/src/test/ui/liveness/liveness-upvars.rs
+++ b/src/test/ui/liveness/liveness-upvars.rs
@@ -1,5 +1,6 @@
// edition:2018
// check-pass
+#![feature(generators)]
#![warn(unused)]
#![allow(unreachable_code)]
@@ -105,4 +106,39 @@
};
}
+async fn yield_now() {
+ todo!();
+}
+
+pub fn async_generator() {
+ let mut state: u32 = 0;
+
+ let _ = async {
+ state = 1;
+ yield_now().await;
+ state = 2;
+ yield_now().await;
+ state = 3;
+ };
+
+ let _ = async move {
+ state = 4; //~ WARN value assigned to `state` is never read
+ //~| WARN unused variable: `state`
+ yield_now().await;
+ state = 5; //~ WARN value assigned to `state` is never read
+ };
+}
+
+pub fn generator() {
+ let mut s: u32 = 0;
+ let _ = |_| {
+ s = 0;
+ yield ();
+ s = 1; //~ WARN value assigned to `s` is never read
+ yield (s = 2);
+ s = yield (); //~ WARN value assigned to `s` is never read
+ s = 3;
+ };
+}
+
fn main() {}
diff --git a/src/test/ui/liveness/liveness-upvars.stderr b/src/test/ui/liveness/liveness-upvars.stderr
index 14fed91..d172330 100644
--- a/src/test/ui/liveness/liveness-upvars.stderr
+++ b/src/test/ui/liveness/liveness-upvars.stderr
@@ -1,11 +1,11 @@
warning: value assigned to `last` is never read
- --> $DIR/liveness-upvars.rs:9:9
+ --> $DIR/liveness-upvars.rs:10:9
|
LL | last = Some(s);
| ^^^^
|
note: the lint level is defined here
- --> $DIR/liveness-upvars.rs:3:9
+ --> $DIR/liveness-upvars.rs:4:9
|
LL | #![warn(unused)]
| ^^^^^^
@@ -13,13 +13,13 @@
= help: maybe it is overwritten before being read?
warning: unused variable: `last`
- --> $DIR/liveness-upvars.rs:9:9
+ --> $DIR/liveness-upvars.rs:10:9
|
LL | last = Some(s);
| ^^^^
|
note: the lint level is defined here
- --> $DIR/liveness-upvars.rs:3:9
+ --> $DIR/liveness-upvars.rs:4:9
|
LL | #![warn(unused)]
| ^^^^^^
@@ -27,7 +27,7 @@
= help: did you mean to capture by reference instead?
warning: unused variable: `sum`
- --> $DIR/liveness-upvars.rs:21:9
+ --> $DIR/liveness-upvars.rs:22:9
|
LL | sum += x;
| ^^^
@@ -35,7 +35,7 @@
= help: did you mean to capture by reference instead?
warning: value captured by `c` is never read
- --> $DIR/liveness-upvars.rs:31:9
+ --> $DIR/liveness-upvars.rs:32:9
|
LL | c = 1;
| ^
@@ -43,7 +43,7 @@
= help: did you mean to capture by reference instead?
warning: value captured by `c` is never read
- --> $DIR/liveness-upvars.rs:35:9
+ --> $DIR/liveness-upvars.rs:36:9
|
LL | c = 1;
| ^
@@ -51,7 +51,7 @@
= help: did you mean to capture by reference instead?
warning: unused variable: `c`
- --> $DIR/liveness-upvars.rs:41:9
+ --> $DIR/liveness-upvars.rs:42:9
|
LL | c += 1;
| ^
@@ -59,7 +59,7 @@
= help: did you mean to capture by reference instead?
warning: value assigned to `c` is never read
- --> $DIR/liveness-upvars.rs:44:9
+ --> $DIR/liveness-upvars.rs:45:9
|
LL | c += 1;
| ^
@@ -67,7 +67,7 @@
= help: maybe it is overwritten before being read?
warning: unused variable: `c`
- --> $DIR/liveness-upvars.rs:44:9
+ --> $DIR/liveness-upvars.rs:45:9
|
LL | c += 1;
| ^
@@ -75,7 +75,7 @@
= help: did you mean to capture by reference instead?
warning: value assigned to `c` is never read
- --> $DIR/liveness-upvars.rs:57:9
+ --> $DIR/liveness-upvars.rs:58:9
|
LL | c += 1;
| ^
@@ -83,7 +83,7 @@
= help: maybe it is overwritten before being read?
warning: value assigned to `c` is never read
- --> $DIR/liveness-upvars.rs:63:9
+ --> $DIR/liveness-upvars.rs:64:9
|
LL | c += 1;
| ^
@@ -91,7 +91,7 @@
= help: maybe it is overwritten before being read?
warning: value assigned to `d` is never read
- --> $DIR/liveness-upvars.rs:72:13
+ --> $DIR/liveness-upvars.rs:73:13
|
LL | d = Some("d1");
| ^
@@ -99,7 +99,7 @@
= help: maybe it is overwritten before being read?
warning: value assigned to `e` is never read
- --> $DIR/liveness-upvars.rs:76:13
+ --> $DIR/liveness-upvars.rs:77:13
|
LL | e = Some("e1");
| ^
@@ -107,7 +107,7 @@
= help: maybe it is overwritten before being read?
warning: value assigned to `e` is never read
- --> $DIR/liveness-upvars.rs:78:13
+ --> $DIR/liveness-upvars.rs:79:13
|
LL | e = Some("e2");
| ^
@@ -115,7 +115,7 @@
= help: maybe it is overwritten before being read?
warning: unused variable: `e`
- --> $DIR/liveness-upvars.rs:76:13
+ --> $DIR/liveness-upvars.rs:77:13
|
LL | e = Some("e1");
| ^
@@ -123,7 +123,7 @@
= help: did you mean to capture by reference instead?
warning: value assigned to `v` is never read
- --> $DIR/liveness-upvars.rs:86:13
+ --> $DIR/liveness-upvars.rs:87:13
|
LL | v = T::default();
| ^
@@ -131,7 +131,7 @@
= help: maybe it is overwritten before being read?
warning: value assigned to `z` is never read
- --> $DIR/liveness-upvars.rs:98:17
+ --> $DIR/liveness-upvars.rs:99:17
|
LL | z = T::default();
| ^
@@ -139,12 +139,52 @@
= help: maybe it is overwritten before being read?
warning: unused variable: `z`
- --> $DIR/liveness-upvars.rs:98:17
+ --> $DIR/liveness-upvars.rs:99:17
|
LL | z = T::default();
| ^
|
= help: did you mean to capture by reference instead?
-warning: 17 warnings emitted
+warning: value assigned to `state` is never read
+ --> $DIR/liveness-upvars.rs:125:9
+ |
+LL | state = 4;
+ | ^^^^^
+ |
+ = help: maybe it is overwritten before being read?
+
+warning: value assigned to `state` is never read
+ --> $DIR/liveness-upvars.rs:128:9
+ |
+LL | state = 5;
+ | ^^^^^
+ |
+ = help: maybe it is overwritten before being read?
+
+warning: unused variable: `state`
+ --> $DIR/liveness-upvars.rs:125:9
+ |
+LL | state = 4;
+ | ^^^^^
+ |
+ = help: did you mean to capture by reference instead?
+
+warning: value assigned to `s` is never read
+ --> $DIR/liveness-upvars.rs:137:9
+ |
+LL | s = 1;
+ | ^
+ |
+ = help: maybe it is overwritten before being read?
+
+warning: value assigned to `s` is never read
+ --> $DIR/liveness-upvars.rs:139:9
+ |
+LL | s = yield ();
+ | ^
+ |
+ = help: maybe it is overwritten before being read?
+
+warning: 22 warnings emitted
diff --git a/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs b/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs
index 387822d..d178c65 100644
--- a/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs
+++ b/src/test/ui/llvm-asm/asm-src-loc-codegen-units.rs
@@ -4,6 +4,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/llvm-asm/asm-src-loc.rs b/src/test/ui/llvm-asm/asm-src-loc.rs
index 063066d..4506c12 100644
--- a/src/test/ui/llvm-asm/asm-src-loc.rs
+++ b/src/test/ui/llvm-asm/asm-src-loc.rs
@@ -3,6 +3,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/llvm-asm/inline-asm-bad-constraint.rs b/src/test/ui/llvm-asm/inline-asm-bad-constraint.rs
index edf2c2e..6a2ce11 100644
--- a/src/test/ui/llvm-asm/inline-asm-bad-constraint.rs
+++ b/src/test/ui/llvm-asm/inline-asm-bad-constraint.rs
@@ -4,6 +4,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
extern "C" {
fn foo(a: usize);
diff --git a/src/test/ui/llvm-asm/inline-asm-bad-constraint.stderr b/src/test/ui/llvm-asm/inline-asm-bad-constraint.stderr
index 2b5c2ec..5efc385 100644
--- a/src/test/ui/llvm-asm/inline-asm-bad-constraint.stderr
+++ b/src/test/ui/llvm-asm/inline-asm-bad-constraint.stderr
@@ -1,5 +1,5 @@
error[E0668]: malformed inline assembly
- --> $DIR/inline-asm-bad-constraint.rs:22:9
+ --> $DIR/inline-asm-bad-constraint.rs:23:9
|
LL | llvm_asm!("" :"={rax"(rax))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@
= note: this error originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0668]: malformed inline assembly
- --> $DIR/inline-asm-bad-constraint.rs:30:9
+ --> $DIR/inline-asm-bad-constraint.rs:31:9
|
LL | llvm_asm!("callq $0" : : "0"(foo))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -15,7 +15,7 @@
= note: this error originates in the macro `llvm_asm` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0668]: malformed inline assembly
- --> $DIR/inline-asm-bad-constraint.rs:37:9
+ --> $DIR/inline-asm-bad-constraint.rs:38:9
|
LL | llvm_asm!("addb $1, $0" : "={rax}"((0i32, rax)));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/llvm-asm/inline-asm-bad-operand.rs b/src/test/ui/llvm-asm/inline-asm-bad-operand.rs
index e5fc4ee..1746c48 100644
--- a/src/test/ui/llvm-asm/inline-asm-bad-operand.rs
+++ b/src/test/ui/llvm-asm/inline-asm-bad-operand.rs
@@ -5,6 +5,7 @@
// ignore-emscripten
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[repr(C)]
struct MyPtr(usize);
diff --git a/src/test/ui/llvm-asm/inline-asm-bad-operand.stderr b/src/test/ui/llvm-asm/inline-asm-bad-operand.stderr
index 1ac7024..8bb8a7a 100644
--- a/src/test/ui/llvm-asm/inline-asm-bad-operand.stderr
+++ b/src/test/ui/llvm-asm/inline-asm-bad-operand.stderr
@@ -1,41 +1,41 @@
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:22:29
+ --> $DIR/inline-asm-bad-operand.rs:23:29
|
LL | llvm_asm!("" :: "r"(""));
| ^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:27:37
+ --> $DIR/inline-asm-bad-operand.rs:28:37
|
LL | llvm_asm!("ret" : : "{rdi}"(target));
| ^^^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:34:34
+ --> $DIR/inline-asm-bad-operand.rs:35:34
|
LL | unsafe { llvm_asm!("" :: "i"(hello)) };
| ^^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:42:43
+ --> $DIR/inline-asm-bad-operand.rs:43:43
|
LL | llvm_asm!("movups $1, %xmm0"::"m"(arr));
| ^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:49:37
+ --> $DIR/inline-asm-bad-operand.rs:50:37
|
LL | llvm_asm!("mov sp, $0"::"r"(addr));
| ^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:56:37
+ --> $DIR/inline-asm-bad-operand.rs:57:37
|
LL | llvm_asm!("mov sp, $0"::"r"(addr),
| ^^^^
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/inline-asm-bad-operand.rs:57:37
+ --> $DIR/inline-asm-bad-operand.rs:58:37
|
LL | ... "r"("hello e0669"));
| ^^^^^^^^^^^^^
diff --git a/src/test/ui/llvm-asm/issue-14936.rs b/src/test/ui/llvm-asm/issue-14936.rs
index 02095a2..46e5a2a 100644
--- a/src/test/ui/llvm-asm/issue-14936.rs
+++ b/src/test/ui/llvm-asm/issue-14936.rs
@@ -1,6 +1,7 @@
// build-pass
#![allow(unused_macros)]
#![allow(dead_code)]
+#![allow(deprecated)] // llvm_asm!
#![feature(llvm_asm)]
type History = Vec<&'static str>;
diff --git a/src/test/ui/llvm-asm/issue-33264.rs b/src/test/ui/llvm-asm/issue-33264.rs
index 32a36e4..8ebf0cf 100644
--- a/src/test/ui/llvm-asm/issue-33264.rs
+++ b/src/test/ui/llvm-asm/issue-33264.rs
@@ -3,6 +3,7 @@
#![allow(dead_code, non_upper_case_globals)]
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[repr(C)]
pub struct D32x4(f32,f32,f32,f32);
diff --git a/src/test/ui/llvm-asm/issue-51431.rs b/src/test/ui/llvm-asm/issue-51431.rs
index ca06bda..706b714 100644
--- a/src/test/ui/llvm-asm/issue-51431.rs
+++ b/src/test/ui/llvm-asm/issue-51431.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no llvm_asm! support
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/llvm-asm/issue-51431.stderr b/src/test/ui/llvm-asm/issue-51431.stderr
index b4b39a2..35c8c1b 100644
--- a/src/test/ui/llvm-asm/issue-51431.stderr
+++ b/src/test/ui/llvm-asm/issue-51431.stderr
@@ -1,5 +1,5 @@
error[E0669]: invalid value for constraint in inline assembly
- --> $DIR/issue-51431.rs:8:37
+ --> $DIR/issue-51431.rs:9:37
|
LL | llvm_asm! {"mov $0,$1"::"0"("bx"),"1"(0x00)}
| ^^^^
diff --git a/src/test/ui/llvm-asm/issue-54067.rs b/src/test/ui/llvm-asm/issue-54067.rs
index f2e0972..6e931b9 100644
--- a/src/test/ui/llvm-asm/issue-54067.rs
+++ b/src/test/ui/llvm-asm/issue-54067.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no llvm_asm! support
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
pub fn boot(addr: Option<u32>) {
unsafe {
diff --git a/src/test/ui/llvm-asm/issue-62046.rs b/src/test/ui/llvm-asm/issue-62046.rs
index fd4d9bd..38b5f1a 100644
--- a/src/test/ui/llvm-asm/issue-62046.rs
+++ b/src/test/ui/llvm-asm/issue-62046.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no asm! support
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/llvm-asm/issue-62046.stderr b/src/test/ui/llvm-asm/issue-62046.stderr
index 6b313ac..73842a4 100644
--- a/src/test/ui/llvm-asm/issue-62046.stderr
+++ b/src/test/ui/llvm-asm/issue-62046.stderr
@@ -1,5 +1,5 @@
error[E0668]: malformed inline assembly
- --> $DIR/issue-62046.rs:8:9
+ --> $DIR/issue-62046.rs:9:9
|
LL | llvm_asm!("nop" : "+r"("r15"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/llvm-asm/issue-69092.rs b/src/test/ui/llvm-asm/issue-69092.rs
index 96c019b..ea1b80c 100644
--- a/src/test/ui/llvm-asm/issue-69092.rs
+++ b/src/test/ui/llvm-asm/issue-69092.rs
@@ -1,10 +1,13 @@
// build-fail
// ignore-emscripten no asm! support
+// The error message differs slightly between LLVM versions
+// min-llvm-version: 13.0
// Regression test for #69092
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe { llvm_asm!(".ascii \"Xen\0\""); }
- //~^ ERROR: expected string in '.ascii' directive
+ //~^ ERROR: expected string
}
diff --git a/src/test/ui/llvm-asm/issue-69092.stderr b/src/test/ui/llvm-asm/issue-69092.stderr
index 2ca86cf..28c5fbb 100644
--- a/src/test/ui/llvm-asm/issue-69092.stderr
+++ b/src/test/ui/llvm-asm/issue-69092.stderr
@@ -1,5 +1,5 @@
-error: expected string in '.ascii' directive
- --> $DIR/issue-69092.rs:8:14
+error: expected string
+ --> $DIR/issue-69092.rs:11:14
|
LL | unsafe { llvm_asm!(".ascii \"Xen\0\""); }
| ^
diff --git a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs
index 2868d3d..c15009f 100644
--- a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs
@@ -13,6 +13,7 @@
// ignore-mips64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[cfg(any(target_arch = "x86",
target_arch = "x86_64"))]
diff --git a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.stderr b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.stderr
index 5fbafe6..bb72a14 100644
--- a/src/test/ui/llvm-asm/llvm-asm-bad-clobber.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.stderr
@@ -1,5 +1,5 @@
error[E0664]: clobber should not be surrounded by braces
- --> $DIR/llvm-asm-bad-clobber.rs:23:42
+ --> $DIR/llvm-asm-bad-clobber.rs:24:42
|
LL | llvm_asm!("xor %eax, %eax" : : : "{eax}");
| ^^^^^^^
diff --git a/src/test/ui/llvm-asm/llvm-asm-concat-src.rs b/src/test/ui/llvm-asm/llvm-asm-concat-src.rs
index 1dc1c85..722eb07 100644
--- a/src/test/ui/llvm-asm/llvm-asm-concat-src.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-concat-src.rs
@@ -3,6 +3,7 @@
// ignore-emscripten no asm
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
pub fn main() {
unsafe { llvm_asm!(concat!("", "")) };
diff --git a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs
index e3bc7d2..1bccb0b 100644
--- a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs
@@ -10,6 +10,7 @@
// ignore-mips64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn foo(x: isize) { println!("{}", x); }
diff --git a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.stderr b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.stderr
index 11c3ed0..f6c618e 100644
--- a/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.stderr
@@ -1,11 +1,11 @@
error[E0662]: input operand constraint contains '='
- --> $DIR/llvm-asm-in-bad-modifier.rs:24:44
+ --> $DIR/llvm-asm-in-bad-modifier.rs:25:44
|
LL | llvm_asm!("mov $1, $0" : "=r"(x) : "=r"(5));
| ^^^^
error[E0663]: input operand constraint contains '+'
- --> $DIR/llvm-asm-in-bad-modifier.rs:25:44
+ --> $DIR/llvm-asm-in-bad-modifier.rs:26:44
|
LL | llvm_asm!("mov $1, $0" : "=r"(y) : "+r"(5));
| ^^^^
diff --git a/src/test/ui/llvm-asm/llvm-asm-in-moved.rs b/src/test/ui/llvm-asm/llvm-asm-in-moved.rs
index 35f4d92..f7b0fe5 100644
--- a/src/test/ui/llvm-asm/llvm-asm-in-moved.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-in-moved.rs
@@ -1,6 +1,7 @@
// run-pass
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#![allow(dead_code)]
use std::cell::Cell;
diff --git a/src/test/ui/llvm-asm/llvm-asm-in-out-operand.rs b/src/test/ui/llvm-asm/llvm-asm-in-out-operand.rs
index acefabd..2429b51 100644
--- a/src/test/ui/llvm-asm/llvm-asm-in-out-operand.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-in-out-operand.rs
@@ -1,6 +1,7 @@
// run-pass
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
unsafe fn next_power_of_2(n: u32) -> u32 {
diff --git a/src/test/ui/llvm-asm/llvm-asm-indirect-memory.rs b/src/test/ui/llvm-asm/llvm-asm-indirect-memory.rs
index 556ad83..441c62b 100644
--- a/src/test/ui/llvm-asm/llvm-asm-indirect-memory.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-indirect-memory.rs
@@ -1,6 +1,7 @@
// run-pass
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
fn read(ptr: &u32) -> u32 {
diff --git a/src/test/ui/llvm-asm/llvm-asm-literal-escaping.rs b/src/test/ui/llvm-asm/llvm-asm-literal-escaping.rs
index 5d45f50..ecd0c2f 100644
--- a/src/test/ui/llvm-asm/llvm-asm-literal-escaping.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-literal-escaping.rs
@@ -2,6 +2,7 @@
// only-x86_64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
unsafe {
diff --git a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs
index daae0c8..04f0972 100644
--- a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs
@@ -14,6 +14,7 @@
// ignore-mips64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
#[cfg(any(target_arch = "x86",
target_arch = "x86_64"))]
diff --git a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.stderr b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.stderr
index 644ccdf..d1250d9 100644
--- a/src/test/ui/llvm-asm/llvm-asm-misplaced-option.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.stderr
@@ -1,11 +1,11 @@
warning: unrecognized option
- --> $DIR/llvm-asm-misplaced-option.rs:25:69
+ --> $DIR/llvm-asm-misplaced-option.rs:26:69
|
LL | llvm_asm!("mov $1, $0" : "=r"(x) : "r"(5_usize), "0"(x) : : "cc");
| ^^^^
warning: expected a clobber, found an option
- --> $DIR/llvm-asm-misplaced-option.rs:32:85
+ --> $DIR/llvm-asm-misplaced-option.rs:33:85
|
LL | llvm_asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile");
| ^^^^^^^^^^
diff --git a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs
index 9c62532..7f51b50 100644
--- a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs
@@ -10,6 +10,7 @@
// ignore-mips64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn foo(x: isize) { println!("{}", x); }
diff --git a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.stderr b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.stderr
index 3e5893f..390c032 100644
--- a/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.stderr
@@ -1,5 +1,5 @@
error[E0384]: cannot assign twice to immutable variable `x`
- --> $DIR/llvm-asm-out-assign-imm.rs:25:39
+ --> $DIR/llvm-asm-out-assign-imm.rs:26:39
|
LL | let x: isize;
| - help: consider making this binding mutable: `mut x`
diff --git a/src/test/ui/llvm-asm/llvm-asm-out-assign.rs b/src/test/ui/llvm-asm/llvm-asm-out-assign.rs
index 321f285..c5f4a9a 100644
--- a/src/test/ui/llvm-asm/llvm-asm-out-assign.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-out-assign.rs
@@ -1,6 +1,7 @@
// run-pass
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!s
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn main() {
diff --git a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs
index 72edb33..c74d156 100644
--- a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs
@@ -10,6 +10,7 @@
// ignore-mips64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn foo(x: isize) { println!("{}", x); }
diff --git a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.stderr b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.stderr
index afed53e..f426170 100644
--- a/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.stderr
@@ -1,5 +1,5 @@
error[E0661]: output operand constraint lacks '=' or '+'
- --> $DIR/llvm-asm-out-no-modifier.rs:23:34
+ --> $DIR/llvm-asm-out-no-modifier.rs:24:34
|
LL | llvm_asm!("mov $1, $0" : "r"(x) : "r"(5));
| ^^^
diff --git a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs
index acf4cf9..161add7 100644
--- a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs
@@ -10,6 +10,7 @@
// ignore-mips64
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn foo(x: isize) { println!("{}", x); }
diff --git a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.stderr b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.stderr
index ac034ab..7e57dc4 100644
--- a/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.stderr
@@ -1,5 +1,5 @@
error[E0381]: use of possibly-uninitialized variable: `x`
- --> $DIR/llvm-asm-out-read-uninit.rs:23:48
+ --> $DIR/llvm-asm-out-read-uninit.rs:24:48
|
LL | llvm_asm!("mov $1, $0" : "=r"(x) : "r"(x));
| ^ use of possibly-uninitialized `x`
diff --git a/src/test/ui/llvm-asm/llvm-asm-parse-errors.rs b/src/test/ui/llvm-asm/llvm-asm-parse-errors.rs
index d458be8..cdd0b94 100644
--- a/src/test/ui/llvm-asm/llvm-asm-parse-errors.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-parse-errors.rs
@@ -1,4 +1,5 @@
#![feature(llvm_asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
llvm_asm!(); //~ ERROR requires a string literal as an argument
diff --git a/src/test/ui/llvm-asm/llvm-asm-parse-errors.stderr b/src/test/ui/llvm-asm/llvm-asm-parse-errors.stderr
index 1fd4680..10cb4fc 100644
--- a/src/test/ui/llvm-asm/llvm-asm-parse-errors.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-parse-errors.stderr
@@ -1,65 +1,65 @@
error: macro requires a string literal as an argument
- --> $DIR/llvm-asm-parse-errors.rs:4:5
+ --> $DIR/llvm-asm-parse-errors.rs:5:5
|
LL | llvm_asm!();
| ^^^^^^^^^^^^ string literal required
error: expected string literal
- --> $DIR/llvm-asm-parse-errors.rs:5:23
+ --> $DIR/llvm-asm-parse-errors.rs:6:23
|
LL | llvm_asm!("nop" : struct);
| ^^^^^^ not a string literal
error: expected string literal
- --> $DIR/llvm-asm-parse-errors.rs:6:35
+ --> $DIR/llvm-asm-parse-errors.rs:7:35
|
LL | llvm_asm!("mov %eax, $$0x2" : struct);
| ^^^^^^ not a string literal
error: expected `(`, found keyword `struct`
- --> $DIR/llvm-asm-parse-errors.rs:7:44
+ --> $DIR/llvm-asm-parse-errors.rs:8:44
|
LL | llvm_asm!("mov %eax, $$0x2" : "={eax}" struct);
| ^^^^^^ expected `(`
error: expected expression, found keyword `struct`
- --> $DIR/llvm-asm-parse-errors.rs:8:44
+ --> $DIR/llvm-asm-parse-errors.rs:9:44
|
LL | llvm_asm!("mov %eax, $$0x2" : "={eax}"(struct));
| ^^^^^^ expected expression
error: expected string literal
- --> $DIR/llvm-asm-parse-errors.rs:9:49
+ --> $DIR/llvm-asm-parse-errors.rs:10:49
|
LL | llvm_asm!("in %dx, %al" : "={al}"(result) : struct);
| ^^^^^^ not a string literal
error: expected `(`, found keyword `struct`
- --> $DIR/llvm-asm-parse-errors.rs:10:56
+ --> $DIR/llvm-asm-parse-errors.rs:11:56
|
LL | llvm_asm!("in %dx, %al" : "={al}"(result) : "{dx}" struct);
| ^^^^^^ expected `(`
error: expected expression, found keyword `struct`
- --> $DIR/llvm-asm-parse-errors.rs:11:56
+ --> $DIR/llvm-asm-parse-errors.rs:12:56
|
LL | llvm_asm!("in %dx, %al" : "={al}"(result) : "{dx}"(struct));
| ^^^^^^ expected expression
error: expected string literal
- --> $DIR/llvm-asm-parse-errors.rs:12:41
+ --> $DIR/llvm-asm-parse-errors.rs:13:41
|
LL | llvm_asm!("mov $$0x200, %eax" : : : struct);
| ^^^^^^ not a string literal
error: expected string literal
- --> $DIR/llvm-asm-parse-errors.rs:13:50
+ --> $DIR/llvm-asm-parse-errors.rs:14:50
|
LL | llvm_asm!("mov eax, 2" : "={eax}"(foo) : : : struct);
| ^^^^^^ not a string literal
error: inline assembly must be a string literal
- --> $DIR/llvm-asm-parse-errors.rs:14:15
+ --> $DIR/llvm-asm-parse-errors.rs:15:15
|
LL | llvm_asm!(123);
| ^^^
diff --git a/src/test/ui/loops/loop-break-value-no-repeat.stderr b/src/test/ui/loops/loop-break-value-no-repeat.stderr
index 1c0d39a..605a184 100644
--- a/src/test/ui/loops/loop-break-value-no-repeat.stderr
+++ b/src/test/ui/loops/loop-break-value-no-repeat.stderr
@@ -9,7 +9,7 @@
help: use `break` on its own without a value inside this `for` loop
|
LL | break
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr
index adb099f..ccb27c3 100644
--- a/src/test/ui/loops/loop-break-value.stderr
+++ b/src/test/ui/loops/loop-break-value.stderr
@@ -29,11 +29,11 @@
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'while_loop;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:30:13
@@ -47,7 +47,7 @@
help: use `break` on its own without a value inside this `while` loop
|
LL | break 'while_loop;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:38:12
@@ -60,7 +60,7 @@
help: use `break` on its own without a value inside this `while` loop
|
LL | if break {
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:43:9
@@ -73,7 +73,7 @@
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:49:13
@@ -87,7 +87,7 @@
help: use `break` on its own without a value inside this `while` loop
|
LL | break 'while_let_loop;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/loop-break-value.rs:56:9
@@ -100,7 +100,7 @@
help: use `break` on its own without a value inside this `for` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/loop-break-value.rs:57:9
@@ -114,7 +114,7 @@
help: use `break` on its own without a value inside this `for` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/loop-break-value.rs:64:13
@@ -128,7 +128,7 @@
help: use `break` on its own without a value inside this `for` loop
|
LL | break 'for_loop;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/loop-break-value.rs:4:31
diff --git a/src/test/ui/loops/loop-no-implicit-break.stderr b/src/test/ui/loops/loop-no-implicit-break.stderr
index 5087662..8a1afde 100644
--- a/src/test/ui/loops/loop-no-implicit-break.stderr
+++ b/src/test/ui/loops/loop-no-implicit-break.stderr
@@ -7,7 +7,7 @@
help: you might have meant to break the loop with this value
|
LL | break 1;
- | ^^^^^ ^
+ | +++++ +
error[E0308]: mismatched types
--> $DIR/loop-no-implicit-break.rs:13:9
@@ -18,7 +18,7 @@
help: you might have meant to break the loop with this value
|
LL | break 1;
- | ^^^^^ ^
+ | +++++ +
error[E0308]: mismatched types
--> $DIR/loop-no-implicit-break.rs:21:9
@@ -29,7 +29,7 @@
help: you might have meant to return this value
|
LL | return 1;
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/loop-no-implicit-break.rs:29:9
@@ -40,7 +40,7 @@
help: you might have meant to return this value
|
LL | return 1;
- | ^^^^^^ ^
+ | ++++++ +
error: aborting due to 4 previous errors
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nll.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nll.stderr
index b95e247..3fdc2da 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nll.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nll.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/old-lub-glb-hr-noteq1.rs:11:14
|
LL | _ => y,
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's> fn(&'r u8, &'s u8) -> &'r u8`
+ found fn pointer `for<'r> fn(&'r u8, &'r u8) -> &'r u8`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs
index 4bdd05b..2aabc0d 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.rs
@@ -10,6 +10,7 @@
// relationship, and that holds.
//
// ignore-compare-mode-nll
+// ignore-compare-mode-polonius
fn foo(x: for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8, y: for<'a> fn(&'a u8, &'a u8) -> &'a u8) {
// The two types above are not equivalent. With the older LUB/GLB
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.stderr
index 252e13a..eacbbb8 100644
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-hr-noteq2.stderr
@@ -1,5 +1,5 @@
error[E0308]: `match` arms have incompatible types
- --> $DIR/old-lub-glb-hr-noteq2.rs:20:14
+ --> $DIR/old-lub-glb-hr-noteq2.rs:21:14
|
LL | let z = match 22 {
| _____________-
diff --git a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr b/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr
index 51bf96f..ad14d6b 100644
--- a/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr
+++ b/src/test/ui/lub-glb/old-lub-glb-object.nll.stderr
@@ -1,14 +1,21 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/old-lub-glb-object.rs:10:14
|
LL | _ => y,
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected trait object `dyn for<'r, 's> Foo<&'r u8, &'s u8>`
+ found trait object `dyn for<'r> Foo<&'r u8, &'r u8>`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/old-lub-glb-object.rs:10:14
|
LL | _ => y,
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected trait object `dyn for<'r, 's> Foo<&'r u8, &'s u8>`
+ found trait object `dyn for<'r> Foo<&'r u8, &'r u8>`
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr
index 4d8a8ed..4383759 100644
--- a/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr
+++ b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr
@@ -21,7 +21,7 @@
...
LL | ping!();
| -------- in this macro invocation (#1)
- |
+ |
::: $DIR/auxiliary/ping.rs:5:1
|
LL | / macro_rules! ping {
@@ -43,7 +43,7 @@
...
LL | deep!();
| -------- in this macro invocation (#1)
- |
+ |
::: $DIR/auxiliary/ping.rs:5:1
|
LL | / macro_rules! ping {
diff --git a/src/test/ui/macros/bad_hello.stderr b/src/test/ui/macros/bad_hello.stderr
index 6ef4cdc..fc9bb82 100644
--- a/src/test/ui/macros/bad_hello.stderr
+++ b/src/test/ui/macros/bad_hello.stderr
@@ -7,7 +7,7 @@
help: you might be missing a string literal to format with
|
LL | println!("{}", 3 + 4);
- | ^^^^^
+ | +++++
error: format argument must be a string literal
--> $DIR/bad_hello.rs:4:14
@@ -18,7 +18,7 @@
help: you might be missing a string literal to format with
|
LL | println!("{} {}", 3, 4);
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/macros/derive-in-eager-expansion-hang.stderr b/src/test/ui/macros/derive-in-eager-expansion-hang.stderr
index dfbbb07..e0a4f38 100644
--- a/src/test/ui/macros/derive-in-eager-expansion-hang.stderr
+++ b/src/test/ui/macros/derive-in-eager-expansion-hang.stderr
@@ -16,7 +16,7 @@
help: you might be missing a string literal to format with
|
LL | format_args!("{}", hang!());
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/macros/empty-trailing-stmt.stderr b/src/test/ui/macros/empty-trailing-stmt.stderr
index 1db759a..97a2edd 100644
--- a/src/test/ui/macros/empty-trailing-stmt.stderr
+++ b/src/test/ui/macros/empty-trailing-stmt.stderr
@@ -7,7 +7,7 @@
help: you might have meant to return this value
|
LL | { return true; }
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/empty-trailing-stmt.rs:5:13
diff --git a/src/test/ui/macros/format-foreign.stderr b/src/test/ui/macros/format-foreign.stderr
index e2f2f14..ff5236d 100644
--- a/src/test/ui/macros/format-foreign.stderr
+++ b/src/test/ui/macros/format-foreign.stderr
@@ -12,7 +12,7 @@
help: format specifiers use curly braces
|
LL | println!("{:.2$} {}!\n", "Hello,", "World", 4);
- | ^^^^^^ ^^
+ | ~~~~~~ ~~
error: argument never used
--> $DIR/format-foreign.rs:3:29
@@ -40,8 +40,8 @@
= note: printf formatting not supported; see the documentation for `std::fmt`
help: format specifiers use curly braces
|
-LL | println!(r###"{:.2$}
-LL | {}!\n
+LL ~ println!(r###"{:.2$}
+LL ~ {}!\n
|
error: argument never used
@@ -76,7 +76,7 @@
help: format specifiers use curly braces
|
LL | println!("{1} {0} $$ {NAME}", 1, 2, NAME=3);
- | ^^^ ^^^ ^^^^^^
+ | ~~~ ~~~ ~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/macros/format-parse-errors.stderr b/src/test/ui/macros/format-parse-errors.stderr
index b479a27..ef914cc 100644
--- a/src/test/ui/macros/format-parse-errors.stderr
+++ b/src/test/ui/macros/format-parse-errors.stderr
@@ -47,7 +47,7 @@
help: you might be missing a string literal to format with
|
LL | format!("{}", 123);
- | ^^^^^
+ | +++++
error: aborting due to 7 previous errors
diff --git a/src/test/ui/macros/issue-30143.stderr b/src/test/ui/macros/issue-30143.stderr
index 19d977f..fd2378d 100644
--- a/src/test/ui/macros/issue-30143.stderr
+++ b/src/test/ui/macros/issue-30143.stderr
@@ -7,7 +7,7 @@
help: you might be missing a string literal to format with
|
LL | println!("{}", 0);
- | ^^^^^
+ | +++++
error: format argument must be a string literal
--> $DIR/issue-30143.rs:6:15
@@ -18,7 +18,7 @@
help: you might be missing a string literal to format with
|
LL | eprintln!("{}", 'a');
- | ^^^^^
+ | +++++
error: format argument must be a string literal
--> $DIR/issue-30143.rs:9:17
@@ -29,7 +29,7 @@
help: you might be missing a string literal to format with
|
LL | writeln!(s, "{}", true).unwrap();
- | ^^^^^
+ | +++++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/macros/issue-34421-mac-expr-bad-stmt-good-add-semi.stderr b/src/test/ui/macros/issue-34421-mac-expr-bad-stmt-good-add-semi.stderr
index b707915..0013966 100644
--- a/src/test/ui/macros/issue-34421-mac-expr-bad-stmt-good-add-semi.stderr
+++ b/src/test/ui/macros/issue-34421-mac-expr-bad-stmt-good-add-semi.stderr
@@ -12,7 +12,7 @@
help: add `;` to interpret the expansion as a statement
|
LL | make_item!(A);
- | ^
+ | +
error: expected expression, found keyword `struct`
--> $DIR/issue-34421-mac-expr-bad-stmt-good-add-semi.rs:3:9
@@ -28,7 +28,7 @@
help: add `;` to interpret the expansion as a statement
|
LL | make_item!(B);
- | ^
+ | +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/macros/issue-86082-option-env-invalid-char.rs b/src/test/ui/macros/issue-86082-option-env-invalid-char.rs
new file mode 100644
index 0000000..b556b24
--- /dev/null
+++ b/src/test/ui/macros/issue-86082-option-env-invalid-char.rs
@@ -0,0 +1,10 @@
+// check-pass
+//
+// Regression test for issue #86082
+//
+// Checks that option_env! does not panic on receiving an invalid
+// environment variable name.
+
+fn main() {
+ option_env!("\0=");
+}
diff --git a/src/test/ui/macros/issue-87877.rs b/src/test/ui/macros/issue-87877.rs
new file mode 100644
index 0000000..a40e2c5
--- /dev/null
+++ b/src/test/ui/macros/issue-87877.rs
@@ -0,0 +1,25 @@
+// check-pass
+
+macro_rules! two_items {
+ () => {
+ extern "C" {}
+ extern "C" {}
+ };
+}
+
+macro_rules! single_expr_funneler {
+ ($expr:expr) => {
+ $expr; // note the semicolon, it changes the statement kind during parsing
+ };
+}
+
+macro_rules! single_item_funneler {
+ ($item:item) => {
+ $item
+ };
+}
+
+fn main() {
+ single_expr_funneler! { two_items! {} }
+ single_item_funneler! { two_items! {} }
+}
diff --git a/src/test/ui/macros/issue-88206.rs b/src/test/ui/macros/issue-88206.rs
new file mode 100644
index 0000000..14e2f66
--- /dev/null
+++ b/src/test/ui/macros/issue-88206.rs
@@ -0,0 +1,66 @@
+// compile-flags: -Z deduplicate-diagnostics=yes
+
+#![warn(unused_imports)]
+
+use std::str::*;
+//~^ NOTE `from_utf8` is imported here, but it is a function
+//~| NOTE `from_utf8_mut` is imported here, but it is a function
+//~| NOTE `from_utf8_unchecked` is imported here, but it is a function
+
+mod hey {
+ pub trait Serialize {}
+ pub trait Deserialize {}
+
+ pub struct X(i32);
+}
+
+use hey::{Serialize, Deserialize, X};
+//~^ NOTE `Serialize` is imported here, but it is only a trait, without a derive macro
+//~| NOTE `Deserialize` is imported here, but it is a trait
+//~| NOTE `X` is imported here, but it is a struct
+
+#[derive(Serialize)]
+//~^ ERROR cannot find derive macro `Serialize`
+struct A;
+
+#[derive(from_utf8_mut)]
+//~^ ERROR cannot find derive macro `from_utf8_mut`
+struct B;
+
+#[derive(println)]
+//~^ ERROR cannot find derive macro `println`
+//~| NOTE `println` is in scope, but it is a function-like macro
+struct C;
+
+#[Deserialize]
+//~^ ERROR cannot find attribute `Deserialize`
+struct D;
+
+#[from_utf8_unchecked]
+//~^ ERROR cannot find attribute `from_utf8_unchecked`
+struct E;
+
+#[println]
+//~^ ERROR cannot find attribute `println`
+//~| NOTE `println` is in scope, but it is a function-like macro
+struct F;
+
+fn main() {
+ from_utf8!();
+ //~^ ERROR cannot find macro `from_utf8`
+
+ Box!();
+ //~^ ERROR cannot find macro `Box`
+ //~| NOTE `Box` is in scope, but it is a struct
+
+ Copy!();
+ //~^ ERROR cannot find macro `Copy`
+ //~| NOTE `Copy` is in scope, but it is a derive macro
+
+ test!();
+ //~^ ERROR cannot find macro `test`
+ //~| NOTE `test` is in scope, but it is an attribute
+
+ X!();
+ //~^ ERROR cannot find macro `X`
+}
diff --git a/src/test/ui/macros/issue-88206.stderr b/src/test/ui/macros/issue-88206.stderr
new file mode 100644
index 0000000..f7f5b56
--- /dev/null
+++ b/src/test/ui/macros/issue-88206.stderr
@@ -0,0 +1,114 @@
+error: cannot find macro `X` in this scope
+ --> $DIR/issue-88206.rs:64:5
+ |
+LL | X!();
+ | ^
+ |
+note: `X` is imported here, but it is a struct, not a macro
+ --> $DIR/issue-88206.rs:17:35
+ |
+LL | use hey::{Serialize, Deserialize, X};
+ | ^
+
+error: cannot find macro `test` in this scope
+ --> $DIR/issue-88206.rs:60:5
+ |
+LL | test!();
+ | ^^^^
+ |
+ = note: `test` is in scope, but it is an attribute: `#[test]`
+
+error: cannot find macro `Copy` in this scope
+ --> $DIR/issue-88206.rs:56:5
+ |
+LL | Copy!();
+ | ^^^^
+ |
+ = note: `Copy` is in scope, but it is a derive macro: `#[derive(Copy)]`
+
+error: cannot find macro `Box` in this scope
+ --> $DIR/issue-88206.rs:52:5
+ |
+LL | Box!();
+ | ^^^
+ |
+ = note: `Box` is in scope, but it is a struct, not a macro
+
+error: cannot find macro `from_utf8` in this scope
+ --> $DIR/issue-88206.rs:49:5
+ |
+LL | from_utf8!();
+ | ^^^^^^^^^
+ |
+note: `from_utf8` is imported here, but it is a function, not a macro
+ --> $DIR/issue-88206.rs:5:5
+ |
+LL | use std::str::*;
+ | ^^^^^^^^^^^
+
+error: cannot find attribute `println` in this scope
+ --> $DIR/issue-88206.rs:43:3
+ |
+LL | #[println]
+ | ^^^^^^^
+ |
+ = note: `println` is in scope, but it is a function-like macro
+
+error: cannot find attribute `from_utf8_unchecked` in this scope
+ --> $DIR/issue-88206.rs:39:3
+ |
+LL | #[from_utf8_unchecked]
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+note: `from_utf8_unchecked` is imported here, but it is a function, not an attribute
+ --> $DIR/issue-88206.rs:5:5
+ |
+LL | use std::str::*;
+ | ^^^^^^^^^^^
+
+error: cannot find attribute `Deserialize` in this scope
+ --> $DIR/issue-88206.rs:35:3
+ |
+LL | #[Deserialize]
+ | ^^^^^^^^^^^
+ |
+note: `Deserialize` is imported here, but it is a trait, not an attribute
+ --> $DIR/issue-88206.rs:17:22
+ |
+LL | use hey::{Serialize, Deserialize, X};
+ | ^^^^^^^^^^^
+
+error: cannot find derive macro `println` in this scope
+ --> $DIR/issue-88206.rs:30:10
+ |
+LL | #[derive(println)]
+ | ^^^^^^^
+ |
+ = note: `println` is in scope, but it is a function-like macro
+
+error: cannot find derive macro `from_utf8_mut` in this scope
+ --> $DIR/issue-88206.rs:26:10
+ |
+LL | #[derive(from_utf8_mut)]
+ | ^^^^^^^^^^^^^
+ |
+note: `from_utf8_mut` is imported here, but it is a function, not a derive macro
+ --> $DIR/issue-88206.rs:5:5
+ |
+LL | use std::str::*;
+ | ^^^^^^^^^^^
+
+error: cannot find derive macro `Serialize` in this scope
+ --> $DIR/issue-88206.rs:22:10
+ |
+LL | #[derive(Serialize)]
+ | ^^^^^^^^^
+ |
+note: `Serialize` is imported here, but it is only a trait, without a derive macro
+ --> $DIR/issue-88206.rs:17:11
+ |
+LL | use hey::{Serialize, Deserialize, X};
+ | ^^^^^^^^^
+
+error: aborting due to 11 previous errors
+
diff --git a/src/test/ui/macros/issue-88228.rs b/src/test/ui/macros/issue-88228.rs
new file mode 100644
index 0000000..cbdef5f
--- /dev/null
+++ b/src/test/ui/macros/issue-88228.rs
@@ -0,0 +1,23 @@
+// compile-flags: -Z deduplicate-diagnostics=yes
+// edition:2018
+
+mod hey {
+ pub use Copy as Bla;
+ pub use std::println as bla;
+}
+
+#[derive(Bla)]
+//~^ ERROR cannot find derive macro `Bla`
+//~| NOTE consider importing this derive macro
+struct A;
+
+#[derive(println)]
+//~^ ERROR cannot find derive macro `println`
+//~|`println` is in scope, but it is a function-like macro
+struct B;
+
+fn main() {
+ bla!();
+ //~^ ERROR cannot find macro `bla`
+ //~| NOTE consider importing this macro
+}
diff --git a/src/test/ui/macros/issue-88228.stderr b/src/test/ui/macros/issue-88228.stderr
new file mode 100644
index 0000000..62afa67
--- /dev/null
+++ b/src/test/ui/macros/issue-88228.stderr
@@ -0,0 +1,28 @@
+error: cannot find macro `bla` in this scope
+ --> $DIR/issue-88228.rs:20:5
+ |
+LL | bla!();
+ | ^^^
+ |
+ = note: consider importing this macro:
+ crate::hey::bla
+
+error: cannot find derive macro `println` in this scope
+ --> $DIR/issue-88228.rs:14:10
+ |
+LL | #[derive(println)]
+ | ^^^^^^^
+ |
+ = note: `println` is in scope, but it is a function-like macro
+
+error: cannot find derive macro `Bla` in this scope
+ --> $DIR/issue-88228.rs:9:10
+ |
+LL | #[derive(Bla)]
+ | ^^^
+ |
+ = note: consider importing this derive macro:
+ crate::hey::Bla
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/macros/lint-trailing-macro-call.rs b/src/test/ui/macros/lint-trailing-macro-call.rs
new file mode 100644
index 0000000..f8e8475
--- /dev/null
+++ b/src/test/ui/macros/lint-trailing-macro-call.rs
@@ -0,0 +1,16 @@
+// check-pass
+//
+// Ensures that we properly lint
+// a removed 'expression' resulting from a macro
+// in trailing expression position
+
+macro_rules! expand_it {
+ () => {
+ #[cfg(FALSE)] 25; //~ WARN trailing semicolon in macro
+ //~| WARN this was previously
+ }
+}
+
+fn main() {
+ expand_it!()
+}
diff --git a/src/test/ui/macros/lint-trailing-macro-call.stderr b/src/test/ui/macros/lint-trailing-macro-call.stderr
new file mode 100644
index 0000000..a98a559
--- /dev/null
+++ b/src/test/ui/macros/lint-trailing-macro-call.stderr
@@ -0,0 +1,18 @@
+warning: trailing semicolon in macro used in expression position
+ --> $DIR/lint-trailing-macro-call.rs:9:25
+ |
+LL | #[cfg(FALSE)] 25;
+ | ^
+...
+LL | expand_it!()
+ | ------------ in this macro invocation
+ |
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: macro invocations at the end of a block are treated as expressions
+ = note: to ignore the value produced by the macro, add a semicolon after the invocation of `expand_it`
+ = note: this warning originates in the macro `expand_it` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr
index b4d2069..5c86460 100644
--- a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr
+++ b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr
@@ -44,7 +44,7 @@
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
- | ^^^^^^^
+ | ~~~~~~~
error[E0599]: no method named `fake` found for type `{integer}` in the current scope
--> $DIR/macro-backtrace-invalid-internals.rs:23:13
@@ -92,7 +92,7 @@
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 8 previous errors
diff --git a/src/test/ui/macros/macro-context.rs b/src/test/ui/macros/macro-context.rs
index 13e1795..d09fdf1 100644
--- a/src/test/ui/macros/macro-context.rs
+++ b/src/test/ui/macros/macro-context.rs
@@ -6,6 +6,8 @@
//~| ERROR macro expansion ignores token `;`
//~| ERROR cannot find type `i` in this scope
//~| ERROR cannot find value `i` in this scope
+ //~| WARN trailing semicolon in macro
+ //~| WARN this was previously
}
fn main() {
diff --git a/src/test/ui/macros/macro-context.stderr b/src/test/ui/macros/macro-context.stderr
index 5ed73b7..3b8a6f1 100644
--- a/src/test/ui/macros/macro-context.stderr
+++ b/src/test/ui/macros/macro-context.stderr
@@ -64,7 +64,21 @@
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 6 previous errors
+warning: trailing semicolon in macro used in expression position
+ --> $DIR/macro-context.rs:3:15
+ |
+LL | () => ( i ; typeof );
+ | ^
+...
+LL | let i = m!();
+ | ---- in this macro invocation
+ |
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 6 previous errors; 1 warning emitted
Some errors have detailed explanations: E0412, E0425.
For more information about an error, try `rustc --explain E0412`.
diff --git a/src/test/ui/macros/macro-expanded-include/test.rs b/src/test/ui/macros/macro-expanded-include/test.rs
index f1a7105..6a2b5ef 100644
--- a/src/test/ui/macros/macro-expanded-include/test.rs
+++ b/src/test/ui/macros/macro-expanded-include/test.rs
@@ -1,4 +1,4 @@
-// ignore-emscripten no llvm_asm! support
+// needs-asm-support
// build-pass (FIXME(62277): could be check-pass?)
#![feature(asm)]
#![allow(unused)]
diff --git a/src/test/ui/macros/macro-in-expression-context-2.stderr b/src/test/ui/macros/macro-in-expression-context-2.stderr
index 8f96609..d0312c4 100644
--- a/src/test/ui/macros/macro-in-expression-context-2.stderr
+++ b/src/test/ui/macros/macro-in-expression-context-2.stderr
@@ -11,7 +11,7 @@
help: add `;` to interpret the expansion as a statement
|
LL | _ => { empty!(); }
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/macros/macro-in-expression-context.fixed b/src/test/ui/macros/macro-in-expression-context.fixed
index df36db0..f22caf2 100644
--- a/src/test/ui/macros/macro-in-expression-context.fixed
+++ b/src/test/ui/macros/macro-in-expression-context.fixed
@@ -3,6 +3,12 @@
macro_rules! foo {
() => {
assert_eq!("A", "A");
+ //~^ WARN trailing semicolon in macro
+ //~| WARN this was previously
+ //~| NOTE macro invocations at the end of a block
+ //~| NOTE to ignore the value produced by the macro
+ //~| NOTE for more information
+ //~| NOTE `#[warn(semicolon_in_expressions_from_macros)]` on by default
assert_eq!("B", "B");
}
//~^^ ERROR macro expansion ignores token `assert_eq` and any following
@@ -12,4 +18,10 @@
fn main() {
foo!();
//~^ NOTE caused by the macro expansion here
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
}
diff --git a/src/test/ui/macros/macro-in-expression-context.rs b/src/test/ui/macros/macro-in-expression-context.rs
index b3f5e56..1a056e5 100644
--- a/src/test/ui/macros/macro-in-expression-context.rs
+++ b/src/test/ui/macros/macro-in-expression-context.rs
@@ -3,6 +3,12 @@
macro_rules! foo {
() => {
assert_eq!("A", "A");
+ //~^ WARN trailing semicolon in macro
+ //~| WARN this was previously
+ //~| NOTE macro invocations at the end of a block
+ //~| NOTE to ignore the value produced by the macro
+ //~| NOTE for more information
+ //~| NOTE `#[warn(semicolon_in_expressions_from_macros)]` on by default
assert_eq!("B", "B");
}
//~^^ ERROR macro expansion ignores token `assert_eq` and any following
@@ -12,4 +18,10 @@
fn main() {
foo!()
//~^ NOTE caused by the macro expansion here
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
+ //~| NOTE in this expansion
}
diff --git a/src/test/ui/macros/macro-in-expression-context.stderr b/src/test/ui/macros/macro-in-expression-context.stderr
index d27d6fb..1840bab 100644
--- a/src/test/ui/macros/macro-in-expression-context.stderr
+++ b/src/test/ui/macros/macro-in-expression-context.stderr
@@ -1,5 +1,5 @@
error: macro expansion ignores token `assert_eq` and any following
- --> $DIR/macro-in-expression-context.rs:6:9
+ --> $DIR/macro-in-expression-context.rs:12:9
|
LL | assert_eq!("B", "B");
| ^^^^^^^^^
@@ -11,5 +11,21 @@
|
= note: the usage of `foo!` is likely invalid in expression context
-error: aborting due to previous error
+warning: trailing semicolon in macro used in expression position
+ --> $DIR/macro-in-expression-context.rs:5:29
+ |
+LL | assert_eq!("A", "A");
+ | ^
+...
+LL | foo!()
+ | ------ in this macro invocation
+ |
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: macro invocations at the end of a block are treated as expressions
+ = note: to ignore the value produced by the macro, add a semicolon after the invocation of `foo`
+ = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr
index 94eb8dc..3e8cfb3 100644
--- a/src/test/ui/macros/macro-name-typo.stderr
+++ b/src/test/ui/macros/macro-name-typo.stderr
@@ -3,7 +3,7 @@
|
LL | printlx!("oh noes!");
| ^^^^^^^ help: a macro with a similar name exists: `println`
- |
+ |
::: $SRC_DIR/std/src/macros.rs:LL:COL
|
LL | macro_rules! println {
diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.stderr b/src/test/ui/macros/macro-or-patterns-back-compat.stderr
index eb6204f..9a5b800 100644
--- a/src/test/ui/macros/macro-or-patterns-back-compat.stderr
+++ b/src/test/ui/macros/macro-or-patterns-back-compat.stderr
@@ -10,7 +10,7 @@
LL | #![deny(rust_2021_incompatible_or_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
--> $DIR/macro-or-patterns-back-compat.rs:13:23
@@ -19,7 +19,7 @@
| ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
--> $DIR/macro-or-patterns-back-compat.rs:19:21
@@ -28,7 +28,7 @@
| ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
--> $DIR/macro-or-patterns-back-compat.rs:23:26
@@ -37,7 +37,7 @@
| ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: aborting due to 4 previous errors
diff --git a/src/test/ui/macros/macro-path-prelude-fail-3.stderr b/src/test/ui/macros/macro-path-prelude-fail-3.stderr
index 523f08d..70900a6 100644
--- a/src/test/ui/macros/macro-path-prelude-fail-3.stderr
+++ b/src/test/ui/macros/macro-path-prelude-fail-3.stderr
@@ -3,11 +3,13 @@
|
LL | inline!();
| ^^^^^^ help: a macro with a similar name exists: `line`
- |
+ |
::: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
LL | macro_rules! line {
| ----------------- similarly named macro `line` defined here
+ |
+ = note: `inline` is in scope, but it is an attribute: `#[inline]`
error: aborting due to previous error
diff --git a/src/test/ui/macros/macro-stability-rpass.rs b/src/test/ui/macros/macro-stability-rpass.rs
index a5f538b..2d02b95 100644
--- a/src/test/ui/macros/macro-stability-rpass.rs
+++ b/src/test/ui/macros/macro-stability-rpass.rs
@@ -1,7 +1,8 @@
// run-pass
// aux-build:unstable-macros.rs
-#![feature(unstable_macros, local_unstable)]
+#![unstable(feature = "one_two_three_testing", issue = "none")]
+#![feature(staged_api, unstable_macros, local_unstable)]
#[macro_use] extern crate unstable_macros;
diff --git a/src/test/ui/macros/macro-use-wrong-name.stderr b/src/test/ui/macros/macro-use-wrong-name.stderr
index 888fb91..326001f 100644
--- a/src/test/ui/macros/macro-use-wrong-name.stderr
+++ b/src/test/ui/macros/macro-use-wrong-name.stderr
@@ -3,7 +3,7 @@
|
LL | macro_two!();
| ^^^^^^^^^ help: a macro with a similar name exists: `macro_one`
- |
+ |
::: $DIR/auxiliary/two_macros.rs:2:1
|
LL | macro_rules! macro_one { () => ("one") }
diff --git a/src/test/ui/macros/macros-nonfatal-errors.rs b/src/test/ui/macros/macros-nonfatal-errors.rs
index 0a496c9..24adc0f 100644
--- a/src/test/ui/macros/macros-nonfatal-errors.rs
+++ b/src/test/ui/macros/macros-nonfatal-errors.rs
@@ -5,9 +5,95 @@
#![feature(asm, llvm_asm)]
#![feature(trace_macros, concat_idents)]
+#![feature(stmt_expr_attributes, arbitrary_enum_discriminant)]
+#![feature(derive_default_enum)]
+#![allow(deprecated)] // llvm_asm!
-#[derive(Default)] //~ ERROR
-enum OrDeriveThis {}
+#[derive(Default)]
+struct DefaultInnerAttrStruct {
+ #[default] //~ ERROR the `#[default]` attribute may only be used on unit enum variants
+ foo: (),
+}
+
+#[derive(Default)]
+struct DefaultInnerAttrTupleStruct(#[default] ());
+//~^ ERROR the `#[default]` attribute may only be used on unit enum variants
+
+#[derive(Default)]
+#[default] //~ ERROR the `#[default]` attribute may only be used on unit enum variants
+struct DefaultOuterAttrStruct {}
+
+#[derive(Default)]
+#[default] //~ ERROR the `#[default]` attribute may only be used on unit enum variants
+enum DefaultOuterAttrEnum {
+ #[default]
+ Foo,
+}
+
+#[rustfmt::skip] // needs some work to handle this case
+#[repr(u8)]
+#[derive(Default)]
+enum AttrOnInnerExpression {
+ Foo = #[default] 0, //~ ERROR the `#[default]` attribute may only be used on unit enum variants
+ Bar([u8; #[default] 1]), //~ ERROR the `#[default]` attribute may only be used on unit enum variants
+ #[default]
+ Baz,
+}
+
+#[derive(Default)] //~ ERROR no default declared
+enum NoDeclaredDefault {
+ Foo,
+ Bar,
+}
+
+#[derive(Default)] //~ ERROR multiple declared defaults
+enum MultipleDefaults {
+ #[default]
+ Foo,
+ #[default]
+ Bar,
+ #[default]
+ Baz,
+}
+
+#[derive(Default)]
+enum ExtraDeriveTokens {
+ #[default = 1] //~ ERROR `#[default]` attribute does not accept a value
+ Foo,
+}
+
+#[derive(Default)]
+enum TwoDefaultAttrs {
+ #[default]
+ #[default]
+ Foo, //~ERROR multiple `#[default]` attributes
+ Bar,
+}
+
+#[derive(Default)]
+enum ManyDefaultAttrs {
+ #[default]
+ #[default]
+ #[default]
+ #[default]
+ Foo, //~ERROR multiple `#[default]` attributes
+ Bar,
+}
+
+#[derive(Default)]
+enum DefaultHasFields {
+ #[default]
+ Foo {}, //~ ERROR the `#[default]` attribute may only be used on unit enum variants
+ Bar,
+}
+
+#[derive(Default)]
+enum NonExhaustiveDefault {
+ #[default]
+ #[non_exhaustive]
+ Foo, //~ ERROR default variant must be exhaustive
+ Bar,
+}
fn main() {
asm!(invalid); //~ ERROR
diff --git a/src/test/ui/macros/macros-nonfatal-errors.stderr b/src/test/ui/macros/macros-nonfatal-errors.stderr
index 14058f8..00c23d5 100644
--- a/src/test/ui/macros/macros-nonfatal-errors.stderr
+++ b/src/test/ui/macros/macros-nonfatal-errors.stderr
@@ -1,49 +1,169 @@
-error[E0665]: `Default` cannot be derived for enums, only structs
- --> $DIR/macros-nonfatal-errors.rs:9:10
+error: the `#[default]` attribute may only be used on unit enum variants
+ --> $DIR/macros-nonfatal-errors.rs:14:5
+ |
+LL | #[default]
+ | ^^^^^^^^^^
+
+error: the `#[default]` attribute may only be used on unit enum variants
+ --> $DIR/macros-nonfatal-errors.rs:19:36
+ |
+LL | struct DefaultInnerAttrTupleStruct(#[default] ());
+ | ^^^^^^^^^^
+
+error: the `#[default]` attribute may only be used on unit enum variants
+ --> $DIR/macros-nonfatal-errors.rs:23:1
+ |
+LL | #[default]
+ | ^^^^^^^^^^
+
+error: the `#[default]` attribute may only be used on unit enum variants
+ --> $DIR/macros-nonfatal-errors.rs:27:1
+ |
+LL | #[default]
+ | ^^^^^^^^^^
+
+error: the `#[default]` attribute may only be used on unit enum variants
+ --> $DIR/macros-nonfatal-errors.rs:37:11
+ |
+LL | Foo = #[default] 0,
+ | ^^^^^^^^^^
+
+error: the `#[default]` attribute may only be used on unit enum variants
+ --> $DIR/macros-nonfatal-errors.rs:38:14
+ |
+LL | Bar([u8; #[default] 1]),
+ | ^^^^^^^^^^
+
+error: no default declared
+ --> $DIR/macros-nonfatal-errors.rs:43:10
|
LL | #[derive(Default)]
| ^^^^^^^
|
+ = help: make a unit variant default by placing `#[default]` above it
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
+error: multiple declared defaults
+ --> $DIR/macros-nonfatal-errors.rs:49:10
+ |
+LL | #[derive(Default)]
+ | ^^^^^^^
+...
+LL | Foo,
+ | --- first default
+LL | #[default]
+LL | Bar,
+ | --- additional default
+LL | #[default]
+LL | Baz,
+ | --- additional default
+ |
+ = note: only one variant can be default
+ = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: `#[default]` attribute does not accept a value
+ --> $DIR/macros-nonfatal-errors.rs:61:5
+ |
+LL | #[default = 1]
+ | ^^^^^^^^^^^^^^
+ |
+ = help: try using `#[default]`
+
+error: multiple `#[default]` attributes
+ --> $DIR/macros-nonfatal-errors.rs:69:5
+ |
+LL | #[default]
+ | ---------- `#[default]` used here
+LL | #[default]
+ | ---------- `#[default]` used again here
+LL | Foo,
+ | ^^^
+ |
+ = note: only one `#[default]` attribute is needed
+help: try removing this
+ --> $DIR/macros-nonfatal-errors.rs:68:5
+ |
+LL | #[default]
+ | ^^^^^^^^^^
+
+error: multiple `#[default]` attributes
+ --> $DIR/macros-nonfatal-errors.rs:79:5
+ |
+LL | #[default]
+ | ---------- `#[default]` used here
+LL | #[default]
+ | ---------- `#[default]` used again here
+...
+LL | Foo,
+ | ^^^
+ |
+ = note: only one `#[default]` attribute is needed
+help: try removing these
+ --> $DIR/macros-nonfatal-errors.rs:76:5
+ |
+LL | #[default]
+ | ^^^^^^^^^^
+LL | #[default]
+ | ^^^^^^^^^^
+LL | #[default]
+ | ^^^^^^^^^^
+
+error: the `#[default]` attribute may only be used on unit enum variants
+ --> $DIR/macros-nonfatal-errors.rs:86:5
+ |
+LL | Foo {},
+ | ^^^
+ |
+ = help: consider a manual implementation of `Default`
+
+error: default variant must be exhaustive
+ --> $DIR/macros-nonfatal-errors.rs:94:5
+ |
+LL | #[non_exhaustive]
+ | ----------------- declared `#[non_exhaustive]` here
+LL | Foo,
+ | ^^^
+ |
+ = help: consider a manual implementation of `Default`
+
error: asm template must be a string literal
- --> $DIR/macros-nonfatal-errors.rs:13:10
+ --> $DIR/macros-nonfatal-errors.rs:99:10
|
LL | asm!(invalid);
| ^^^^^^^
error: inline assembly must be a string literal
- --> $DIR/macros-nonfatal-errors.rs:14:15
+ --> $DIR/macros-nonfatal-errors.rs:100:15
|
LL | llvm_asm!(invalid);
| ^^^^^^^
error: concat_idents! requires ident args.
- --> $DIR/macros-nonfatal-errors.rs:16:5
+ --> $DIR/macros-nonfatal-errors.rs:102:5
|
LL | concat_idents!("not", "idents");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: argument must be a string literal
- --> $DIR/macros-nonfatal-errors.rs:18:17
+ --> $DIR/macros-nonfatal-errors.rs:104:17
|
LL | option_env!(invalid);
| ^^^^^^^
error: expected string literal
- --> $DIR/macros-nonfatal-errors.rs:19:10
+ --> $DIR/macros-nonfatal-errors.rs:105:10
|
LL | env!(invalid);
| ^^^^^^^
error: expected string literal
- --> $DIR/macros-nonfatal-errors.rs:20:10
+ --> $DIR/macros-nonfatal-errors.rs:106:10
|
LL | env!(foo, abr, baz);
| ^^^
error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined
- --> $DIR/macros-nonfatal-errors.rs:21:5
+ --> $DIR/macros-nonfatal-errors.rs:107:5
|
LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -51,7 +171,7 @@
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
error: format argument must be a string literal
- --> $DIR/macros-nonfatal-errors.rs:23:13
+ --> $DIR/macros-nonfatal-errors.rs:109:13
|
LL | format!(invalid);
| ^^^^^^^
@@ -59,22 +179,22 @@
help: you might be missing a string literal to format with
|
LL | format!("{}", invalid);
- | ^^^^^
+ | +++++
error: argument must be a string literal
- --> $DIR/macros-nonfatal-errors.rs:25:14
+ --> $DIR/macros-nonfatal-errors.rs:111:14
|
LL | include!(invalid);
| ^^^^^^^
error: argument must be a string literal
- --> $DIR/macros-nonfatal-errors.rs:27:18
+ --> $DIR/macros-nonfatal-errors.rs:113:18
|
LL | include_str!(invalid);
| ^^^^^^^
error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: $FILE_NOT_FOUND_MSG (os error 2)
- --> $DIR/macros-nonfatal-errors.rs:28:5
+ --> $DIR/macros-nonfatal-errors.rs:114:5
|
LL | include_str!("i'd be quite surprised if a file with this name existed");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -82,13 +202,13 @@
= note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
error: argument must be a string literal
- --> $DIR/macros-nonfatal-errors.rs:29:20
+ --> $DIR/macros-nonfatal-errors.rs:115:20
|
LL | include_bytes!(invalid);
| ^^^^^^^
error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: $FILE_NOT_FOUND_MSG (os error 2)
- --> $DIR/macros-nonfatal-errors.rs:30:5
+ --> $DIR/macros-nonfatal-errors.rs:116:5
|
LL | include_bytes!("i'd be quite surprised if a file with this name existed");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -96,11 +216,10 @@
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
error: trace_macros! accepts only `true` or `false`
- --> $DIR/macros-nonfatal-errors.rs:32:5
+ --> $DIR/macros-nonfatal-errors.rs:118:5
|
LL | trace_macros!(invalid);
| ^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 15 previous errors
+error: aborting due to 27 previous errors
-For more information about this error, try `rustc --explain E0665`.
diff --git a/src/test/ui/malformed/malformed-derive-entry.stderr b/src/test/ui/malformed/malformed-derive-entry.stderr
index ba096a9..0ddce1b 100644
--- a/src/test/ui/malformed/malformed-derive-entry.stderr
+++ b/src/test/ui/malformed/malformed-derive-entry.stderr
@@ -21,12 +21,12 @@
|
LL | #[derive(Copy(Bad))]
| ^^^^ the trait `Clone` is not implemented for `Test1`
- |
- ::: $SRC_DIR/core/src/marker.rs:LL:COL
+ |
+note: required by a bound in `Copy`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
|
LL | pub trait Copy: Clone {
- | ----- required by this bound in `Copy`
- |
+ | ^^^^^ required by this bound in `Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Test2: Clone` is not satisfied
@@ -34,12 +34,12 @@
|
LL | #[derive(Copy="bad")]
| ^^^^ the trait `Clone` is not implemented for `Test2`
- |
- ::: $SRC_DIR/core/src/marker.rs:LL:COL
+ |
+note: required by a bound in `Copy`
+ --> $SRC_DIR/core/src/marker.rs:LL:COL
|
LL | pub trait Copy: Clone {
- | ----- required by this bound in `Copy`
- |
+ | ^^^^^ required by this bound in `Copy`
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 5 previous errors
diff --git a/src/test/ui/malformed/malformed-meta-delim.stderr b/src/test/ui/malformed/malformed-meta-delim.stderr
index 407193d..27636c3 100644
--- a/src/test/ui/malformed/malformed-meta-delim.stderr
+++ b/src/test/ui/malformed/malformed-meta-delim.stderr
@@ -7,7 +7,7 @@
help: the delimiters should be `(` and `)`
|
LL | #[allow ( foo_lint ) ]
- | ^ ^
+ | ~ ~
error: wrong meta list delimiters
--> $DIR/malformed-meta-delim.rs:8:9
@@ -18,7 +18,7 @@
help: the delimiters should be `(` and `)`
|
LL | #[allow ( foo_lint ) ]
- | ^ ^
+ | ~ ~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/malformed/malformed-plugin-3.stderr b/src/test/ui/malformed/malformed-plugin-3.stderr
index 11abdb1..64cb429 100644
--- a/src/test/ui/malformed/malformed-plugin-3.stderr
+++ b/src/test/ui/malformed/malformed-plugin-3.stderr
@@ -14,3 +14,4 @@
error: aborting due to previous error; 1 warning emitted
+For more information about this error, try `rustc --explain E0498`.
diff --git a/src/test/ui/malformed/malformed-unwind-1.rs b/src/test/ui/malformed/malformed-unwind-1.rs
deleted file mode 100644
index 009695b..0000000
--- a/src/test/ui/malformed/malformed-unwind-1.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-#![feature(unwind_attributes)]
-
-#[unwind] //~ ERROR malformed `unwind` attribute
-extern "C" fn f1() {}
-
-#[unwind = ""] //~ ERROR malformed `unwind` attribute
-extern "C" fn f2() {}
-
-fn main() {}
diff --git a/src/test/ui/malformed/malformed-unwind-1.stderr b/src/test/ui/malformed/malformed-unwind-1.stderr
deleted file mode 100644
index 0a553e8..0000000
--- a/src/test/ui/malformed/malformed-unwind-1.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: malformed `unwind` attribute input
- --> $DIR/malformed-unwind-1.rs:3:1
- |
-LL | #[unwind]
- | ^^^^^^^^^ help: must be of the form: `#[unwind(allowed|aborts)]`
-
-error: malformed `unwind` attribute input
- --> $DIR/malformed-unwind-1.rs:6:1
- |
-LL | #[unwind = ""]
- | ^^^^^^^^^^^^^^ help: must be of the form: `#[unwind(allowed|aborts)]`
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/malformed/malformed-unwind-2.rs b/src/test/ui/malformed/malformed-unwind-2.rs
deleted file mode 100644
index 9aafc7c..0000000
--- a/src/test/ui/malformed/malformed-unwind-2.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#![feature(unwind_attributes)]
-
-#[unwind(allowed, aborts)]
-//~^ ERROR malformed `unwind` attribute
-extern "C" fn f1() {}
-
-#[unwind(unsupported)]
-//~^ ERROR malformed `unwind` attribute
-extern "C" fn f2() {}
-
-fn main() {}
diff --git a/src/test/ui/malformed/malformed-unwind-2.stderr b/src/test/ui/malformed/malformed-unwind-2.stderr
deleted file mode 100644
index 28512bf..0000000
--- a/src/test/ui/malformed/malformed-unwind-2.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-error[E0633]: malformed `unwind` attribute input
- --> $DIR/malformed-unwind-2.rs:3:1
- |
-LL | #[unwind(allowed, aborts)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid argument
- |
-help: the allowed arguments are `allowed` and `aborts`
- |
-LL | #[unwind(allowed)]
- |
-LL | #[unwind(aborts)]
- |
-
-error[E0633]: malformed `unwind` attribute input
- --> $DIR/malformed-unwind-2.rs:7:1
- |
-LL | #[unwind(unsupported)]
- | ^^^^^^^^^^^^^^^^^^^^^^ invalid argument
- |
-help: the allowed arguments are `allowed` and `aborts`
- |
-LL | #[unwind(allowed)]
- |
-LL | #[unwind(aborts)]
- |
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0633`.
diff --git a/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr b/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr
index 0fc2664..1f34105 100644
--- a/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr
+++ b/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `NotDebugOrDisplay: Marker` is not satisfied
--> $DIR/overlap-marker-trait.rs:27:17
|
-LL | fn is_marker<T: Marker>() { }
- | ------ required by this bound in `is_marker`
-...
LL | is_marker::<NotDebugOrDisplay>();
| ^^^^^^^^^^^^^^^^^ the trait `Marker` is not implemented for `NotDebugOrDisplay`
+ |
+note: required by a bound in `is_marker`
+ --> $DIR/overlap-marker-trait.rs:15:17
+ |
+LL | fn is_marker<T: Marker>() { }
+ | ^^^^^^ required by this bound in `is_marker`
error: aborting due to previous error
diff --git a/src/test/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs b/src/test/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs
new file mode 100644
index 0000000..a8f3db5
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/overlapping-impl-1-modulo-regions.rs
@@ -0,0 +1,9 @@
+// check-pass
+#![feature(marker_trait_attr)]
+
+#[marker]
+pub trait F {}
+impl<T> F for T where T: Copy {}
+impl<T> F for T where T: 'static {}
+
+fn main() {}
diff --git a/src/test/ui/marker_trait_attr/region-overlap.rs b/src/test/ui/marker_trait_attr/region-overlap.rs
new file mode 100644
index 0000000..b3c6671
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/region-overlap.rs
@@ -0,0 +1,8 @@
+#![feature(marker_trait_attr)]
+
+#[marker]
+trait A {}
+impl<'a> A for (&'static (), &'a ()) {} //~ ERROR type annotations needed
+impl<'a> A for (&'a (), &'static ()) {} //~ ERROR type annotations needed
+
+fn main() {}
diff --git a/src/test/ui/marker_trait_attr/region-overlap.stderr b/src/test/ui/marker_trait_attr/region-overlap.stderr
new file mode 100644
index 0000000..e4a94d5
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/region-overlap.stderr
@@ -0,0 +1,29 @@
+error[E0283]: type annotations needed
+ --> $DIR/region-overlap.rs:5:10
+ |
+LL | impl<'a> A for (&'static (), &'a ()) {}
+ | ^ cannot infer type for tuple `(&'static (), &'a ())`
+ |
+ = note: cannot satisfy `(&'static (), &'a ()): A`
+note: required by a bound in `A`
+ --> $DIR/region-overlap.rs:4:1
+ |
+LL | trait A {}
+ | ^^^^^^^ required by this bound in `A`
+
+error[E0283]: type annotations needed
+ --> $DIR/region-overlap.rs:6:10
+ |
+LL | impl<'a> A for (&'a (), &'static ()) {}
+ | ^ cannot infer type for tuple `(&'a (), &'static ())`
+ |
+ = note: cannot satisfy `(&'a (), &'static ()): A`
+note: required by a bound in `A`
+ --> $DIR/region-overlap.rs:4:1
+ |
+LL | trait A {}
+ | ^^^^^^^ required by this bound in `A`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/marker_trait_attr/unsound-overlap.rs b/src/test/ui/marker_trait_attr/unsound-overlap.rs
new file mode 100644
index 0000000..2e5101b
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/unsound-overlap.rs
@@ -0,0 +1,25 @@
+#![feature(marker_trait_attr)]
+
+#[marker]
+trait A {}
+
+trait B {}
+
+impl<T: A> B for T {}
+impl<T: B> A for T {}
+impl A for &str {}
+impl<T: A + B> A for (T,) {}
+trait TraitWithAssoc {
+ type Assoc;
+}
+
+impl<T: A> TraitWithAssoc for T {
+ type Assoc = T;
+}
+
+impl TraitWithAssoc for ((&str,),) {
+ //~^ ERROR conflicting implementations
+ type Assoc = ((&'static str,),);
+}
+
+fn main() {}
diff --git a/src/test/ui/marker_trait_attr/unsound-overlap.stderr b/src/test/ui/marker_trait_attr/unsound-overlap.stderr
new file mode 100644
index 0000000..5ebac82
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/unsound-overlap.stderr
@@ -0,0 +1,12 @@
+error[E0119]: conflicting implementations of trait `TraitWithAssoc` for type `((&str,),)`
+ --> $DIR/unsound-overlap.rs:20:1
+ |
+LL | impl<T: A> TraitWithAssoc for T {
+ | ------------------------------- first implementation here
+...
+LL | impl TraitWithAssoc for ((&str,),) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `((&str,),)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/match/issue-82392.stdout b/src/test/ui/match/issue-82392.stdout
index 8ff76c6..4f46e32 100644
--- a/src/test/ui/match/issue-82392.stdout
+++ b/src/test/ui/match/issue-82392.stdout
@@ -9,12 +9,11 @@
pub fn main() ({
(if (true as bool)
({ } as
- ()) else {match ((Some as
+ ()) else if (let Some(a) =
+ ((Some as
fn(i32) -> Option<i32> {Option::<i32>::Some})((3
as
i32))
- as Option<i32>) {
- Some(a) => { }
- _ => { }
- }} as ())
- } as ())
+ as Option<i32>) as bool)
+ ({ } as ()) as ())
+ } as ())
diff --git a/src/test/ui/match/match-pattern-field-mismatch.stderr b/src/test/ui/match/match-pattern-field-mismatch.stderr
index 3783948..c994ee4 100644
--- a/src/test/ui/match/match-pattern-field-mismatch.stderr
+++ b/src/test/ui/match/match-pattern-field-mismatch.stderr
@@ -1,20 +1,20 @@
error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
- --> $DIR/match-pattern-field-mismatch.rs:10:11
+ --> $DIR/match-pattern-field-mismatch.rs:10:22
|
LL | Rgb(usize, usize, usize),
- | ------------------------ tuple variant defined here
+ | ----- ----- ----- tuple variant has 3 fields
...
LL | Color::Rgb(_, _) => { }
- | ^^^^^^^^^^^^^^^^ expected 3 fields, found 2
+ | ^ ^ expected 3 fields, found 2
|
help: use `_` to explicitly ignore each field
|
LL | Color::Rgb(_, _, _) => { }
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | Color::Rgb(..) => { }
- | ^^
+ | ~~
error: aborting due to previous error
diff --git a/src/test/ui/meta/expected-error-correct-rev.a.stderr b/src/test/ui/meta/expected-error-correct-rev.a.stderr
index df4dbdb..75c1f69 100644
--- a/src/test/ui/meta/expected-error-correct-rev.a.stderr
+++ b/src/test/ui/meta/expected-error-correct-rev.a.stderr
@@ -9,7 +9,7 @@
help: change the type of the numeric literal from `usize` to `u32`
|
LL | let x: u32 = 22_u32;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr b/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr
index 583b2c4..7985357 100644
--- a/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr
+++ b/src/test/ui/meta/meta-expected-error-wrong-rev.a.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/meta-expected-error-wrong-rev.rs:13:18
+ --> $DIR/meta-expected-error-wrong-rev.rs:14:18
|
LL | let x: u32 = 22_usize;
| --- ^^^^^^^^ expected `u32`, found `usize`
@@ -9,7 +9,7 @@
help: change the type of the numeric literal from `usize` to `u32`
|
LL | let x: u32 = 22_u32;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/meta/meta-expected-error-wrong-rev.rs b/src/test/ui/meta/meta-expected-error-wrong-rev.rs
index 7e49434..80af527 100644
--- a/src/test/ui/meta/meta-expected-error-wrong-rev.rs
+++ b/src/test/ui/meta/meta-expected-error-wrong-rev.rs
@@ -1,4 +1,5 @@
// ignore-compare-mode-nll
+// ignore-compare-mode-polonius
// revisions: a
// should-fail
diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
index 82660a7..e725e74 100644
--- a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
+++ b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr
@@ -17,7 +17,7 @@
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | let y: usize = x.foo().try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr b/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr
index 42802ba..ed03b37 100644
--- a/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr
+++ b/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr
@@ -13,11 +13,11 @@
help: disambiguate the associated function for candidate #1
|
LL | fn main() { Me2::me(&1_usize); }
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | fn main() { Me::me(&1_usize); }
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/methods/method-ambig-two-traits-from-bounds.stderr b/src/test/ui/methods/method-ambig-two-traits-from-bounds.stderr
index 5cbed65..1feaa2c 100644
--- a/src/test/ui/methods/method-ambig-two-traits-from-bounds.stderr
+++ b/src/test/ui/methods/method-ambig-two-traits-from-bounds.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | A::foo(t);
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(t);
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/methods/method-ambig-two-traits-from-impls.stderr b/src/test/ui/methods/method-ambig-two-traits-from-impls.stderr
index 8585929..f69b568 100644
--- a/src/test/ui/methods/method-ambig-two-traits-from-impls.stderr
+++ b/src/test/ui/methods/method-ambig-two-traits-from-impls.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | A::foo(AB {});
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(AB {});
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr b/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr
index 85b3964..e0a58ae 100644
--- a/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr
+++ b/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | A::foo();
- | ^^^^^^
+ | ~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo();
- | ^^^^^^
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/methods/method-ambig-two-traits-with-default-method.stderr b/src/test/ui/methods/method-ambig-two-traits-with-default-method.stderr
index 4ce7236..e84dff8 100644
--- a/src/test/ui/methods/method-ambig-two-traits-with-default-method.stderr
+++ b/src/test/ui/methods/method-ambig-two-traits-with-default-method.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | Foo::method(&1_usize);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | Bar::method(&1_usize);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/methods/method-call-lifetime-args-fail.stderr b/src/test/ui/methods/method-call-lifetime-args-fail.stderr
index ea50815..835edb4 100644
--- a/src/test/ui/methods/method-call-lifetime-args-fail.stderr
+++ b/src/test/ui/methods/method-call-lifetime-args-fail.stderr
@@ -14,7 +14,7 @@
help: add missing lifetime argument
|
LL | S.early::<'static, 'b>();
- | ^^^^
+ | ++++
error[E0107]: this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:18:7
@@ -214,7 +214,7 @@
help: add missing lifetime argument
|
LL | S::early::<'static, 'b>(S);
- | ^^^^
+ | ++++
error[E0107]: this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:65:8
diff --git a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
index 0a516c8..5907539 100644
--- a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
+++ b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
@@ -47,15 +47,15 @@
help: disambiguate the associated function for candidate #1
|
LL | let z = X::foo(x);
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | let z = NuisanceFoo::foo(x);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #3
|
LL | let z = FinalFoo::foo(x);
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:139:24
diff --git a/src/test/ui/methods/method-missing-call.stderr b/src/test/ui/methods/method-missing-call.stderr
index 241c50d..045f9ab 100644
--- a/src/test/ui/methods/method-missing-call.stderr
+++ b/src/test/ui/methods/method-missing-call.stderr
@@ -7,7 +7,7 @@
help: use parentheses to call the method
|
LL | .get_x();
- | ^^
+ | ++
error[E0615]: attempted to take value of method `filter_map` on type `Filter<Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/method-missing-call.rs:27:20: 27:25]>, [closure@$DIR/method-missing-call.rs:28:23: 28:35]>`
--> $DIR/method-missing-call.rs:29:16
@@ -18,7 +18,7 @@
help: use parentheses to call the method
|
LL | .filter_map(_);
- | ^^^
+ | +++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
index c6dde67c..09978b3 100644
--- a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
+++ b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
@@ -7,7 +7,7 @@
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let x = 2.0_f32.neg();
- | ^^^^^^^
+ | ~~~~~~~
error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
--> $DIR/method-on-ambiguous-numeric-type.rs:14:15
@@ -18,7 +18,7 @@
help: you must specify a type for this binding, like `f32`
|
LL | let y: f32 = 2.0;
- | ^^^^^^
+ | ~~~~~~
error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
--> $DIR/method-on-ambiguous-numeric-type.rs:19:26
@@ -37,7 +37,7 @@
help: you must specify a type for this binding, like `i32`
|
LL | ($ident:ident) => { let $ident: i32 = 42; }
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
--> $DIR/method-on-ambiguous-numeric-type.rs:30:9
@@ -48,7 +48,7 @@
help: you must specify a type for this binding, like `i32`
|
LL | ($ident:ident) => { let $ident: i32 = 42; }
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to 5 previous errors
diff --git a/src/test/ui/mir/issue-75053.full_tait.stderr b/src/test/ui/mir/issue-75053.full_tait.stderr
deleted file mode 100644
index 543d15f..0000000
--- a/src/test/ui/mir/issue-75053.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-75053.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-75053.rs:49:1
- |
-LL | fn main() {
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/mir/issue-75053.in_bindings.stderr b/src/test/ui/mir/issue-75053.in_bindings.stderr
deleted file mode 100644
index d75996b..0000000
--- a/src/test/ui/mir/issue-75053.in_bindings.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0557]: feature has been removed
- --> $DIR/issue-75053.rs:7:34
- |
-LL | #![cfg_attr(in_bindings, feature(impl_trait_in_bindings))]
- | ^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
- |
- = note: removed due to being incomplete and unstable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0557`.
diff --git a/src/test/ui/mir/issue-75053.min_tait.stderr b/src/test/ui/mir/issue-75053.min_tait.stderr
deleted file mode 100644
index c533275..0000000
--- a/src/test/ui/mir/issue-75053.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-75053.rs:49:1
- |
-LL | fn main() {
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/mir/issue-75053.rs b/src/test/ui/mir/issue-75053.rs
index b71f84d..cb56eaa 100644
--- a/src/test/ui/mir/issue-75053.rs
+++ b/src/test/ui/mir/issue-75053.rs
@@ -1,9 +1,6 @@
// compile-flags: -Z mir-opt-level=3
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait, rustc_attrs)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait, rustc_attrs)]
use std::marker::PhantomData;
diff --git a/src/test/ui/mir/issue-75053.stderr b/src/test/ui/mir/issue-75053.stderr
new file mode 100644
index 0000000..64e59e6
--- /dev/null
+++ b/src/test/ui/mir/issue-75053.stderr
@@ -0,0 +1,8 @@
+error: fatal error triggered by #[rustc_error]
+ --> $DIR/issue-75053.rs:46:1
+ |
+LL | fn main() {
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/mir/issue-80742.rs b/src/test/ui/mir/issue-80742.rs
deleted file mode 100644
index c06d182..0000000
--- a/src/test/ui/mir/issue-80742.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// check-fail
-
-// This test used to cause an ICE in rustc_mir::interpret::step::eval_rvalue_into_place
-
-#![allow(incomplete_features)]
-#![feature(const_evaluatable_checked)]
-#![feature(const_generics)]
-
-use std::fmt::Debug;
-use std::marker::PhantomData;
-use std::mem::size_of;
-
-struct Inline<T>
-where
- [u8; size_of::<T>() + 1]: ,
-{
- _phantom: PhantomData<T>,
- buf: [u8; size_of::<T>() + 1],
-}
-
-impl<T> Inline<T>
-where
- [u8; size_of::<T>() + 1]: ,
-{
- pub fn new(val: T) -> Inline<T> {
- todo!()
- }
-}
-
-fn main() {
- let dst = Inline::<dyn Debug>::new(0); //~ ERROR
- //~^ ERROR
-}
diff --git a/src/test/ui/mir/issue-80742.stderr b/src/test/ui/mir/issue-80742.stderr
deleted file mode 100644
index 961234c..0000000
--- a/src/test/ui/mir/issue-80742.stderr
+++ /dev/null
@@ -1,70 +0,0 @@
-error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
- --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
-LL | intrinsics::size_of::<T>()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | size_of called on unsized type `dyn Debug`
- | inside `std::mem::size_of::<dyn Debug>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
- ::: $DIR/issue-80742.rs:23:10
- |
-LL | [u8; size_of::<T>() + 1]: ,
- | -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:23:10
-
-error[E0599]: the function or associated item `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied
- --> $DIR/issue-80742.rs:31:36
- |
-LL | / struct Inline<T>
-LL | | where
-LL | | [u8; size_of::<T>() + 1]: ,
-LL | | {
-LL | | _phantom: PhantomData<T>,
-LL | | buf: [u8; size_of::<T>() + 1],
-LL | | }
- | |_- function or associated item `new` not found for this
-...
-LL | let dst = Inline::<dyn Debug>::new(0);
- | ^^^ function or associated item cannot be called on `Inline<dyn Debug>` due to unsatisfied trait bounds
- |
- ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
- |
-LL | pub trait Debug {
- | --------------- doesn't satisfy `dyn Debug: Sized`
- |
- = note: the following trait bounds were not satisfied:
- `dyn Debug: Sized`
-
-error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
- --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
-LL | intrinsics::size_of::<T>()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | size_of called on unsized type `dyn Debug`
- | inside `std::mem::size_of::<dyn Debug>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
- ::: $DIR/issue-80742.rs:15:10
- |
-LL | [u8; size_of::<T>() + 1]: ,
- | -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:15:10
-
-error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
- --> $DIR/issue-80742.rs:31:15
- |
-LL | struct Inline<T>
- | - required by this bound in `Inline`
-...
-LL | let dst = Inline::<dyn Debug>::new(0);
- | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `dyn Debug`
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | struct Inline<T: ?Sized>
- | ^^^^^^^^
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0080, E0277, E0599.
-For more information about an error, try `rustc --explain E0080`.
diff --git a/src/test/ui/mir/issue-89485.rs b/src/test/ui/mir/issue-89485.rs
new file mode 100644
index 0000000..cb507ee
--- /dev/null
+++ b/src/test/ui/mir/issue-89485.rs
@@ -0,0 +1,18 @@
+// Regression test for issue #89485.
+
+// run-pass
+
+#[derive(Debug, Eq, PartialEq)]
+pub enum Type {
+ A = 1,
+ B = 2,
+}
+pub fn encode(v: Type) -> Type {
+ match v {
+ Type::A => Type::B,
+ _ => v,
+ }
+}
+fn main() {
+ assert_eq!(Type::B, encode(Type::A));
+}
diff --git a/src/test/ui/mir/remove-zsts-query-cycle.rs b/src/test/ui/mir/remove-zsts-query-cycle.rs
new file mode 100644
index 0000000..8f93c6c
--- /dev/null
+++ b/src/test/ui/mir/remove-zsts-query-cycle.rs
@@ -0,0 +1,16 @@
+// Regression test for #88972. Used to cause a query cycle:
+// optimized mir -> remove zsts -> layout of a generator -> optimized mir.
+//
+// edition:2018
+// compile-flags: --crate-type=lib
+// build-pass
+
+pub async fn listen() -> Result<(), std::io::Error> {
+ let f = do_async();
+ std::mem::forget(f);
+ Ok(())
+}
+
+pub async fn do_async() {
+ listen().await.unwrap()
+}
diff --git a/src/test/ui/mismatched_types/E0631.stderr b/src/test/ui/mismatched_types/E0631.stderr
index 1b10325..c8e81c9 100644
--- a/src/test/ui/mismatched_types/E0631.stderr
+++ b/src/test/ui/mismatched_types/E0631.stderr
@@ -1,48 +1,60 @@
error[E0631]: type mismatch in closure arguments
--> $DIR/E0631.rs:7:5
|
-LL | fn foo<F: Fn(usize)>(_: F) {}
- | --------- required by this bound in `foo`
-...
LL | foo(|_: isize| {});
| ^^^ ---------- found signature of `fn(isize) -> _`
| |
| expected signature of `fn(usize) -> _`
+ |
+note: required by a bound in `foo`
+ --> $DIR/E0631.rs:3:11
+ |
+LL | fn foo<F: Fn(usize)>(_: F) {}
+ | ^^^^^^^^^ required by this bound in `foo`
error[E0631]: type mismatch in closure arguments
--> $DIR/E0631.rs:8:5
|
-LL | fn bar<F: Fn<usize>>(_: F) {}
- | --------- required by this bound in `bar`
-...
LL | bar(|_: isize| {});
| ^^^ ---------- found signature of `fn(isize) -> _`
| |
| expected signature of `fn(usize) -> _`
+ |
+note: required by a bound in `bar`
+ --> $DIR/E0631.rs:4:11
+ |
+LL | fn bar<F: Fn<usize>>(_: F) {}
+ | ^^^^^^^^^ required by this bound in `bar`
error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:9:9
|
-LL | fn foo<F: Fn(usize)>(_: F) {}
- | --------- required by this bound in `foo`
-...
LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`
...
LL | foo(f);
| ^ expected signature of `fn(usize) -> _`
+ |
+note: required by a bound in `foo`
+ --> $DIR/E0631.rs:3:11
+ |
+LL | fn foo<F: Fn(usize)>(_: F) {}
+ | ^^^^^^^^^ required by this bound in `foo`
error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:10:9
|
-LL | fn bar<F: Fn<usize>>(_: F) {}
- | --------- required by this bound in `bar`
-LL | fn main() {
LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`
...
LL | bar(f);
| ^ expected signature of `fn(usize) -> _`
+ |
+note: required by a bound in `bar`
+ --> $DIR/E0631.rs:4:11
+ |
+LL | fn bar<F: Fn<usize>>(_: F) {}
+ | ^^^^^^^^^ required by this bound in `bar`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/mismatched_types/abridged.stderr b/src/test/ui/mismatched_types/abridged.stderr
index 61994e5..db4e858 100644
--- a/src/test/ui/mismatched_types/abridged.stderr
+++ b/src/test/ui/mismatched_types/abridged.stderr
@@ -78,10 +78,12 @@
LL | fn f() -> String {
| ------ expected `String` because of return type
LL | 1+2
- | ^^^
- | |
- | expected struct `String`, found integer
- | help: try using a conversion method: `(1+2).to_string()`
+ | ^^^ expected struct `String`, found integer
+ |
+help: try using a conversion method
+ |
+LL | (1+2).to_string()
+ | + +++++++++++++
error[E0308]: mismatched types
--> $DIR/abridged.rs:59:5
@@ -89,10 +91,12 @@
LL | fn g() -> String {
| ------ expected `String` because of return type
LL | -2
- | ^^
- | |
- | expected struct `String`, found integer
- | help: try using a conversion method: `(-2).to_string()`
+ | ^^ expected struct `String`, found integer
+ |
+help: try using a conversion method
+ |
+LL | (-2).to_string()
+ | + +++++++++++++
error: aborting due to 8 previous errors
diff --git a/src/test/ui/mismatched_types/cast-rfc0401.stderr b/src/test/ui/mismatched_types/cast-rfc0401.stderr
index 6a97d1e..a47eb87 100644
--- a/src/test/ui/mismatched_types/cast-rfc0401.stderr
+++ b/src/test/ui/mismatched_types/cast-rfc0401.stderr
@@ -29,7 +29,7 @@
help: consider borrowing the value
|
LL | let _ = &*v as &u8;
- | ^^
+ | ++
error[E0605]: non-primitive cast: `*const u8` as `E`
--> $DIR/cast-rfc0401.rs:30:13
diff --git a/src/test/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr b/src/test/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr
index a8da87d..d7db90e 100644
--- a/src/test/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-count-expected-type-issue-47244.stderr
@@ -9,7 +9,7 @@
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _n = m.iter().map(|(_, b)| {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr
index 4053437..6790017 100644
--- a/src/test/ui/mismatched_types/closure-arg-count.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-count.stderr
@@ -9,7 +9,7 @@
help: consider changing the closure to take and ignore the expected arguments
|
LL | [1, 2, 3].sort_by(|_, _| panic!());
- | ^^^^^^
+ | ~~~~~~
error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
--> $DIR/closure-arg-count.rs:7:15
@@ -30,7 +30,7 @@
help: change the closure to take multiple arguments instead of a single tuple
|
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument
--> $DIR/closure-arg-count.rs:11:15
@@ -43,39 +43,43 @@
help: change the closure to take multiple arguments instead of a single tuple
|
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
--> $DIR/closure-arg-count.rs:13:5
|
-LL | fn f<F: Fn<usize>>(_: F) {}
- | --------- required by this bound in `f`
-...
LL | f(|| panic!());
| ^ -- takes 0 arguments
| |
| expected closure that takes 1 argument
|
+note: required by a bound in `f`
+ --> $DIR/closure-arg-count.rs:3:9
+ |
+LL | fn f<F: Fn<usize>>(_: F) {}
+ | ^^^^^^^^^ required by this bound in `f`
help: consider changing the closure to take and ignore the expected argument
|
LL | f(|_| panic!());
- | ^^^
+ | ~~~
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
--> $DIR/closure-arg-count.rs:15:5
|
-LL | fn f<F: Fn<usize>>(_: F) {}
- | --------- required by this bound in `f`
-...
LL | f( move || panic!());
| ^ ---------- takes 0 arguments
| |
| expected closure that takes 1 argument
|
+note: required by a bound in `f`
+ --> $DIR/closure-arg-count.rs:3:9
+ |
+LL | fn f<F: Fn<usize>>(_: F) {}
+ | ^^^^^^^^^ required by this bound in `f`
help: consider changing the closure to take and ignore the expected argument
|
LL | f( move |_| panic!());
- | ^^^
+ | ~~~
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:18:53
@@ -88,7 +92,7 @@
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:20:53
@@ -101,7 +105,7 @@
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
--> $DIR/closure-arg-count.rs:22:53
@@ -149,10 +153,14 @@
LL | call(Foo);
| ^^^ expected function that takes 0 arguments
...
-LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
- | ------------- required by this bound in `call`
LL | struct Foo(u8);
| --------------- takes 1 argument
+ |
+note: required by a bound in `call`
+ --> $DIR/closure-arg-count.rs:42:30
+ |
+LL | fn call<F, R>(_: F) where F: FnOnce() -> R {}
+ | ^^^^^^^^^^^^^ required by this bound in `call`
error: aborting due to 14 previous errors
diff --git a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr b/src/test/ui/mismatched_types/closure-mismatch.nll.stderr
index 745a61b8..f29126e 100644
--- a/src/test/ui/mismatched_types/closure-mismatch.nll.stderr
+++ b/src/test/ui/mismatched_types/closure-mismatch.nll.stderr
@@ -1,14 +1,26 @@
-error: higher-ranked subtype error
+error: implementation of `FnOnce` is not general enough
--> $DIR/closure-mismatch.rs:8:5
|
LL | baz(|_| ());
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^ implementation of `FnOnce` is not general enough
+ |
+ = note: closure with signature `fn(&'2 ())` must implement `FnOnce<(&'1 (),)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&'2 (),)>`, for some specific lifetime `'2`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/closure-mismatch.rs:8:5
|
LL | baz(|_| ());
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected type `for<'r> Fn<(&'r (),)>`
+ found type `Fn<(&(),)>`
+note: this closure does not fulfill the lifetime requirements
+ --> $DIR/closure-mismatch.rs:8:9
+ |
+LL | baz(|_| ());
+ | ^^^^^^
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/fn-variance-1.stderr b/src/test/ui/mismatched_types/fn-variance-1.stderr
index dbb281b..afde894 100644
--- a/src/test/ui/mismatched_types/fn-variance-1.stderr
+++ b/src/test/ui/mismatched_types/fn-variance-1.stderr
@@ -3,12 +3,15 @@
|
LL | fn takes_mut(x: &mut isize) { }
| --------------------------- found signature of `for<'r> fn(&'r mut isize) -> _`
-LL |
-LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
- | --------- required by this bound in `apply`
...
LL | apply(&3, takes_mut);
| ^^^^^^^^^ expected signature of `fn(&{integer}) -> _`
+ |
+note: required by a bound in `apply`
+ --> $DIR/fn-variance-1.rs:5:37
+ |
+LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
+ | ^^^^^^^^^ required by this bound in `apply`
error[E0631]: type mismatch in function arguments
--> $DIR/fn-variance-1.rs:15:19
@@ -16,11 +19,14 @@
LL | fn takes_imm(x: &isize) { }
| ----------------------- found signature of `for<'r> fn(&'r isize) -> _`
...
-LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
- | --------- required by this bound in `apply`
-...
LL | apply(&mut 3, takes_imm);
| ^^^^^^^^^ expected signature of `fn(&mut {integer}) -> _`
+ |
+note: required by a bound in `apply`
+ --> $DIR/fn-variance-1.rs:5:37
+ |
+LL | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
+ | ^^^^^^^^^ required by this bound in `apply`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/mismatched_types/issue-26480.stderr b/src/test/ui/mismatched_types/issue-26480.stderr
index d085972..e480bb2 100644
--- a/src/test/ui/mismatched_types/issue-26480.stderr
+++ b/src/test/ui/mismatched_types/issue-26480.stderr
@@ -11,7 +11,7 @@
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | ($arr.len() * size_of($arr[0])).try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0605]: non-primitive cast: `{integer}` as `()`
--> $DIR/issue-26480.rs:22:19
diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr
index 69ae3d8..67e8ee2 100644
--- a/src/test/ui/mismatched_types/issue-36053-2.stderr
+++ b/src/test/ui/mismatched_types/issue-36053-2.stderr
@@ -14,7 +14,7 @@
| |
| doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool`
| doesn't satisfy `_: FnMut<(&&str,)>`
- |
+ |
::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL
|
LL | pub struct Filter<I, P> {
diff --git a/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr
index 1e035ff..c7e1f87 100644
--- a/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr
+++ b/src/test/ui/mismatched_types/issue-74918-missing-lifetime.stderr
@@ -7,7 +7,7 @@
help: consider introducing a named lifetime parameter
|
LL | type Item<'a> = IteratorChunk<'a, T, S>;
- | ^^^^ ^^^
+ | ++++ +++
error: aborting due to previous error
diff --git a/src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr b/src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr
index a64cb82..9867add 100644
--- a/src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr
+++ b/src/test/ui/mismatched_types/issue-75361-mismatched-impl.stderr
@@ -2,10 +2,10 @@
--> $DIR/issue-75361-mismatched-impl.rs:18:3
|
LL | fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>;
- | --------------------------------------------------------------------- expected `fn(&T) -> Box<(dyn MyTrait<Item = &_> + 'static)>`
+ | --------------------------------------------------------------------- expected `fn(&T) -> Box<(dyn MyTrait<Item = &T> + 'static)>`
...
LL | fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType> + '_> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&T) -> Box<dyn MyTrait<Item = &_>>`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&T) -> Box<dyn MyTrait<Item = &T>>`
|
= note: expected `fn(&T) -> Box<(dyn MyTrait<Item = &T> + 'static)>`
found `fn(&T) -> Box<dyn MyTrait<Item = &T>>`
diff --git a/src/test/ui/mismatched_types/numeric-literal-cast.stderr b/src/test/ui/mismatched_types/numeric-literal-cast.stderr
index 22a6df8..7ab5224 100644
--- a/src/test/ui/mismatched_types/numeric-literal-cast.stderr
+++ b/src/test/ui/mismatched_types/numeric-literal-cast.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `u8` to `u16`
|
LL | foo(1u16);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-literal-cast.rs:8:10
@@ -18,7 +18,7 @@
help: change the type of the numeric literal from `f32` to `f64`
|
LL | foo1(2f64);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-literal-cast.rs:10:10
@@ -29,7 +29,7 @@
help: change the type of the numeric literal from `i16` to `i32`
|
LL | foo2(3i32);
- | ^^^^
+ | ~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/mismatched_types/recovered-block.stderr b/src/test/ui/mismatched_types/recovered-block.stderr
index f2b8404a..f275321 100644
--- a/src/test/ui/mismatched_types/recovered-block.stderr
+++ b/src/test/ui/mismatched_types/recovered-block.stderr
@@ -7,7 +7,7 @@
help: add `struct` here to parse `Foo` as a public struct
|
LL | pub struct Foo { text }
- | ^^^^^^
+ | ++++++
error: expected one of `(` or `<`, found `{`
--> $DIR/recovered-block.rs:17:9
diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
index ab36b85..ad59462 100644
--- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
+++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs
@@ -6,6 +6,7 @@
fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize {
//~^ NOTE required by this bound in `call_it`
+//~| NOTE required by a bound in `call_it`
f(2, y)
}
diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
index 111ff4a..4406f8a 100644
--- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
+++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr
@@ -1,14 +1,17 @@
error[E0631]: type mismatch in closure arguments
- --> $DIR/unboxed-closures-vtable-mismatch.rs:15:24
+ --> $DIR/unboxed-closures-vtable-mismatch.rs:16:24
|
-LL | fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize {
- | ------------------------- required by this bound in `call_it`
-...
LL | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
| ----------------------------- found signature of `fn(usize, isize) -> _`
LL |
LL | let z = call_it(3, f);
| ^ expected signature of `fn(isize, isize) -> _`
+ |
+note: required by a bound in `call_it`
+ --> $DIR/unboxed-closures-vtable-mismatch.rs:7:14
+ |
+LL | fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
error: aborting due to previous error
diff --git a/src/test/ui/missing/missing-fields-in-struct-pattern.stderr b/src/test/ui/missing/missing-fields-in-struct-pattern.stderr
index a95b5bb..1fe9f52 100644
--- a/src/test/ui/missing/missing-fields-in-struct-pattern.stderr
+++ b/src/test/ui/missing/missing-fields-in-struct-pattern.stderr
@@ -7,7 +7,7 @@
help: use the tuple variant pattern syntax instead
|
LL | if let S(a, b, c, d) = S(1, 2, 3, 4) {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/missing/missing-items/missing-type-parameter2.stderr b/src/test/ui/missing/missing-items/missing-type-parameter2.stderr
index 985a9bb..f955659 100644
--- a/src/test/ui/missing/missing-items/missing-type-parameter2.stderr
+++ b/src/test/ui/missing/missing-items/missing-type-parameter2.stderr
@@ -10,11 +10,11 @@
help: a struct with a similar name exists
|
LL | impl X<X> {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<N> X<N> {}
- | ^^^
+ | +++
error[E0412]: cannot find type `N` in this scope
--> $DIR/missing-type-parameter2.rs:9:28
@@ -27,11 +27,11 @@
help: a type parameter with a similar name exists
|
LL | impl<T, const A: u8 = 2> X<T> {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<T, const A: u8 = 2, N> X<N> {}
- | ^^^
+ | +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:14:20
@@ -45,11 +45,11 @@
help: a struct with a similar name exists
|
LL | fn foo(_: T) where X: Send {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn foo<T>(_: T) where T: Send {}
- | ^^^
+ | +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:14:11
@@ -63,11 +63,11 @@
help: a struct with a similar name exists
|
LL | fn foo(_: X) where T: Send {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn foo<T>(_: T) where T: Send {}
- | ^^^
+ | +++
error[E0412]: cannot find type `A` in this scope
--> $DIR/missing-type-parameter2.rs:18:24
@@ -81,11 +81,11 @@
help: a struct with a similar name exists
|
LL | fn bar<const N: u8>(_: X) {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn bar<const N: u8, A>(_: A) {}
- | ^^^
+ | +++
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/missing-type-parameter2.rs:6:8
@@ -96,7 +96,7 @@
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl X<{ N }> {}
- | ^ ^
+ | + +
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/missing-type-parameter2.rs:9:15
@@ -113,7 +113,7 @@
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl<T, const A: u8 = 2> X<{ N }> {}
- | ^ ^
+ | + +
error: aborting due to 8 previous errors
diff --git a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr
index f7e1781..a315bba 100644
--- a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr
+++ b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr
@@ -11,7 +11,7 @@
help: borrow this field in the pattern to avoid moving `node.next.0`
|
LL | Some(ref right) => consume(right),
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr
index a30bfa6..2adaf57 100644
--- a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr
+++ b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr
@@ -20,7 +20,7 @@
help: consider further restricting this bound
|
LL | fn conspirator<F>(mut f: F) where F: FnMut(&mut R, bool) + Copy {
- | ^^^^^^
+ | ++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/multiple-plugin-registrars.rs b/src/test/ui/multiple-plugin-registrars.rs
deleted file mode 100644
index d211204..0000000
--- a/src/test/ui/multiple-plugin-registrars.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// error-pattern: multiple plugin registration functions found
-
-#![feature(plugin_registrar)]
-
-// the registration function isn't typechecked yet
-#[plugin_registrar]
-pub fn one() {}
-
-#[plugin_registrar]
-pub fn two() {}
-
-fn main() {}
diff --git a/src/test/ui/multiple-plugin-registrars.stderr b/src/test/ui/multiple-plugin-registrars.stderr
deleted file mode 100644
index 7b86d76..0000000
--- a/src/test/ui/multiple-plugin-registrars.stderr
+++ /dev/null
@@ -1,29 +0,0 @@
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/multiple-plugin-registrars.rs:6:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
- |
- = note: `#[warn(deprecated)]` on by default
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/multiple-plugin-registrars.rs:9:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-error: multiple plugin registration functions found
- |
-note: one is here
- --> $DIR/multiple-plugin-registrars.rs:10:1
- |
-LL | pub fn two() {}
- | ^^^^^^^^^^^^^^^
-note: one is here
- --> $DIR/multiple-plugin-registrars.rs:7:1
- |
-LL | pub fn one() {}
- | ^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 2 warnings emitted
-
diff --git a/src/test/ui/mut/mutable-enum-indirect.stderr b/src/test/ui/mut/mutable-enum-indirect.stderr
index 5b26f94..8ec478c 100644
--- a/src/test/ui/mut/mutable-enum-indirect.stderr
+++ b/src/test/ui/mut/mutable-enum-indirect.stderr
@@ -1,9 +1,6 @@
error[E0277]: `NoSync` cannot be shared between threads safely
--> $DIR/mutable-enum-indirect.rs:17:5
|
-LL | fn bar<T: Sync>(_: T) {}
- | ---- required by this bound in `bar`
-...
LL | bar(&x);
| ^^^ `NoSync` cannot be shared between threads safely
|
@@ -14,6 +11,11 @@
LL | enum Foo { A(NoSync) }
| ^^^
= note: required because it appears within the type `&Foo`
+note: required by a bound in `bar`
+ --> $DIR/mutable-enum-indirect.rs:13:11
+ |
+LL | fn bar<T: Sync>(_: T) {}
+ | ^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/mutexguard-sync.stderr b/src/test/ui/mutexguard-sync.stderr
index 588c32a..172e257 100644
--- a/src/test/ui/mutexguard-sync.stderr
+++ b/src/test/ui/mutexguard-sync.stderr
@@ -1,14 +1,16 @@
error[E0277]: `Cell<i32>` cannot be shared between threads safely
--> $DIR/mutexguard-sync.rs:11:15
|
-LL | fn test_sync<T: Sync>(_t: T) {}
- | ---- required by this bound in `test_sync`
-...
LL | test_sync(guard);
| ^^^^^ `Cell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
= note: required because of the requirements on the impl of `Sync` for `MutexGuard<'_, Cell<i32>>`
+note: required by a bound in `test_sync`
+ --> $DIR/mutexguard-sync.rs:5:17
+ |
+LL | fn test_sync<T: Sync>(_t: T) {}
+ | ^^^^ required by this bound in `test_sync`
error: aborting due to previous error
diff --git a/src/test/ui/namespace/namespace-mix.stderr b/src/test/ui/namespace/namespace-mix.stderr
index ded3173..e4e1071 100644
--- a/src/test/ui/namespace/namespace-mix.stderr
+++ b/src/test/ui/namespace/namespace-mix.stderr
@@ -11,7 +11,7 @@
help: a tuple struct with a similar name exists
|
LL | check(m1::TS);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m2::S;
@@ -24,7 +24,7 @@
|
LL | check(xm1::S);
| ^^^^^^
- |
+ |
::: $DIR/auxiliary/namespace-mix.rs:3:5
|
LL | pub struct TS();
@@ -34,7 +34,7 @@
help: a tuple struct with a similar name exists
|
LL | check(xm1::TS);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m2::S;
@@ -56,11 +56,11 @@
help: use struct literal syntax instead
|
LL | check(m7::V {});
- | ^^^^^^^^
+ | ~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | check(m7::TV);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m8::V;
@@ -73,7 +73,7 @@
|
LL | check(xm7::V);
| ^^^^^^
- |
+ |
::: $DIR/auxiliary/namespace-mix.rs:6:9
|
LL | V {},
@@ -84,11 +84,11 @@
help: use struct literal syntax instead
|
LL | check(xm7::V { /* fields */ });
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | check(xm7::TV);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m8::V;
@@ -99,398 +99,530 @@
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:33:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m1::S{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::S: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:35:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m2::S{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::S`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:36:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m2::S);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:39:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm1::S{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::S: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:41:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm2::S{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::S`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:42:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm2::S);
| ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:55:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m3::TS{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:56:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m3::TS);
| ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::TS: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:57:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m4::TS{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::TS`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:58:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m4::TS);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:61:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm3::TS{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:62:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm3::TS);
| ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::TS: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:63:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm4::TS{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::TS`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:64:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm4::TS);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:77:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m5::US{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:78:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m5::US);
| ^^^^^^ the trait `Impossible` is not implemented for `c::US`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:79:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m6::US{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::US`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:80:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m6::US);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:83:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm5::US{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:84:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm5::US);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:85:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm6::US{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:86:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm6::US);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:99:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m7::V{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:101:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m8::V{});
| ^^^^^^^ the trait `Impossible` is not implemented for `c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:102:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m8::V);
| ^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:105:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm7::V{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:107:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm8::V{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:108:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm8::V);
| ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:121:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m9::TV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:122:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(m9::TV);
| ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:123:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(mA::TV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:124:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(mA::TV);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:127:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm9::TV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:128:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xm9::TV);
| ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:129:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xmA::TV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:130:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xmA::TV);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:143:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(mB::UV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:144:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(mB::UV);
| ^^^^^^ the trait `Impossible` is not implemented for `c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:145:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(mC::UV{});
| ^^^^^^^^ the trait `Impossible` is not implemented for `c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:146:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(mC::UV);
| ^^^^^^ the trait `Impossible` is not implemented for `c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:149:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xmB::UV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:150:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xmB::UV);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:151:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xmC::UV{});
| ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied
--> $DIR/namespace-mix.rs:152:11
|
-LL | fn check<T: Impossible>(_: T) {}
- | ---------- required by this bound in `check`
-...
LL | check(xmC::UV);
| ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item`
+ |
+note: required by a bound in `check`
+ --> $DIR/namespace-mix.rs:21:13
+ |
+LL | fn check<T: Impossible>(_: T) {}
+ | ^^^^^^^^^^ required by this bound in `check`
error: aborting due to 48 previous errors
diff --git a/src/test/ui/never_type/defaulted-never-note.rs b/src/test/ui/never_type/defaulted-never-note.rs
index 6979c3e..70333c5 100644
--- a/src/test/ui/never_type/defaulted-never-note.rs
+++ b/src/test/ui/never_type/defaulted-never-note.rs
@@ -20,7 +20,7 @@
fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
//~^ NOTE required by this bound in `foo`
-
+//~| NOTE required by a bound in `foo`
fn smeg() {
let _x = return;
foo(_x);
diff --git a/src/test/ui/never_type/defaulted-never-note.stderr b/src/test/ui/never_type/defaulted-never-note.stderr
index 9973837..109a81a 100644
--- a/src/test/ui/never_type/defaulted-never-note.stderr
+++ b/src/test/ui/never_type/defaulted-never-note.stderr
@@ -1,15 +1,17 @@
error[E0277]: the trait bound `!: ImplementedForUnitButNotNever` is not satisfied
--> $DIR/defaulted-never-note.rs:26:5
|
-LL | fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
- | ----------------------------- required by this bound in `foo`
-...
LL | foo(_x);
| ^^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!`
|
= note: this trait is implemented for `()`.
= note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information).
= help: did you intend to use the type `()` here instead?
+note: required by a bound in `foo`
+ --> $DIR/defaulted-never-note.rs:21:11
+ |
+LL | fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/never_type/issue-51506.stderr b/src/test/ui/never_type/issue-51506.stderr
index 16d93c1..38f299d 100644
--- a/src/test/ui/never_type/issue-51506.stderr
+++ b/src/test/ui/never_type/issue-51506.stderr
@@ -1,13 +1,15 @@
error[E0277]: `!` is not an iterator
--> $DIR/issue-51506.rs:13:5
|
-LL | type Out: Iterator<Item = u32>;
- | -------------------- required by this bound in `Trait::Out`
-...
LL | default type Out = !;
| ^^^^^^^^^^^^^^^^^^^^^ `!` is not an iterator
|
= help: the trait `Iterator` is not implemented for `!`
+note: required by a bound in `Trait::Out`
+ --> $DIR/issue-51506.rs:7:15
+ |
+LL | type Out: Iterator<Item = u32>;
+ | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait::Out`
error: aborting due to previous error
diff --git a/src/test/ui/never_type/issue-52443.stderr b/src/test/ui/never_type/issue-52443.stderr
index 1683841..216b56f 100644
--- a/src/test/ui/never_type/issue-52443.stderr
+++ b/src/test/ui/never_type/issue-52443.stderr
@@ -6,23 +6,28 @@
|
= note: `#[warn(while_true)]` on by default
-error[E0744]: `for` is not allowed in a `const`
+error[E0658]: `for` is not allowed in a `const`
--> $DIR/issue-52443.rs:9:12
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
+ = help: add `#![feature(const_for)]` to the crate attributes to enable
error[E0308]: mismatched types
--> $DIR/issue-52443.rs:2:10
|
LL | [(); & { loop { continue } } ];
- | ^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | expected `usize`, found reference
- | help: consider removing the borrow: `{ loop { continue } }`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found reference
|
= note: expected type `usize`
found reference `&_`
+help: consider removing the borrow
+ |
+LL - [(); & { loop { continue } } ];
+LL + [(); { loop { continue } } ];
+ |
error[E0308]: mismatched types
--> $DIR/issue-52443.rs:4:17
@@ -56,5 +61,5 @@
error: aborting due to 6 previous errors; 1 warning emitted
-Some errors have detailed explanations: E0015, E0308, E0658, E0744.
+Some errors have detailed explanations: E0015, E0308, E0658.
For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/nll/borrowed-match-issue-45045.rs b/src/test/ui/nll/borrowed-match-issue-45045.rs
index 0cd8e95..978eeb8 100644
--- a/src/test/ui/nll/borrowed-match-issue-45045.rs
+++ b/src/test/ui/nll/borrowed-match-issue-45045.rs
@@ -10,8 +10,8 @@
let f = &mut e;
let g = f;
match e {
- Xyz::A => println!("a"),
//~^ cannot use `e` because it was mutably borrowed [E0503]
+ Xyz::A => println!("a"),
Xyz::B => println!("b"),
};
*g = Xyz::B;
diff --git a/src/test/ui/nll/borrowed-match-issue-45045.stderr b/src/test/ui/nll/borrowed-match-issue-45045.stderr
index 1607304..9d46826 100644
--- a/src/test/ui/nll/borrowed-match-issue-45045.stderr
+++ b/src/test/ui/nll/borrowed-match-issue-45045.stderr
@@ -1,11 +1,11 @@
error[E0503]: cannot use `e` because it was mutably borrowed
- --> $DIR/borrowed-match-issue-45045.rs:13:9
+ --> $DIR/borrowed-match-issue-45045.rs:12:11
|
LL | let f = &mut e;
| ------ borrow of `e` occurs here
-...
-LL | Xyz::A => println!("a"),
- | ^^^^^^ use of borrowed `e`
+LL | let g = f;
+LL | match e {
+ | ^ use of borrowed `e`
...
LL | *g = Xyz::B;
| ----------- borrow later used here
diff --git a/src/test/ui/nll/closure-use-spans.stderr b/src/test/ui/nll/closure-use-spans.stderr
index 8716290..ad928f1 100644
--- a/src/test/ui/nll/closure-use-spans.stderr
+++ b/src/test/ui/nll/closure-use-spans.stderr
@@ -26,7 +26,7 @@
LL | x = 0;
| ^^^^^ assignment to borrowed `x` occurs here
LL | move || *y;
- | - borrow later captured here by closure
+ | -- borrow later captured here by closure
error: aborting due to 3 previous errors
diff --git a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs
index 1983e13..ebea6d3 100644
--- a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs
+++ b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs
@@ -1,4 +1,4 @@
-// This test enumerates various cases of interest where a ADT or tuple is
+// This test enumerates various cases of interest where an ADT or tuple is
// partially initialized and then used in some way that is wrong *even*
// after rust-lang/rust#54987 is implemented.
//
diff --git a/src/test/ui/nll/issue-51191.rs b/src/test/ui/nll/issue-51191.rs
index 747bfe3..836587d 100644
--- a/src/test/ui/nll/issue-51191.rs
+++ b/src/test/ui/nll/issue-51191.rs
@@ -3,11 +3,13 @@
impl Struct {
fn bar(self: &mut Self) {
//~^ WARN function cannot return without recursing
+ //~^^ HELP a `loop` may express intention better if this is on purpose
(&mut self).bar();
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
+ //~^^ HELP try removing `&mut` here
}
- fn imm(self) {
+ fn imm(self) { //~ HELP consider changing this to be mutable
(&mut self).bar();
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
}
@@ -25,7 +27,8 @@
fn mtblref(&mut self) {
(&mut self).bar();
//~^ ERROR cannot borrow `self` as mutable, as it is not declared as mutable [E0596]
+ //~^^ HELP try removing `&mut` here
}
}
-fn main () {}
+fn main() {}
diff --git a/src/test/ui/nll/issue-51191.stderr b/src/test/ui/nll/issue-51191.stderr
index 4e2e4c2..18696f5 100644
--- a/src/test/ui/nll/issue-51191.stderr
+++ b/src/test/ui/nll/issue-51191.stderr
@@ -3,7 +3,7 @@
|
LL | fn bar(self: &mut Self) {
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
-LL |
+...
LL | (&mut self).bar();
| ----------------- recursive call site
|
@@ -11,16 +11,24 @@
= help: a `loop` may express intention better if this is on purpose
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:6:9
+ --> $DIR/issue-51191.rs:7:9
+ |
+LL | (&mut self).bar();
+ | ^^^^^^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/issue-51191.rs:4:18
+ |
+LL | fn bar(self: &mut Self) {
+ | ^^^^^^^^^
+help: try removing `&mut` here
+ --> $DIR/issue-51191.rs:7:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^
- | |
- | cannot borrow as mutable
- | try removing `&mut` here
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:11:9
+ --> $DIR/issue-51191.rs:13:9
|
LL | fn imm(self) {
| ---- help: consider changing this to be mutable: `mut self`
@@ -28,25 +36,33 @@
| ^^^^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:20:9
+ --> $DIR/issue-51191.rs:22:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow data in a `&` reference as mutable
- --> $DIR/issue-51191.rs:20:9
+ --> $DIR/issue-51191.rs:22:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
- --> $DIR/issue-51191.rs:26:9
+ --> $DIR/issue-51191.rs:28:9
+ |
+LL | (&mut self).bar();
+ | ^^^^^^^^^^^ cannot borrow as mutable
+ |
+note: the binding is already a mutable borrow
+ --> $DIR/issue-51191.rs:27:16
+ |
+LL | fn mtblref(&mut self) {
+ | ^^^^^^^^^
+help: try removing `&mut` here
+ --> $DIR/issue-51191.rs:28:9
|
LL | (&mut self).bar();
| ^^^^^^^^^^^
- | |
- | cannot borrow as mutable
- | try removing `&mut` here
error: aborting due to 5 previous errors; 1 warning emitted
diff --git a/src/test/ui/nll/issue-53807.stderr b/src/test/ui/nll/issue-53807.stderr
index 6767f7c..574a114 100644
--- a/src/test/ui/nll/issue-53807.stderr
+++ b/src/test/ui/nll/issue-53807.stderr
@@ -8,7 +8,7 @@
help: borrow this field in the pattern to avoid moving `maybe.0`
|
LL | if let Some(ref thing) = maybe {
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/nll/issue-54382-use-span-of-tail-of-block.stderr b/src/test/ui/nll/issue-54382-use-span-of-tail-of-block.stderr
index 2dca92e..6dacfd1 100644
--- a/src/test/ui/nll/issue-54382-use-span-of-tail-of-block.stderr
+++ b/src/test/ui/nll/issue-54382-use-span-of-tail-of-block.stderr
@@ -16,7 +16,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | D("other").next(&_thing1);
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/nll/issue-54556-niconii.stderr b/src/test/ui/nll/issue-54556-niconii.stderr
index 1bfebd7..70f063c 100644
--- a/src/test/ui/nll/issue-54556-niconii.stderr
+++ b/src/test/ui/nll/issue-54556-niconii.stderr
@@ -16,7 +16,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | if let Ok(_) = counter.lock() { };
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/nll/issue-54556-stephaneyfx.stderr b/src/test/ui/nll/issue-54556-stephaneyfx.stderr
index bfb0eb7..a5a0fc4 100644
--- a/src/test/ui/nll/issue-54556-stephaneyfx.stderr
+++ b/src/test/ui/nll/issue-54556-stephaneyfx.stderr
@@ -17,7 +17,7 @@
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = rows.map(|row| row).next(); x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to previous error
diff --git a/src/test/ui/nll/issue-54556-temps-in-tail-diagnostic.stderr b/src/test/ui/nll/issue-54556-temps-in-tail-diagnostic.stderr
index 047fdbc..68d3cef 100644
--- a/src/test/ui/nll/issue-54556-temps-in-tail-diagnostic.stderr
+++ b/src/test/ui/nll/issue-54556-temps-in-tail-diagnostic.stderr
@@ -15,7 +15,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | D(&_thing1).end();
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/nll/issue-54556-used-vs-unused-tails.stderr b/src/test/ui/nll/issue-54556-used-vs-unused-tails.stderr
index 85920a8..25226e2 100644
--- a/src/test/ui/nll/issue-54556-used-vs-unused-tails.stderr
+++ b/src/test/ui/nll/issue-54556-used-vs-unused-tails.stderr
@@ -11,7 +11,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
@@ -26,7 +26,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
@@ -41,7 +41,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }; } // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
@@ -56,7 +56,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | let _ = { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
@@ -71,7 +71,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | let _u = { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
@@ -88,7 +88,7 @@
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let _x = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
- | ^^^^^^^ ^^^
+ | +++++++ +++
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
@@ -105,7 +105,7 @@
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | _y = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
- | ^^^^^^^ ^^^
+ | +++++++ +++
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
@@ -121,7 +121,7 @@
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
@@ -139,7 +139,7 @@
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } // `let x = ...; x`
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to 9 previous errors
diff --git a/src/test/ui/nll/match-cfg-fake-edges2.rs b/src/test/ui/nll/match-cfg-fake-edges2.rs
index 84c0dec..e61db71 100644
--- a/src/test/ui/nll/match-cfg-fake-edges2.rs
+++ b/src/test/ui/nll/match-cfg-fake-edges2.rs
@@ -7,8 +7,8 @@
let r = &mut y.1;
// We don't actually test y.1 to select the second arm, but we don't want
// borrowck results to be based on the order we match patterns.
- match y {
- (false, true) => 1, //~ ERROR cannot use `y.1` because it was mutably borrowed
+ match y { //~ ERROR cannot use `y.1` because it was mutably borrowed
+ (false, true) => 1,
(true, _) => {
r;
2
diff --git a/src/test/ui/nll/match-cfg-fake-edges2.stderr b/src/test/ui/nll/match-cfg-fake-edges2.stderr
index eab8965..0ce8384 100644
--- a/src/test/ui/nll/match-cfg-fake-edges2.stderr
+++ b/src/test/ui/nll/match-cfg-fake-edges2.stderr
@@ -1,12 +1,12 @@
error[E0503]: cannot use `y.1` because it was mutably borrowed
- --> $DIR/match-cfg-fake-edges2.rs:11:17
+ --> $DIR/match-cfg-fake-edges2.rs:10:5
|
LL | let r = &mut y.1;
| -------- borrow of `y.1` occurs here
...
-LL | (false, true) => 1,
- | ^^^^ use of borrowed `y.1`
-LL | (true, _) => {
+LL | match y {
+ | ^^^^^^^ use of borrowed `y.1`
+...
LL | r;
| - borrow later used here
diff --git a/src/test/ui/nll/match-on-borrowed.rs b/src/test/ui/nll/match-on-borrowed.rs
index aba0a7f..447dabe 100644
--- a/src/test/ui/nll/match-on-borrowed.rs
+++ b/src/test/ui/nll/match-on-borrowed.rs
@@ -45,8 +45,9 @@
E::W => panic!(),
};
match e { // Don't know that E uses a tag for its discriminant
+ //~^ ERROR
_ if false => (),
- E::V(_, r) => (), //~ ERROR
+ E::V(_, r) => (),
E::W => (),
}
x;
@@ -58,8 +59,9 @@
E::W => panic!(),
};
match f { // Don't know that E uses a tag for its discriminant
+ //~^ ERROR
_ if false => (),
- E::V(_, r) => (), //~ ERROR
+ E::V(_, r) => (),
E::W => (),
}
x;
@@ -77,7 +79,8 @@
fn match_on_borrowed(mut t: bool) {
let x = &mut t;
match t {
- true => (), //~ ERROR
+ //~^ ERROR
+ true => (),
false => (),
}
x;
diff --git a/src/test/ui/nll/match-on-borrowed.stderr b/src/test/ui/nll/match-on-borrowed.stderr
index f9c9a84..2121b59 100644
--- a/src/test/ui/nll/match-on-borrowed.stderr
+++ b/src/test/ui/nll/match-on-borrowed.stderr
@@ -1,41 +1,40 @@
error[E0503]: cannot use `e` because it was mutably borrowed
- --> $DIR/match-on-borrowed.rs:49:9
+ --> $DIR/match-on-borrowed.rs:47:11
|
LL | E::V(ref mut x, _) => x,
| --------- borrow of `e.0` occurs here
...
-LL | E::V(_, r) => (),
- | ^^^^^^^^^^ use of borrowed `e.0`
+LL | match e { // Don't know that E uses a tag for its discriminant
+ | ^ use of borrowed `e.0`
...
LL | x;
| - borrow later used here
error[E0503]: cannot use `*f` because it was mutably borrowed
- --> $DIR/match-on-borrowed.rs:62:9
+ --> $DIR/match-on-borrowed.rs:61:11
|
LL | E::V(ref mut x, _) => x,
| --------- borrow of `f.0` occurs here
...
-LL | E::V(_, r) => (),
- | ^^^^^^^^^^ use of borrowed `f.0`
+LL | match f { // Don't know that E uses a tag for its discriminant
+ | ^ use of borrowed `f.0`
...
LL | x;
| - borrow later used here
error[E0503]: cannot use `t` because it was mutably borrowed
- --> $DIR/match-on-borrowed.rs:80:9
+ --> $DIR/match-on-borrowed.rs:81:5
|
LL | let x = &mut t;
| ------ borrow of `t` occurs here
LL | match t {
-LL | true => (),
- | ^^^^ use of borrowed `t`
+ | ^^^^^^^ use of borrowed `t`
...
LL | x;
| - borrow later used here
error[E0381]: use of possibly-uninitialized variable: `n`
- --> $DIR/match-on-borrowed.rs:90:11
+ --> $DIR/match-on-borrowed.rs:93:11
|
LL | match n {}
| ^ use of possibly-uninitialized `n`
diff --git a/src/test/ui/nll/outlives-suggestion-simple.polonius.stderr b/src/test/ui/nll/outlives-suggestion-simple.polonius.stderr
index dbbda62..c00288f 100644
--- a/src/test/ui/nll/outlives-suggestion-simple.polonius.stderr
+++ b/src/test/ui/nll/outlives-suggestion-simple.polonius.stderr
@@ -121,3 +121,4 @@
error: aborting due to 10 previous errors
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/nll/relate_tys/fn-subtype.rs b/src/test/ui/nll/relate_tys/fn-subtype.rs
index ac00627..0730dcc 100644
--- a/src/test/ui/nll/relate_tys/fn-subtype.rs
+++ b/src/test/ui/nll/relate_tys/fn-subtype.rs
@@ -6,5 +6,5 @@
fn main() {
let x: fn(&'static ()) = |_| {};
- let y: for<'a> fn(&'a ()) = x; //~ ERROR higher-ranked subtype error
+ let y: for<'a> fn(&'a ()) = x; //~ ERROR mismatched types [E0308]
}
diff --git a/src/test/ui/nll/relate_tys/fn-subtype.stderr b/src/test/ui/nll/relate_tys/fn-subtype.stderr
index b089b5a..94def69 100644
--- a/src/test/ui/nll/relate_tys/fn-subtype.stderr
+++ b/src/test/ui/nll/relate_tys/fn-subtype.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/fn-subtype.rs:9:33
|
LL | let y: for<'a> fn(&'a ()) = x;
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r> fn(&'r ())`
+ found fn pointer `fn(&())`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs
index fca69b8..a6d6ffa 100644
--- a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs
+++ b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.rs
@@ -12,7 +12,7 @@
fn foo() {
let a: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it();
- //~^ ERROR higher-ranked subtype error
+ //~^ ERROR mismatched types [E0308]
drop(a);
}
@@ -20,7 +20,7 @@
// The code path for patterns is mildly different, so go ahead and
// test that too:
let _: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it();
- //~^ ERROR higher-ranked subtype error
+ //~^ ERROR mismatched types [E0308]
}
-fn main() { }
+fn main() {}
diff --git a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr
index 7906dbd..8c1eaeb 100644
--- a/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr
+++ b/src/test/ui/nll/relate_tys/hr-fn-aaa-as-aba.stderr
@@ -1,14 +1,21 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/hr-fn-aaa-as-aba.rs:14:58
|
LL | let a: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it();
- | ^^^^^^^^^
+ | ^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's> fn(&'r u32, &'s u32) -> &'r u32`
+ found fn pointer `for<'a> fn(&'a u32, &'a u32) -> &'a u32`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/hr-fn-aaa-as-aba.rs:22:12
|
LL | let _: for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 = make_it();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32`
+ found fn pointer `for<'r> fn(&'r u32, &'r u32) -> &'r u32`
error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
index 44dcd19..37a01f2 100644
--- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
+++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
@@ -30,6 +30,6 @@
fn main() {
let _x = <fn(&())>::make_f();
- //~^ higher-ranked subtype error
- //~| higher-ranked subtype error
+ //~^ ERROR implementation of `Y` is not general enough
+ //~| ERROR implementation of `Y` is not general enough
}
diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
index 190b520..ed79c7d 100644
--- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
+++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
@@ -1,14 +1,20 @@
-error: higher-ranked subtype error
+error: implementation of `Y` is not general enough
--> $DIR/impl-fn-ignore-binder-via-bottom.rs:32:14
|
LL | let _x = <fn(&())>::make_f();
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough
+ |
+ = note: `Y` would have to be implemented for the type `for<'r> fn(&'r ())`
+ = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
-error: higher-ranked subtype error
+error: implementation of `Y` is not general enough
--> $DIR/impl-fn-ignore-binder-via-bottom.rs:32:14
|
LL | let _x = <fn(&())>::make_f();
- | ^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough
+ |
+ = note: `Y` would have to be implemented for the type `for<'r> fn(&'r ())`
+ = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/nll/relate_tys/trait-hrtb.rs b/src/test/ui/nll/relate_tys/trait-hrtb.rs
index 80f31ca..2e94fc5 100644
--- a/src/test/ui/nll/relate_tys/trait-hrtb.rs
+++ b/src/test/ui/nll/relate_tys/trait-hrtb.rs
@@ -12,5 +12,5 @@
fn main() {
let x: Box<dyn Foo<'static>> = make_foo();
- let y: Box<dyn for<'a> Foo<'a>> = x; //~ ERROR higher-ranked subtype error
+ let y: Box<dyn for<'a> Foo<'a>> = x; //~ ERROR mismatched types [E0308]
}
diff --git a/src/test/ui/nll/relate_tys/trait-hrtb.stderr b/src/test/ui/nll/relate_tys/trait-hrtb.stderr
index 4df2f35..60a7f20 100644
--- a/src/test/ui/nll/relate_tys/trait-hrtb.stderr
+++ b/src/test/ui/nll/relate_tys/trait-hrtb.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/trait-hrtb.rs:15:39
|
LL | let y: Box<dyn for<'a> Foo<'a>> = x;
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected trait object `dyn for<'r> Foo<'r>`
+ found trait object `dyn Foo<'_>`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/nll/relate_tys/universe-violation.rs b/src/test/ui/nll/relate_tys/universe-violation.rs
index d29f8f8..8389c8e 100644
--- a/src/test/ui/nll/relate_tys/universe-violation.rs
+++ b/src/test/ui/nll/relate_tys/universe-violation.rs
@@ -12,6 +12,6 @@
fn main() {
let a: fn(_) -> _ = make_it();
- let b: fn(&u32) -> &u32 = a; //~ ERROR higher-ranked subtype error
+ let b: fn(&u32) -> &u32 = a; //~ ERROR mismatched types [E0308]
drop(a);
}
diff --git a/src/test/ui/nll/relate_tys/universe-violation.stderr b/src/test/ui/nll/relate_tys/universe-violation.stderr
index 6dc7878..ff4c7abc 100644
--- a/src/test/ui/nll/relate_tys/universe-violation.stderr
+++ b/src/test/ui/nll/relate_tys/universe-violation.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/universe-violation.rs:15:31
|
LL | let b: fn(&u32) -> &u32 = a;
- | ^
+ | ^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r> fn(&'r u32) -> &'r u32`
+ found fn pointer `fn(&u32) -> &u32`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr b/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
index f6a86aa..d05fc79 100644
--- a/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
+++ b/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
@@ -7,7 +7,7 @@
help: add explicit lifetime `ReEarlyBound(0, 'a)` to the type of `x`
|
LL | fn foo<'a, T>(x: &ReEarlyBound(0, 'a) T) -> impl Foo<'a> {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr
index eba00c5..88253ba 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr
@@ -5,7 +5,12 @@
| ^^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<T as MyTrait<'a>>::Output: 'a`...
- = note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds
+ = note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds...
+note: ...that is required by this bound
+ --> $DIR/projection-where-clause-env-wrong-bound.rs:29:8
+ |
+LL | T: 'a,
+ | ^^
error: aborting due to previous error
diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr
index 34b8385..9f7fc03 100644
--- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr
@@ -5,7 +5,12 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<T as MyTrait<'a>>::Output: 'a`...
- = note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds
+ = note: ...so that the type `<T as MyTrait<'a>>::Output` will meet its required lifetime bounds...
+note: ...that is required by this bound
+ --> $DIR/projection-where-clause-env-wrong-lifetime.rs:20:8
+ |
+LL | T: 'a,
+ | ^^
error: aborting due to previous error
diff --git a/src/test/ui/nll/user-annotations/closure-substs.polonius.stderr b/src/test/ui/nll/user-annotations/closure-substs.polonius.stderr
index 46b6c04..af159a6 100644
--- a/src/test/ui/nll/user-annotations/closure-substs.polonius.stderr
+++ b/src/test/ui/nll/user-annotations/closure-substs.polonius.stderr
@@ -21,7 +21,7 @@
--> $DIR/closure-substs.rs:15:16
|
LL | |x: &i32| -> &'static i32 {
- | - ------------ return type of closure is &'2 i32
+ | - - let's call the lifetime of this reference `'2`
| |
| let's call the lifetime of this reference `'1`
LL | return x;
@@ -58,3 +58,4 @@
error: aborting due to 6 previous errors
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/no-mangle-associated-fn.rs b/src/test/ui/no-mangle-associated-fn.rs
new file mode 100644
index 0000000..ecd44ab
--- /dev/null
+++ b/src/test/ui/no-mangle-associated-fn.rs
@@ -0,0 +1,37 @@
+// aux-build: no-mangle-associated-fn.rs
+// run-pass
+
+extern crate no_mangle_associated_fn;
+
+struct Foo;
+
+impl Foo {
+ #[no_mangle]
+ fn foo() -> u8 {
+ 1
+ }
+}
+
+trait Bar {
+ fn qux() -> u8;
+}
+
+impl Bar for Foo {
+ #[no_mangle]
+ fn qux() -> u8 {
+ 4
+ }
+}
+
+fn main() {
+ extern "Rust" {
+ fn foo() -> u8;
+ fn bar() -> u8;
+ fn baz() -> u8;
+ fn qux() -> u8;
+ }
+ assert_eq!(unsafe { foo() }, 1);
+ assert_eq!(unsafe { bar() }, 2);
+ assert_eq!(unsafe { baz() }, 3);
+ assert_eq!(unsafe { qux() }, 4);
+}
diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr
index 2ee3202..80708c9 100644
--- a/src/test/ui/no-send-res-ports.stderr
+++ b/src/test/ui/no-send-res-ports.stderr
@@ -10,11 +10,6 @@
LL | | println!("{:?}", y);
LL | | });
| |_____- within this `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`
- |
- ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL
- |
-LL | F: Send + 'static,
- | ---- required by this bound in `spawn`
|
= help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`, the trait `Send` is not implemented for `Rc<()>`
note: required because it appears within the type `Port<()>`
@@ -28,6 +23,11 @@
LL | struct Foo {
| ^^^
= note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`
+note: required by a bound in `spawn`
+ --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
+ |
+LL | F: Send + 'static,
+ | ^^^^ required by this bound in `spawn`
error: aborting due to previous error
diff --git a/src/test/ui/no-std-inject.stderr b/src/test/ui/no-std-inject.stderr
index a82931e..8e22680 100644
--- a/src/test/ui/no-std-inject.stderr
+++ b/src/test/ui/no-std-inject.stderr
@@ -8,7 +8,7 @@
help: you can use `as` to change the binding name of the import
|
LL | extern crate core as other_core;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/no_send-enum.stderr b/src/test/ui/no_send-enum.stderr
index 9d75583..814f347 100644
--- a/src/test/ui/no_send-enum.stderr
+++ b/src/test/ui/no_send-enum.stderr
@@ -1,9 +1,6 @@
error[E0277]: `NoSend` cannot be sent between threads safely
--> $DIR/no_send-enum.rs:16:5
|
-LL | fn bar<T: Send>(_: T) {}
- | ---- required by this bound in `bar`
-...
LL | bar(x);
| ^^^ `NoSend` cannot be sent between threads safely
|
@@ -13,6 +10,11 @@
|
LL | enum Foo {
| ^^^
+note: required by a bound in `bar`
+ --> $DIR/no_send-enum.rs:12:11
+ |
+LL | fn bar<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/no_send-rc.stderr b/src/test/ui/no_send-rc.stderr
index 713dd75..f8be5e7 100644
--- a/src/test/ui/no_send-rc.stderr
+++ b/src/test/ui/no_send-rc.stderr
@@ -1,13 +1,15 @@
error[E0277]: `Rc<{integer}>` cannot be sent between threads safely
--> $DIR/no_send-rc.rs:7:9
|
-LL | fn bar<T: Send>(_: T) {}
- | ---- required by this bound in `bar`
-...
LL | bar(x);
| ^ `Rc<{integer}>` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Rc<{integer}>`
+note: required by a bound in `bar`
+ --> $DIR/no_send-rc.rs:3:11
+ |
+LL | fn bar<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/no_send-struct.stderr b/src/test/ui/no_send-struct.stderr
index a28a5e6..2f8cf35 100644
--- a/src/test/ui/no_send-struct.stderr
+++ b/src/test/ui/no_send-struct.stderr
@@ -1,13 +1,15 @@
error[E0277]: `Foo` cannot be sent between threads safely
--> $DIR/no_send-struct.rs:15:9
|
-LL | fn bar<T: Send>(_: T) {}
- | ---- required by this bound in `bar`
-...
LL | bar(x);
| ^ `Foo` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Foo`
+note: required by a bound in `bar`
+ --> $DIR/no_send-struct.rs:11:11
+ |
+LL | fn bar<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/no_share-enum.stderr b/src/test/ui/no_share-enum.stderr
index a8ab692..ad83786 100644
--- a/src/test/ui/no_share-enum.stderr
+++ b/src/test/ui/no_share-enum.stderr
@@ -1,9 +1,6 @@
error[E0277]: `NoSync` cannot be shared between threads safely
--> $DIR/no_share-enum.rs:14:5
|
-LL | fn bar<T: Sync>(_: T) {}
- | ---- required by this bound in `bar`
-...
LL | bar(x);
| ^^^ `NoSync` cannot be shared between threads safely
|
@@ -13,6 +10,11 @@
|
LL | enum Foo { A(NoSync) }
| ^^^
+note: required by a bound in `bar`
+ --> $DIR/no_share-enum.rs:10:11
+ |
+LL | fn bar<T: Sync>(_: T) {}
+ | ^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/no_share-struct.stderr b/src/test/ui/no_share-struct.stderr
index a35271a..8983b08 100644
--- a/src/test/ui/no_share-struct.stderr
+++ b/src/test/ui/no_share-struct.stderr
@@ -1,13 +1,15 @@
error[E0277]: `Foo` cannot be shared between threads safely
--> $DIR/no_share-struct.rs:12:9
|
-LL | fn bar<T: Sync>(_: T) {}
- | ---- required by this bound in `bar`
-...
LL | bar(x);
| ^ `Foo` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Foo`
+note: required by a bound in `bar`
+ --> $DIR/no_share-struct.rs:8:11
+ |
+LL | fn bar<T: Sync>(_: T) {}
+ | ^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/non-fmt-panic.fixed b/src/test/ui/non-fmt-panic.fixed
new file mode 100644
index 0000000..d226f41
--- /dev/null
+++ b/src/test/ui/non-fmt-panic.fixed
@@ -0,0 +1,84 @@
+// run-rustfix
+// rustfix-only-machine-applicable
+// build-pass (FIXME(62277): should be check-pass)
+// aux-build:fancy-panic.rs
+
+extern crate fancy_panic;
+
+const C: &str = "abc {}";
+static S: &str = "{bla}";
+
+#[allow(unreachable_code)]
+fn main() {
+ panic!("{}", "here's a brace: {"); //~ WARN panic message contains a brace
+ std::panic!("{}", "another one: }"); //~ WARN panic message contains a brace
+ core::panic!("{}", "Hello {}"); //~ WARN panic message contains an unused formatting placeholder
+ assert!(false, "{}", "{:03x} {test} bla");
+ //~^ WARN panic message contains unused formatting placeholders
+ assert!(false, "{}", S);
+ //~^ WARN panic message is not a string literal
+ assert!(false, "{}", 123);
+ //~^ WARN panic message is not a string literal
+ assert!(false, "{:?}", Some(123));
+ //~^ WARN panic message is not a string literal
+ debug_assert!(false, "{}", "{{}} bla"); //~ WARN panic message contains braces
+ panic!("{}", C); //~ WARN panic message is not a string literal
+ panic!("{}", S); //~ WARN panic message is not a string literal
+ std::panic::panic_any(123); //~ WARN panic message is not a string literal
+ core::panic!("{}", &*"abc"); //~ WARN panic message is not a string literal
+ std::panic::panic_any(Some(123)); //~ WARN panic message is not a string literal
+ panic!("{}", concat!("{", "}")); //~ WARN panic message contains an unused formatting placeholder
+ panic!("{}", concat!("{", "{")); //~ WARN panic message contains braces
+
+ fancy_panic::fancy_panic!("test {} 123");
+ //~^ WARN panic message contains an unused formatting placeholder
+
+ fancy_panic::fancy_panic!(); // OK
+ fancy_panic::fancy_panic!(S); // OK
+
+ macro_rules! a {
+ () => { 123 };
+ }
+
+ std::panic::panic_any(a!()); //~ WARN panic message is not a string literal
+
+ panic!("{}", 1); //~ WARN panic message is not a string literal
+ assert!(false, "{}", 1); //~ WARN panic message is not a string literal
+ debug_assert!(false, "{}", 1); //~ WARN panic message is not a string literal
+
+ std::panic::panic_any(123); //~ WARN panic message is not a string literal
+ std::panic::panic_any(123); //~ WARN panic message is not a string literal
+
+ // Check that the lint only triggers for std::panic and core::panic,
+ // not any panic macro:
+ macro_rules! panic {
+ ($e:expr) => ();
+ }
+ panic!("{}"); // OK
+ panic!(S); // OK
+
+ a(1);
+ b(1);
+ c(1);
+ d(1);
+}
+
+fn a<T: Send + 'static>(v: T) {
+ std::panic::panic_any(v); //~ WARN panic message is not a string literal
+ assert!(false, v); //~ WARN panic message is not a string literal
+}
+
+fn b<T: std::fmt::Debug + Send + 'static>(v: T) {
+ std::panic::panic_any(v); //~ WARN panic message is not a string literal
+ assert!(false, "{:?}", v); //~ WARN panic message is not a string literal
+}
+
+fn c<T: std::fmt::Display + Send + 'static>(v: T) {
+ std::panic::panic_any(v); //~ WARN panic message is not a string literal
+ assert!(false, "{}", v); //~ WARN panic message is not a string literal
+}
+
+fn d<T: std::fmt::Display + std::fmt::Debug + Send + 'static>(v: T) {
+ std::panic::panic_any(v); //~ WARN panic message is not a string literal
+ assert!(false, "{}", v); //~ WARN panic message is not a string literal
+}
diff --git a/src/test/ui/non-fmt-panic.rs b/src/test/ui/non-fmt-panic.rs
index 77390aa..2ffd763 100644
--- a/src/test/ui/non-fmt-panic.rs
+++ b/src/test/ui/non-fmt-panic.rs
@@ -1,3 +1,5 @@
+// run-rustfix
+// rustfix-only-machine-applicable
// build-pass (FIXME(62277): should be check-pass)
// aux-build:fancy-panic.rs
@@ -15,19 +17,24 @@
//~^ WARN panic message contains unused formatting placeholders
assert!(false, S);
//~^ WARN panic message is not a string literal
+ assert!(false, 123);
+ //~^ WARN panic message is not a string literal
+ assert!(false, Some(123));
+ //~^ WARN panic message is not a string literal
debug_assert!(false, "{{}} bla"); //~ WARN panic message contains braces
panic!(C); //~ WARN panic message is not a string literal
panic!(S); //~ WARN panic message is not a string literal
std::panic!(123); //~ WARN panic message is not a string literal
core::panic!(&*"abc"); //~ WARN panic message is not a string literal
+ panic!(Some(123)); //~ WARN panic message is not a string literal
panic!(concat!("{", "}")); //~ WARN panic message contains an unused formatting placeholder
panic!(concat!("{", "{")); //~ WARN panic message contains braces
fancy_panic::fancy_panic!("test {} 123");
//~^ WARN panic message contains an unused formatting placeholder
- fancy_panic::fancy_panic!(S);
- //~^ WARN panic message is not a string literal
+ fancy_panic::fancy_panic!(); // OK
+ fancy_panic::fancy_panic!(S); // OK
macro_rules! a {
() => { 123 };
@@ -49,4 +56,29 @@
}
panic!("{}"); // OK
panic!(S); // OK
+
+ a(1);
+ b(1);
+ c(1);
+ d(1);
+}
+
+fn a<T: Send + 'static>(v: T) {
+ panic!(v); //~ WARN panic message is not a string literal
+ assert!(false, v); //~ WARN panic message is not a string literal
+}
+
+fn b<T: std::fmt::Debug + Send + 'static>(v: T) {
+ panic!(v); //~ WARN panic message is not a string literal
+ assert!(false, v); //~ WARN panic message is not a string literal
+}
+
+fn c<T: std::fmt::Display + Send + 'static>(v: T) {
+ panic!(v); //~ WARN panic message is not a string literal
+ assert!(false, v); //~ WARN panic message is not a string literal
+}
+
+fn d<T: std::fmt::Display + std::fmt::Debug + Send + 'static>(v: T) {
+ panic!(v); //~ WARN panic message is not a string literal
+ assert!(false, v); //~ WARN panic message is not a string literal
}
diff --git a/src/test/ui/non-fmt-panic.stderr b/src/test/ui/non-fmt-panic.stderr
index 6aa2eb1..b62cc37 100644
--- a/src/test/ui/non-fmt-panic.stderr
+++ b/src/test/ui/non-fmt-panic.stderr
@@ -1,5 +1,5 @@
warning: panic message contains a brace
- --> $DIR/non-fmt-panic.rs:11:29
+ --> $DIR/non-fmt-panic.rs:13:29
|
LL | panic!("here's a brace: {");
| ^
@@ -9,10 +9,10 @@
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", "here's a brace: {");
- | ^^^^^
+ | +++++
warning: panic message contains a brace
- --> $DIR/non-fmt-panic.rs:12:31
+ --> $DIR/non-fmt-panic.rs:14:31
|
LL | std::panic!("another one: }");
| ^
@@ -21,10 +21,10 @@
help: add a "{}" format string to use the message literally
|
LL | std::panic!("{}", "another one: }");
- | ^^^^^
+ | +++++
warning: panic message contains an unused formatting placeholder
- --> $DIR/non-fmt-panic.rs:13:25
+ --> $DIR/non-fmt-panic.rs:15:25
|
LL | core::panic!("Hello {}");
| ^^
@@ -33,14 +33,14 @@
help: add the missing argument
|
LL | core::panic!("Hello {}", ...);
- | ^^^^^
+ | +++++
help: or add a "{}" format string to use the message literally
|
LL | core::panic!("{}", "Hello {}");
- | ^^^^^
+ | +++++
warning: panic message contains unused formatting placeholders
- --> $DIR/non-fmt-panic.rs:14:21
+ --> $DIR/non-fmt-panic.rs:16:21
|
LL | assert!(false, "{:03x} {test} bla");
| ^^^^^^ ^^^^^^
@@ -49,27 +49,53 @@
help: add the missing arguments
|
LL | assert!(false, "{:03x} {test} bla", ...);
- | ^^^^^
+ | +++++
help: or add a "{}" format string to use the message literally
|
LL | assert!(false, "{}", "{:03x} {test} bla");
- | ^^^^^
+ | +++++
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:16:20
+ --> $DIR/non-fmt-panic.rs:18:20
|
LL | assert!(false, S);
| ^
|
- = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to Display the message
|
LL | assert!(false, "{}", S);
- | ^^^^^
+ | +++++
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:20:20
+ |
+LL | assert!(false, 123);
+ | ^^^
+ |
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{}" format string to Display the message
+ |
+LL | assert!(false, "{}", 123);
+ | +++++
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:22:20
+ |
+LL | assert!(false, Some(123));
+ | ^^^^^^^^^
+ |
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{:?}" format string to use the Debug implementation of `Option<i32>`
+ |
+LL | assert!(false, "{:?}", Some(123));
+ | +++++++
warning: panic message contains braces
- --> $DIR/non-fmt-panic.rs:18:27
+ --> $DIR/non-fmt-panic.rs:24:27
|
LL | debug_assert!(false, "{{}} bla");
| ^^^^
@@ -78,10 +104,10 @@
help: add a "{}" format string to use the message literally
|
LL | debug_assert!(false, "{}", "{{}} bla");
- | ^^^^^
+ | +++++
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:19:12
+ --> $DIR/non-fmt-panic.rs:25:12
|
LL | panic!(C);
| ^
@@ -91,14 +117,10 @@
help: add a "{}" format string to Display the message
|
LL | panic!("{}", C);
- | ^^^^^
-help: or use std::panic::panic_any instead
- |
-LL | std::panic::panic_any(C);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:20:12
+ --> $DIR/non-fmt-panic.rs:26:12
|
LL | panic!(S);
| ^
@@ -108,44 +130,57 @@
help: add a "{}" format string to Display the message
|
LL | panic!("{}", S);
- | ^^^^^
-help: or use std::panic::panic_any instead
- |
-LL | std::panic::panic_any(S);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:21:17
+ --> $DIR/non-fmt-panic.rs:27:17
|
LL | std::panic!(123);
| ^^^
|
- = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: this usage of std::panic!() is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to Display the message
|
LL | std::panic!("{}", 123);
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(123);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:22:18
+ --> $DIR/non-fmt-panic.rs:28:18
|
LL | core::panic!(&*"abc");
| ^^^^^^^
|
- = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: this usage of core::panic!() is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
help: add a "{}" format string to Display the message
|
LL | core::panic!("{}", &*"abc");
- | ^^^^^
+ | +++++
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:29:12
+ |
+LL | panic!(Some(123));
+ | ^^^^^^^^^
+ |
+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{:?}" format string to use the Debug implementation of `Option<i32>`
+ |
+LL | panic!("{:?}", Some(123));
+ | +++++++
+help: or use std::panic::panic_any instead
+ |
+LL | std::panic::panic_any(Some(123));
+ | ~~~~~~~~~~~~~~~~~~~~~
warning: panic message contains an unused formatting placeholder
- --> $DIR/non-fmt-panic.rs:23:12
+ --> $DIR/non-fmt-panic.rs:30:12
|
LL | panic!(concat!("{", "}"));
| ^^^^^^^^^^^^^^^^^
@@ -154,14 +189,14 @@
help: add the missing argument
|
LL | panic!(concat!("{", "}"), ...);
- | ^^^^^
+ | +++++
help: or add a "{}" format string to use the message literally
|
LL | panic!("{}", concat!("{", "}"));
- | ^^^^^
+ | +++++
warning: panic message contains braces
- --> $DIR/non-fmt-panic.rs:24:5
+ --> $DIR/non-fmt-panic.rs:31:5
|
LL | panic!(concat!("{", "{"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -170,10 +205,10 @@
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", concat!("{", "{"));
- | ^^^^^
+ | +++++
warning: panic message contains an unused formatting placeholder
- --> $DIR/non-fmt-panic.rs:26:37
+ --> $DIR/non-fmt-panic.rs:33:37
|
LL | fancy_panic::fancy_panic!("test {} 123");
| ^^
@@ -181,16 +216,7 @@
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:29:31
- |
-LL | fancy_panic::fancy_panic!(S);
- | ^
- |
- = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
-
-warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:36:12
+ --> $DIR/non-fmt-panic.rs:43:12
|
LL | panic!(a!());
| ^^^^
@@ -200,14 +226,14 @@
help: add a "{}" format string to Display the message
|
LL | panic!("{}", a!());
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(a!());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:38:12
+ --> $DIR/non-fmt-panic.rs:45:12
|
LL | panic!(format!("{}", 1));
| ^^^^^^^^^^^^^^^^
@@ -217,39 +243,42 @@
= note: the panic!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
|
-LL | panic!("{}", 1);
- | -- --
+LL - panic!(format!("{}", 1));
+LL + panic!("{}", 1);
+ |
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:39:20
+ --> $DIR/non-fmt-panic.rs:46:20
|
LL | assert!(false, format!("{}", 1));
| ^^^^^^^^^^^^^^^^
|
- = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
= note: the assert!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
|
-LL | assert!(false, "{}", 1);
- | -- --
+LL - assert!(false, format!("{}", 1));
+LL + assert!(false, "{}", 1);
+ |
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:40:26
+ --> $DIR/non-fmt-panic.rs:47:26
|
LL | debug_assert!(false, format!("{}", 1));
| ^^^^^^^^^^^^^^^^
|
- = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: this usage of debug_assert!() is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
= note: the debug_assert!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
|
-LL | debug_assert!(false, "{}", 1);
- | -- --
+LL - debug_assert!(false, format!("{}", 1));
+LL + debug_assert!(false, "{}", 1);
+ |
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:42:12
+ --> $DIR/non-fmt-panic.rs:49:12
|
LL | panic![123];
| ^^^
@@ -259,14 +288,14 @@
help: add a "{}" format string to Display the message
|
LL | panic!["{}", 123];
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(123);
- | ^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ~~~~~~~~~~~~~~~~~~~~~~ ~
warning: panic message is not a string literal
- --> $DIR/non-fmt-panic.rs:43:12
+ --> $DIR/non-fmt-panic.rs:50:12
|
LL | panic!{123};
| ^^^
@@ -276,11 +305,121 @@
help: add a "{}" format string to Display the message
|
LL | panic!{"{}", 123};
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(123);
- | ^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ~~~~~~~~~~~~~~~~~~~~~~ ~
-warning: 20 warnings emitted
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:67:12
+ |
+LL | panic!(v);
+ | ------ ^
+ | |
+ | help: use std::panic::panic_any instead: `std::panic::panic_any`
+ |
+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:68:20
+ |
+LL | assert!(false, v);
+ | ^
+ |
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:72:12
+ |
+LL | panic!(v);
+ | ^
+ |
+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{:?}" format string to use the Debug implementation of `T`
+ |
+LL | panic!("{:?}", v);
+ | +++++++
+help: or use std::panic::panic_any instead
+ |
+LL | std::panic::panic_any(v);
+ | ~~~~~~~~~~~~~~~~~~~~~
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:73:20
+ |
+LL | assert!(false, v);
+ | ^
+ |
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{:?}" format string to use the Debug implementation of `T`
+ |
+LL | assert!(false, "{:?}", v);
+ | +++++++
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:77:12
+ |
+LL | panic!(v);
+ | ^
+ |
+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{}" format string to Display the message
+ |
+LL | panic!("{}", v);
+ | +++++
+help: or use std::panic::panic_any instead
+ |
+LL | std::panic::panic_any(v);
+ | ~~~~~~~~~~~~~~~~~~~~~
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:78:20
+ |
+LL | assert!(false, v);
+ | ^
+ |
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{}" format string to Display the message
+ |
+LL | assert!(false, "{}", v);
+ | +++++
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:82:12
+ |
+LL | panic!(v);
+ | ^
+ |
+ = note: this usage of panic!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{}" format string to Display the message
+ |
+LL | panic!("{}", v);
+ | +++++
+help: or use std::panic::panic_any instead
+ |
+LL | std::panic::panic_any(v);
+ | ~~~~~~~~~~~~~~~~~~~~~
+
+warning: panic message is not a string literal
+ --> $DIR/non-fmt-panic.rs:83:20
+ |
+LL | assert!(false, v);
+ | ^
+ |
+ = note: this usage of assert!() is deprecated; it will be a hard error in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+help: add a "{}" format string to Display the message
+ |
+LL | assert!(false, "{}", v);
+ | +++++
+
+warning: 30 warnings emitted
diff --git a/src/test/ui/not-panic/not-panic-safe-2.stderr b/src/test/ui/not-panic/not-panic-safe-2.stderr
index 6deb1e7..6559470 100644
--- a/src/test/ui/not-panic/not-panic-safe-2.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-2.stderr
@@ -1,22 +1,21 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-2.rs:10:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<Rc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `Rc<RefCell<i32>>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-2.rs:7:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-2.rs:10:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<Rc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
@@ -24,6 +23,11 @@
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `Rc<RefCell<i32>>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-2.rs:7:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/not-panic/not-panic-safe-3.stderr b/src/test/ui/not-panic/not-panic-safe-3.stderr
index ef1cf54..db3fdb2 100644
--- a/src/test/ui/not-panic/not-panic-safe-3.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-3.stderr
@@ -1,22 +1,21 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-3.rs:10:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<Arc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `Arc<RefCell<i32>>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-3.rs:7:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-3.rs:10:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<Arc<RefCell<i32>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
@@ -24,6 +23,11 @@
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `Arc<RefCell<i32>>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-3.rs:7:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/not-panic/not-panic-safe-4.stderr b/src/test/ui/not-panic/not-panic-safe-4.stderr
index 2f86b96..079601b 100644
--- a/src/test/ui/not-panic/not-panic-safe-4.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-4.stderr
@@ -1,22 +1,21 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-4.rs:9:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<&RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `&RefCell<i32>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-4.rs:6:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-4.rs:9:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<&RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
@@ -24,6 +23,11 @@
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `&RefCell<i32>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-4.rs:6:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/not-panic/not-panic-safe-5.stderr b/src/test/ui/not-panic/not-panic-safe-5.stderr
index c9f407a..edd0f72 100644
--- a/src/test/ui/not-panic/not-panic-safe-5.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-5.stderr
@@ -1,14 +1,16 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-5.rs:9:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<*const UnsafeCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `*const UnsafeCell<i32>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-5.rs:6:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error: aborting due to previous error
diff --git a/src/test/ui/not-panic/not-panic-safe-6.stderr b/src/test/ui/not-panic/not-panic-safe-6.stderr
index cf75c89..f3b784a 100644
--- a/src/test/ui/not-panic/not-panic-safe-6.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-6.stderr
@@ -1,22 +1,21 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-6.rs:9:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<*mut RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `*mut RefCell<i32>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-6.rs:6:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/not-panic-safe-6.rs:9:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<*mut RefCell<i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
@@ -24,6 +23,11 @@
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
= note: required because of the requirements on the impl of `UnwindSafe` for `*mut RefCell<i32>`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe-6.rs:6:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/not-panic/not-panic-safe.stderr b/src/test/ui/not-panic/not-panic-safe.stderr
index 1aaf17b..b95cd91 100644
--- a/src/test/ui/not-panic/not-panic-safe.stderr
+++ b/src/test/ui/not-panic/not-panic-safe.stderr
@@ -1,14 +1,16 @@
error[E0277]: the type `&mut i32` may not be safely transferred across an unwind boundary
--> $DIR/not-panic-safe.rs:9:5
|
-LL | fn assert<T: UnwindSafe + ?Sized>() {}
- | ---------- required by this bound in `assert`
-...
LL | assert::<&mut i32>();
| ^^^^^^^^^^^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary
|
= help: the trait `UnwindSafe` is not implemented for `&mut i32`
= note: `UnwindSafe` is implemented for `&i32`, but not for `&mut i32`
+note: required by a bound in `assert`
+ --> $DIR/not-panic-safe.rs:6:14
+ |
+LL | fn assert<T: UnwindSafe + ?Sized>() {}
+ | ^^^^^^^^^^ required by this bound in `assert`
error: aborting due to previous error
diff --git a/src/test/ui/not-sync.stderr b/src/test/ui/not-sync.stderr
index 85d3599..1ee358b 100644
--- a/src/test/ui/not-sync.stderr
+++ b/src/test/ui/not-sync.stderr
@@ -1,68 +1,80 @@
error[E0277]: `Cell<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:8:12
|
-LL | fn test<T: Sync>() {}
- | ---- required by this bound in `test`
-...
LL | test::<Cell<i32>>();
| ^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
+note: required by a bound in `test`
+ --> $DIR/not-sync.rs:5:12
+ |
+LL | fn test<T: Sync>() {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:10:12
|
-LL | fn test<T: Sync>() {}
- | ---- required by this bound in `test`
-...
LL | test::<RefCell<i32>>();
| ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
+note: required by a bound in `test`
+ --> $DIR/not-sync.rs:5:12
+ |
+LL | fn test<T: Sync>() {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `Rc<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:13:12
|
-LL | fn test<T: Sync>() {}
- | ---- required by this bound in `test`
-...
LL | test::<Rc<i32>>();
| ^^^^^^^ `Rc<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Rc<i32>`
+note: required by a bound in `test`
+ --> $DIR/not-sync.rs:5:12
+ |
+LL | fn test<T: Sync>() {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `std::rc::Weak<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:15:12
|
-LL | fn test<T: Sync>() {}
- | ---- required by this bound in `test`
-...
LL | test::<Weak<i32>>();
| ^^^^^^^^^ `std::rc::Weak<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `std::rc::Weak<i32>`
+note: required by a bound in `test`
+ --> $DIR/not-sync.rs:5:12
+ |
+LL | fn test<T: Sync>() {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:18:12
|
-LL | fn test<T: Sync>() {}
- | ---- required by this bound in `test`
-...
LL | test::<Receiver<i32>>();
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<i32>`
+note: required by a bound in `test`
+ --> $DIR/not-sync.rs:5:12
+ |
+LL | fn test<T: Sync>() {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `Sender<i32>` cannot be shared between threads safely
--> $DIR/not-sync.rs:20:12
|
-LL | fn test<T: Sync>() {}
- | ---- required by this bound in `test`
-...
LL | test::<Sender<i32>>();
| ^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Sender<i32>`
+note: required by a bound in `test`
+ --> $DIR/not-sync.rs:5:12
+ |
+LL | fn test<T: Sync>() {}
+ | ^^^^ required by this bound in `test`
error: aborting due to 6 previous errors
diff --git a/src/test/ui/numeric/const-scope.stderr b/src/test/ui/numeric/const-scope.stderr
index 5a275d5..6732391 100644
--- a/src/test/ui/numeric/const-scope.stderr
+++ b/src/test/ui/numeric/const-scope.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `i8` to `i32`
|
LL | const C: i32 = 1i32;
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/const-scope.rs:2:15
@@ -26,7 +26,7 @@
help: change the type of the numeric literal from `i8` to `i32`
|
LL | let c: i32 = 1i32;
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/const-scope.rs:6:17
@@ -47,7 +47,7 @@
help: change the type of the numeric literal from `i8` to `i32`
|
LL | let c: i32 = 1i32;
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/const-scope.rs:11:17
@@ -60,7 +60,7 @@
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | let d: i8 = c.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/numeric/len.stderr b/src/test/ui/numeric/len.stderr
index 79b38b0..9a3248c 100644
--- a/src/test/ui/numeric/len.stderr
+++ b/src/test/ui/numeric/len.stderr
@@ -7,7 +7,7 @@
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | test(array.len().try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/numeric/numeric-cast-2.stderr b/src/test/ui/numeric/numeric-cast-2.stderr
index 858990f..83d8ce5 100644
--- a/src/test/ui/numeric/numeric-cast-2.stderr
+++ b/src/test/ui/numeric/numeric-cast-2.stderr
@@ -9,7 +9,7 @@
help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
|
LL | let x: u16 = foo().try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-2.rs:7:18
diff --git a/src/test/ui/numeric/numeric-cast-binop.stderr b/src/test/ui/numeric/numeric-cast-binop.stderr
index cb051aa..b0ff507 100644
--- a/src/test/ui/numeric/numeric-cast-binop.stderr
+++ b/src/test/ui/numeric/numeric-cast-binop.stderr
@@ -7,7 +7,7 @@
help: you can convert `x_u8` from `u8` to `u16`, matching the type of `x_u16`
|
LL | u16::from(x_u8) > x_u16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:25:16
@@ -18,7 +18,7 @@
help: you can convert `x_u8` from `u8` to `u32`, matching the type of `x_u32`
|
LL | u32::from(x_u8) > x_u32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:27:16
@@ -29,7 +29,7 @@
help: you can convert `x_u8` from `u8` to `u64`, matching the type of `x_u64`
|
LL | u64::from(x_u8) > x_u64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:29:16
@@ -40,7 +40,7 @@
help: you can convert `x_u8` from `u8` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u8) > x_u128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:31:16
@@ -51,7 +51,7 @@
help: you can convert `x_u8` from `u8` to `usize`, matching the type of `x_usize`
|
LL | usize::from(x_u8) > x_usize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:34:17
@@ -71,7 +71,7 @@
help: you can convert `x_u16` from `u16` to `u32`, matching the type of `x_u32`
|
LL | u32::from(x_u16) > x_u32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:38:17
@@ -82,7 +82,7 @@
help: you can convert `x_u16` from `u16` to `u64`, matching the type of `x_u64`
|
LL | u64::from(x_u16) > x_u64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:40:17
@@ -93,7 +93,7 @@
help: you can convert `x_u16` from `u16` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u16) > x_u128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:42:17
@@ -104,7 +104,7 @@
help: you can convert `x_u16` from `u16` to `usize`, matching the type of `x_usize`
|
LL | usize::from(x_u16) > x_usize;
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:45:17
@@ -133,7 +133,7 @@
help: you can convert `x_u32` from `u32` to `u64`, matching the type of `x_u64`
|
LL | u64::from(x_u32) > x_u64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:51:17
@@ -144,7 +144,7 @@
help: you can convert `x_u32` from `u32` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u32) > x_u128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:53:17
@@ -155,7 +155,7 @@
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:56:17
@@ -193,7 +193,7 @@
help: you can convert `x_u64` from `u64` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u64) > x_u128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:64:17
@@ -204,7 +204,7 @@
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:67:18
@@ -251,7 +251,7 @@
help: you can convert a `usize` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:78:19
@@ -280,7 +280,7 @@
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:84:19
@@ -291,7 +291,7 @@
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:86:19
@@ -302,7 +302,7 @@
help: you can convert a `u128` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:92:16
@@ -313,7 +313,7 @@
help: you can convert `x_i8` from `i8` to `i16`, matching the type of `x_i16`
|
LL | i16::from(x_i8) > x_i16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:94:16
@@ -324,7 +324,7 @@
help: you can convert `x_i8` from `i8` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_i8) > x_i32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:96:16
@@ -335,7 +335,7 @@
help: you can convert `x_i8` from `i8` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_i8) > x_i64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:98:16
@@ -346,7 +346,7 @@
help: you can convert `x_i8` from `i8` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i8) > x_i128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:100:16
@@ -357,7 +357,7 @@
help: you can convert `x_i8` from `i8` to `isize`, matching the type of `x_isize`
|
LL | isize::from(x_i8) > x_isize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:103:17
@@ -377,7 +377,7 @@
help: you can convert `x_i16` from `i16` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_i16) > x_i32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:107:17
@@ -388,7 +388,7 @@
help: you can convert `x_i16` from `i16` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_i16) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:109:17
@@ -399,7 +399,7 @@
help: you can convert `x_i16` from `i16` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i16) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:111:17
@@ -410,7 +410,7 @@
help: you can convert `x_i16` from `i16` to `isize`, matching the type of `x_isize`
|
LL | isize::from(x_i16) > x_isize;
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:114:17
@@ -439,7 +439,7 @@
help: you can convert `x_i32` from `i32` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_i32) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:120:17
@@ -450,7 +450,7 @@
help: you can convert `x_i32` from `i32` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i32) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:122:17
@@ -461,7 +461,7 @@
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:125:17
@@ -499,7 +499,7 @@
help: you can convert `x_i64` from `i64` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i64) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:133:17
@@ -510,7 +510,7 @@
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:136:18
@@ -557,7 +557,7 @@
help: you can convert an `isize` to an `i128` and panic if the converted value doesn't fit
|
LL | x_i128 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:147:19
@@ -586,7 +586,7 @@
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:153:19
@@ -597,7 +597,7 @@
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:155:19
@@ -608,7 +608,7 @@
help: you can convert an `i128` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_i128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:161:16
@@ -619,7 +619,7 @@
help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit
|
LL | x_u8 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:163:16
@@ -630,7 +630,7 @@
help: you can convert `x_u8` from `u8` to `i16`, matching the type of `x_i16`
|
LL | i16::from(x_u8) > x_i16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:165:16
@@ -641,7 +641,7 @@
help: you can convert `x_u8` from `u8` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_u8) > x_i32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:167:16
@@ -652,7 +652,7 @@
help: you can convert `x_u8` from `u8` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_u8) > x_i64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:169:16
@@ -663,7 +663,7 @@
help: you can convert `x_u8` from `u8` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u8) > x_i128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:171:16
@@ -674,7 +674,7 @@
help: you can convert `x_u8` from `u8` to `isize`, matching the type of `x_isize`
|
LL | isize::from(x_u8) > x_isize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:174:17
@@ -685,7 +685,7 @@
help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit
|
LL | x_u16 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:176:17
@@ -696,7 +696,7 @@
help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit
|
LL | x_u16 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:178:17
@@ -707,7 +707,7 @@
help: you can convert `x_u16` from `u16` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_u16) > x_i32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:180:17
@@ -718,7 +718,7 @@
help: you can convert `x_u16` from `u16` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_u16) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:182:17
@@ -729,7 +729,7 @@
help: you can convert `x_u16` from `u16` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u16) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:184:17
@@ -740,7 +740,7 @@
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
LL | x_u16 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:187:17
@@ -751,7 +751,7 @@
help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:189:17
@@ -762,7 +762,7 @@
help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:191:17
@@ -773,7 +773,7 @@
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:193:17
@@ -784,7 +784,7 @@
help: you can convert `x_u32` from `u32` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_u32) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:195:17
@@ -795,7 +795,7 @@
help: you can convert `x_u32` from `u32` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u32) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:197:17
@@ -806,7 +806,7 @@
help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:200:17
@@ -817,7 +817,7 @@
help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:202:17
@@ -828,7 +828,7 @@
help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:204:17
@@ -839,7 +839,7 @@
help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:206:17
@@ -850,7 +850,7 @@
help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:208:17
@@ -861,7 +861,7 @@
help: you can convert `x_u64` from `u64` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u64) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:210:17
@@ -872,7 +872,7 @@
help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:213:18
@@ -883,7 +883,7 @@
help: you can convert an `i8` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:215:18
@@ -894,7 +894,7 @@
help: you can convert an `i16` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:217:18
@@ -905,7 +905,7 @@
help: you can convert an `i32` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:219:18
@@ -916,7 +916,7 @@
help: you can convert an `i64` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:221:18
@@ -927,7 +927,7 @@
help: you can convert an `i128` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:223:18
@@ -938,7 +938,7 @@
help: you can convert an `isize` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:226:19
@@ -949,7 +949,7 @@
help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:228:19
@@ -960,7 +960,7 @@
help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:230:19
@@ -971,7 +971,7 @@
help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:232:19
@@ -982,7 +982,7 @@
help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:234:19
@@ -993,7 +993,7 @@
help: you can convert an `i128` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:236:19
@@ -1004,7 +1004,7 @@
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:242:16
@@ -1015,7 +1015,7 @@
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:244:16
@@ -1026,7 +1026,7 @@
help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:246:16
@@ -1037,7 +1037,7 @@
help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:248:16
@@ -1048,7 +1048,7 @@
help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:250:16
@@ -1059,7 +1059,7 @@
help: you can convert a `u128` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:252:16
@@ -1070,7 +1070,7 @@
help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:255:17
@@ -1090,7 +1090,7 @@
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:259:17
@@ -1101,7 +1101,7 @@
help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:261:17
@@ -1112,7 +1112,7 @@
help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:263:17
@@ -1123,7 +1123,7 @@
help: you can convert a `u128` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:265:17
@@ -1134,7 +1134,7 @@
help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:268:17
@@ -1163,7 +1163,7 @@
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:274:17
@@ -1174,7 +1174,7 @@
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:276:17
@@ -1185,7 +1185,7 @@
help: you can convert a `u128` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:278:17
@@ -1196,7 +1196,7 @@
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:281:17
@@ -1234,7 +1234,7 @@
help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:289:17
@@ -1245,7 +1245,7 @@
help: you can convert a `u128` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:291:17
@@ -1256,7 +1256,7 @@
help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:294:18
@@ -1303,7 +1303,7 @@
help: you can convert a `u128` to an `i128` and panic if the converted value doesn't fit
|
LL | x_i128 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:304:18
@@ -1314,7 +1314,7 @@
help: you can convert a `usize` to an `i128` and panic if the converted value doesn't fit
|
LL | x_i128 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:307:19
@@ -1334,7 +1334,7 @@
help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:311:19
@@ -1345,7 +1345,7 @@
help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:313:19
@@ -1356,7 +1356,7 @@
help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:315:19
@@ -1367,7 +1367,7 @@
help: you can convert a `u128` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:317:19
@@ -1378,7 +1378,7 @@
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 132 previous errors
diff --git a/src/test/ui/numeric/numeric-cast-no-fix.stderr b/src/test/ui/numeric/numeric-cast-no-fix.stderr
index 4852e70..4510ce1 100644
--- a/src/test/ui/numeric/numeric-cast-no-fix.stderr
+++ b/src/test/ui/numeric/numeric-cast-no-fix.stderr
@@ -47,7 +47,7 @@
help: you can convert `x_u8` from `u8` to `isize`, matching the type of `-1_isize`
|
LL | isize::from(x_u8) > -1_isize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:23:15
@@ -74,7 +74,7 @@
help: you can convert `x_u64` from `u64` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u64) > -1_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:29:13
@@ -85,7 +85,7 @@
help: you can convert `x_u32` from `u32` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u32) > -1_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:31:13
@@ -96,7 +96,7 @@
help: you can convert `x_u16` from `u16` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u16) > -1_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:33:12
@@ -107,7 +107,7 @@
help: you can convert `x_u8` from `u8` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u8) > -1_i128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:36:15
@@ -142,7 +142,7 @@
help: you can convert `x_u32` from `u32` to `i64`, matching the type of `-1_i64`
|
LL | i64::from(x_u32) > -1_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:44:13
@@ -153,7 +153,7 @@
help: you can convert `x_u16` from `u16` to `i64`, matching the type of `-1_i64`
|
LL | i64::from(x_u16) > -1_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:46:12
@@ -164,7 +164,7 @@
help: you can convert `x_u8` from `u8` to `i64`, matching the type of `-1_i64`
|
LL | i64::from(x_u8) > -1_i64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:49:15
@@ -207,7 +207,7 @@
help: you can convert `x_u16` from `u16` to `i32`, matching the type of `-1_i32`
|
LL | i32::from(x_u16) > -1_i32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:59:12
@@ -218,7 +218,7 @@
help: you can convert `x_u8` from `u8` to `i32`, matching the type of `-1_i32`
|
LL | i32::from(x_u8) > -1_i32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:62:15
@@ -269,7 +269,7 @@
help: you can convert `x_u8` from `u8` to `i16`, matching the type of `-1_i16`
|
LL | i16::from(x_u8) > -1_i16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:75:15
diff --git a/src/test/ui/numeric/numeric-cast.stderr b/src/test/ui/numeric/numeric-cast.stderr
index ffd6368..8bc617b 100644
--- a/src/test/ui/numeric/numeric-cast.stderr
+++ b/src/test/ui/numeric/numeric-cast.stderr
@@ -7,7 +7,7 @@
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:25:18
@@ -18,7 +18,7 @@
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:27:18
@@ -47,7 +47,7 @@
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:33:18
@@ -58,7 +58,7 @@
help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:35:18
@@ -69,7 +69,7 @@
help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:37:18
@@ -80,7 +80,7 @@
help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:39:18
@@ -91,7 +91,7 @@
help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:44:18
@@ -102,7 +102,7 @@
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:46:18
@@ -113,7 +113,7 @@
help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:48:18
@@ -124,7 +124,7 @@
help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:50:18
@@ -135,7 +135,7 @@
help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:52:18
@@ -155,7 +155,7 @@
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:57:18
@@ -166,7 +166,7 @@
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:59:18
@@ -195,7 +195,7 @@
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:69:16
@@ -233,7 +233,7 @@
help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:77:16
@@ -244,7 +244,7 @@
help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:79:16
@@ -255,7 +255,7 @@
help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:81:16
@@ -266,7 +266,7 @@
help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:83:16
@@ -277,7 +277,7 @@
help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:88:16
@@ -288,7 +288,7 @@
help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit
|
LL | foo::<i64>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:90:16
@@ -299,7 +299,7 @@
help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit
|
LL | foo::<i64>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:92:16
@@ -337,7 +337,7 @@
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
LL | foo::<i64>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:101:16
@@ -375,7 +375,7 @@
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:112:16
@@ -386,7 +386,7 @@
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:115:16
@@ -415,7 +415,7 @@
help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:121:16
@@ -426,7 +426,7 @@
help: you can convert an `i64` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:123:16
@@ -437,7 +437,7 @@
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:125:16
@@ -448,7 +448,7 @@
help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:127:16
@@ -459,7 +459,7 @@
help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:132:16
@@ -470,7 +470,7 @@
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:134:16
@@ -481,7 +481,7 @@
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:136:16
@@ -492,7 +492,7 @@
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:138:16
@@ -521,7 +521,7 @@
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:144:16
@@ -532,7 +532,7 @@
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:147:16
@@ -561,7 +561,7 @@
help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:156:16
@@ -572,7 +572,7 @@
help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:158:16
@@ -583,7 +583,7 @@
help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:161:16
@@ -603,7 +603,7 @@
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:165:16
@@ -614,7 +614,7 @@
help: you can convert an `i64` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:167:16
@@ -625,7 +625,7 @@
help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:169:16
@@ -636,7 +636,7 @@
help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:171:16
@@ -647,7 +647,7 @@
help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:176:16
@@ -658,7 +658,7 @@
help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:178:16
@@ -669,7 +669,7 @@
help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:180:16
@@ -680,7 +680,7 @@
help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:182:16
@@ -691,7 +691,7 @@
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:184:16
@@ -711,7 +711,7 @@
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:188:16
@@ -722,7 +722,7 @@
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:190:16
@@ -733,7 +733,7 @@
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:193:16
@@ -753,7 +753,7 @@
help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:200:15
@@ -764,7 +764,7 @@
help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:202:15
@@ -775,7 +775,7 @@
help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:204:15
@@ -786,7 +786,7 @@
help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:207:15
@@ -797,7 +797,7 @@
help: you can convert an `isize` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:209:15
@@ -808,7 +808,7 @@
help: you can convert an `i64` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:211:15
@@ -819,7 +819,7 @@
help: you can convert an `i32` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:213:15
@@ -830,7 +830,7 @@
help: you can convert an `i16` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:215:15
@@ -841,7 +841,7 @@
help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:220:15
@@ -852,7 +852,7 @@
help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:222:15
@@ -863,7 +863,7 @@
help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:224:15
@@ -874,7 +874,7 @@
help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:226:15
@@ -885,7 +885,7 @@
help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:228:15
@@ -896,7 +896,7 @@
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:230:15
@@ -907,7 +907,7 @@
help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:232:15
@@ -918,7 +918,7 @@
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:234:15
@@ -929,7 +929,7 @@
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:236:15
@@ -940,7 +940,7 @@
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:242:16
@@ -951,7 +951,7 @@
help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f64>(x_usize as f64);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:244:16
@@ -962,7 +962,7 @@
help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f64>(x_u64 as f64);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:246:16
@@ -973,7 +973,7 @@
help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_u32.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:248:16
@@ -984,7 +984,7 @@
help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_u16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:250:16
@@ -995,7 +995,7 @@
help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_u8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:252:16
@@ -1006,7 +1006,7 @@
help: you can convert an `isize` to an `f64`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f64>(x_isize as f64);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:254:16
@@ -1017,7 +1017,7 @@
help: you can convert an `i64` to an `f64`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f64>(x_i64 as f64);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:256:16
@@ -1028,7 +1028,7 @@
help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_i32.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:258:16
@@ -1039,7 +1039,7 @@
help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_i16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:260:16
@@ -1050,7 +1050,7 @@
help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_i8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:263:16
@@ -1070,7 +1070,7 @@
help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f32>(x_usize as f32);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:268:16
@@ -1081,7 +1081,7 @@
help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f32>(x_u64 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:270:16
@@ -1092,7 +1092,7 @@
help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f32>(x_u32 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:272:16
@@ -1103,7 +1103,7 @@
help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_u16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:274:16
@@ -1114,7 +1114,7 @@
help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_u8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:276:16
@@ -1125,7 +1125,7 @@
help: you can convert an `isize` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_isize as f32);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:278:16
@@ -1136,7 +1136,7 @@
help: you can convert an `i64` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_i64 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:280:16
@@ -1147,7 +1147,7 @@
help: you can convert an `i32` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_i32 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:282:16
@@ -1158,7 +1158,7 @@
help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_i16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:284:16
@@ -1169,7 +1169,7 @@
help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_i8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:289:16
diff --git a/src/test/ui/numeric/numeric-suffix.stderr b/src/test/ui/numeric/numeric-suffix.stderr
index a62956e..d3f0221 100644
--- a/src/test/ui/numeric/numeric-suffix.stderr
+++ b/src/test/ui/numeric/numeric-suffix.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `u64` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:9:18
@@ -18,7 +18,7 @@
help: change the type of the numeric literal from `u32` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:11:18
@@ -29,7 +29,7 @@
help: change the type of the numeric literal from `u16` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:13:18
@@ -40,7 +40,7 @@
help: change the type of the numeric literal from `u8` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:15:18
@@ -51,7 +51,7 @@
help: change the type of the numeric literal from `isize` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:17:18
@@ -62,7 +62,7 @@
help: change the type of the numeric literal from `i64` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:19:18
@@ -73,7 +73,7 @@
help: change the type of the numeric literal from `i32` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:21:18
@@ -84,7 +84,7 @@
help: change the type of the numeric literal from `i16` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:23:18
@@ -95,7 +95,7 @@
help: change the type of the numeric literal from `i8` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:25:18
@@ -106,7 +106,7 @@
help: change the type of the numeric literal from `f64` to `usize`
|
LL | foo::<usize>(42usize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:27:18
@@ -117,7 +117,7 @@
help: change the type of the numeric literal from `f32` to `usize`
|
LL | foo::<usize>(42usize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:30:18
@@ -128,7 +128,7 @@
help: change the type of the numeric literal from `usize` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:32:18
@@ -139,7 +139,7 @@
help: change the type of the numeric literal from `u64` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:34:18
@@ -150,7 +150,7 @@
help: change the type of the numeric literal from `u32` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:36:18
@@ -161,7 +161,7 @@
help: change the type of the numeric literal from `u16` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:38:18
@@ -172,7 +172,7 @@
help: change the type of the numeric literal from `u8` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:41:18
@@ -183,7 +183,7 @@
help: change the type of the numeric literal from `i64` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:43:18
@@ -194,7 +194,7 @@
help: change the type of the numeric literal from `i32` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:45:18
@@ -205,7 +205,7 @@
help: change the type of the numeric literal from `i16` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:47:18
@@ -216,7 +216,7 @@
help: change the type of the numeric literal from `i8` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:49:18
@@ -227,7 +227,7 @@
help: change the type of the numeric literal from `f64` to `isize`
|
LL | foo::<isize>(42isize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:51:18
@@ -238,7 +238,7 @@
help: change the type of the numeric literal from `f32` to `isize`
|
LL | foo::<isize>(42isize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:54:16
@@ -249,7 +249,7 @@
help: change the type of the numeric literal from `usize` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:57:16
@@ -260,7 +260,7 @@
help: change the type of the numeric literal from `u32` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:59:16
@@ -271,7 +271,7 @@
help: change the type of the numeric literal from `u16` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:61:16
@@ -282,7 +282,7 @@
help: change the type of the numeric literal from `u8` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:63:16
@@ -293,7 +293,7 @@
help: change the type of the numeric literal from `isize` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:65:16
@@ -304,7 +304,7 @@
help: change the type of the numeric literal from `i64` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:67:16
@@ -315,7 +315,7 @@
help: change the type of the numeric literal from `i32` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:69:16
@@ -326,7 +326,7 @@
help: change the type of the numeric literal from `i16` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:71:16
@@ -337,7 +337,7 @@
help: change the type of the numeric literal from `i8` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:73:16
@@ -348,7 +348,7 @@
help: change the type of the numeric literal from `f64` to `u64`
|
LL | foo::<u64>(42u64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:75:16
@@ -359,7 +359,7 @@
help: change the type of the numeric literal from `f32` to `u64`
|
LL | foo::<u64>(42u64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:78:16
@@ -370,7 +370,7 @@
help: change the type of the numeric literal from `usize` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:80:16
@@ -381,7 +381,7 @@
help: change the type of the numeric literal from `u64` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:82:16
@@ -392,7 +392,7 @@
help: change the type of the numeric literal from `u32` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:84:16
@@ -403,7 +403,7 @@
help: change the type of the numeric literal from `u16` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:86:16
@@ -414,7 +414,7 @@
help: change the type of the numeric literal from `u8` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:88:16
@@ -425,7 +425,7 @@
help: change the type of the numeric literal from `isize` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:91:16
@@ -436,7 +436,7 @@
help: change the type of the numeric literal from `i32` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:93:16
@@ -447,7 +447,7 @@
help: change the type of the numeric literal from `i16` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:95:16
@@ -458,7 +458,7 @@
help: change the type of the numeric literal from `i8` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:97:16
@@ -469,7 +469,7 @@
help: change the type of the numeric literal from `f64` to `i64`
|
LL | foo::<i64>(42i64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:99:16
@@ -480,7 +480,7 @@
help: change the type of the numeric literal from `f32` to `i64`
|
LL | foo::<i64>(42i64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:102:16
@@ -491,7 +491,7 @@
help: change the type of the numeric literal from `usize` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:104:16
@@ -502,7 +502,7 @@
help: change the type of the numeric literal from `u64` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:107:16
@@ -513,7 +513,7 @@
help: change the type of the numeric literal from `u16` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:109:16
@@ -524,7 +524,7 @@
help: change the type of the numeric literal from `u8` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:111:16
@@ -535,7 +535,7 @@
help: change the type of the numeric literal from `isize` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:113:16
@@ -546,7 +546,7 @@
help: change the type of the numeric literal from `i64` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:115:16
@@ -557,7 +557,7 @@
help: change the type of the numeric literal from `i32` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:117:16
@@ -568,7 +568,7 @@
help: change the type of the numeric literal from `i16` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:119:16
@@ -579,7 +579,7 @@
help: change the type of the numeric literal from `i8` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:121:16
@@ -590,7 +590,7 @@
help: change the type of the numeric literal from `f64` to `u32`
|
LL | foo::<u32>(42u32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:123:16
@@ -601,7 +601,7 @@
help: change the type of the numeric literal from `f32` to `u32`
|
LL | foo::<u32>(42u32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:126:16
@@ -612,7 +612,7 @@
help: change the type of the numeric literal from `usize` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:128:16
@@ -623,7 +623,7 @@
help: change the type of the numeric literal from `u64` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:130:16
@@ -634,7 +634,7 @@
help: change the type of the numeric literal from `u32` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:132:16
@@ -645,7 +645,7 @@
help: change the type of the numeric literal from `u16` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:134:16
@@ -656,7 +656,7 @@
help: change the type of the numeric literal from `u8` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:136:16
@@ -667,7 +667,7 @@
help: change the type of the numeric literal from `isize` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:138:16
@@ -678,7 +678,7 @@
help: change the type of the numeric literal from `i64` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:141:16
@@ -689,7 +689,7 @@
help: change the type of the numeric literal from `i16` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:143:16
@@ -700,7 +700,7 @@
help: change the type of the numeric literal from `i8` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:145:16
@@ -711,7 +711,7 @@
help: change the type of the numeric literal from `f64` to `i32`
|
LL | foo::<i32>(42i32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:147:16
@@ -722,7 +722,7 @@
help: change the type of the numeric literal from `f32` to `i32`
|
LL | foo::<i32>(42i32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:150:16
@@ -733,7 +733,7 @@
help: change the type of the numeric literal from `usize` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:152:16
@@ -744,7 +744,7 @@
help: change the type of the numeric literal from `u64` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:154:16
@@ -755,7 +755,7 @@
help: change the type of the numeric literal from `u32` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:157:16
@@ -766,7 +766,7 @@
help: change the type of the numeric literal from `u8` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:159:16
@@ -777,7 +777,7 @@
help: change the type of the numeric literal from `isize` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:161:16
@@ -788,7 +788,7 @@
help: change the type of the numeric literal from `i64` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:163:16
@@ -799,7 +799,7 @@
help: change the type of the numeric literal from `i32` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:165:16
@@ -810,7 +810,7 @@
help: change the type of the numeric literal from `i16` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:167:16
@@ -821,7 +821,7 @@
help: change the type of the numeric literal from `i8` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:169:16
@@ -832,7 +832,7 @@
help: change the type of the numeric literal from `f64` to `u16`
|
LL | foo::<u16>(42u16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:171:16
@@ -843,7 +843,7 @@
help: change the type of the numeric literal from `f32` to `u16`
|
LL | foo::<u16>(42u16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:174:16
@@ -854,7 +854,7 @@
help: change the type of the numeric literal from `usize` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:176:16
@@ -865,7 +865,7 @@
help: change the type of the numeric literal from `u64` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:178:16
@@ -876,7 +876,7 @@
help: change the type of the numeric literal from `u32` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:180:16
@@ -887,7 +887,7 @@
help: change the type of the numeric literal from `u16` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:182:16
@@ -898,7 +898,7 @@
help: change the type of the numeric literal from `u8` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:184:16
@@ -909,7 +909,7 @@
help: change the type of the numeric literal from `isize` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:186:16
@@ -920,7 +920,7 @@
help: change the type of the numeric literal from `i64` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:188:16
@@ -931,7 +931,7 @@
help: change the type of the numeric literal from `i32` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:191:16
@@ -942,7 +942,7 @@
help: change the type of the numeric literal from `i8` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:193:16
@@ -953,7 +953,7 @@
help: change the type of the numeric literal from `f64` to `i16`
|
LL | foo::<i16>(42i16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:195:16
@@ -964,7 +964,7 @@
help: change the type of the numeric literal from `f32` to `i16`
|
LL | foo::<i16>(42i16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:198:15
@@ -975,7 +975,7 @@
help: change the type of the numeric literal from `usize` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:200:15
@@ -986,7 +986,7 @@
help: change the type of the numeric literal from `u64` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:202:15
@@ -997,7 +997,7 @@
help: change the type of the numeric literal from `u32` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:204:15
@@ -1008,7 +1008,7 @@
help: change the type of the numeric literal from `u16` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:207:15
@@ -1019,7 +1019,7 @@
help: change the type of the numeric literal from `isize` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:209:15
@@ -1030,7 +1030,7 @@
help: change the type of the numeric literal from `i64` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:211:15
@@ -1041,7 +1041,7 @@
help: change the type of the numeric literal from `i32` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:213:15
@@ -1052,7 +1052,7 @@
help: change the type of the numeric literal from `i16` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:215:15
@@ -1063,7 +1063,7 @@
help: change the type of the numeric literal from `i8` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:217:15
@@ -1074,7 +1074,7 @@
help: change the type of the numeric literal from `f64` to `u8`
|
LL | foo::<u8>(42u8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:219:15
@@ -1085,7 +1085,7 @@
help: change the type of the numeric literal from `f32` to `u8`
|
LL | foo::<u8>(42u8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:222:15
@@ -1096,7 +1096,7 @@
help: change the type of the numeric literal from `usize` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:224:15
@@ -1107,7 +1107,7 @@
help: change the type of the numeric literal from `u64` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:226:15
@@ -1118,7 +1118,7 @@
help: change the type of the numeric literal from `u32` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:228:15
@@ -1129,7 +1129,7 @@
help: change the type of the numeric literal from `u16` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:230:15
@@ -1140,7 +1140,7 @@
help: change the type of the numeric literal from `u8` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:232:15
@@ -1151,7 +1151,7 @@
help: change the type of the numeric literal from `isize` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:234:15
@@ -1162,7 +1162,7 @@
help: change the type of the numeric literal from `i64` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:236:15
@@ -1173,7 +1173,7 @@
help: change the type of the numeric literal from `i32` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:238:15
@@ -1184,7 +1184,7 @@
help: change the type of the numeric literal from `i16` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:241:15
@@ -1195,7 +1195,7 @@
help: change the type of the numeric literal from `f64` to `i8`
|
LL | foo::<i8>(42i8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:243:15
@@ -1206,7 +1206,7 @@
help: change the type of the numeric literal from `f32` to `i8`
|
LL | foo::<i8>(42i8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:246:16
@@ -1217,7 +1217,7 @@
help: change the type of the numeric literal from `usize` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:248:16
@@ -1228,7 +1228,7 @@
help: change the type of the numeric literal from `u64` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:250:16
@@ -1239,7 +1239,7 @@
help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_u32.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:252:16
@@ -1250,7 +1250,7 @@
help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_u16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:254:16
@@ -1261,7 +1261,7 @@
help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_u8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:256:16
@@ -1272,7 +1272,7 @@
help: change the type of the numeric literal from `isize` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:258:16
@@ -1283,7 +1283,7 @@
help: change the type of the numeric literal from `i64` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:260:16
@@ -1294,7 +1294,7 @@
help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_i32.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:262:16
@@ -1305,7 +1305,7 @@
help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_i16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:264:16
@@ -1316,7 +1316,7 @@
help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_i8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:267:16
@@ -1327,7 +1327,7 @@
help: change the type of the numeric literal from `f32` to `f64`
|
LL | foo::<f64>(42.0_f64);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:270:16
@@ -1338,7 +1338,7 @@
help: change the type of the numeric literal from `usize` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:272:16
@@ -1349,7 +1349,7 @@
help: change the type of the numeric literal from `u64` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:274:16
@@ -1360,7 +1360,7 @@
help: change the type of the numeric literal from `u32` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:276:16
@@ -1371,7 +1371,7 @@
help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_u16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:278:16
@@ -1382,7 +1382,7 @@
help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_u8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:280:16
@@ -1393,7 +1393,7 @@
help: change the type of the numeric literal from `isize` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:282:16
@@ -1404,7 +1404,7 @@
help: change the type of the numeric literal from `i64` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:284:16
@@ -1415,7 +1415,7 @@
help: change the type of the numeric literal from `i32` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:286:16
@@ -1426,7 +1426,7 @@
help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_i16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:288:16
@@ -1437,7 +1437,7 @@
help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_i8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:290:16
@@ -1448,7 +1448,7 @@
help: change the type of the numeric literal from `f64` to `f32`
|
LL | foo::<f32>(42.0_f32);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:294:16
diff --git a/src/test/ui/object-does-not-impl-trait.stderr b/src/test/ui/object-does-not-impl-trait.stderr
index 44424bc..bf16411 100644
--- a/src/test/ui/object-does-not-impl-trait.stderr
+++ b/src/test/ui/object-does-not-impl-trait.stderr
@@ -1,10 +1,14 @@
error[E0277]: the trait bound `Box<dyn Foo>: Foo` is not satisfied
--> $DIR/object-does-not-impl-trait.rs:6:44
|
-LL | fn take_foo<F:Foo>(f: F) {}
- | --- required by this bound in `take_foo`
LL | fn take_object(f: Box<dyn Foo>) { take_foo(f); }
| ^ the trait `Foo` is not implemented for `Box<dyn Foo>`
+ |
+note: required by a bound in `take_foo`
+ --> $DIR/object-does-not-impl-trait.rs:5:15
+ |
+LL | fn take_foo<F:Foo>(f: F) {}
+ | ^^^ required by this bound in `take_foo`
error: aborting due to previous error
diff --git a/src/test/ui/object-lifetime-default-inferred.rs b/src/test/ui/object-lifetime-default-inferred.rs
new file mode 100644
index 0000000..8a1156b
--- /dev/null
+++ b/src/test/ui/object-lifetime-default-inferred.rs
@@ -0,0 +1,35 @@
+// run-pass
+// Test that even with prior inferred parameters, object lifetimes of objects after are still
+// valid.
+
+// pretty-expanded FIXME #23616
+
+#![allow(dead_code)]
+#![feature(generic_arg_infer)]
+
+trait Test {
+ fn foo(&self) { }
+}
+
+struct Foo;
+impl Test for Foo {}
+
+struct SomeStruct<'a> {
+ t: &'a dyn Test,
+ u: &'a (dyn Test+'a),
+}
+
+fn a<'a, const N: usize>(_: [u8; N], t: &'a (dyn Test+'a), mut ss: SomeStruct<'a>) {
+ ss.t = t;
+}
+
+fn b<'a, T>(_: T, t: &'a (dyn Test+'a), mut ss: SomeStruct<'a>) {
+ ss.u = t;
+}
+
+fn main() {
+ // Inside a function body, we can just infer both
+ // lifetimes, to allow &'tmp (Display+'static).
+ a::<_>([], &Foo as &dyn Test, SomeStruct{t:&Foo,u:&Foo});
+ b::<_>(0u8, &Foo as &dyn Test, SomeStruct{t:&Foo,u:&Foo});
+}
diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr
index 70b99ef..e0a8534 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr
@@ -10,7 +10,7 @@
help: to declare that the trait object captures data from argument `ss`, you can add an explicit `'_` lifetime bound
|
LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait + '_> {
- | ^^^^
+ | ++++
error[E0621]: explicit lifetime required in the type of `ss`
--> $DIR/object-lifetime-default-from-box-error.rs:31:12
diff --git a/src/test/ui/object-safety/object-safety-no-static.curr.stderr b/src/test/ui/object-safety/object-safety-no-static.curr.stderr
index e00d6bb..bd8cf4e 100644
--- a/src/test/ui/object-safety/object-safety-no-static.curr.stderr
+++ b/src/test/ui/object-safety/object-safety-no-static.curr.stderr
@@ -14,11 +14,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) {}
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr b/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr
index 91a071f..ea1c575 100644
--- a/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr
+++ b/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr
@@ -16,11 +16,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) {}
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/object-safety/object-safety-no-static.stderr b/src/test/ui/object-safety/object-safety-no-static.stderr
deleted file mode 100644
index 0de783f..0000000
--- a/src/test/ui/object-safety/object-safety-no-static.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety-no-static.rs:8:1
- |
-LL | fn foo();
- | --- associated function `foo` has no `self` parameter
-...
-LL | fn foo_implicit<T:Foo+'static>(b: Box<T>) -> Box<dyn Foo + 'static> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/obsolete-in-place/bad.bad.stderr b/src/test/ui/obsolete-in-place/bad.bad.stderr
deleted file mode 100644
index d895981..0000000
--- a/src/test/ui/obsolete-in-place/bad.bad.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error: expected expression, found keyword `in`
- --> $DIR/bad.rs:10:5
- |
-LL | in(foo) { bar };
- | ^^ expected expression
-
-error[E0282]: type annotations needed
- --> $DIR/bad.rs:9:8
- |
-LL | let (x, y, foo, bar);
- | ---------------- consider giving the pattern a type
-LL | x <- y;
- | ^^^ cannot infer type
- |
- = note: type must be known at this point
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/obsolete-in-place/bad.stderr b/src/test/ui/obsolete-in-place/bad.stderr
index b9aad01..363dfb7 100644
--- a/src/test/ui/obsolete-in-place/bad.stderr
+++ b/src/test/ui/obsolete-in-place/bad.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-`
|
LL | x < - y;
- | ^^^
+ | ~~~
error: expected expression, found keyword `in`
--> $DIR/bad.rs:10:5
diff --git a/src/test/ui/occurs-check-2.stderr b/src/test/ui/occurs-check-2.stderr
index 7f93697..c004043 100644
--- a/src/test/ui/occurs-check-2.stderr
+++ b/src/test/ui/occurs-check-2.stderr
@@ -2,10 +2,12 @@
--> $DIR/occurs-check-2.rs:7:9
|
LL | f = box g;
- | ^^^^^
- | |
- | cyclic type of infinite size
- | help: try using a conversion method: `(box g).to_string()`
+ | ^^^^^ cyclic type of infinite size
+ |
+help: try using a conversion method
+ |
+LL | f = (box g).to_string();
+ | + +++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/occurs-check.stderr b/src/test/ui/occurs-check.stderr
index 01e2b1f..452163e 100644
--- a/src/test/ui/occurs-check.stderr
+++ b/src/test/ui/occurs-check.stderr
@@ -2,10 +2,12 @@
--> $DIR/occurs-check.rs:5:9
|
LL | f = box f;
- | ^^^^^
- | |
- | cyclic type of infinite size
- | help: try using a conversion method: `(box f).to_string()`
+ | ^^^^^ cyclic type of infinite size
+ |
+help: try using a conversion method
+ |
+LL | f = (box f).to_string();
+ | + +++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/on-unimplemented/enclosing-scope.stderr b/src/test/ui/on-unimplemented/enclosing-scope.stderr
index 4c1aaf3..abd156d 100644
--- a/src/test/ui/on-unimplemented/enclosing-scope.stderr
+++ b/src/test/ui/on-unimplemented/enclosing-scope.stderr
@@ -1,9 +1,6 @@
error[E0277]: the trait bound `Foo: Trait` is not satisfied
--> $DIR/enclosing-scope.rs:14:11
|
-LL | fn f<T: Trait>(x: T) {}
- | ----- required by this bound in `f`
-...
LL | let x = || {
| _____________-
LL | | f(Foo{});
@@ -13,26 +10,32 @@
LL | | };
LL | | };
| |_____- in this scope
+ |
+note: required by a bound in `f`
+ --> $DIR/enclosing-scope.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
error[E0277]: the trait bound `Foo: Trait` is not satisfied
--> $DIR/enclosing-scope.rs:16:15
|
-LL | fn f<T: Trait>(x: T) {}
- | ----- required by this bound in `f`
-...
LL | let y = || {
| _________________-
LL | | f(Foo{});
| | ^^^^^ the trait `Trait` is not implemented for `Foo`
LL | | };
| |_________- in this scope
+ |
+note: required by a bound in `f`
+ --> $DIR/enclosing-scope.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
error[E0277]: the trait bound `Foo: Trait` is not satisfied
--> $DIR/enclosing-scope.rs:22:15
|
-LL | fn f<T: Trait>(x: T) {}
- | ----- required by this bound in `f`
-LL |
LL | / fn main() {
LL | | let x = || {
LL | | f(Foo{});
@@ -44,13 +47,16 @@
LL | | f(Foo{});
LL | | }
| |_- in this scope
+ |
+note: required by a bound in `f`
+ --> $DIR/enclosing-scope.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
error[E0277]: the trait bound `Foo: Trait` is not satisfied
--> $DIR/enclosing-scope.rs:26:7
|
-LL | fn f<T: Trait>(x: T) {}
- | ----- required by this bound in `f`
-LL |
LL | / fn main() {
LL | | let x = || {
LL | | f(Foo{});
@@ -60,6 +66,12 @@
| | ^^^^^ the trait `Trait` is not implemented for `Foo`
LL | | }
| |_- in this scope
+ |
+note: required by a bound in `f`
+ --> $DIR/enclosing-scope.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/on-unimplemented/on-trait.stderr b/src/test/ui/on-unimplemented/on-trait.stderr
index 00c8492..4b040f1 100644
--- a/src/test/ui/on-unimplemented/on-trait.stderr
+++ b/src/test/ui/on-unimplemented/on-trait.stderr
@@ -1,24 +1,28 @@
error[E0277]: the trait bound `Option<Vec<u8>>: MyFromIterator<&u8>` is not satisfied
--> $DIR/on-trait.rs:28:30
|
-LL | fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B {
- | ----------------- required by this bound in `collect`
-...
LL | let y: Option<Vec<u8>> = collect(x.iter()); // this should give approximately the same error for x.iter().collect()
| ^^^^^^^ a collection of type `Option<Vec<u8>>` cannot be built from an iterator over elements of type `&u8`
|
= help: the trait `MyFromIterator<&u8>` is not implemented for `Option<Vec<u8>>`
+note: required by a bound in `collect`
+ --> $DIR/on-trait.rs:22:39
+ |
+LL | fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B {
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `collect`
error[E0277]: the trait bound `String: Foo<u8, _, u32>` is not satisfied
--> $DIR/on-trait.rs:31:21
|
-LL | fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T {
- | --------------- required by this bound in `foobar`
-...
LL | let x: String = foobar();
| ^^^^^^ test error `String` with `u8` `_` `u32` in `Foo`
|
= help: the trait `Foo<u8, _, u32>` is not implemented for `String`
+note: required by a bound in `foobar`
+ --> $DIR/on-trait.rs:12:24
+ |
+LL | fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T {
+ | ^^^^^^^^^^^^^^^ required by this bound in `foobar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/once-cant-call-twice-on-heap.stderr b/src/test/ui/once-cant-call-twice-on-heap.stderr
index 8761b52..dde7572 100644
--- a/src/test/ui/once-cant-call-twice-on-heap.stderr
+++ b/src/test/ui/once-cant-call-twice-on-heap.stderr
@@ -16,7 +16,7 @@
help: consider further restricting this bound
|
LL | fn foo<F:FnOnce() + Copy>(blk: F) {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr b/src/test/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
index 61175b8..8e6964e 100644
--- a/src/test/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
+++ b/src/test/ui/or-patterns/issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr
@@ -10,7 +10,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let (0 | (1 | 2)) = 0 { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
--> $DIR/issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs:3:11
diff --git a/src/test/ui/out-of-stack.rs b/src/test/ui/out-of-stack.rs
index 2d59c9f..ce02553 100644
--- a/src/test/ui/out-of-stack.rs
+++ b/src/test/ui/out-of-stack.rs
@@ -2,6 +2,7 @@
#![allow(unused_must_use)]
#![allow(unconditional_recursion)]
+#![allow(deprecated)] // llvm_asm!
// ignore-android: FIXME (#20004)
// ignore-emscripten no processes
// ignore-sgx no processes
diff --git a/src/test/ui/packed/issue-27060-2.stderr b/src/test/ui/packed/issue-27060-2.stderr
index 5dbcc96..8cd2ce6 100644
--- a/src/test/ui/packed/issue-27060-2.stderr
+++ b/src/test/ui/packed/issue-27060-2.stderr
@@ -8,14 +8,19 @@
|
= note: the last field of a packed struct may only have a dynamically sized type if it does not need drop to be run
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - pub struct Bad<T: ?Sized> {
+LL + pub struct Bad<T> {
+ |
help: borrowed types always have a statically known size
|
LL | data: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | data: Box<T>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/panics/abort-on-panic.rs b/src/test/ui/panics/abort-on-panic.rs
index 2aea607..1f6ad64 100644
--- a/src/test/ui/panics/abort-on-panic.rs
+++ b/src/test/ui/panics/abort-on-panic.rs
@@ -1,7 +1,7 @@
// run-pass
#![allow(unused_must_use)]
-#![feature(unwind_attributes)]
+#![feature(c_unwind)]
#![feature(panic_always_abort)]
// Since we mark some ABIs as "nounwind" to LLVM, we must make sure that
// we never unwind through them.
@@ -9,23 +9,17 @@
// ignore-emscripten no processes
// ignore-sgx no processes
-use std::{env, panic};
-use std::io::prelude::*;
use std::io;
+use std::io::prelude::*;
use std::process::{exit, Command, Stdio};
use std::sync::{Arc, Barrier};
use std::thread;
+use std::{env, panic};
-#[unwind(aborts)] // FIXME(#58794) should work even without the attribute
extern "C" fn panic_in_ffi() {
panic!("Test");
}
-#[unwind(aborts)]
-extern "Rust" fn panic_in_rust_abi() {
- panic!("TestRust");
-}
-
fn should_have_aborted() {
io::stdout().write(b"This should never be printed.\n");
let _ = io::stdout().flush();
@@ -37,18 +31,17 @@
}
fn test() {
- let _ = panic::catch_unwind(|| { panic_in_ffi(); });
- should_have_aborted();
-}
-
-fn testrust() {
- let _ = panic::catch_unwind(|| { panic_in_rust_abi(); });
+ let _ = panic::catch_unwind(|| {
+ panic_in_ffi();
+ });
should_have_aborted();
}
fn test_always_abort() {
panic::always_abort();
- let _ = panic::catch_unwind(|| { panic!(); });
+ let _ = panic::catch_unwind(|| {
+ panic!();
+ });
should_have_aborted();
}
@@ -56,7 +49,7 @@
let barrier = Arc::new(Barrier::new(2));
let thr = {
let barrier = barrier.clone();
- thread::spawn(move ||{
+ thread::spawn(move || {
barrier.wait();
panic!("in thread");
})
@@ -70,7 +63,6 @@
fn main() {
let tests: &[(_, fn())] = &[
("test", test),
- ("testrust", testrust),
("test_always_abort", test_always_abort),
("test_always_abort_thread", test_always_abort_thread),
];
@@ -78,17 +70,21 @@
let args: Vec<String> = env::args().collect();
if args.len() > 1 {
// This is inside the self-executed command.
- for (a,f) in tests {
- if &args[1] == a { return f() }
+ for (a, f) in tests {
+ if &args[1] == a {
+ return f();
+ }
}
bomb_out_but_not_abort("bad test");
}
let execute_self_expecting_abort = |arg| {
let mut p = Command::new(&args[0])
- .stdout(Stdio::piped())
- .stdin(Stdio::piped())
- .arg(arg).spawn().unwrap();
+ .stdout(Stdio::piped())
+ .stdin(Stdio::piped())
+ .arg(arg)
+ .spawn()
+ .unwrap();
let status = p.wait().unwrap();
assert!(!status.success());
// Any reasonable platform can distinguish a process which
@@ -96,7 +92,7 @@
assert_ne!(status.code(), Some(1));
};
- for (a,_f) in tests {
+ for (a, _f) in tests {
execute_self_expecting_abort(a);
}
}
diff --git a/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr b/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr
new file mode 100644
index 0000000..fcdc070
--- /dev/null
+++ b/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr
@@ -0,0 +1,5 @@
+thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:21:5
+stack backtrace:
+ 0: std::panicking::begin_panic
+ 1: issue_47429_short_backtraces::main
+note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
diff --git a/src/test/ui/panics/issue-47429-short-backtraces.rs b/src/test/ui/panics/issue-47429-short-backtraces.rs
index 015ab8f..35ecfc0 100644
--- a/src/test/ui/panics/issue-47429-short-backtraces.rs
+++ b/src/test/ui/panics/issue-47429-short-backtraces.rs
@@ -12,6 +12,11 @@
// ignore-emscripten no panic or subprocess support
// ignore-sgx no subprocess support
+// NOTE(eddyb) output differs between symbol mangling schemes
+// revisions: legacy v0
+// [legacy] compile-flags: -Zsymbol-mangling-version=legacy
+// [v0] compile-flags: -Zsymbol-mangling-version=v0
+
fn main() {
panic!()
}
diff --git a/src/test/ui/panics/issue-47429-short-backtraces.run.stderr b/src/test/ui/panics/issue-47429-short-backtraces.run.stderr
deleted file mode 100644
index 3287963..0000000
--- a/src/test/ui/panics/issue-47429-short-backtraces.run.stderr
+++ /dev/null
@@ -1,5 +0,0 @@
-thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:16:5
-stack backtrace:
- 0: std::panicking::begin_panic
- 1: issue_47429_short_backtraces::main
-note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
diff --git a/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr b/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr
new file mode 100644
index 0000000..1cbf117
--- /dev/null
+++ b/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr
@@ -0,0 +1,5 @@
+thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:21:5
+stack backtrace:
+ 0: std::panicking::begin_panic::<&str>
+ 1: issue_47429_short_backtraces::main
+note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
diff --git a/src/test/ui/panics/panic-2021.stderr b/src/test/ui/panics/panic-2021.stderr
index 59b1e4f..373c1c2 100644
--- a/src/test/ui/panics/panic-2021.stderr
+++ b/src/test/ui/panics/panic-2021.stderr
@@ -7,7 +7,7 @@
help: you might be missing a string literal to format with
|
LL | panic!("{}", 123);
- | ^^^^^
+ | +++++
error: 1 positional argument in format string, but no arguments were given
--> $DIR/panic-2021.rs:5:13
@@ -30,7 +30,7 @@
help: you might be missing a string literal to format with
|
LL | assert!(false, "{}", 123);
- | ^^^^^
+ | +++++
error: 1 positional argument in format string, but no arguments were given
--> $DIR/panic-2021.rs:8:21
diff --git a/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs
new file mode 100644
index 0000000..fd01337
--- /dev/null
+++ b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.rs
@@ -0,0 +1,49 @@
+// Regression test for #87481: short backtrace formatting cut off the entire stack trace.
+
+// Codegen-units is specified here so that we can replicate a typical rustc invocation which
+// is not normally limited to 1 CGU. This is important so that the `__rust_begin_short_backtrace`
+// and `__rust_end_short_backtrace` symbols are not marked internal to the CGU and thus will be
+// named in the symbol table.
+// compile-flags: -O -Ccodegen-units=8
+
+// run-fail
+// check-run-results
+// exec-env:RUST_BACKTRACE=1
+
+// We need to normalize out frame 5 because without debug info, dbghelp.dll doesn't know where CGU
+// internal functions like `main` start or end and so it will return whatever symbol happens
+// to be located near the address.
+// normalize-stderr-test: "5: .*" -> "5: some Rust fn"
+
+// Backtraces are pretty broken in general on i686-pc-windows-msvc (#62897).
+// only-x86_64-pc-windows-msvc
+
+fn main() {
+ a();
+}
+
+// Make these no_mangle so dbghelp.dll can figure out the symbol names.
+
+#[no_mangle]
+#[inline(never)]
+fn a() {
+ b();
+}
+
+#[no_mangle]
+#[inline(never)]
+fn b() {
+ c();
+}
+
+#[no_mangle]
+#[inline(never)]
+fn c() {
+ d();
+}
+
+#[no_mangle]
+#[inline(never)]
+fn d() {
+ panic!("d was called");
+}
diff --git a/src/test/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr
new file mode 100644
index 0000000..799a8b3
--- /dev/null
+++ b/src/test/ui/panics/panic-short-backtrace-windows-x86_64.run.stderr
@@ -0,0 +1,9 @@
+thread 'main' panicked at 'd was called', $DIR/panic-short-backtrace-windows-x86_64.rs:48:5
+stack backtrace:
+ 0: std::panicking::begin_panic
+ 1: d
+ 2: c
+ 3: b
+ 4: a
+ 5: some Rust fn
+note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
diff --git a/src/test/ui/parenthesized-deref-suggestion.stderr b/src/test/ui/parenthesized-deref-suggestion.stderr
index 24be32a..cafddbe 100644
--- a/src/test/ui/parenthesized-deref-suggestion.stderr
+++ b/src/test/ui/parenthesized-deref-suggestion.stderr
@@ -7,7 +7,7 @@
help: `(sess as *const Session)` is a raw pointer; try dereferencing it
|
LL | (*(sess as *const Session)).opts;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0609]: no field `0` on type `[u32; 1]`
--> $DIR/parenthesized-deref-suggestion.rs:10:21
diff --git a/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr b/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
index 6dfe7aa..cec6980 100644
--- a/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
+++ b/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
@@ -12,11 +12,11 @@
LL | #[cfg(FALSE)] fn e() { let _ = [#[attr]]; }
| ^ expected expression
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `#`
+error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:9:35
|
LL | #[cfg(FALSE)] fn e() { let _ = foo#[attr](); }
- | ^ expected one of 7 possible tokens
+ | ^ expected one of 8 possible tokens
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:11:36
@@ -70,11 +70,11 @@
|
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `#`
+error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:23:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x #![attr] as Y; }
- | ^ expected one of 7 possible tokens
+ | ^ expected one of 8 possible tokens
error: an inner attribute is not permitted in this context
--> $DIR/attr-stmt-expr-attr-bad.rs:25:35
@@ -372,11 +372,11 @@
LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
| ^
-error: expected one of `.`, `;`, `?`, or an operator, found `#`
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:100:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#![attr]foo(); }
- | ^ expected one of `.`, `;`, `?`, or an operator
+ | ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: unexpected token: `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:103:34
@@ -384,11 +384,11 @@
LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
| ^
-error: expected one of `.`, `;`, `?`, or an operator, found `#`
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found `#`
--> $DIR/attr-stmt-expr-attr-bad.rs:103:34
|
LL | #[cfg(FALSE)] fn e() { let _ = x.#[attr]foo(); }
- | ^ expected one of `.`, `;`, `?`, or an operator
+ | ^ expected one of `.`, `;`, `?`, `else`, or an operator
error: expected statement after outer attribute
--> $DIR/attr-stmt-expr-attr-bad.rs:108:37
diff --git a/src/test/ui/parser/bad-crate-name.stderr b/src/test/ui/parser/bad-crate-name.stderr
index e015010..c98a620 100644
--- a/src/test/ui/parser/bad-crate-name.stderr
+++ b/src/test/ui/parser/bad-crate-name.stderr
@@ -7,7 +7,7 @@
help: if the original crate name uses dashes you need to use underscores in the code
|
LL | extern crate krate_name_here;
- | ^ ^
+ | ~ ~
error[E0463]: can't find crate for `krate_name_here`
--> $DIR/bad-crate-name.rs:1:1
diff --git a/src/test/ui/parser/bad-value-ident-false.stderr b/src/test/ui/parser/bad-value-ident-false.stderr
index b59ea97..b23322f 100644
--- a/src/test/ui/parser/bad-value-ident-false.stderr
+++ b/src/test/ui/parser/bad-value-ident-false.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | fn r#false() { }
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/bad-value-ident-true.stderr b/src/test/ui/parser/bad-value-ident-true.stderr
index 12132b0..3eaa600 100644
--- a/src/test/ui/parser/bad-value-ident-true.stderr
+++ b/src/test/ui/parser/bad-value-ident-true.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | fn r#true() { }
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/bare-struct-body.stderr b/src/test/ui/parser/bare-struct-body.stderr
index df10b0e..c77992b 100644
--- a/src/test/ui/parser/bare-struct-body.stderr
+++ b/src/test/ui/parser/bare-struct-body.stderr
@@ -9,9 +9,9 @@
|
help: you might have forgotten to add the struct literal inside the block
|
-LL | fn foo() -> Foo { SomeStruct {
+LL ~ fn foo() -> Foo { SomeStruct {
LL | val: (),
-LL | } }
+LL ~ } }
|
error: struct literal body without path
@@ -25,9 +25,9 @@
|
help: you might have forgotten to add the struct literal inside the block
|
-LL | let x = { SomeStruct {
+LL ~ let x = { SomeStruct {
LL | val: (),
-LL | } };
+LL ~ } };
|
error[E0308]: mismatched types
diff --git a/src/test/ui/parser/bounds-type.rs b/src/test/ui/parser/bounds-type.rs
index 7a187a0..4ae4549 100644
--- a/src/test/ui/parser/bounds-type.rs
+++ b/src/test/ui/parser/bounds-type.rs
@@ -9,10 +9,10 @@
T: Tr +, // OK
T: ?'a, //~ ERROR `?` may only modify trait bounds, not lifetime bounds
- T: ?const Tr, // OK
- T: ?const ?Tr, // OK
- T: ?const Tr + 'a, // OK
- T: ?const 'a, //~ ERROR `?const` may only modify trait bounds, not lifetime bounds
+ T: ~const Tr, // OK
+ T: ~const ?Tr, // OK
+ T: ~const Tr + 'a, // OK
+ T: ~const 'a, //~ ERROR `~const` may only modify trait bounds, not lifetime bounds
>;
fn main() {}
diff --git a/src/test/ui/parser/bounds-type.stderr b/src/test/ui/parser/bounds-type.stderr
index 9a1f2ed..005bc1e 100644
--- a/src/test/ui/parser/bounds-type.stderr
+++ b/src/test/ui/parser/bounds-type.stderr
@@ -4,10 +4,10 @@
LL | T: ?'a,
| ^
-error: `?const` may only modify trait bounds, not lifetime bounds
+error: `~const` may only modify trait bounds, not lifetime bounds
--> $DIR/bounds-type.rs:15:8
|
-LL | T: ?const 'a,
+LL | T: ~const 'a,
| ^^^^^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/byte-literals.stderr b/src/test/ui/parser/byte-literals.stderr
index 55be113..c3d0006 100644
--- a/src/test/ui/parser/byte-literals.stderr
+++ b/src/test/ui/parser/byte-literals.stderr
@@ -36,10 +36,12 @@
--> $DIR/byte-literals.rs:10:7
|
LL | b'é';
- | ^
- | |
- | byte constant must be ASCII
- | help: use a \xHH escape for a non-ASCII byte: `\xE9`
+ | ^ byte constant must be ASCII
+ |
+help: if you meant to use the unicode code point for 'é', use a \xHH escape
+ |
+LL | b'\xE9';
+ | ~~~~
error[E0763]: unterminated byte constant
--> $DIR/byte-literals.rs:11:6
diff --git a/src/test/ui/parser/byte-string-literals.stderr b/src/test/ui/parser/byte-string-literals.stderr
index 3a5a8b3..3b8b369 100644
--- a/src/test/ui/parser/byte-string-literals.stderr
+++ b/src/test/ui/parser/byte-string-literals.stderr
@@ -24,10 +24,12 @@
--> $DIR/byte-string-literals.rs:6:7
|
LL | b"é";
- | ^
- | |
- | byte constant must be ASCII
- | help: use a \xHH escape for a non-ASCII byte: `\xE9`
+ | ^ byte constant must be ASCII
+ |
+help: if you meant to use the unicode code point for 'é', use a \xHH escape
+ |
+LL | b"\xE9";
+ | ~~~~
error: raw byte string must be ASCII
--> $DIR/byte-string-literals.rs:7:10
diff --git a/src/test/ui/parser/chained-comparison-suggestion.stderr b/src/test/ui/parser/chained-comparison-suggestion.stderr
index 067920d..694b0b6 100644
--- a/src/test/ui/parser/chained-comparison-suggestion.stderr
+++ b/src/test/ui/parser/chained-comparison-suggestion.stderr
@@ -7,7 +7,7 @@
help: split the comparison into two
|
LL | 1 < 2 && 2 <= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:9:7
@@ -18,7 +18,7 @@
help: split the comparison into two
|
LL | 1 < 2 && 2 < 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:13:7
@@ -29,7 +29,7 @@
help: split the comparison into two
|
LL | 1 <= 2 && 2 < 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:18:7
@@ -40,7 +40,7 @@
help: split the comparison into two
|
LL | 1 <= 2 && 2 <= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:23:7
@@ -51,7 +51,7 @@
help: split the comparison into two
|
LL | 1 > 2 && 2 >= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:28:7
@@ -62,7 +62,7 @@
help: split the comparison into two
|
LL | 1 > 2 && 2 > 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:32:7
@@ -73,7 +73,7 @@
help: split the comparison into two
|
LL | 1 >= 2 && 2 > 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:36:7
@@ -84,7 +84,7 @@
help: split the comparison into two
|
LL | 1 >= 2 && 2 >= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:41:7
@@ -95,7 +95,7 @@
help: parenthesize the comparison
|
LL | 1 == (2 < 3);
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:45:7
@@ -106,7 +106,7 @@
help: parenthesize the comparison
|
LL | (1 > 2) == false;
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:49:7
@@ -117,7 +117,7 @@
help: split the comparison into two
|
LL | 1 == 2 && 2 == 3;
- | ^^^^
+ | ++++
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:4:14
diff --git a/src/test/ui/parser/doc-comment-in-stmt.stderr b/src/test/ui/parser/doc-comment-in-stmt.stderr
index 5d94d6f..febfb60 100644
--- a/src/test/ui/parser/doc-comment-in-stmt.stderr
+++ b/src/test/ui/parser/doc-comment-in-stmt.stderr
@@ -9,7 +9,7 @@
help: add a space before `!` to use a regular comment
|
LL | // !self.allow_ty_infer()
- | ^^^^
+ | ~~~~
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! bar */`
--> $DIR/doc-comment-in-stmt.rs:9:5
@@ -22,7 +22,7 @@
help: add a space before `!` to use a regular comment
|
LL | /* ! bar */
- | ^^^^
+ | ~~~~
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/** baz */`
--> $DIR/doc-comment-in-stmt.rs:13:7
@@ -33,7 +33,7 @@
help: add a space before `*` to use a regular comment
|
LL | 1 /* * baz */
- | ^^^^
+ | ~~~~
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! quux */`
--> $DIR/doc-comment-in-stmt.rs:17:7
@@ -44,7 +44,7 @@
help: add a space before `!` to use a regular comment
|
LL | 2 /* ! quux */
- | ^^^^
+ | ~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/parser/dotdotdot-expr.stderr b/src/test/ui/parser/dotdotdot-expr.stderr
index ec1335c..e7203f2 100644
--- a/src/test/ui/parser/dotdotdot-expr.stderr
+++ b/src/test/ui/parser/dotdotdot-expr.stderr
@@ -7,11 +7,11 @@
help: use `..` for an exclusive range
|
LL | let _redemptive = 1..21;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | let _redemptive = 1..=21;
- | ^^^
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/expr-as-stmt-2.stderr b/src/test/ui/parser/expr-as-stmt-2.stderr
index 2a70127..2b6314c 100644
--- a/src/test/ui/parser/expr-as-stmt-2.stderr
+++ b/src/test/ui/parser/expr-as-stmt-2.stderr
@@ -10,7 +10,7 @@
help: you might have meant to return this value
|
LL | if let Some(x) = a { return true; } else { false }
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt-2.rs:3:40
@@ -24,19 +24,22 @@
help: you might have meant to return this value
|
LL | if let Some(x) = a { true } else { return false; }
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt-2.rs:6:5
|
LL | fn foo(a: Option<u32>, b: Option<u32>) -> bool {
| ---- expected `bool` because of return type
-LL | if let Some(x) = a { true } else { false }
- | ------------------------------------------ help: parentheses are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
...
LL | / &&
LL | | if let Some(y) = a { true } else { false }
| |______________________________________________^ expected `bool`, found `&&bool`
+ |
+help: parentheses are required to parse this as an expression
+ |
+LL | (if let Some(x) = a { true } else { false })
+ | + +
error: aborting due to 3 previous errors
diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr
index 067b7ed..ba5cd01 100644
--- a/src/test/ui/parser/expr-as-stmt.stderr
+++ b/src/test/ui/parser/expr-as-stmt.stderr
@@ -2,25 +2,34 @@
--> $DIR/expr-as-stmt.rs:8:9
|
LL | {2} + {2}
- | --- ^ expected expression
- | |
- | help: parentheses are required to parse this as an expression: `({2})`
+ | ^ expected expression
+ |
+help: parentheses are required to parse this as an expression
+ |
+LL | ({2}) + {2}
+ | + +
error: expected expression, found `+`
--> $DIR/expr-as-stmt.rs:13:9
|
LL | {2} + 2
- | --- ^ expected expression
- | |
- | help: parentheses are required to parse this as an expression: `({2})`
+ | ^ expected expression
+ |
+help: parentheses are required to parse this as an expression
+ |
+LL | ({2}) + 2
+ | + +
error: expected expression, found `+`
--> $DIR/expr-as-stmt.rs:19:12
|
LL | { 42 } + foo;
- | ------ ^ expected expression
- | |
- | help: parentheses are required to parse this as an expression: `({ 42 })`
+ | ^ expected expression
+ |
+help: parentheses are required to parse this as an expression
+ |
+LL | ({ 42 }) + foo;
+ | + +
error: expected expression, found `>`
--> $DIR/expr-as-stmt.rs:32:7
@@ -30,9 +39,9 @@
|
help: parentheses are required to parse this as an expression
|
-LL | (match x {
+LL ~ (match x {
LL | _ => 1,
-LL | }) > 0
+LL ~ }) > 0
|
error[E0308]: mismatched types
@@ -44,7 +53,7 @@
help: you might have meant to return this value
|
LL | {return 2;} + {2}
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:13:6
@@ -55,7 +64,7 @@
help: you might have meant to return this value
|
LL | {return 2;} + 2
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:19:7
@@ -66,7 +75,7 @@
help: you might have meant to return this value
|
LL | { return 42; } + foo;
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:25:7
@@ -77,15 +86,18 @@
help: you might have meant to return this value
|
LL | { return 3; } * 3
- | ^^^^^^ ^
+ | ++++++ +
error[E0614]: type `{integer}` cannot be dereferenced
--> $DIR/expr-as-stmt.rs:25:11
|
LL | { 3 } * 3
- | ----- ^^^
- | |
- | help: parentheses are required to parse this as an expression: `({ 3 })`
+ | ^^^
+ |
+help: parentheses are required to parse this as an expression
+ |
+LL | ({ 3 }) * 3
+ | + +
error: aborting due to 9 previous errors
diff --git a/src/test/ui/parser/fn-body-eq-expr-semi.stderr b/src/test/ui/parser/fn-body-eq-expr-semi.stderr
index fdc7a94..f1255d8 100644
--- a/src/test/ui/parser/fn-body-eq-expr-semi.stderr
+++ b/src/test/ui/parser/fn-body-eq-expr-semi.stderr
@@ -7,7 +7,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:5:20
@@ -18,7 +18,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:9:14
@@ -29,7 +29,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:11:20
@@ -40,7 +40,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:16:14
@@ -51,7 +51,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:17:20
@@ -62,7 +62,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:21:14
@@ -73,7 +73,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:22:20
@@ -84,7 +84,7 @@
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: incorrect function inside `extern` block
--> $DIR/fn-body-eq-expr-semi.rs:9:8
diff --git a/src/test/ui/parser/fn-header-semantic-fail.stderr b/src/test/ui/parser/fn-header-semantic-fail.stderr
index b3f60b1..0adfa5b 100644
--- a/src/test/ui/parser/fn-header-semantic-fail.stderr
+++ b/src/test/ui/parser/fn-header-semantic-fail.stderr
@@ -113,7 +113,7 @@
help: remove the qualifiers
|
LL | fn fe1();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:51:19
@@ -127,7 +127,7 @@
help: remove the qualifiers
|
LL | fn fe2();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:52:18
@@ -141,7 +141,7 @@
help: remove the qualifiers
|
LL | fn fe3();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:53:23
@@ -155,7 +155,7 @@
help: remove the qualifiers
|
LL | fn fe4();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:54:42
@@ -169,7 +169,7 @@
help: remove the qualifiers
|
LL | fn fe5();
- | ^^
+ | ~~
error: functions cannot be both `const` and `async`
--> $DIR/fn-header-semantic-fail.rs:54:9
diff --git a/src/test/ui/parser/incorrect-move-async-order-issue-79694.stderr b/src/test/ui/parser/incorrect-move-async-order-issue-79694.stderr
index 2add9fb..5367b98 100644
--- a/src/test/ui/parser/incorrect-move-async-order-issue-79694.stderr
+++ b/src/test/ui/parser/incorrect-move-async-order-issue-79694.stderr
@@ -7,7 +7,7 @@
help: try switching the order
|
LL | let _ = async move { };
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/inverted-parameters.stderr b/src/test/ui/parser/inverted-parameters.stderr
index ae180af..d1a2493 100644
--- a/src/test/ui/parser/inverted-parameters.stderr
+++ b/src/test/ui/parser/inverted-parameters.stderr
@@ -38,15 +38,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn fizz(self: i32) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn fizz(i32: TypeName) {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn fizz(_: i32) {}
- | ^^^^^^
+ | ~~~~~~
error: expected one of `:`, `@`, or `|`, found `S`
--> $DIR/inverted-parameters.rs:27:23
diff --git a/src/test/ui/parser/issue-10636-1.stderr b/src/test/ui/parser/issue-10636-1.stderr
index ff90cb9..1e6294e 100644
--- a/src/test/ui/parser/issue-10636-1.stderr
+++ b/src/test/ui/parser/issue-10636-1.stderr
@@ -1,8 +1,8 @@
error: mismatched closing delimiter: `)`
- --> $DIR/issue-10636-1.rs:4:1
+ --> $DIR/issue-10636-1.rs:1:12
|
LL | struct Obj {
- | - unclosed delimiter
+ | ^ unclosed delimiter
...
LL | )
| ^ mismatched closing delimiter
diff --git a/src/test/ui/parser/issue-10636-2.stderr b/src/test/ui/parser/issue-10636-2.stderr
index 5b9a9b7..d4f2da9 100644
--- a/src/test/ui/parser/issue-10636-2.stderr
+++ b/src/test/ui/parser/issue-10636-2.stderr
@@ -1,8 +1,8 @@
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
- --> $DIR/issue-10636-2.rs:5:25
+ --> $DIR/issue-10636-2.rs:5:15
|
LL | option.map(|some| 42;
- | - ^ help: `)` may belong here
+ | ^ ^ help: `)` may belong here
| |
| unclosed delimiter
diff --git a/src/test/ui/parser/issue-14303-fncall.full.stderr b/src/test/ui/parser/issue-14303-fncall.full.stderr
new file mode 100644
index 0000000..02af61e
--- /dev/null
+++ b/src/test/ui/parser/issue-14303-fncall.full.stderr
@@ -0,0 +1,9 @@
+error[E0747]: type provided when a lifetime was expected
+ --> $DIR/issue-14303-fncall.rs:16:26
+ |
+LL | .collect::<Vec<S<_, 'a>>>();
+ | ^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/parser/issue-14303-fncall.generic_arg.stderr b/src/test/ui/parser/issue-14303-fncall.generic_arg.stderr
new file mode 100644
index 0000000..9f3359b
--- /dev/null
+++ b/src/test/ui/parser/issue-14303-fncall.generic_arg.stderr
@@ -0,0 +1,9 @@
+error[E0747]: inferred provided when a lifetime was expected
+ --> $DIR/issue-14303-fncall.rs:16:26
+ |
+LL | .collect::<Vec<S<_, 'a>>>();
+ | ^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/parser/issue-14303-fncall.rs b/src/test/ui/parser/issue-14303-fncall.rs
index 46ece84..976a79a 100644
--- a/src/test/ui/parser/issue-14303-fncall.rs
+++ b/src/test/ui/parser/issue-14303-fncall.rs
@@ -1,6 +1,9 @@
-// can't run rustfix because it doesn't handle multipart suggestions correctly
+// revisions: full generic_arg
// compile-flags: -Zborrowck=mir
+// can't run rustfix because it doesn't handle multipart suggestions correctly
// we need the above to avoid ast borrowck failure in recovered code
+#![cfg_attr(generic_arg, feature(generic_arg_infer))]
+
struct S<'a, T> {
a: &'a T,
@@ -11,7 +14,8 @@
let _x = (*start..*end)
.map(|x| S { a: start, b: end })
.collect::<Vec<S<_, 'a>>>();
- //~^ ERROR type provided when a lifetime was expected
+ //[generic_arg]~^ ERROR inferred provided when a lifetime was expected
+ //[full]~^^ ERROR type provided when a lifetime was expected
}
fn main() {}
diff --git a/src/test/ui/parser/issue-14303-fncall.stderr b/src/test/ui/parser/issue-14303-fncall.stderr
deleted file mode 100644
index cdda0d0..0000000
--- a/src/test/ui/parser/issue-14303-fncall.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0747]: type provided when a lifetime was expected
- --> $DIR/issue-14303-fncall.rs:13:26
- |
-LL | .collect::<Vec<S<_, 'a>>>();
- | ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/parser/issue-32214.stderr b/src/test/ui/parser/issue-32214.stderr
index bc61b3b..d0a9b52 100644
--- a/src/test/ui/parser/issue-32214.stderr
+++ b/src/test/ui/parser/issue-32214.stderr
@@ -9,7 +9,7 @@
help: move the constraint after the generic argument
|
LL | pub fn test<W, I: Trait<W, Item = ()> >() {}
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/issue-35813-postfix-after-cast.stderr b/src/test/ui/parser/issue-35813-postfix-after-cast.stderr
index 9ccf17a..19b6855 100644
--- a/src/test/ui/parser/issue-35813-postfix-after-cast.stderr
+++ b/src/test/ui/parser/issue-35813-postfix-after-cast.stderr
@@ -7,7 +7,7 @@
help: try surrounding the expression in parentheses
|
LL | (vec![1, 2, 3] as Vec<i32>)[0];
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:12:5
@@ -18,7 +18,7 @@
help: try surrounding the expression in parentheses
|
LL | (vec![1, 2, 3]: Vec<i32>)[0];
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:17:5
@@ -29,7 +29,7 @@
help: try surrounding the expression in parentheses
|
LL | ((&[0]) as &[i32])[0];
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:19:5
@@ -40,7 +40,7 @@
help: try surrounding the expression in parentheses
|
LL | ((&[0i32]): &[i32; 1])[0];
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:39:13
@@ -51,7 +51,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32: i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:41:13
@@ -62,7 +62,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32: i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:43:13
@@ -73,7 +73,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32 as i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:45:13
@@ -84,7 +84,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32 as i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:47:13
@@ -95,7 +95,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32: i32 as u32 as i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:49:13
@@ -106,7 +106,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32).count_ones(): u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:51:13
@@ -117,7 +117,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32).count_ones(): u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:53:13
@@ -128,7 +128,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32).count_ones() as u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:55:13
@@ -139,7 +139,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32).count_ones() as u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:57:13
@@ -150,7 +150,7 @@
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32: i32).count_ones() as u32 as i32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:62:13
@@ -162,8 +162,8 @@
|
help: try surrounding the expression in parentheses
|
-LL | let _ = (0
-LL | as i32)
+LL ~ let _ = (0
+LL ~ as i32)
|
error: casts cannot be followed by indexing
@@ -175,7 +175,7 @@
help: try surrounding the expression in parentheses
|
LL | let x: i32 = (&vec![1, 2, 3] as &Vec<i32>)[0];
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:75:5
@@ -186,7 +186,7 @@
help: try surrounding the expression in parentheses
|
LL | (0 as i32).max(0);
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:77:5
@@ -197,7 +197,7 @@
help: try surrounding the expression in parentheses
|
LL | (0: i32).max(0);
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:92:8
@@ -208,7 +208,7 @@
help: try surrounding the expression in parentheses
|
LL | if (5u64 as i32).max(0) == 0 {
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:95:8
@@ -219,7 +219,7 @@
help: try surrounding the expression in parentheses
|
LL | if (5u64: u64).max(0) == 0 {
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:102:9
@@ -230,7 +230,7 @@
help: try surrounding the expression in parentheses
|
LL | (5u64 as u32).max(0) == 0
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:106:9
@@ -241,7 +241,7 @@
help: try surrounding the expression in parentheses
|
LL | (5u64: u64).max(0) == 0
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:111:24
@@ -252,7 +252,7 @@
help: try surrounding the expression in parentheses
|
LL | static bar: &[i32] = &((&[1,2,3] as &[i32])[0..1]);
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:114:25
@@ -263,7 +263,7 @@
help: try surrounding the expression in parentheses
|
LL | static bar2: &[i32] = &((&[1i32,2,3]: &[i32; 3])[0..1]);
- | ^ ^
+ | + +
error: casts cannot be followed by ?
--> $DIR/issue-35813-postfix-after-cast.rs:119:5
@@ -274,7 +274,7 @@
help: try surrounding the expression in parentheses
|
LL | (Err(0u64) as Result<u64,u64>)?;
- | ^ ^
+ | + +
error: casts cannot be followed by ?
--> $DIR/issue-35813-postfix-after-cast.rs:121:5
@@ -285,7 +285,7 @@
help: try surrounding the expression in parentheses
|
LL | (Err(0u64): Result<u64,u64>)?;
- | ^ ^
+ | + +
error: casts cannot be followed by a function call
--> $DIR/issue-35813-postfix-after-cast.rs:145:5
@@ -296,7 +296,7 @@
help: try surrounding the expression in parentheses
|
LL | (drop as fn(u8))(0);
- | ^ ^
+ | + +
error: casts cannot be followed by a function call
--> $DIR/issue-35813-postfix-after-cast.rs:147:5
@@ -307,7 +307,7 @@
help: try surrounding the expression in parentheses
|
LL | (drop_ptr: fn(u8))(0);
- | ^ ^
+ | + +
error: casts cannot be followed by `.await`
--> $DIR/issue-35813-postfix-after-cast.rs:152:5
@@ -318,7 +318,7 @@
help: try surrounding the expression in parentheses
|
LL | (Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>).await;
- | ^ ^
+ | + +
error: casts cannot be followed by `.await`
--> $DIR/issue-35813-postfix-after-cast.rs:155:5
@@ -329,7 +329,7 @@
help: try surrounding the expression in parentheses
|
LL | (Box::pin(noop()): Pin<Box<_>>).await;
- | ^ ^
+ | + +
error: casts cannot be followed by a field access
--> $DIR/issue-35813-postfix-after-cast.rs:167:5
@@ -340,7 +340,7 @@
help: try surrounding the expression in parentheses
|
LL | (Foo::default() as Foo).bar;
- | ^ ^
+ | + +
error: casts cannot be followed by a field access
--> $DIR/issue-35813-postfix-after-cast.rs:169:5
@@ -351,7 +351,7 @@
help: try surrounding the expression in parentheses
|
LL | (Foo::default(): Foo).bar;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:84:9
@@ -362,7 +362,7 @@
help: try surrounding the expression in parentheses
|
LL | (if true { 33 } else { 44 } as i32).max(0),
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:86:9
@@ -373,7 +373,7 @@
help: try surrounding the expression in parentheses
|
LL | (if true { 33 } else { 44 }: i32).max(0)
- | ^ ^
+ | + +
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-35813-postfix-after-cast.rs:131:13
diff --git a/src/test/ui/parser/issue-44406.stderr b/src/test/ui/parser/issue-44406.stderr
index 701c32d..3723871 100644
--- a/src/test/ui/parser/issue-44406.stderr
+++ b/src/test/ui/parser/issue-44406.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | foo!(r#true);
- | ^^^^^^
+ | ~~~~~~
error: expected type, found keyword `true`
--> $DIR/issue-44406.rs:8:10
diff --git a/src/test/ui/parser/issue-57198.stderr b/src/test/ui/parser/issue-57198.stderr
index 197c4cc..5a56d80 100644
--- a/src/test/ui/parser/issue-57198.stderr
+++ b/src/test/ui/parser/issue-57198.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | m::r#for();
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/issue-58856-1.stderr b/src/test/ui/parser/issue-58856-1.stderr
index f1abb40..2afb26d 100644
--- a/src/test/ui/parser/issue-58856-1.stderr
+++ b/src/test/ui/parser/issue-58856-1.stderr
@@ -1,8 +1,8 @@
error: expected one of `)`, `,`, or `:`, found `>`
- --> $DIR/issue-58856-1.rs:3:14
+ --> $DIR/issue-58856-1.rs:3:9
|
LL | fn b(self>
- | - ^ help: `)` may belong here
+ | ^ ^ help: `)` may belong here
| |
| unclosed delimiter
diff --git a/src/test/ui/parser/issue-58856-2.stderr b/src/test/ui/parser/issue-58856-2.stderr
index 303b5ea..627dd38 100644
--- a/src/test/ui/parser/issue-58856-2.stderr
+++ b/src/test/ui/parser/issue-58856-2.stderr
@@ -1,8 +1,8 @@
error: expected one of `)` or `,`, found `->`
- --> $DIR/issue-58856-2.rs:6:26
+ --> $DIR/issue-58856-2.rs:6:19
|
LL | fn how_are_you(&self -> Empty {
- | - -^^
+ | ^ -^^
| | |
| | help: `)` may belong here
| unclosed delimiter
diff --git a/src/test/ui/parser/issue-60075.stderr b/src/test/ui/parser/issue-60075.stderr
index e3b7f4a..210ef70 100644
--- a/src/test/ui/parser/issue-60075.stderr
+++ b/src/test/ui/parser/issue-60075.stderr
@@ -17,10 +17,10 @@
| - item list ends here
error: mismatched closing delimiter: `)`
- --> $DIR/issue-60075.rs:6:10
+ --> $DIR/issue-60075.rs:4:31
|
LL | fn qux() -> Option<usize> {
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL | let _ = if true {
LL | });
| ^ mismatched closing delimiter
diff --git a/src/test/ui/parser/issue-62524.stderr b/src/test/ui/parser/issue-62524.stderr
index d5e07622..55eed04 100644
--- a/src/test/ui/parser/issue-62524.stderr
+++ b/src/test/ui/parser/issue-62524.stderr
@@ -17,11 +17,11 @@
help: change the delimiters to curly braces
|
LL | y! { /* items */ }
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: add a semicolon
|
LL | Ϥ,;
- | ^
+ | +
error: cannot find macro `y` in this scope
--> $DIR/issue-62524.rs:5:1
diff --git a/src/test/ui/parser/issue-62554.stderr b/src/test/ui/parser/issue-62554.stderr
index 935d384..5dc9a96 100644
--- a/src/test/ui/parser/issue-62554.stderr
+++ b/src/test/ui/parser/issue-62554.stderr
@@ -63,8 +63,8 @@
|
help: try placing this code inside a block
|
-LL | fn foo(u: u8) { if u8 { macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
-LL | }
+LL ~ fn foo(u: u8) { if u8 { macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
+LL + }
|
error: aborting due to 6 previous errors
diff --git a/src/test/ui/parser/issue-62894.stderr b/src/test/ui/parser/issue-62894.stderr
index cf3727c..9b7bd15 100644
--- a/src/test/ui/parser/issue-62894.stderr
+++ b/src/test/ui/parser/issue-62894.stderr
@@ -42,7 +42,7 @@
LL |
LL | fn main() {}
| ^^ unexpected token
- |
+ |
::: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
LL | ($left:expr, $right:expr $(,)?) => ({
diff --git a/src/test/ui/parser/issue-62895.stderr b/src/test/ui/parser/issue-62895.stderr
index ed4d234..2e7e500 100644
--- a/src/test/ui/parser/issue-62895.stderr
+++ b/src/test/ui/parser/issue-62895.stderr
@@ -19,7 +19,7 @@
help: add `fn` here to parse `g` as a public function
|
LL | pub fn g() -> is
- | ^^
+ | ++
error: expected item, found `;`
--> $DIR/issue-62895.rs:10:9
diff --git a/src/test/ui/parser/issue-62973.stderr b/src/test/ui/parser/issue-62973.stderr
index 95ee52d..51d835e 100644
--- a/src/test/ui/parser/issue-62973.stderr
+++ b/src/test/ui/parser/issue-62973.stderr
@@ -21,10 +21,10 @@
| ^
error: expected one of `,` or `}`, found `{`
- --> $DIR/issue-62973.rs:6:25
+ --> $DIR/issue-62973.rs:6:8
|
LL | fn p() { match s { v, E { [) {) }
- | - - -^ expected one of `,` or `}`
+ | ^ - -^ expected one of `,` or `}`
| | | |
| | | help: `}` may belong here
| | while parsing this struct
@@ -41,9 +41,9 @@
|
help: surround the struct literal with parentheses
|
-LL | fn p() { match (s { v, E { [) {) }
+LL ~ fn p() { match (s { v, E { [) {) }
LL |
-LL | )
+LL ~ )
|
error: expected one of `.`, `?`, `{`, or an operator, found `}`
@@ -56,18 +56,18 @@
| ^ expected one of `.`, `?`, `{`, or an operator
error: mismatched closing delimiter: `)`
- --> $DIR/issue-62973.rs:6:28
+ --> $DIR/issue-62973.rs:6:27
|
LL | fn p() { match s { v, E { [) {) }
- | -^ mismatched closing delimiter
+ | ^^ mismatched closing delimiter
| |
| unclosed delimiter
error: mismatched closing delimiter: `)`
- --> $DIR/issue-62973.rs:6:31
+ --> $DIR/issue-62973.rs:6:30
|
LL | fn p() { match s { v, E { [) {) }
- | -^ mismatched closing delimiter
+ | ^^ mismatched closing delimiter
| |
| unclosed delimiter
diff --git a/src/test/ui/parser/issue-63116.stderr b/src/test/ui/parser/issue-63116.stderr
index 4766dfa..cfdd99d 100644
--- a/src/test/ui/parser/issue-63116.stderr
+++ b/src/test/ui/parser/issue-63116.stderr
@@ -13,10 +13,10 @@
| ^ expected one of 7 possible tokens
error: mismatched closing delimiter: `]`
- --> $DIR/issue-63116.rs:3:16
+ --> $DIR/issue-63116.rs:3:14
|
LL | impl W <s(f;Y(;]
- | - ^ mismatched closing delimiter
+ | ^ ^ mismatched closing delimiter
| |
| unclosed delimiter
diff --git a/src/test/ui/parser/issue-64732.stderr b/src/test/ui/parser/issue-64732.stderr
index ac04258..8046254 100644
--- a/src/test/ui/parser/issue-64732.stderr
+++ b/src/test/ui/parser/issue-64732.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a byte string literal, use double quotes
|
LL | let _foo = b"hello\0";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: character literal may only contain one codepoint
--> $DIR/issue-64732.rs:6:16
@@ -18,7 +18,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | let _bar = "hello";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr b/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr
index ad72dd3..0a88dd2 100644
--- a/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr
+++ b/src/test/ui/parser/issue-65257-invalid-var-decl-recovery.stderr
@@ -7,7 +7,7 @@
help: write `let` instead of `auto` to introduce a new variable
|
LL | let n = 0;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:4:5
@@ -18,7 +18,7 @@
help: write `let` instead of `auto` to introduce a new variable
|
LL | let m;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:8:5
@@ -29,7 +29,7 @@
help: write `let` instead of `var` to introduce a new variable
|
LL | let n = 0;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:10:5
@@ -40,7 +40,7 @@
help: write `let` instead of `var` to introduce a new variable
|
LL | let m;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5
diff --git a/src/test/ui/parser/issue-66357-unexpected-unreachable.stderr b/src/test/ui/parser/issue-66357-unexpected-unreachable.stderr
index 332711d..6cbab85 100644
--- a/src/test/ui/parser/issue-66357-unexpected-unreachable.stderr
+++ b/src/test/ui/parser/issue-66357-unexpected-unreachable.stderr
@@ -5,10 +5,10 @@
| ^ expected one of `,` or `:`
error: expected one of `&`, `(`, `)`, `-`, `...`, `..=`, `..`, `[`, `_`, `box`, `mut`, `ref`, `|`, identifier, or path, found `*`
- --> $DIR/issue-66357-unexpected-unreachable.rs:12:14
+ --> $DIR/issue-66357-unexpected-unreachable.rs:12:13
|
LL | fn f() { |[](* }
- | -^ help: `)` may belong here
+ | ^^ help: `)` may belong here
| |
| unclosed delimiter
diff --git a/src/test/ui/parser/issue-67377-invalid-syntax-in-enum-discriminant.stderr b/src/test/ui/parser/issue-67377-invalid-syntax-in-enum-discriminant.stderr
index f20ec75..34f1397 100644
--- a/src/test/ui/parser/issue-67377-invalid-syntax-in-enum-discriminant.stderr
+++ b/src/test/ui/parser/issue-67377-invalid-syntax-in-enum-discriminant.stderr
@@ -1,107 +1,107 @@
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
|
LL | V = [PhantomData; { [ () ].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
|
LL | V = [Vec::new; { [].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
|
LL | V = [PhantomData; { [ () ].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
|
LL | V = [Vec::new; { [].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
|
LL | V = [PhantomData; { [ () ].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
|
LL | V = [Vec::new; { [].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:42
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:5:27
|
LL | V = [PhantomData; { [ () ].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:24
|
LL | V = [Vec::new; { [].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
error: mismatched closing delimiter: `]`
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:36
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:24
|
LL | V = [Vec::new; { [0].len() ].len() as isize,
- | - - ^ mismatched closing delimiter
+ | - ^ ^ mismatched closing delimiter
| | |
| | unclosed delimiter
| closing delimiter possibly meant for this
diff --git a/src/test/ui/parser/issue-68629.stderr b/src/test/ui/parser/issue-68629.stderr
index 19c9ef3..b2c7ddd 100644
--- a/src/test/ui/parser/issue-68629.stderr
+++ b/src/test/ui/parser/issue-68629.stderr
Binary files differ
diff --git a/src/test/ui/parser/issue-68730.stderr b/src/test/ui/parser/issue-68730.stderr
index 8602aba..6585a19 100644
--- a/src/test/ui/parser/issue-68730.stderr
+++ b/src/test/ui/parser/issue-68730.stderr
Binary files differ
diff --git a/src/test/ui/parser/issue-68890-2.stderr b/src/test/ui/parser/issue-68890-2.stderr
index dce03e1..1a64b9a 100644
--- a/src/test/ui/parser/issue-68890-2.stderr
+++ b/src/test/ui/parser/issue-68890-2.stderr
@@ -12,7 +12,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0224]: at least one trait is required for an object type
--> $DIR/issue-68890-2.rs:3:14
diff --git a/src/test/ui/parser/issue-72253.rs b/src/test/ui/parser/issue-72253.rs
index 6f9af73..1446a79 100644
--- a/src/test/ui/parser/issue-72253.rs
+++ b/src/test/ui/parser/issue-72253.rs
@@ -1,6 +1,6 @@
fn main() {
let a = std::process::Command::new("echo")
.arg("1")
- ,arg("2") //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `,`
+ ,arg("2") //~ ERROR expected one of `.`, `;`, `?`, `else`, or an operator, found `,`
.output();
}
diff --git a/src/test/ui/parser/issue-72253.stderr b/src/test/ui/parser/issue-72253.stderr
index 3819fd9..477fa09 100644
--- a/src/test/ui/parser/issue-72253.stderr
+++ b/src/test/ui/parser/issue-72253.stderr
@@ -1,8 +1,8 @@
-error: expected one of `.`, `;`, `?`, or an operator, found `,`
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found `,`
--> $DIR/issue-72253.rs:4:9
|
LL | .arg("1")
- | - expected one of `.`, `;`, `?`, or an operator
+ | - expected one of `.`, `;`, `?`, `else`, or an operator
LL | ,arg("2")
| ^ unexpected token
diff --git a/src/test/ui/parser/issue-72373.stderr b/src/test/ui/parser/issue-72373.stderr
index dfde862..0bb99a0 100644
--- a/src/test/ui/parser/issue-72373.stderr
+++ b/src/test/ui/parser/issue-72373.stderr
@@ -7,7 +7,7 @@
help: if you meant to bind the contents of the rest of the array pattern into `ts`, use `@`
|
LL | [h, ref ts @ ..] => foo(c, n - h) + foo(ts, n),
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr
index c10037d..6f26f36 100644
--- a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr
+++ b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr
@@ -35,7 +35,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-73568-lifetime-after-mut.rs:19:23
@@ -44,7 +44,7 @@
| ^^ help: use `dyn`: `dyn 'a`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0224]: at least one trait is required for an object type
--> $DIR/issue-73568-lifetime-after-mut.rs:14:18
diff --git a/src/test/ui/parser/issue-81806.stderr b/src/test/ui/parser/issue-81806.stderr
index b8ada11..a62c9b0 100644
--- a/src/test/ui/parser/issue-81806.stderr
+++ b/src/test/ui/parser/issue-81806.stderr
@@ -11,7 +11,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | r#impl
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/issue-84117.rs b/src/test/ui/parser/issue-84117.rs
index 0f20073..9195858 100644
--- a/src/test/ui/parser/issue-84117.rs
+++ b/src/test/ui/parser/issue-84117.rs
@@ -2,8 +2,8 @@
let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
//~^ ERROR expected one of `>`, a const expression
//~| ERROR expected one of `>`, a const expression, lifetime, or type, found `}`
- //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
- //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
- //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+ //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
+ //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
+ //~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
}
//~^ ERROR expected one of `,`, `:`, `=`, or `>`, found `}`
diff --git a/src/test/ui/parser/issue-84117.stderr b/src/test/ui/parser/issue-84117.stderr
index d667a49..5b9cc53 100644
--- a/src/test/ui/parser/issue-84117.stderr
+++ b/src/test/ui/parser/issue-84117.stderr
@@ -7,11 +7,11 @@
| | help: use `=` if you meant to assign
| while parsing the type for `inner_local`
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
--> $DIR/issue-84117.rs:2:65
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
- | ^ expected one of 7 possible tokens
+ | ^ expected one of 8 possible tokens
error: expected one of `,`, `:`, `=`, or `>`, found `}`
--> $DIR/issue-84117.rs:8:1
@@ -33,17 +33,17 @@
| | help: use `=` if you meant to assign
| while parsing the type for `inner_local`
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
--> $DIR/issue-84117.rs:2:65
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
- | ^ expected one of 7 possible tokens
+ | ^ expected one of 8 possible tokens
-error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
+error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
--> $DIR/issue-84117.rs:2:33
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
- | ^ expected one of 7 possible tokens
+ | ^ expected one of 8 possible tokens
error: aborting due to 6 previous errors
diff --git a/src/test/ui/parser/issue-87197-missing-semicolon.fixed b/src/test/ui/parser/issue-87197-missing-semicolon.fixed
new file mode 100644
index 0000000..53f071d
--- /dev/null
+++ b/src/test/ui/parser/issue-87197-missing-semicolon.fixed
@@ -0,0 +1,10 @@
+// run-rustfix
+// Parser should know when a semicolon is missing.
+// https://github.com/rust-lang/rust/issues/87197
+
+fn main() {
+ let x = 100; //~ ERROR: expected `;`
+ println!("{}", x); //~ ERROR: expected `;`
+ let y = 200; //~ ERROR: expected `;`
+ println!("{}", y);
+}
diff --git a/src/test/ui/parser/issue-87197-missing-semicolon.rs b/src/test/ui/parser/issue-87197-missing-semicolon.rs
new file mode 100644
index 0000000..db0edf4
--- /dev/null
+++ b/src/test/ui/parser/issue-87197-missing-semicolon.rs
@@ -0,0 +1,10 @@
+// run-rustfix
+// Parser should know when a semicolon is missing.
+// https://github.com/rust-lang/rust/issues/87197
+
+fn main() {
+ let x = 100 //~ ERROR: expected `;`
+ println!("{}", x) //~ ERROR: expected `;`
+ let y = 200 //~ ERROR: expected `;`
+ println!("{}", y);
+}
diff --git a/src/test/ui/parser/issue-87197-missing-semicolon.stderr b/src/test/ui/parser/issue-87197-missing-semicolon.stderr
new file mode 100644
index 0000000..57772de
--- /dev/null
+++ b/src/test/ui/parser/issue-87197-missing-semicolon.stderr
@@ -0,0 +1,26 @@
+error: expected `;`, found `println`
+ --> $DIR/issue-87197-missing-semicolon.rs:6:16
+ |
+LL | let x = 100
+ | ^ help: add `;` here
+LL | println!("{}", x)
+ | ------- unexpected token
+
+error: expected `;`, found keyword `let`
+ --> $DIR/issue-87197-missing-semicolon.rs:7:22
+ |
+LL | println!("{}", x)
+ | ^ help: add `;` here
+LL | let y = 200
+ | --- unexpected token
+
+error: expected `;`, found `println`
+ --> $DIR/issue-87197-missing-semicolon.rs:8:16
+ |
+LL | let y = 200
+ | ^ help: add `;` here
+LL | println!("{}", y);
+ | ------- unexpected token
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/parser/issue-87217-keyword-order/const-async-const.rs b/src/test/ui/parser/issue-87217-keyword-order/const-async-const.rs
new file mode 100644
index 0000000..7c3d915
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/const-async-const.rs
@@ -0,0 +1,11 @@
+// edition:2018
+
+// Test that even when `const` is already present, the proposed fix is `const const async`,
+// like for `pub pub`.
+
+const async const fn test() {}
+//~^ ERROR expected one of `extern`, `fn`, or `unsafe`, found keyword `const`
+//~| NOTE expected one of `extern`, `fn`, or `unsafe`
+//~| HELP `const` must come before `async`
+//~| SUGGESTION const async
+//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
diff --git a/src/test/ui/parser/issue-87217-keyword-order/const-async-const.stderr b/src/test/ui/parser/issue-87217-keyword-order/const-async-const.stderr
new file mode 100644
index 0000000..5628091
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/const-async-const.stderr
@@ -0,0 +1,13 @@
+error: expected one of `extern`, `fn`, or `unsafe`, found keyword `const`
+ --> $DIR/const-async-const.rs:6:13
+ |
+LL | const async const fn test() {}
+ | ------^^^^^
+ | | |
+ | | expected one of `extern`, `fn`, or `unsafe`
+ | help: `const` must come before `async`: `const async`
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-87217-keyword-order/several-kw-jump.rs b/src/test/ui/parser/issue-87217-keyword-order/several-kw-jump.rs
new file mode 100644
index 0000000..86fdb78
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/several-kw-jump.rs
@@ -0,0 +1,14 @@
+// edition:2018
+
+// There is an order to respect for keywords before a function:
+// `<visibility>, const, async, unsafe, extern, "<ABI>"`
+//
+// This test ensures the compiler is helpful about them being misplaced.
+// Visibilities are tested elsewhere.
+
+async unsafe const fn test() {}
+//~^ ERROR expected one of `extern` or `fn`, found keyword `const`
+//~| NOTE expected one of `extern` or `fn`
+//~| HELP `const` must come before `async unsafe`
+//~| SUGGESTION const async unsafe
+//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
diff --git a/src/test/ui/parser/issue-87217-keyword-order/several-kw-jump.stderr b/src/test/ui/parser/issue-87217-keyword-order/several-kw-jump.stderr
new file mode 100644
index 0000000..65cce77
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/several-kw-jump.stderr
@@ -0,0 +1,13 @@
+error: expected one of `extern` or `fn`, found keyword `const`
+ --> $DIR/several-kw-jump.rs:9:14
+ |
+LL | async unsafe const fn test() {}
+ | -------------^^^^^
+ | | |
+ | | expected one of `extern` or `fn`
+ | help: `const` must come before `async unsafe`: `const async unsafe`
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-87217-keyword-order/wrong-async.rs b/src/test/ui/parser/issue-87217-keyword-order/wrong-async.rs
new file mode 100644
index 0000000..edfb330
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/wrong-async.rs
@@ -0,0 +1,14 @@
+// edition:2018
+
+// There is an order to respect for keywords before a function:
+// `<visibility>, const, async, unsafe, extern, "<ABI>"`
+//
+// This test ensures the compiler is helpful about them being misplaced.
+// Visibilities are tested elsewhere.
+
+unsafe async fn test() {}
+//~^ ERROR expected one of `extern` or `fn`, found keyword `async`
+//~| NOTE expected one of `extern` or `fn`
+//~| HELP `async` must come before `unsafe`
+//~| SUGGESTION async unsafe
+//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
diff --git a/src/test/ui/parser/issue-87217-keyword-order/wrong-async.stderr b/src/test/ui/parser/issue-87217-keyword-order/wrong-async.stderr
new file mode 100644
index 0000000..3acd9e4
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/wrong-async.stderr
@@ -0,0 +1,13 @@
+error: expected one of `extern` or `fn`, found keyword `async`
+ --> $DIR/wrong-async.rs:9:8
+ |
+LL | unsafe async fn test() {}
+ | -------^^^^^
+ | | |
+ | | expected one of `extern` or `fn`
+ | help: `async` must come before `unsafe`: `async unsafe`
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-87217-keyword-order/wrong-const.rs b/src/test/ui/parser/issue-87217-keyword-order/wrong-const.rs
new file mode 100644
index 0000000..abd692b
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/wrong-const.rs
@@ -0,0 +1,14 @@
+// edition:2018
+
+// There is an order to respect for keywords before a function:
+// `<visibility>, const, async, unsafe, extern, "<ABI>"`
+//
+// This test ensures the compiler is helpful about them being misplaced.
+// Visibilities are tested elsewhere.
+
+unsafe const fn test() {}
+//~^ ERROR expected one of `extern` or `fn`, found keyword `const`
+//~| NOTE expected one of `extern` or `fn`
+//~| HELP `const` must come before `unsafe`
+//~| SUGGESTION const unsafe
+//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
diff --git a/src/test/ui/parser/issue-87217-keyword-order/wrong-const.stderr b/src/test/ui/parser/issue-87217-keyword-order/wrong-const.stderr
new file mode 100644
index 0000000..9a3e07b
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/wrong-const.stderr
@@ -0,0 +1,13 @@
+error: expected one of `extern` or `fn`, found keyword `const`
+ --> $DIR/wrong-const.rs:9:8
+ |
+LL | unsafe const fn test() {}
+ | -------^^^^^
+ | | |
+ | | expected one of `extern` or `fn`
+ | help: `const` must come before `unsafe`: `const unsafe`
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-87217-keyword-order/wrong-unsafe.rs b/src/test/ui/parser/issue-87217-keyword-order/wrong-unsafe.rs
new file mode 100644
index 0000000..7f0761e
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/wrong-unsafe.rs
@@ -0,0 +1,14 @@
+// edition:2018
+
+// There is an order to respect for keywords before a function:
+// `<visibility>, const, async, unsafe, extern, "<ABI>"`
+//
+// This test ensures the compiler is helpful about them being misplaced.
+// Visibilities are tested elsewhere.
+
+extern unsafe fn test() {}
+//~^ ERROR expected `fn`, found keyword `unsafe`
+//~| NOTE expected `fn`
+//~| HELP `unsafe` must come before `extern`
+//~| SUGGESTION unsafe extern
+//~| NOTE keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
diff --git a/src/test/ui/parser/issue-87217-keyword-order/wrong-unsafe.stderr b/src/test/ui/parser/issue-87217-keyword-order/wrong-unsafe.stderr
new file mode 100644
index 0000000..395ee9f
--- /dev/null
+++ b/src/test/ui/parser/issue-87217-keyword-order/wrong-unsafe.stderr
@@ -0,0 +1,13 @@
+error: expected `fn`, found keyword `unsafe`
+ --> $DIR/wrong-unsafe.rs:9:8
+ |
+LL | extern unsafe fn test() {}
+ | -------^^^^^^
+ | | |
+ | | expected `fn`
+ | help: `unsafe` must come before `extern`: `unsafe extern`
+ |
+ = note: keyword order for functions declaration is `default`, `pub`, `const`, `async`, `unsafe`, `extern`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-87635.rs b/src/test/ui/parser/issue-87635.rs
new file mode 100644
index 0000000..da74c18
--- /dev/null
+++ b/src/test/ui/parser/issue-87635.rs
@@ -0,0 +1,9 @@
+struct Foo {}
+
+impl Foo {
+ pub fn bar()
+ //~^ ERROR: expected `;`, found `}`
+ //~| ERROR: associated function in `impl` without body
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/issue-87635.stderr b/src/test/ui/parser/issue-87635.stderr
new file mode 100644
index 0000000..920a9f9
--- /dev/null
+++ b/src/test/ui/parser/issue-87635.stderr
@@ -0,0 +1,19 @@
+error: expected `;`, found `}`
+ --> $DIR/issue-87635.rs:4:17
+ |
+LL | pub fn bar()
+ | ^ help: add `;` here
+...
+LL | }
+ | - unexpected token
+
+error: associated function in `impl` without body
+ --> $DIR/issue-87635.rs:4:5
+ |
+LL | pub fn bar()
+ | ^^^^^^^^^^^-
+ | |
+ | help: provide a definition for the function: `{ <body> }`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/parser/issue-87812-path.rs b/src/test/ui/parser/issue-87812-path.rs
new file mode 100644
index 0000000..b887808
--- /dev/null
+++ b/src/test/ui/parser/issue-87812-path.rs
@@ -0,0 +1,11 @@
+macro_rules! foo {
+ ( $f:path ) => {{
+ let _: usize = $f; //~ERROR
+ }};
+}
+
+struct Baz;
+
+fn main() {
+ foo!(Baz);
+}
diff --git a/src/test/ui/parser/issue-87812-path.stderr b/src/test/ui/parser/issue-87812-path.stderr
new file mode 100644
index 0000000..0c8e6fd
--- /dev/null
+++ b/src/test/ui/parser/issue-87812-path.stderr
@@ -0,0 +1,16 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-87812-path.rs:3:24
+ |
+LL | let _: usize = $f;
+ | ----- ^^ expected `usize`, found struct `Baz`
+ | |
+ | expected due to this
+...
+LL | foo!(Baz);
+ | ---------- in this macro invocation
+ |
+ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/parser/issue-87812.rs b/src/test/ui/parser/issue-87812.rs
new file mode 100644
index 0000000..0ba87b9
--- /dev/null
+++ b/src/test/ui/parser/issue-87812.rs
@@ -0,0 +1,13 @@
+#![deny(break_with_label_and_loop)]
+
+macro_rules! foo {
+ ( $f:block ) => {
+ '_l: loop {
+ break '_l $f; //~ERROR
+ }
+ };
+}
+
+fn main() {
+ let x = foo!({ 3 });
+}
diff --git a/src/test/ui/parser/issue-87812.stderr b/src/test/ui/parser/issue-87812.stderr
new file mode 100644
index 0000000..d61ee23
--- /dev/null
+++ b/src/test/ui/parser/issue-87812.stderr
@@ -0,0 +1,22 @@
+error: this labeled break expression is easy to confuse with an unlabeled break with a labeled value expression
+ --> $DIR/issue-87812.rs:6:13
+ |
+LL | break '_l $f;
+ | ^^^^^^^^^^^^
+...
+LL | let x = foo!({ 3 });
+ | ----------- in this macro invocation
+ |
+note: the lint level is defined here
+ --> $DIR/issue-87812.rs:1:9
+ |
+LL | #![deny(break_with_label_and_loop)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: wrap this expression in parentheses
+ |
+LL | break '_l ($f);
+ | + +
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-88583-union-as-ident.rs b/src/test/ui/parser/issue-88583-union-as-ident.rs
new file mode 100644
index 0000000..b3d66d4
--- /dev/null
+++ b/src/test/ui/parser/issue-88583-union-as-ident.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+#![allow(non_camel_case_types)]
+
+struct union;
+
+impl union {
+ pub fn new() -> Self {
+ union { }
+ }
+}
+
+fn main() {
+ let _u = union::new();
+}
diff --git a/src/test/ui/parser/issue-89574.rs b/src/test/ui/parser/issue-89574.rs
new file mode 100644
index 0000000..0a477f1
--- /dev/null
+++ b/src/test/ui/parser/issue-89574.rs
@@ -0,0 +1,4 @@
+fn main() {
+ const EMPTY_ARRAY = [];
+ //~^ missing type for `const` item
+}
diff --git a/src/test/ui/parser/issue-89574.stderr b/src/test/ui/parser/issue-89574.stderr
new file mode 100644
index 0000000..cbee3d3
--- /dev/null
+++ b/src/test/ui/parser/issue-89574.stderr
@@ -0,0 +1,8 @@
+error: missing type for `const` item
+ --> $DIR/issue-89574.rs:2:11
+ |
+LL | const EMPTY_ARRAY = [];
+ | ^^^^^^^^^^^ help: provide a type for the item: `EMPTY_ARRAY: <type>`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/item-free-const-no-body-semantic-fail.rs b/src/test/ui/parser/item-free-const-no-body-semantic-fail.rs
index 15a15a2..613b3c9 100644
--- a/src/test/ui/parser/item-free-const-no-body-semantic-fail.rs
+++ b/src/test/ui/parser/item-free-const-no-body-semantic-fail.rs
@@ -4,3 +4,4 @@
const A: u8; //~ ERROR free constant item without body
const B; //~ ERROR free constant item without body
+//~^ ERROR missing type for `const` item
diff --git a/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr b/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr
index aa75e5c..c340e95 100644
--- a/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr
+++ b/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr
@@ -14,5 +14,11 @@
| |
| help: provide a definition for the constant: `= <expr>;`
-error: aborting due to 2 previous errors
+error: missing type for `const` item
+ --> $DIR/item-free-const-no-body-semantic-fail.rs:6:7
+ |
+LL | const B;
+ | ^ help: provide a type for the item: `B: <type>`
+
+error: aborting due to 3 previous errors
diff --git a/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs b/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs
index 61d3eab..780479e 100644
--- a/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs
+++ b/src/test/ui/parser/item-free-static-no-body-semantic-fail.rs
@@ -4,6 +4,8 @@
static A: u8; //~ ERROR free static item without body
static B; //~ ERROR free static item without body
+//~^ ERROR missing type for `static` item
static mut C: u8; //~ ERROR free static item without body
static mut D; //~ ERROR free static item without body
+//~^ ERROR missing type for `static mut` item
diff --git a/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr b/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr
index 7b40832..4d542b7 100644
--- a/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr
+++ b/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr
@@ -15,7 +15,7 @@
| help: provide a definition for the static: `= <expr>;`
error: free static item without body
- --> $DIR/item-free-static-no-body-semantic-fail.rs:8:1
+ --> $DIR/item-free-static-no-body-semantic-fail.rs:9:1
|
LL | static mut C: u8;
| ^^^^^^^^^^^^^^^^-
@@ -23,12 +23,24 @@
| help: provide a definition for the static: `= <expr>;`
error: free static item without body
- --> $DIR/item-free-static-no-body-semantic-fail.rs:9:1
+ --> $DIR/item-free-static-no-body-semantic-fail.rs:10:1
|
LL | static mut D;
| ^^^^^^^^^^^^-
| |
| help: provide a definition for the static: `= <expr>;`
-error: aborting due to 4 previous errors
+error: missing type for `static` item
+ --> $DIR/item-free-static-no-body-semantic-fail.rs:6:8
+ |
+LL | static B;
+ | ^ help: provide a type for the item: `B: <type>`
+
+error: missing type for `static mut` item
+ --> $DIR/item-free-static-no-body-semantic-fail.rs:10:12
+ |
+LL | static mut D;
+ | ^ help: provide a type for the item: `D: <type>`
+
+error: aborting due to 6 previous errors
diff --git a/src/test/ui/parser/keyword-abstract.stderr b/src/test/ui/parser/keyword-abstract.stderr
index b355b3a..730c5b6 100644
--- a/src/test/ui/parser/keyword-abstract.stderr
+++ b/src/test/ui/parser/keyword-abstract.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#abstract = ();
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-as-as-identifier.stderr b/src/test/ui/parser/keyword-as-as-identifier.stderr
index dea4afd..b9ebdf4 100644
--- a/src/test/ui/parser/keyword-as-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-as-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#as = "foo";
- | ^^^^
+ | ~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-break-as-identifier.stderr b/src/test/ui/parser/keyword-break-as-identifier.stderr
index db05f39..05615b4 100644
--- a/src/test/ui/parser/keyword-break-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-break-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#break = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-const-as-identifier.stderr b/src/test/ui/parser/keyword-const-as-identifier.stderr
index 45c1299..f7efa53 100644
--- a/src/test/ui/parser/keyword-const-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-const-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#const = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-continue-as-identifier.stderr b/src/test/ui/parser/keyword-continue-as-identifier.stderr
index 2ec4b28..aed6be2 100644
--- a/src/test/ui/parser/keyword-continue-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-continue-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#continue = "foo";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-else-as-identifier.stderr b/src/test/ui/parser/keyword-else-as-identifier.stderr
index b622806..3fc8af3 100644
--- a/src/test/ui/parser/keyword-else-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-else-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#else = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-enum-as-identifier.stderr b/src/test/ui/parser/keyword-enum-as-identifier.stderr
index 0f3fa3f..4632814 100644
--- a/src/test/ui/parser/keyword-enum-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-enum-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#enum = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-final.stderr b/src/test/ui/parser/keyword-final.stderr
index c74e310..f2edc3f 100644
--- a/src/test/ui/parser/keyword-final.stderr
+++ b/src/test/ui/parser/keyword-final.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#final = ();
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-fn-as-identifier.stderr b/src/test/ui/parser/keyword-fn-as-identifier.stderr
index 3219eaf..100295c 100644
--- a/src/test/ui/parser/keyword-fn-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-fn-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#fn = "foo";
- | ^^^^
+ | ~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-for-as-identifier.stderr b/src/test/ui/parser/keyword-for-as-identifier.stderr
index 30974af..312a635 100644
--- a/src/test/ui/parser/keyword-for-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-for-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#for = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-if-as-identifier.stderr b/src/test/ui/parser/keyword-if-as-identifier.stderr
index a72030b..086a777 100644
--- a/src/test/ui/parser/keyword-if-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-if-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#if = "foo";
- | ^^^^
+ | ~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-impl-as-identifier.stderr b/src/test/ui/parser/keyword-impl-as-identifier.stderr
index e51c60e..a7493d2 100644
--- a/src/test/ui/parser/keyword-impl-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-impl-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#impl = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-let-as-identifier.stderr b/src/test/ui/parser/keyword-let-as-identifier.stderr
index d580b45..456e06db 100644
--- a/src/test/ui/parser/keyword-let-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-let-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#let = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-loop-as-identifier.stderr b/src/test/ui/parser/keyword-loop-as-identifier.stderr
index 15c008d..c3b33af 100644
--- a/src/test/ui/parser/keyword-loop-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-loop-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#loop = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-match-as-identifier.stderr b/src/test/ui/parser/keyword-match-as-identifier.stderr
index 5ba6396..1ca80db 100644
--- a/src/test/ui/parser/keyword-match-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-match-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#match = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-mod-as-identifier.stderr b/src/test/ui/parser/keyword-mod-as-identifier.stderr
index 7fb1bda..ea161b0 100644
--- a/src/test/ui/parser/keyword-mod-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-mod-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#mod = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-move-as-identifier.stderr b/src/test/ui/parser/keyword-move-as-identifier.stderr
index 9721c88..8036cec 100644
--- a/src/test/ui/parser/keyword-move-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-move-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#move = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-override.stderr b/src/test/ui/parser/keyword-override.stderr
index 8bbc6fc..7ae669b 100644
--- a/src/test/ui/parser/keyword-override.stderr
+++ b/src/test/ui/parser/keyword-override.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#override = ();
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-pub-as-identifier.stderr b/src/test/ui/parser/keyword-pub-as-identifier.stderr
index 10ff53e..df9429a 100644
--- a/src/test/ui/parser/keyword-pub-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-pub-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#pub = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-return-as-identifier.stderr b/src/test/ui/parser/keyword-return-as-identifier.stderr
index 5b5f2b7..831f557 100644
--- a/src/test/ui/parser/keyword-return-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-return-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#return = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-static-as-identifier.stderr b/src/test/ui/parser/keyword-static-as-identifier.stderr
index 81aeb9e..d133e93 100644
--- a/src/test/ui/parser/keyword-static-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-static-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#static = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-struct-as-identifier.stderr b/src/test/ui/parser/keyword-struct-as-identifier.stderr
index 1b287b6..228ba7c 100644
--- a/src/test/ui/parser/keyword-struct-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-struct-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#struct = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-trait-as-identifier.stderr b/src/test/ui/parser/keyword-trait-as-identifier.stderr
index c3d4d61..ea90ed3 100644
--- a/src/test/ui/parser/keyword-trait-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-trait-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#trait = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr b/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr
index fcd717d..37ba0f2 100644
--- a/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr
+++ b/src/test/ui/parser/keyword-try-as-identifier-edition2018.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#try = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-type-as-identifier.stderr b/src/test/ui/parser/keyword-type-as-identifier.stderr
index dfe1958..1c49811 100644
--- a/src/test/ui/parser/keyword-type-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-type-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#type = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-typeof.stderr b/src/test/ui/parser/keyword-typeof.stderr
index 7cef6de..9fb8ac1 100644
--- a/src/test/ui/parser/keyword-typeof.stderr
+++ b/src/test/ui/parser/keyword-typeof.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#typeof = ();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-unsafe-as-identifier.stderr b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr
index d714a99..ddd1bd5 100644
--- a/src/test/ui/parser/keyword-unsafe-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-unsafe-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#unsafe = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-use-as-identifier.stderr b/src/test/ui/parser/keyword-use-as-identifier.stderr
index 30a6c5b..880afb0 100644
--- a/src/test/ui/parser/keyword-use-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-use-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#use = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-where-as-identifier.stderr b/src/test/ui/parser/keyword-where-as-identifier.stderr
index 38d734a..7b6210b 100644
--- a/src/test/ui/parser/keyword-where-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-where-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#where = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword-while-as-identifier.stderr b/src/test/ui/parser/keyword-while-as-identifier.stderr
index 22b5454..8f744c3 100644
--- a/src/test/ui/parser/keyword-while-as-identifier.stderr
+++ b/src/test/ui/parser/keyword-while-as-identifier.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#while = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/keyword.stderr b/src/test/ui/parser/keyword.stderr
index c179f4e..f7692f8 100644
--- a/src/test/ui/parser/keyword.stderr
+++ b/src/test/ui/parser/keyword.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#break {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/lex-bad-char-literals-2.stderr b/src/test/ui/parser/lex-bad-char-literals-2.stderr
index 3a545ee..c2b19a7 100644
--- a/src/test/ui/parser/lex-bad-char-literals-2.stderr
+++ b/src/test/ui/parser/lex-bad-char-literals-2.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | "nope"
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/lex-bad-char-literals-3.stderr b/src/test/ui/parser/lex-bad-char-literals-3.stderr
index ec661ee..62a5e42 100644
--- a/src/test/ui/parser/lex-bad-char-literals-3.stderr
+++ b/src/test/ui/parser/lex-bad-char-literals-3.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | static c: char = "●●";
- | ^^^^
+ | ~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-3.rs:5:20
@@ -18,7 +18,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | let ch: &str = "●●";
- | ^^^^
+ | ~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/lex-bad-char-literals-5.stderr b/src/test/ui/parser/lex-bad-char-literals-5.stderr
index 334165a..184817a 100644
--- a/src/test/ui/parser/lex-bad-char-literals-5.stderr
+++ b/src/test/ui/parser/lex-bad-char-literals-5.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | static c: char = "\x10\x10";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-5.rs:5:20
@@ -18,7 +18,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | let ch: &str = "\x10\x10";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/lex-bad-char-literals-6.stderr b/src/test/ui/parser/lex-bad-char-literals-6.stderr
index 48b8fc6..4332bde 100644
--- a/src/test/ui/parser/lex-bad-char-literals-6.stderr
+++ b/src/test/ui/parser/lex-bad-char-literals-6.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | let x: &str = "ab";
- | ^^^^
+ | ~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-6.rs:4:19
@@ -18,7 +18,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | let y: char = "cd";
- | ^^^^
+ | ~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-6.rs:6:13
@@ -29,7 +29,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | let z = "ef";
- | ^^^^
+ | ~~~~
error[E0277]: can't compare `&str` with `char`
--> $DIR/lex-bad-char-literals-6.rs:9:10
diff --git a/src/test/ui/parser/lifetime-in-pattern.stderr b/src/test/ui/parser/lifetime-in-pattern.stderr
index 4ffee65..bf73595 100644
--- a/src/test/ui/parser/lifetime-in-pattern.stderr
+++ b/src/test/ui/parser/lifetime-in-pattern.stderr
@@ -14,15 +14,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn test(self: &str) {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn test(str: &TypeName) {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn test(_: &str) {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/lifetime_starts_expressions.rs b/src/test/ui/parser/lifetime_starts_expressions.rs
index e009879..903b4de 100644
--- a/src/test/ui/parser/lifetime_starts_expressions.rs
+++ b/src/test/ui/parser/lifetime_starts_expressions.rs
@@ -1,13 +1,39 @@
+#![allow(unused, dead_code)]
+
fn foo() -> u32 {
return 'label: loop { break 'label 42; };
}
fn bar() -> u32 {
loop { break 'label: loop { break 'label 42; }; }
- //~^ ERROR expected identifier, found keyword `loop`
- //~| ERROR expected type, found keyword `loop`
+ //~^ ERROR: parentheses are required around this expression to avoid confusion
+ //~| HELP: wrap the expression in parentheses
+}
+
+fn baz() -> u32 {
+ 'label: loop {
+ break 'label
+ //~^ WARNING: this labeled break expression is easy to confuse with an unlabeled break
+ loop { break 42; };
+ //~^ HELP: wrap this expression in parentheses
+ };
+
+ 'label2: loop {
+ break 'label2 'inner: loop { break 42; };
+ // no warnings or errors here
+ }
}
pub fn main() {
- foo();
+ // Regression test for issue #86948, as resolved in #87026:
+ let a = 'first_loop: loop {
+ break 'first_loop 1;
+ };
+ let b = loop {
+ break 'inner_loop: loop {
+ //~^ ERROR: parentheses are required around this expression to avoid confusion
+ //~| HELP: wrap the expression in parentheses
+ break 'inner_loop 1;
+ };
+ };
}
diff --git a/src/test/ui/parser/lifetime_starts_expressions.stderr b/src/test/ui/parser/lifetime_starts_expressions.stderr
index 7275841..82e2743 100644
--- a/src/test/ui/parser/lifetime_starts_expressions.stderr
+++ b/src/test/ui/parser/lifetime_starts_expressions.stderr
@@ -1,23 +1,47 @@
-error: expected identifier, found keyword `loop`
- --> $DIR/lifetime_starts_expressions.rs:6:26
+error: parentheses are required around this expression to avoid confusion with a labeled break expression
+ --> $DIR/lifetime_starts_expressions.rs:8:18
|
LL | loop { break 'label: loop { break 'label 42; }; }
- | ^^^^ expected identifier, found keyword
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-help: you can escape reserved keywords to use them as identifiers
+help: wrap the expression in parentheses
|
-LL | loop { break 'label: r#loop { break 'label 42; }; }
- | ^^^^^^
+LL | loop { break ('label: loop { break 'label 42; }); }
+ | + +
-error: expected type, found keyword `loop`
- --> $DIR/lifetime_starts_expressions.rs:6:26
+error: parentheses are required around this expression to avoid confusion with a labeled break expression
+ --> $DIR/lifetime_starts_expressions.rs:33:15
|
-LL | loop { break 'label: loop { break 'label 42; }; }
- | - ^^^^ expected type
- | |
- | help: maybe write a path separator here: `::`
+LL | break 'inner_loop: loop {
+ | _______________^
+LL | |
+LL | |
+LL | | break 'inner_loop 1;
+LL | | };
+ | |_________^
|
- = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
+help: wrap the expression in parentheses
+ |
+LL ~ break ('inner_loop: loop {
+LL |
+LL |
+LL | break 'inner_loop 1;
+LL ~ });
+ |
-error: aborting due to 2 previous errors
+warning: this labeled break expression is easy to confuse with an unlabeled break with a labeled value expression
+ --> $DIR/lifetime_starts_expressions.rs:15:9
+ |
+LL | / break 'label
+LL | |
+LL | | loop { break 42; };
+ | |______________________________^
+ |
+ = note: `#[warn(break_with_label_and_loop)]` on by default
+help: wrap this expression in parentheses
+ |
+LL | (loop { break 42; });
+ | + +
+
+error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/src/test/ui/parser/macro-keyword.stderr b/src/test/ui/parser/macro-keyword.stderr
index 9fe95c3..22f3ccd 100644
--- a/src/test/ui/parser/macro-keyword.stderr
+++ b/src/test/ui/parser/macro-keyword.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | fn r#macro() {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/macro-mismatched-delim-brace-paren.stderr b/src/test/ui/parser/macro-mismatched-delim-brace-paren.stderr
index 93c5ab3..077d318 100644
--- a/src/test/ui/parser/macro-mismatched-delim-brace-paren.stderr
+++ b/src/test/ui/parser/macro-mismatched-delim-brace-paren.stderr
@@ -1,8 +1,8 @@
error: mismatched closing delimiter: `)`
- --> $DIR/macro-mismatched-delim-brace-paren.rs:6:5
+ --> $DIR/macro-mismatched-delim-brace-paren.rs:4:10
|
LL | foo! {
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL | bar, "baz", 1, 2.0
LL | )
| ^ mismatched closing delimiter
diff --git a/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr b/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr
index 424c7a6..967a3e6 100644
--- a/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr
+++ b/src/test/ui/parser/macro-mismatched-delim-paren-brace.stderr
@@ -10,10 +10,10 @@
| ^ unexpected closing delimiter
error: mismatched closing delimiter: `}`
- --> $DIR/macro-mismatched-delim-paren-brace.rs:4:5
+ --> $DIR/macro-mismatched-delim-paren-brace.rs:2:10
|
LL | foo! (
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL | bar, "baz", 1, 2.0
LL | }
| ^ mismatched closing delimiter
diff --git a/src/test/ui/parser/macro/issue-37234.stderr b/src/test/ui/parser/macro/issue-37234.stderr
index f0ec79e..8d9636d 100644
--- a/src/test/ui/parser/macro/issue-37234.stderr
+++ b/src/test/ui/parser/macro/issue-37234.stderr
@@ -1,8 +1,8 @@
-error: expected one of `.`, `;`, `?`, or an operator, found `""`
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found `""`
--> $DIR/issue-37234.rs:3:19
|
LL | let x = 5 "";
- | ^^ expected one of `.`, `;`, `?`, or an operator
+ | ^^ expected one of `.`, `;`, `?`, `else`, or an operator
...
LL | failed!();
| ---------- in this macro invocation
diff --git a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr
index caca84f..876bfd38 100644
--- a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr
+++ b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr
@@ -12,7 +12,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0224]: at least one trait is required for an object type
--> $DIR/trait-object-macro-matcher.rs:11:8
diff --git a/src/test/ui/parser/macros-no-semicolon-items.stderr b/src/test/ui/parser/macros-no-semicolon-items.stderr
index f9019b78..6d2431c 100644
--- a/src/test/ui/parser/macros-no-semicolon-items.stderr
+++ b/src/test/ui/parser/macros-no-semicolon-items.stderr
@@ -7,11 +7,11 @@
help: change the delimiters to curly braces
|
LL | macro_rules! foo{}
- | ^^
+ | ~~
help: add a semicolon
|
LL | macro_rules! foo();
- | ^
+ | +
error: macros that expand to items must be delimited with braces or followed by a semicolon
--> $DIR/macros-no-semicolon-items.rs:8:5
@@ -26,16 +26,16 @@
|
help: change the delimiters to curly braces
|
-LL | bar!{
+LL ~ bar!{
LL | blah
LL | blah
LL | blah
-LL | }
+LL + }
|
help: add a semicolon
|
LL | );
- | ^
+ | +
error: unexpected end of macro invocation
--> $DIR/macros-no-semicolon-items.rs:1:1
diff --git a/src/test/ui/parser/macros-no-semicolon.rs b/src/test/ui/parser/macros-no-semicolon.rs
index fd79fa8..24d1ae9 100644
--- a/src/test/ui/parser/macros-no-semicolon.rs
+++ b/src/test/ui/parser/macros-no-semicolon.rs
@@ -1,5 +1,5 @@
fn main() {
- assert_eq!(1, 2)
- assert_eq!(3, 4) //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq`
+ assert_eq!(1, 2) //~ ERROR: expected `;`
+ assert_eq!(3, 4) //~ ERROR: expected `;`
println!("hello");
}
diff --git a/src/test/ui/parser/macros-no-semicolon.stderr b/src/test/ui/parser/macros-no-semicolon.stderr
index 9492191..f310662 100644
--- a/src/test/ui/parser/macros-no-semicolon.stderr
+++ b/src/test/ui/parser/macros-no-semicolon.stderr
@@ -1,10 +1,18 @@
-error: expected one of `.`, `;`, `?`, `}`, or an operator, found `assert_eq`
- --> $DIR/macros-no-semicolon.rs:3:5
+error: expected `;`, found `assert_eq`
+ --> $DIR/macros-no-semicolon.rs:2:21
|
LL | assert_eq!(1, 2)
- | - expected one of `.`, `;`, `?`, `}`, or an operator
+ | ^ help: add `;` here
LL | assert_eq!(3, 4)
- | ^^^^^^^^^ unexpected token
+ | --------- unexpected token
-error: aborting due to previous error
+error: expected `;`, found `println`
+ --> $DIR/macros-no-semicolon.rs:3:21
+ |
+LL | assert_eq!(3, 4)
+ | ^ help: add `;` here
+LL | println!("hello");
+ | ------- unexpected token
+
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/match-arm-without-braces.stderr b/src/test/ui/parser/match-arm-without-braces.stderr
index 03ae351..4831d79 100644
--- a/src/test/ui/parser/match-arm-without-braces.stderr
+++ b/src/test/ui/parser/match-arm-without-braces.stderr
@@ -18,8 +18,8 @@
|
help: surround the statements with a body
|
-LL | { 7;
-LL | 8; }
+LL ~ { 7;
+LL ~ 8; }
|
error: `match` arm body without braces
@@ -33,8 +33,8 @@
|
help: surround the statements with a body
|
-LL | { 11;
-LL | 12; }
+LL ~ { 11;
+LL ~ 12; }
|
error: `match` arm body without braces
@@ -48,8 +48,8 @@
|
help: surround the statements with a body
|
-LL | { 14;
-LL | 15; }
+LL ~ { 14;
+LL ~ 15; }
|
error: expected one of `,`, `.`, `?`, `}`, or an operator, found reserved identifier `_`
@@ -73,8 +73,8 @@
|
help: surround the statements with a body
|
-LL | { 20;
-LL | 21 }
+LL ~ { 20;
+LL ~ 21 }
|
error: `match` arm body without braces
@@ -88,8 +88,8 @@
|
help: surround the statements with a body
|
-LL | { 24;
-LL | 25 }
+LL ~ { 24;
+LL ~ 25 }
|
error: `match` arm body without braces
@@ -103,8 +103,8 @@
|
help: surround the statements with a body
|
-LL | { 27;
-LL | 28 }
+LL ~ { 27;
+LL ~ 28 }
|
error: expected one of `,`, `.`, `?`, `}`, or an operator, found `;`
diff --git a/src/test/ui/parser/match-arrows-block-then-binop.stderr b/src/test/ui/parser/match-arrows-block-then-binop.stderr
index 3bc451e..cb361a3 100644
--- a/src/test/ui/parser/match-arrows-block-then-binop.stderr
+++ b/src/test/ui/parser/match-arrows-block-then-binop.stderr
@@ -6,9 +6,9 @@
|
help: parentheses are required to parse this as an expression
|
-LL | 0 => ({
+LL ~ 0 => ({
LL | 0
-LL | }) + 5
+LL ~ }) + 5
|
error: aborting due to previous error
diff --git a/src/test/ui/parser/mbe_missing_right_paren.stderr b/src/test/ui/parser/mbe_missing_right_paren.stderr
index ec04b93..ccaf77d 100644
--- a/src/test/ui/parser/mbe_missing_right_paren.stderr
+++ b/src/test/ui/parser/mbe_missing_right_paren.stderr
@@ -15,11 +15,11 @@
help: change the delimiters to curly braces
|
LL | macro_rules! abc { /* items */ }
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: add a semicolon
|
LL | macro_rules! abc(ؼ;
- | ^
+ | +
error: unexpected end of macro invocation
--> $DIR/mbe_missing_right_paren.rs:3:19
diff --git a/src/test/ui/parser/missing-semicolon.rs b/src/test/ui/parser/missing-semicolon.rs
index a24dfa7..f68d177 100644
--- a/src/test/ui/parser/missing-semicolon.rs
+++ b/src/test/ui/parser/missing-semicolon.rs
@@ -1,6 +1,6 @@
macro_rules! m {
($($e1:expr),*; $($e2:expr),*) => {
- $( let x = $e1 )*; //~ ERROR expected one of `.`, `;`, `?`, or
+ $( let x = $e1 )*; //~ ERROR expected one of `.`, `;`, `?`, `else`, or
$( println!("{}", $e2) )*;
}
}
diff --git a/src/test/ui/parser/missing-semicolon.stderr b/src/test/ui/parser/missing-semicolon.stderr
index 68f0f44..72f76b6 100644
--- a/src/test/ui/parser/missing-semicolon.stderr
+++ b/src/test/ui/parser/missing-semicolon.stderr
@@ -1,8 +1,8 @@
-error: expected one of `.`, `;`, `?`, or an operator, found keyword `let`
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found keyword `let`
--> $DIR/missing-semicolon.rs:3:12
|
LL | $( let x = $e1 )*;
- | ^^^ expected one of `.`, `;`, `?`, or an operator
+ | ^^^ expected one of `.`, `;`, `?`, `else`, or an operator
...
LL | fn main() { m!(0, 0; 0, 0); }
| --------------- in this macro invocation
diff --git a/src/test/ui/parser/mut-patterns.stderr b/src/test/ui/parser/mut-patterns.stderr
index 88a77ad..bfa443a 100644
--- a/src/test/ui/parser/mut-patterns.stderr
+++ b/src/test/ui/parser/mut-patterns.stderr
@@ -59,7 +59,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut mut r#yield(become, await) = r#yield(0, 0);
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found reserved keyword `become`
--> $DIR/mut-patterns.rs:28:23
@@ -70,7 +70,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut mut yield(r#become, await) = r#yield(0, 0);
- | ^^^^^^^^
+ | ~~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/mut-patterns.rs:28:31
@@ -81,7 +81,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut mut yield(become, r#await) = r#yield(0, 0);
- | ^^^^^^^
+ | ~~~~~~~
error: `mut` must be attached to each individual binding
--> $DIR/mut-patterns.rs:28:9
diff --git a/src/test/ui/parser/new-unicode-escapes-1.stderr b/src/test/ui/parser/new-unicode-escapes-1.stderr
index 1ffdc04..d133e46 100644
--- a/src/test/ui/parser/new-unicode-escapes-1.stderr
+++ b/src/test/ui/parser/new-unicode-escapes-1.stderr
@@ -7,7 +7,7 @@
help: terminate the unicode escape
|
LL | let s = "\u{2603}";
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/parser/no-const-fn-in-extern-block.stderr b/src/test/ui/parser/no-const-fn-in-extern-block.stderr
index 04fc8c8..4ac0e26 100644
--- a/src/test/ui/parser/no-const-fn-in-extern-block.stderr
+++ b/src/test/ui/parser/no-const-fn-in-extern-block.stderr
@@ -9,7 +9,7 @@
help: remove the qualifiers
|
LL | fn foo();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/no-const-fn-in-extern-block.rs:4:21
@@ -23,7 +23,7 @@
help: remove the qualifiers
|
LL | fn bar();
- | ^^
+ | ~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/omitted-arg-in-item-fn.stderr b/src/test/ui/parser/omitted-arg-in-item-fn.stderr
index bc3329d..329fa87 100644
--- a/src/test/ui/parser/omitted-arg-in-item-fn.stderr
+++ b/src/test/ui/parser/omitted-arg-in-item-fn.stderr
@@ -8,15 +8,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: x) {
- | ^^^^^^^
+ | ~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo(x: TypeName) {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(_: x) {
- | ^^^^
+ | ~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/parser-recovery-2.stderr b/src/test/ui/parser/parser-recovery-2.stderr
index cd3da4c..0980d03 100644
--- a/src/test/ui/parser/parser-recovery-2.stderr
+++ b/src/test/ui/parser/parser-recovery-2.stderr
@@ -5,10 +5,10 @@
| ^
error: mismatched closing delimiter: `)`
- --> $DIR/parser-recovery-2.rs:6:5
+ --> $DIR/parser-recovery-2.rs:4:14
|
LL | fn bar() {
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL | let x = foo();
LL | )
| ^ mismatched closing delimiter
diff --git a/src/test/ui/parser/pat-lt-bracket-2.stderr b/src/test/ui/parser/pat-lt-bracket-2.stderr
index 6db9a4a..762733c 100644
--- a/src/test/ui/parser/pat-lt-bracket-2.stderr
+++ b/src/test/ui/parser/pat-lt-bracket-2.stderr
@@ -8,11 +8,11 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn a(self: B<) {}
- | ^^^^^^^
+ | ~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn a(_: B<) {}
- | ^^^^
+ | ~~~~
error: aborting due to previous error
diff --git a/src/test/ui/parser/range-3.rs b/src/test/ui/parser/range-3.rs
index 931839f..2c917a2 100644
--- a/src/test/ui/parser/range-3.rs
+++ b/src/test/ui/parser/range-3.rs
@@ -2,5 +2,5 @@
pub fn main() {
let r = 1..2..3;
- //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
+ //~^ ERROR expected one of `.`, `;`, `?`, `else`, or an operator, found `..`
}
diff --git a/src/test/ui/parser/range-3.stderr b/src/test/ui/parser/range-3.stderr
index f866ea5..340167f 100644
--- a/src/test/ui/parser/range-3.stderr
+++ b/src/test/ui/parser/range-3.stderr
@@ -1,8 +1,8 @@
-error: expected one of `.`, `;`, `?`, or an operator, found `..`
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found `..`
--> $DIR/range-3.rs:4:17
|
LL | let r = 1..2..3;
- | ^^ expected one of `.`, `;`, `?`, or an operator
+ | ^^ expected one of `.`, `;`, `?`, `else`, or an operator
error: aborting due to previous error
diff --git a/src/test/ui/parser/range-4.rs b/src/test/ui/parser/range-4.rs
index 20af956..c970c96 100644
--- a/src/test/ui/parser/range-4.rs
+++ b/src/test/ui/parser/range-4.rs
@@ -2,5 +2,5 @@
pub fn main() {
let r = ..1..2;
- //~^ ERROR expected one of `.`, `;`, `?`, or an operator, found `..`
+ //~^ ERROR expected one of `.`, `;`, `?`, `else`, or an operator, found `..`
}
diff --git a/src/test/ui/parser/range-4.stderr b/src/test/ui/parser/range-4.stderr
index dcb8517..720d489 100644
--- a/src/test/ui/parser/range-4.stderr
+++ b/src/test/ui/parser/range-4.stderr
@@ -1,8 +1,8 @@
-error: expected one of `.`, `;`, `?`, or an operator, found `..`
+error: expected one of `.`, `;`, `?`, `else`, or an operator, found `..`
--> $DIR/range-4.rs:4:16
|
LL | let r = ..1..2;
- | ^^ expected one of `.`, `;`, `?`, or an operator
+ | ^^ expected one of `.`, `;`, `?`, `else`, or an operator
error: aborting due to previous error
diff --git a/src/test/ui/parser/range_inclusive_dotdotdot.stderr b/src/test/ui/parser/range_inclusive_dotdotdot.stderr
index f129e1e..2dc2c87 100644
--- a/src/test/ui/parser/range_inclusive_dotdotdot.stderr
+++ b/src/test/ui/parser/range_inclusive_dotdotdot.stderr
@@ -7,11 +7,11 @@
help: use `..` for an exclusive range
|
LL | return ..1;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | return ..=1;
- | ^^^
+ | ~~~
error: unexpected token: `...`
--> $DIR/range_inclusive_dotdotdot.rs:12:13
@@ -22,11 +22,11 @@
help: use `..` for an exclusive range
|
LL | let x = ..0;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | let x = ..=0;
- | ^^^
+ | ~~~
error: unexpected token: `...`
--> $DIR/range_inclusive_dotdotdot.rs:16:14
@@ -37,11 +37,11 @@
help: use `..` for an exclusive range
|
LL | let x = 5..5;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | let x = 5..=5;
- | ^^^
+ | ~~~
error: unexpected token: `...`
--> $DIR/range_inclusive_dotdotdot.rs:20:15
@@ -52,11 +52,11 @@
help: use `..` for an exclusive range
|
LL | for _ in 0..1 {}
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | for _ in 0..=1 {}
- | ^^^
+ | ~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/parser/recover-assoc-eq-missing-term.stderr b/src/test/ui/parser/recover-assoc-eq-missing-term.stderr
index 6e41e13..f3ed77c 100644
--- a/src/test/ui/parser/recover-assoc-eq-missing-term.stderr
+++ b/src/test/ui/parser/recover-assoc-eq-missing-term.stderr
@@ -7,11 +7,12 @@
help: to constrain the associated type, add a type after `=`
|
LL | bar::<Item = TheType>();
- | ^^^^^^^
+ | +++++++
help: remove the `=` if `Item` is a type
|
-LL | bar::<Item >();
- | --
+LL - bar::<Item = >();
+LL + bar::<Item >();
+ |
error: aborting due to previous error
diff --git a/src/test/ui/parser/recover-from-bad-variant.stderr b/src/test/ui/parser/recover-from-bad-variant.stderr
index 9b9d2bc..61ea369 100644
--- a/src/test/ui/parser/recover-from-bad-variant.stderr
+++ b/src/test/ui/parser/recover-from-bad-variant.stderr
@@ -27,7 +27,7 @@
help: use the tuple variant pattern syntax instead
|
LL | Enum::Bar(a, b) => {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/parser/recover-from-homoglyph.stderr b/src/test/ui/parser/recover-from-homoglyph.stderr
index c807931..f11ca9f 100644
--- a/src/test/ui/parser/recover-from-homoglyph.stderr
+++ b/src/test/ui/parser/recover-from-homoglyph.stderr
@@ -7,7 +7,7 @@
help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
|
LL | println!("");
- | ^
+ | ~
error[E0308]: mismatched types
--> $DIR/recover-from-homoglyph.rs:3:20
diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr
index 2d80884..7620668 100644
--- a/src/test/ui/parser/recover-range-pats.stderr
+++ b/src/test/ui/parser/recover-range-pats.stderr
@@ -205,7 +205,7 @@
LL | #![deny(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:45:13
@@ -214,7 +214,7 @@
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:48:13
@@ -223,7 +223,7 @@
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:51:13
@@ -232,7 +232,7 @@
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:54:16
@@ -241,7 +241,7 @@
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:57:13
@@ -250,7 +250,7 @@
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:60:14
@@ -259,7 +259,7 @@
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:64:13
@@ -268,7 +268,7 @@
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:138:20
@@ -280,7 +280,7 @@
| ------------ in this macro invocation
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0029]: only `char` and numeric types are allowed in range patterns
diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr
index afb964c..74429cb 100644
--- a/src/test/ui/parser/require-parens-for-chained-comparison.stderr
+++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr
@@ -7,7 +7,7 @@
help: split the comparison into two
|
LL | false == false && false == false;
- | ^^^^^^^^
+ | ++++++++
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:9:11
@@ -18,7 +18,7 @@
help: parenthesize the comparison
|
LL | false == (0 < 2);
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:13:6
@@ -29,7 +29,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | f::<X>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:17:6
@@ -40,7 +40,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | f::<Result<Option<X>, Option<Option<X>>>(1, 2);
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:22:21
diff --git a/src/test/ui/parser/struct-literal-in-for.stderr b/src/test/ui/parser/struct-literal-in-for.stderr
index 5c22943..feabd8f 100644
--- a/src/test/ui/parser/struct-literal-in-for.stderr
+++ b/src/test/ui/parser/struct-literal-in-for.stderr
@@ -9,9 +9,9 @@
|
help: surround the struct literal with parentheses
|
-LL | for x in (Foo {
+LL ~ for x in (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error[E0277]: `bool` is not an iterator
diff --git a/src/test/ui/parser/struct-literal-in-if.stderr b/src/test/ui/parser/struct-literal-in-if.stderr
index 7a64a42..b5a9864 100644
--- a/src/test/ui/parser/struct-literal-in-if.stderr
+++ b/src/test/ui/parser/struct-literal-in-if.stderr
@@ -9,9 +9,9 @@
|
help: surround the struct literal with parentheses
|
-LL | if (Foo {
+LL ~ if (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error: aborting due to previous error
diff --git a/src/test/ui/parser/struct-literal-in-match-discriminant.stderr b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr
index 9807776..692b4d7 100644
--- a/src/test/ui/parser/struct-literal-in-match-discriminant.stderr
+++ b/src/test/ui/parser/struct-literal-in-match-discriminant.stderr
@@ -9,9 +9,9 @@
|
help: surround the struct literal with parentheses
|
-LL | match (Foo {
+LL ~ match (Foo {
LL | x: 3
-LL | }) {
+LL ~ }) {
|
error: aborting due to previous error
diff --git a/src/test/ui/parser/struct-literal-in-while.stderr b/src/test/ui/parser/struct-literal-in-while.stderr
index a14df3a..17e9277 100644
--- a/src/test/ui/parser/struct-literal-in-while.stderr
+++ b/src/test/ui/parser/struct-literal-in-while.stderr
@@ -9,9 +9,9 @@
|
help: surround the struct literal with parentheses
|
-LL | while (Foo {
+LL ~ while (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error: aborting due to previous error
diff --git a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr
index d12ea0b..b948ab2 100644
--- a/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr
+++ b/src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr
@@ -9,9 +9,9 @@
|
help: surround the struct literal with parentheses
|
-LL | while || (Foo {
+LL ~ while || (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error[E0308]: mismatched types
diff --git a/src/test/ui/parser/struct-literal-variant-in-if.stderr b/src/test/ui/parser/struct-literal-variant-in-if.stderr
index 3ea5ca5..4cffbe4 100644
--- a/src/test/ui/parser/struct-literal-variant-in-if.stderr
+++ b/src/test/ui/parser/struct-literal-variant-in-if.stderr
@@ -7,7 +7,7 @@
help: surround the struct literal with parentheses
|
LL | if x == (E::I { field1: true, field2: 42 }) {}
- | ^ ^
+ | + +
error: struct literals are not allowed here
--> $DIR/struct-literal-variant-in-if.rs:15:13
@@ -18,7 +18,7 @@
help: surround the struct literal with parentheses
|
LL | if x == (E::V { field: false }) {}
- | ^ ^
+ | + +
error: struct literals are not allowed here
--> $DIR/struct-literal-variant-in-if.rs:17:13
@@ -29,7 +29,7 @@
help: surround the struct literal with parentheses
|
LL | if x == (E::J { field: -42 }) {}
- | ^ ^
+ | + +
error: struct literals are not allowed here
--> $DIR/struct-literal-variant-in-if.rs:19:13
@@ -40,7 +40,7 @@
help: surround the struct literal with parentheses
|
LL | if x == (E::K { field: "" }) {}
- | ^ ^
+ | + +
error[E0423]: expected value, found struct variant `E::V`
--> $DIR/struct-literal-variant-in-if.rs:10:13
@@ -51,7 +51,7 @@
help: surround the struct literal with parentheses
|
LL | if x == (E::V { field }) {}
- | ^ ^
+ | + +
error[E0308]: mismatched types
--> $DIR/struct-literal-variant-in-if.rs:10:20
diff --git a/src/test/ui/parser/trait-object-delimiters.rs b/src/test/ui/parser/trait-object-delimiters.rs
index 650ab57..b5258ee 100644
--- a/src/test/ui/parser/trait-object-delimiters.rs
+++ b/src/test/ui/parser/trait-object-delimiters.rs
@@ -6,7 +6,7 @@
fn foo2(_: &dyn (Drop + AsRef<str>)) {} //~ ERROR incorrect braces around trait bounds
fn foo3(_: &dyn {Drop + AsRef<str>}) {} //~ ERROR expected parameter name, found `{`
-//~^ ERROR expected one of `!`, `(`, `)`, `,`, `?`, `for`, lifetime, or path, found `{`
+//~^ ERROR expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
//~| ERROR at least one trait is required for an object type
fn foo4(_: &dyn <Drop + AsRef<str>>) {} //~ ERROR expected identifier, found `<`
diff --git a/src/test/ui/parser/trait-object-delimiters.stderr b/src/test/ui/parser/trait-object-delimiters.stderr
index 18b1b24..ee638d8 100644
--- a/src/test/ui/parser/trait-object-delimiters.stderr
+++ b/src/test/ui/parser/trait-object-delimiters.stderr
@@ -12,8 +12,9 @@
|
help: remove the parentheses
|
-LL | fn foo2(_: &dyn Drop + AsRef<str>) {}
- | -- --
+LL - fn foo2(_: &dyn (Drop + AsRef<str>)) {}
+LL + fn foo2(_: &dyn Drop + AsRef<str>) {}
+ |
error: expected parameter name, found `{`
--> $DIR/trait-object-delimiters.rs:8:17
@@ -21,11 +22,11 @@
LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
| ^ expected parameter name
-error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, lifetime, or path, found `{`
+error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
--> $DIR/trait-object-delimiters.rs:8:17
|
LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
- | -^ expected one of 8 possible tokens
+ | -^ expected one of 9 possible tokens
| |
| help: missing `,`
diff --git a/src/test/ui/parser/trait-object-trait-parens.stderr b/src/test/ui/parser/trait-object-trait-parens.stderr
index 9bfc494..b39fe46 100644
--- a/src/test/ui/parser/trait-object-trait-parens.stderr
+++ b/src/test/ui/parser/trait-object-trait-parens.stderr
@@ -24,7 +24,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/trait-object-trait-parens.rs:13:16
@@ -33,7 +33,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn ?Sized + (for<'a> Trait<'a>) + (Obj)`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/trait-object-trait-parens.rs:18:16
@@ -42,7 +42,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn for<'a> Trait<'a> + (Obj) + (?Sized)`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/trait-object-trait-parens.rs:8:35
diff --git a/src/test/ui/parser/unclosed-delimiter-in-dep.stderr b/src/test/ui/parser/unclosed-delimiter-in-dep.stderr
index 00861a5..1366ef1 100644
--- a/src/test/ui/parser/unclosed-delimiter-in-dep.stderr
+++ b/src/test/ui/parser/unclosed-delimiter-in-dep.stderr
@@ -1,10 +1,10 @@
error: mismatched closing delimiter: `}`
- --> $DIR/unclosed_delim_mod.rs:7:1
+ --> $DIR/unclosed_delim_mod.rs:5:7
|
LL | pub fn new() -> Result<Value, ()> {
| - closing delimiter possibly meant for this
LL | Ok(Value {
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL | }
LL | }
| ^ mismatched closing delimiter
diff --git a/src/test/ui/parser/unclosed_delim_mod.stderr b/src/test/ui/parser/unclosed_delim_mod.stderr
index 9c16707..a46d020 100644
--- a/src/test/ui/parser/unclosed_delim_mod.stderr
+++ b/src/test/ui/parser/unclosed_delim_mod.stderr
@@ -1,10 +1,10 @@
error: mismatched closing delimiter: `}`
- --> $DIR/unclosed_delim_mod.rs:7:1
+ --> $DIR/unclosed_delim_mod.rs:5:7
|
LL | pub fn new() -> Result<Value, ()> {
| - closing delimiter possibly meant for this
LL | Ok(Value {
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL | }
LL | }
| ^ mismatched closing delimiter
diff --git a/src/test/ui/parser/unicode-chars.stderr b/src/test/ui/parser/unicode-chars.stderr
index 4e14eda..0cfe924 100644
--- a/src/test/ui/parser/unicode-chars.stderr
+++ b/src/test/ui/parser/unicode-chars.stderr
@@ -7,7 +7,7 @@
help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
|
LL | let y = 0;
- | ^
+ | ~
error: aborting due to previous error
diff --git a/src/test/ui/parser/unicode-quote-chars.stderr b/src/test/ui/parser/unicode-quote-chars.stderr
index 04ea0c6..092abeb 100644
--- a/src/test/ui/parser/unicode-quote-chars.stderr
+++ b/src/test/ui/parser/unicode-quote-chars.stderr
@@ -7,7 +7,7 @@
help: Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '"' (Quotation Mark), but are not
|
LL | println!("hello world");
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: unknown start of token: \u{201d}
--> $DIR/unicode-quote-chars.rs:2:26
@@ -18,7 +18,7 @@
help: Unicode character '”' (Right Double Quotation Mark) looks like '"' (Quotation Mark), but it is not
|
LL | println!(“hello world");
- | ^
+ | ~
error: expected `,`, found `world`
--> $DIR/unicode-quote-chars.rs:2:21
diff --git a/src/test/ui/parser/use-unclosed-brace.stderr b/src/test/ui/parser/use-unclosed-brace.stderr
index d29a68f..438fe9c 100644
--- a/src/test/ui/parser/use-unclosed-brace.stderr
+++ b/src/test/ui/parser/use-unclosed-brace.stderr
@@ -8,10 +8,10 @@
| ^
error: expected one of `,`, `::`, `as`, or `}`, found `;`
- --> $DIR/use-unclosed-brace.rs:4:19
+ --> $DIR/use-unclosed-brace.rs:4:10
|
LL | use foo::{bar, baz;
- | - ^
+ | ^ ^
| | |
| | expected one of `,`, `::`, `as`, or `}`
| | help: `}` may belong here
diff --git a/src/test/ui/partialeq_help.stderr b/src/test/ui/partialeq_help.stderr
index e14e17c..528306b 100644
--- a/src/test/ui/partialeq_help.stderr
+++ b/src/test/ui/partialeq_help.stderr
@@ -8,7 +8,7 @@
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn foo<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs b/src/test/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs
new file mode 100644
index 0000000..f7373c4
--- /dev/null
+++ b/src/test/ui/pattern/auxiliary/declarations-for-tuple-field-count-errors.rs
@@ -0,0 +1,20 @@
+pub struct Z0;
+pub struct Z1();
+
+pub struct S(pub u8, pub u8, pub u8);
+pub struct M(
+ pub u8,
+ pub u8,
+ pub u8,
+);
+
+pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+
+pub enum E2 {
+ S(u8, u8, u8),
+ M(
+ u8,
+ u8,
+ u8,
+ ),
+}
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-copy.rs b/src/test/ui/pattern/bindings-after-at/bind-by-copy.rs
index 508e486..2b349f0 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-copy.rs
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-copy.rs
@@ -2,8 +2,6 @@
// Test copy
-#![feature(bindings_after_at)]
-
struct A { a: i32, b: i32 }
struct B { a: i32, b: C }
struct D { a: i32, d: C }
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs
index 71503ec..9d1f08d 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.rs
@@ -2,8 +2,6 @@
// It checks that you cannot use an AND-pattern (`binding @ pat`)
// where one side is by-ref and the other is by-move.
-#![feature(bindings_after_at)]
-
struct X {
x: (),
}
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
index e50ae3e..4249a74 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
@@ -1,5 +1,5 @@
error: cannot move out of value because it is borrowed
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:14:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:12:14
|
LL | Some(ref _y @ _z) => {}
| ------^^^--
@@ -8,7 +8,7 @@
| value borrowed, by `_y`, here
error: borrow of moved value
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:21:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:19:14
|
LL | Some(_z @ ref _y) => {}
| --^^^------
@@ -18,7 +18,7 @@
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
error: cannot move out of value because it is borrowed
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:28:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:26:14
|
LL | Some(ref mut _y @ _z) => {}
| ----------^^^--
@@ -27,7 +27,7 @@
| value borrowed, by `_y`, here
error: borrow of moved value
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:35:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:33:14
|
LL | Some(_z @ ref mut _y) => {}
| --^^^----------
@@ -37,7 +37,7 @@
| move occurs because `_z` has type `X` which does not implement the `Copy` trait
error[E0382]: borrow of moved value
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:14:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:12:14
|
LL | Some(ref _y @ _z) => {}
| ^^^^^^^^^--
@@ -49,10 +49,10 @@
help: borrow this field in the pattern to avoid moving `x.0`
|
LL | Some(ref _y @ ref _z) => {}
- | ^^^
+ | +++
error[E0382]: borrow of moved value
- --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:28:14
+ --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:26:14
|
LL | Some(ref mut _y @ _z) => {}
| ^^^^^^^^^^^^^--
@@ -64,7 +64,7 @@
help: borrow this field in the pattern to avoid moving `x.0`
|
LL | Some(ref mut _y @ ref _z) => {}
- | ^^^
+ | +++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs b/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs
index 08240db..1816a74 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.rs
@@ -1,7 +1,5 @@
// See issue #12534.
-#![feature(bindings_after_at)]
-
fn main() {}
struct A(Box<u8>);
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr b/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
index a77b866..ee0885a 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
@@ -1,5 +1,5 @@
error[E0382]: use of partially moved value
- --> $DIR/bind-by-move-no-subbindings-fun-param.rs:9:6
+ --> $DIR/bind-by-move-no-subbindings-fun-param.rs:7:6
|
LL | fn f(a @ A(u): A) -> Box<u8> {
| ^^^^^^-^
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs
index bce43f9..a61d682 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.rs
@@ -1,7 +1,5 @@
// Test that moving on both sides of an `@` pattern is not allowed.
-#![feature(bindings_after_at)]
-
fn main() {
struct U; // Not copy!
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
index ff8183e..8e00bf5 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
@@ -1,5 +1,5 @@
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:13:9
+ --> $DIR/borrowck-move-and-move.rs:11:9
|
LL | let a @ b = U;
| ^^^^- - move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -8,7 +8,7 @@
| value used here after move
error[E0382]: use of partially moved value
- --> $DIR/borrowck-move-and-move.rs:15:9
+ --> $DIR/borrowck-move-and-move.rs:13:9
|
LL | let a @ (b, c) = (U, U);
| ^^^^^^^^-^
@@ -19,7 +19,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: use of partially moved value
- --> $DIR/borrowck-move-and-move.rs:17:9
+ --> $DIR/borrowck-move-and-move.rs:15:9
|
LL | let a @ (b, c) = (u(), u());
| ^^^^^^^^-^
@@ -30,7 +30,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:20:16
+ --> $DIR/borrowck-move-and-move.rs:18:16
|
LL | match Ok(U) {
| ----- move occurs because value has type `Result<U, U>`, which does not implement the `Copy` trait
@@ -41,7 +41,7 @@
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:20:29
+ --> $DIR/borrowck-move-and-move.rs:18:29
|
LL | match Ok(U) {
| ----- move occurs because value has type `Result<U, U>`, which does not implement the `Copy` trait
@@ -52,7 +52,7 @@
| value moved here
error[E0382]: use of partially moved value
- --> $DIR/borrowck-move-and-move.rs:27:9
+ --> $DIR/borrowck-move-and-move.rs:25:9
|
LL | xs @ [a, .., b] => {}
| ^^^^^^^^^^^^^-^
@@ -63,7 +63,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: use of partially moved value
- --> $DIR/borrowck-move-and-move.rs:31:9
+ --> $DIR/borrowck-move-and-move.rs:29:9
|
LL | xs @ [_, ys @ .., _] => {}
| ^^^^^^^^^-------^^^^
@@ -74,7 +74,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: use of moved value
- --> $DIR/borrowck-move-and-move.rs:24:12
+ --> $DIR/borrowck-move-and-move.rs:22:12
|
LL | fn fun(a @ b: U) {}
| ^^^^-
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs
index f1ee87b..fbdefd9 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box-pass.rs
@@ -2,7 +2,6 @@
// Test `@` patterns combined with `box` patterns.
-#![feature(bindings_after_at)]
#![feature(box_patterns)]
#[derive(Copy, Clone)]
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs
index 07fac1d..45aa65e 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.rs
@@ -1,6 +1,5 @@
// Test `@` patterns combined with `box` patterns.
-#![feature(bindings_after_at)]
#![feature(box_patterns)]
#[derive(Copy, Clone)]
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
index 83da16a..4b20488 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
@@ -1,5 +1,5 @@
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-at-and-box.rs:32:9
+ --> $DIR/borrowck-pat-at-and-box.rs:31:9
|
LL | let ref a @ box b = Box::new(NC);
| -----^^^^^^^-
@@ -8,7 +8,7 @@
| value borrowed, by `a`, here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:35:9
+ --> $DIR/borrowck-pat-at-and-box.rs:34:9
|
LL | let ref a @ box ref mut b = Box::new(nc());
| -----^^^^^^^---------
@@ -17,7 +17,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:37:9
+ --> $DIR/borrowck-pat-at-and-box.rs:36:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| -----^^^^^^^---------
@@ -26,7 +26,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:39:9
+ --> $DIR/borrowck-pat-at-and-box.rs:38:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| -----^^^^^^^---------
@@ -35,7 +35,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:43:9
+ --> $DIR/borrowck-pat-at-and-box.rs:42:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| -----^^^^^^^---------
@@ -44,7 +44,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:49:9
+ --> $DIR/borrowck-pat-at-and-box.rs:48:9
|
LL | let ref mut a @ box ref b = Box::new(NC);
| ---------^^^^^^^-----
@@ -53,7 +53,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:63:9
+ --> $DIR/borrowck-pat-at-and-box.rs:62:9
|
LL | ref mut a @ box ref b => {
| ---------^^^^^^^-----
@@ -62,7 +62,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:55:11
+ --> $DIR/borrowck-pat-at-and-box.rs:54:11
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
| ---------^^^^^^^-----
@@ -71,7 +71,7 @@
| mutable borrow, by `a`, occurs here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-at-and-box.rs:32:9
+ --> $DIR/borrowck-pat-at-and-box.rs:31:9
|
LL | let ref a @ box b = Box::new(NC);
| ^^^^^^^^^^^^-
@@ -82,7 +82,7 @@
= note: move occurs because value has type `NC`, which does not implement the `Copy` trait
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:39:9
+ --> $DIR/borrowck-pat-at-and-box.rs:38:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| ^^^^^^^^^^^^---------
@@ -94,7 +94,7 @@
| ------- mutable borrow later used here
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-at-and-box.rs:43:9
+ --> $DIR/borrowck-pat-at-and-box.rs:42:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
| ^^^^^^^^^^^^---------
@@ -106,7 +106,7 @@
| ------- mutable borrow later used here
error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:49:9
+ --> $DIR/borrowck-pat-at-and-box.rs:48:9
|
LL | let ref mut a @ box ref b = Box::new(NC);
| ^^^^^^^^^^^^^^^^-----
@@ -118,7 +118,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:63:9
+ --> $DIR/borrowck-pat-at-and-box.rs:62:9
|
LL | ref mut a @ box ref b => {
| ^^^^^^^^^^^^^^^^-----
@@ -130,7 +130,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-at-and-box.rs:55:11
+ --> $DIR/borrowck-pat-at-and-box.rs:54:11
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
| ^^^^^^^^^^^^^^^^-----
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs
index c4ce50c..0108861 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-copy-bindings-in-at.rs
@@ -2,8 +2,6 @@
// Test `Copy` bindings in the rhs of `@` patterns.
-#![feature(bindings_after_at)]
-
#[derive(Copy, Clone)]
struct C;
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs
index a22d277..82f16fc 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.rs
@@ -1,8 +1,6 @@
// Test that `by_move_binding @ pat_with_by_ref_bindings` is prevented even with promotion.
// Currently this logic exists in THIR match checking as opposed to borrowck.
-#![feature(bindings_after_at)]
-
fn main() {
struct U;
let a @ ref b = U; //~ ERROR borrow of moved value
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
index 0e09d47..be4e81c 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse-promotion.stderr
@@ -1,5 +1,5 @@
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse-promotion.rs:8:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse-promotion.rs:6:9
|
LL | let a @ ref b = U;
| -^^^-----
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs
index 8a574f8..06dc6e1 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.rs
@@ -1,7 +1,5 @@
// Test that `by_move_binding @ pat_with_by_ref_bindings` is prevented.
-#![feature(bindings_after_at)]
-
fn main() {
struct U;
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
index 79addf9..bc2c162 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
@@ -1,5 +1,5 @@
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:22:9
|
LL | let a @ ref b = U;
| -^^^-----
@@ -9,7 +9,7 @@
| move occurs because `a` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:26:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:9
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
| -^^^^^^^^^^^^---------^^^^^^-----^
@@ -20,7 +20,7 @@
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:26:14
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:14
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
| -----^^^---------
@@ -30,7 +30,7 @@
| move occurs because `b` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:26:33
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:33
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
| -^^^-----
@@ -40,7 +40,7 @@
| move occurs because `d` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:29:9
|
LL | let a @ [ref mut b, ref c] = [U, U];
| -^^^^---------^^-----^
@@ -51,7 +51,7 @@
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:31:9
|
LL | let a @ ref b = u();
| -^^^-----
@@ -61,7 +61,7 @@
| move occurs because `a` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:35:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:9
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
| -^^^^^^^^^^^^---------^^^^^^-----^
@@ -72,7 +72,7 @@
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:35:14
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:14
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
| -----^^^---------
@@ -82,7 +82,7 @@
| move occurs because `b` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:35:33
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:33
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
| -^^^-----
@@ -92,7 +92,7 @@
| move occurs because `d` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:40:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:38:9
|
LL | let a @ [ref mut b, ref c] = [u(), u()];
| -^^^^---------^^-----^
@@ -103,7 +103,7 @@
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:44:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:42:9
|
LL | a @ Some(ref b) => {}
| -^^^^^^^^-----^
@@ -113,7 +113,7 @@
| move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:49:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:47:9
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
| -^^^^^^^^^^^^^^^^^---------^^^^^^-----^^
@@ -124,7 +124,7 @@
| move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:49:19
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:47:19
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
| -----^^^---------
@@ -134,7 +134,7 @@
| move occurs because `b` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:49:38
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:47:38
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
| -^^^-----
@@ -144,7 +144,7 @@
| move occurs because `d` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:57:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:55:9
|
LL | mut a @ Some([ref b, ref mut c]) => {}
| -----^^^^^^^^^-----^^---------^^
@@ -155,7 +155,7 @@
| move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:63:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:9
|
LL | a @ Some(ref b) => {}
| -^^^^^^^^-----^
@@ -165,7 +165,7 @@
| move occurs because `a` has type `Option<U>` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:69:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:9
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
| -^^^^^^^^^^^^^^^^^---------^^^^^^-----^^
@@ -176,7 +176,7 @@
| move occurs because `a` has type `Option<(U, U)>` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:69:19
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:19
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
| -----^^^---------
@@ -186,7 +186,7 @@
| move occurs because `b` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:69:38
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:38
|
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
| -^^^-----
@@ -196,7 +196,7 @@
| move occurs because `d` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:77:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:75:9
|
LL | mut a @ Some([ref b, ref mut c]) => {}
| -----^^^^^^^^^-----^^---------^^
@@ -207,7 +207,7 @@
| move occurs because `a` has type `Option<[U; 2]>` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:13:11
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:11:11
|
LL | fn f1(a @ ref b: U) {}
| -^^^-----
@@ -217,7 +217,7 @@
| move occurs because `a` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:16:11
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:11
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
| -----^^^^^^^^-----^^^^^^^^^^-----^
@@ -228,7 +228,7 @@
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:16:20
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:20
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
| -^^^-----
@@ -238,7 +238,7 @@
| move occurs because `b` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:16:31
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:31
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
| -----^^^-----
@@ -248,7 +248,7 @@
| move occurs because `d` has type `U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:21:11
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:19:11
|
LL | fn f3(a @ [ref mut b, ref c]: [U; 2]) {}
| -^^^^---------^^-----^
@@ -259,7 +259,7 @@
| move occurs because `a` has type `[U; 2]` which does not implement the `Copy` trait
error[E0382]: use of partially moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:26:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:24:9
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (U, U);
| ^^^^^^^^^^^^^^^^^^^^^^^^---------^
@@ -270,7 +270,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: use of partially moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:35:9
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:33:9
|
LL | let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());
| ^^^^^^^^^^^^^^^^^^^^^^^^---------^
@@ -281,7 +281,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: use of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:49:38
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:47:38
|
LL | match Some((U, U)) {
| ------------ move occurs because value has type `Option<(U, U)>`, which does not implement the `Copy` trait
@@ -292,7 +292,7 @@
| value moved here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:57:30
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:55:30
|
LL | match Some([U, U]) {
| ------------ move occurs because value has type `Option<[U; 2]>`, which does not implement the `Copy` trait
@@ -303,7 +303,7 @@
| value moved here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:63:18
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:61:18
|
LL | match Some(u()) {
| --------- move occurs because value has type `Option<U>`, which does not implement the `Copy` trait
@@ -314,7 +314,7 @@
| value moved here
error[E0382]: use of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:69:38
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:67:38
|
LL | match Some((u(), u())) {
| ---------------- move occurs because value has type `Option<(U, U)>`, which does not implement the `Copy` trait
@@ -325,7 +325,7 @@
| value moved here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:77:30
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:75:30
|
LL | match Some([u(), u()]) {
| ---------------- move occurs because value has type `Option<[U; 2]>`, which does not implement the `Copy` trait
@@ -336,7 +336,7 @@
| value moved here
error[E0382]: use of partially moved value
- --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:16:11
+ --> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:14:11
|
LL | fn f2(mut a @ (b @ ref c, mut d @ ref e): (U, U)) {}
| ^^^^^^^^^^^^^^^^^^^^-------------^
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs
index b9235eab..0b0a780 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.rs
@@ -1,7 +1,5 @@
// Test that `ref mut? @ pat_with_by_move_bindings` is prevented.
-#![feature(bindings_after_at)]
-
fn main() {
struct U;
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
index 50b2f89..c019aae 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
@@ -1,5 +1,5 @@
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:26:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:24:9
|
LL | let ref a @ b = U;
| -----^^^-
@@ -8,7 +8,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:28:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:26:9
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
| -----^^^^^^^^^^^^-----^^^^^^^^^^-^
@@ -18,7 +18,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:28:18
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:26:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
| -----^^^-----
@@ -27,7 +27,7 @@
| value borrowed, by `b`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:28:33
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:26:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
| -----^^^-
@@ -36,7 +36,7 @@
| value borrowed, by `d`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:32:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:30:9
|
LL | let ref mut a @ [b, mut c] = [U, U];
| ---------^^^^-^^-----^
@@ -46,7 +46,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:35:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:33:9
|
LL | let ref a @ b = u();
| -----^^^-
@@ -55,7 +55,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:38:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:36:9
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| -----^^^^^^^^^^^^-----^^^^^^^^^^-^
@@ -65,7 +65,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:38:18
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:36:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| -----^^^-----
@@ -74,7 +74,7 @@
| value borrowed, by `b`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:38:33
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:36:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| -----^^^-
@@ -83,7 +83,7 @@
| value borrowed, by `d`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:44:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:42:9
|
LL | let ref mut a @ [b, mut c] = [u(), u()];
| ---------^^^^-^^-----^
@@ -93,7 +93,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:49:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:47:9
|
LL | ref a @ Some(b) => {}
| -----^^^^^^^^-^
@@ -102,7 +102,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:54:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:52:9
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| -----^^^^^^^^^^^^^^^^^-----^^^^^^^^^^-^^
@@ -112,7 +112,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:54:23
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:52:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| -----^^^-----
@@ -121,7 +121,7 @@
| value borrowed, by `b`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:54:38
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:52:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| -----^^^-
@@ -130,7 +130,7 @@
| value borrowed, by `d`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:61:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:59:9
|
LL | ref mut a @ Some([b, mut c]) => {}
| ---------^^^^^^^^^-^^-----^^
@@ -140,7 +140,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:66:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:64:9
|
LL | ref a @ Some(b) => {}
| -----^^^^^^^^-^
@@ -149,7 +149,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:71:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:69:9
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| -----^^^^^^^^^^^^^^^^^-----^^^^^^^^^^-^^
@@ -159,7 +159,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:71:23
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:69:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| -----^^^-----
@@ -168,7 +168,7 @@
| value borrowed, by `b`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:71:38
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:69:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| -----^^^-
@@ -177,7 +177,7 @@
| value borrowed, by `d`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:80:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:78:9
|
LL | ref mut a @ Some([b, mut c]) => {}
| ---------^^^^^^^^^-^^-----^^
@@ -187,7 +187,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:13:11
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
|
LL | fn f1(ref a @ b: U) {}
| -----^^^-
@@ -196,7 +196,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:16:11
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:14:11
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| -----^^^^^^^^^^^^-----^^^^^^^^^^-^
@@ -206,7 +206,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:16:20
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:14:20
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| -----^^^-----
@@ -215,7 +215,7 @@
| value borrowed, by `b`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:16:35
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:14:35
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| -----^^^-
@@ -224,7 +224,7 @@
| value borrowed, by `d`, here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-by-move-and-ref.rs:22:11
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:20:11
|
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
| ---------^^^^-^^-----^
@@ -234,7 +234,7 @@
| value borrowed, by `a`, here
error[E0382]: borrow of partially moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:32:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:30:9
|
LL | let ref mut a @ [b, mut c] = [U, U];
| ^^^^^^^^^^^^^^^^-----^
@@ -245,7 +245,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:35:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:33:9
|
LL | let ref a @ b = u();
| ^^^^^^^^- --- move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -254,7 +254,7 @@
| value borrowed here after move
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:38:18
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:36:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| ^^^^^^^^-----
@@ -265,7 +265,7 @@
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:38:33
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:36:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| ^^^^^^^^-
@@ -276,7 +276,7 @@
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of partially moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:44:9
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:42:9
|
LL | let ref mut a @ [b, mut c] = [u(), u()];
| ^^^^^^^^^^^^^^^^-----^
@@ -287,7 +287,7 @@
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:71:23
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:69:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^^^^-----
@@ -299,10 +299,10 @@
help: borrow this field in the pattern to avoid moving the value
|
LL | ref a @ Some((ref b @ ref mut c, ref d @ e)) => {}
- | ^^^
+ | +++
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:71:38
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:69:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^^^^-
@@ -314,10 +314,10 @@
help: borrow this field in the pattern to avoid moving the value
|
LL | ref a @ Some((ref b @ mut c, ref d @ ref e)) => {}
- | ^^^
+ | +++
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:13:11
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
|
LL | fn f1(ref a @ b: U) {}
| ^^^^^^^^-
@@ -327,7 +327,7 @@
| move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:16:20
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:14:20
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| ^^^^^^^^-----
@@ -338,7 +338,7 @@
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:16:35
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:14:35
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| ^^^^^^^^-
@@ -349,7 +349,7 @@
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of partially moved value
- --> $DIR/borrowck-pat-by-move-and-ref.rs:22:11
+ --> $DIR/borrowck-pat-by-move-and-ref.rs:20:11
|
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
| ^^^^^^^^^^^^^^^^-----^
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs
index fb24301..df213f6 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-both-sides.rs
@@ -3,8 +3,6 @@
// Test that `ref` patterns may be used on both sides
// of an `@` pattern according to NLL borrowck.
-#![feature(bindings_after_at)]
-
fn main() {
struct U; // Not copy!
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs
index 2d391cd..6bc0d34 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.rs
@@ -1,5 +1,3 @@
-#![feature(bindings_after_at)]
-
enum Option<T> {
None,
Some(T),
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
index 13032c3..2ae78d1 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
@@ -1,5 +1,5 @@
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:10:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:8:9
|
LL | ref mut z @ &mut Some(ref a) => {
| ---------^^^^^^^^^^^^^-----^
@@ -8,7 +8,7 @@
| mutable borrow, by `z`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:35:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:33:9
|
LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub
| ---------^^^^-----------------^
@@ -18,7 +18,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:35:22
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:33:22
|
LL | let ref mut a @ (ref b @ ref mut c) = u(); // sub-in-sub
| -----^^^---------
@@ -27,7 +27,7 @@
| immutable borrow, by `b`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:39:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:37:9
|
LL | let ref a @ ref mut b = U;
| -----^^^---------
@@ -36,7 +36,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:41:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:39:9
|
LL | let ref mut a @ ref b = U;
| ---------^^^-----
@@ -45,7 +45,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:43:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:41:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
@@ -55,7 +55,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:45:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:43:9
|
LL | let ref mut a @ (ref b, ref c) = (U, U);
| ---------^^^^-----^^-----^
@@ -65,7 +65,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:48:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:46:9
|
LL | let ref mut a @ ref b = u();
| ---------^^^-----
@@ -74,7 +74,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:53:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:51:9
|
LL | let ref a @ ref mut b = u();
| -----^^^---------
@@ -83,7 +83,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:59:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:57:9
|
LL | let ref mut a @ ref b = U;
| ---------^^^-----
@@ -92,7 +92,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:63:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:61:9
|
LL | let ref a @ ref mut b = U;
| -----^^^---------
@@ -101,7 +101,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:69:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:67:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => {
| ---------^^^^^^-----^
@@ -110,7 +110,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:69:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:67:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) => {
| ---------^^^^^^^-----^
@@ -119,7 +119,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| -----^^^^^^---------^
@@ -128,7 +128,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| -----^^^^^^^---------^
@@ -137,7 +137,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:89:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
| -----^^^^^^---------^
@@ -146,7 +146,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:89:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
| -----^^^^^^^---------^
@@ -155,7 +155,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:96:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
| ---------^^^^^^-----^
@@ -164,7 +164,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:96:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
| ---------^^^^^^^-----^
@@ -173,7 +173,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:9
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
| -----^^^^^^---------^
@@ -182,7 +182,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:33
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
| -----^^^^^^^---------^
@@ -191,7 +191,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:109:9
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
| ---------^^^^^^-----^
@@ -200,7 +200,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:33
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:109:33
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
| ---------^^^^^^^-----^
@@ -209,7 +209,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:119:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:117:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
@@ -219,7 +219,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:125:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:123:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
@@ -229,7 +229,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:131:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:129:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| -----^^^^---------^^---------^
@@ -239,7 +239,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:136:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:134:9
|
LL | let ref mut a @ (ref b, ref c) = (U, U);
| ---------^^^^-----^^-----^
@@ -249,7 +249,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:24:11
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:22:11
|
LL | fn f1(ref a @ ref mut b: U) {}
| -----^^^---------
@@ -258,7 +258,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:26:11
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:24:11
|
LL | fn f2(ref mut a @ ref b: U) {}
| ---------^^^-----
@@ -267,7 +267,7 @@
| mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:11
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:26:11
|
LL | fn f3(ref a @ [ref b, ref mut mid @ .., ref c]: [U; 4]) {}
| -----^^^^^^^^^^^----------------^^^^^^^^
@@ -276,7 +276,7 @@
| immutable borrow, by `a`, occurs here
error: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:30:22
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:22
|
LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {}
| -----^^^-------------
@@ -286,7 +286,7 @@
| immutable borrow, by `a`, occurs here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:30:30
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:30
|
LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {}
| ---------^^^-
@@ -295,7 +295,7 @@
| value borrowed, by `b`, here
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:10:31
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:8:31
|
LL | ref mut z @ &mut Some(ref a) => {
| ----------------------^^^^^-
@@ -307,7 +307,7 @@
| ---------- mutable borrow later used here
error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:48:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:46:9
|
LL | let ref mut a @ ref b = u();
| ^^^^^^^^^^^^-----
@@ -319,7 +319,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:53:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:51:9
|
LL | let ref a @ ref mut b = u();
| ^^^^^^^^---------
@@ -331,7 +331,7 @@
| -------- mutable borrow later used here
error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:20
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:20
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| -----------^^^^^^^^^-
@@ -343,7 +343,7 @@
| - immutable borrow later used here
error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:78:45
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:45
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
| ------------^^^^^^^^^-
@@ -355,7 +355,7 @@
| - immutable borrow later used here
error[E0594]: cannot assign to `*b`, as it is immutable for the pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:89:61
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:87:61
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { *b = U; false } => {}
| ^^^^^^ cannot assign
@@ -363,7 +363,7 @@
= note: variables bound in patterns are immutable until the end of the pattern guard
error[E0594]: cannot assign to `*a`, as it is immutable for the pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:96:61
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:94:61
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { *a = Err(U); false } => {}
| ^^^^^^^^^^^ cannot assign
@@ -371,7 +371,7 @@
= note: variables bound in patterns are immutable until the end of the pattern guard
error[E0507]: cannot move out of `b` in pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:66
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:66
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
| ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait
@@ -379,7 +379,7 @@
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
error[E0507]: cannot move out of `b` in pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:103:66
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:101:66
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if { drop(b); false } => {}
| ^ move occurs because `b` has type `&mut U`, which does not implement the `Copy` trait
@@ -387,7 +387,7 @@
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
error[E0507]: cannot move out of `a` in pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:66
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:109:66
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
| ^ move occurs because `a` has type `&mut Result<U, U>`, which does not implement the `Copy` trait
@@ -395,7 +395,7 @@
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
error[E0507]: cannot move out of `a` in pattern guard
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:111:66
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:109:66
|
LL | ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if { drop(a); false } => {}
| ^ move occurs because `a` has type `&mut Result<U, U>`, which does not implement the `Copy` trait
@@ -403,7 +403,7 @@
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:119:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:117:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| ^^^^^^^^^---------^^^^^^^^^^^^
@@ -415,7 +415,7 @@
| ------ mutable borrow later used here
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:125:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:123:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| ^^^^^^^^^---------^^^^^^^^^^^^
@@ -427,7 +427,7 @@
| ------ mutable borrow later used here
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:131:9
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:129:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
| ^^^^^^^^^---------^^^^^^^^^^^^
@@ -439,7 +439,7 @@
| ------ mutable borrow later used here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-and-ref.rs:30:30
+ --> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:30
|
LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {}
| --------^^^^^^^^^^^^-
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs
index 339814e..99739c7 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.rs
@@ -1,7 +1,5 @@
// Test that `ref mut x @ ref mut y` and varieties of that are not allowed.
-#![feature(bindings_after_at)]
-
fn main() {
struct U;
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
index 0370037..aa02230 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
@@ -1,5 +1,5 @@
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:28:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:26:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
@@ -8,7 +8,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:31:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:29:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
@@ -17,7 +17,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:35:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:33:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
@@ -26,7 +26,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:38:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:36:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
@@ -35,7 +35,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:41:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:39:9
|
LL | let ref mut a @ ref mut b = U;
| ---------^^^---------
@@ -44,7 +44,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:46:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:44:9
|
LL | let ref mut a @ (
| ^--------
@@ -66,7 +66,7 @@
| |_____^
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:56:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:54:9
|
LL | let ref mut a @ (
| ^--------
@@ -88,7 +88,7 @@
| |_________^
error: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:66:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:64:9
|
LL | let a @ (ref mut b, ref mut c) = (U, U);
| -^^^^---------^^---------^
@@ -99,7 +99,7 @@
| move occurs because `a` has type `(U, U)` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:69:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:67:9
|
LL | let a @ (b, [c, d]) = &mut val; // Same as ^--
| -^^^^-^^^-^^-^^
@@ -111,7 +111,7 @@
| move occurs because `a` has type `&mut (U, [U; 2])` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:72:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:70:9
|
LL | let a @ &mut ref mut b = &mut U;
| -^^^^^^^^---------
@@ -121,7 +121,7 @@
| move occurs because `a` has type `&mut U` which does not implement the `Copy` trait
error: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:74:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:72:9
|
LL | let a @ &mut (ref mut b, ref mut c) = &mut (U, U);
| -^^^^^^^^^---------^^---------^
@@ -132,7 +132,7 @@
| move occurs because `a` has type `&mut (U, U)` which does not implement the `Copy` trait
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:78:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:76:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
@@ -141,7 +141,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:78:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:76:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
@@ -150,7 +150,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:84:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:82:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
@@ -159,7 +159,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:84:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:82:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
@@ -168,7 +168,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:91:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:89:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
@@ -177,7 +177,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:91:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:89:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
@@ -186,7 +186,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:103:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:101:9
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^---------^
@@ -195,7 +195,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:103:37
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:101:37
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------^^^^^^^---------^
@@ -204,7 +204,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:10:11
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:8:11
|
LL | fn f1(ref mut a @ ref mut b: U) {}
| ---------^^^---------
@@ -213,7 +213,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:12:11
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:10:11
|
LL | fn f2(ref mut a @ ref mut b: U) {}
| ---------^^^---------
@@ -222,7 +222,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:15:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:13:9
|
LL | ref mut a @ [
| ^--------
@@ -240,7 +240,7 @@
| |_________^
error: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:23:22
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:21:22
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
| ---------^^^-------------
@@ -250,7 +250,7 @@
| first mutable borrow, by `a`, occurs here
error: cannot move out of value because it is borrowed
- --> $DIR/borrowck-pat-ref-mut-twice.rs:23:34
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:21:34
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
| ---------^^^-
@@ -259,7 +259,7 @@
| value borrowed, by `b`, here
error[E0499]: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:31:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:29:9
|
LL | let ref mut a @ ref mut b = U;
| ^^^^^^^^^^^^---------
@@ -271,7 +271,7 @@
| - first borrow later used here
error[E0499]: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:41:9
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:39:9
|
LL | let ref mut a @ ref mut b = U;
| ^^^^^^^^^^^^---------
@@ -283,7 +283,7 @@
| ------ first borrow later used here
error[E0499]: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:91:24
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:89:24
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------------^^^^^^^^^-
@@ -295,7 +295,7 @@
| ----------- first borrow later used here
error[E0499]: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:91:53
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:89:53
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ----------------^^^^^^^^^-
@@ -307,7 +307,7 @@
| ----------- first borrow later used here
error[E0499]: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:103:24
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:101:24
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ---------------^^^^^^^^^-
@@ -319,7 +319,7 @@
| - first borrow later used here
error[E0499]: cannot borrow value as mutable more than once at a time
- --> $DIR/borrowck-pat-ref-mut-twice.rs:103:53
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:101:53
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
| ----------------^^^^^^^^^-
@@ -331,7 +331,7 @@
| - first borrow later used here
error[E0382]: borrow of moved value
- --> $DIR/borrowck-pat-ref-mut-twice.rs:23:34
+ --> $DIR/borrowck-pat-ref-mut-twice.rs:21:34
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
| ------------^^^^^^^^^^^^-
diff --git a/src/test/ui/pattern/bindings-after-at/box-patterns.rs b/src/test/ui/pattern/bindings-after-at/box-patterns.rs
index ef9669a..9db3725 100644
--- a/src/test/ui/pattern/bindings-after-at/box-patterns.rs
+++ b/src/test/ui/pattern/bindings-after-at/box-patterns.rs
@@ -2,7 +2,6 @@
// run-pass
-#![feature(bindings_after_at)]
#![feature(box_patterns)]
#[derive(Debug, PartialEq)]
diff --git a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs b/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs
index f731aa2..1e2c296 100644
--- a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs
+++ b/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.rs
@@ -1,7 +1,5 @@
// Test that mixing `Copy` and non-`Copy` types in `@` patterns is forbidden.
-#![feature(bindings_after_at)]
-
#[derive(Copy, Clone)]
struct C;
diff --git a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr b/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
index 183a371..d290144 100644
--- a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
+++ b/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
@@ -1,5 +1,5 @@
error[E0382]: use of partially moved value
- --> $DIR/copy-and-move-mixed.rs:14:9
+ --> $DIR/copy-and-move-mixed.rs:12:9
|
LL | let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
| ^^^^^^^^^^------------^
diff --git a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs
index c15167e..dfd4d02 100644
--- a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs
+++ b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.rs
@@ -7,7 +7,6 @@
// If `binding` is allowed to influence `subpat`,
// this would create problems for the generalization aforementioned.
-#![feature(bindings_after_at)]
fn main() {
struct NotCopy;
diff --git a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
index a41fec7..d78faa6 100644
--- a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
+++ b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
@@ -1,5 +1,5 @@
error: cannot move out of value because it is borrowed
- --> $DIR/default-binding-modes-both-sides-independent.rs:27:9
+ --> $DIR/default-binding-modes-both-sides-independent.rs:26:9
|
LL | let ref a @ b = NotCopy;
| -----^^^-
@@ -8,7 +8,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/default-binding-modes-both-sides-independent.rs:30:9
+ --> $DIR/default-binding-modes-both-sides-independent.rs:29:9
|
LL | let ref mut a @ b = NotCopy;
| ---------^^^-
@@ -17,7 +17,7 @@
| value borrowed, by `a`, here
error: cannot move out of value because it is borrowed
- --> $DIR/default-binding-modes-both-sides-independent.rs:35:12
+ --> $DIR/default-binding-modes-both-sides-independent.rs:34:12
|
LL | Ok(ref a @ b) | Err(b @ ref a) => {
| -----^^^-
@@ -26,7 +26,7 @@
| value borrowed, by `a`, here
error: borrow of moved value
- --> $DIR/default-binding-modes-both-sides-independent.rs:35:29
+ --> $DIR/default-binding-modes-both-sides-independent.rs:34:29
|
LL | Ok(ref a @ b) | Err(b @ ref a) => {
| -^^^-----
@@ -36,7 +36,7 @@
| move occurs because `b` has type `NotCopy` which does not implement the `Copy` trait
error: cannot move out of value because it is borrowed
- --> $DIR/default-binding-modes-both-sides-independent.rs:43:9
+ --> $DIR/default-binding-modes-both-sides-independent.rs:42:9
|
LL | ref a @ b => {
| -----^^^-
@@ -45,7 +45,7 @@
| value borrowed, by `a`, here
error[E0382]: borrow of moved value
- --> $DIR/default-binding-modes-both-sides-independent.rs:30:9
+ --> $DIR/default-binding-modes-both-sides-independent.rs:29:9
|
LL | let ref mut a @ b = NotCopy;
| ^^^^^^^^^^^^- ------- move occurs because value has type `NotCopy`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/feature-gate-bindings_after_at.rs b/src/test/ui/pattern/bindings-after-at/feature-gate-bindings_after_at.rs
deleted file mode 100644
index d655f15..0000000
--- a/src/test/ui/pattern/bindings-after-at/feature-gate-bindings_after_at.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() {
- let x @ y = 0; //~ ERROR pattern bindings after an `@` are unstable
-}
diff --git a/src/test/ui/pattern/bindings-after-at/feature-gate-bindings_after_at.stderr b/src/test/ui/pattern/bindings-after-at/feature-gate-bindings_after_at.stderr
deleted file mode 100644
index b976ef4..0000000
--- a/src/test/ui/pattern/bindings-after-at/feature-gate-bindings_after_at.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: pattern bindings after an `@` are unstable
- --> $DIR/feature-gate-bindings_after_at.rs:2:13
- |
-LL | let x @ y = 0;
- | ^
- |
- = note: see issue #65490 <https://github.com/rust-lang/rust/issues/65490> for more information
- = help: add `#![feature(bindings_after_at)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs b/src/test/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs
index 497d94a..fe7d1eb 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs
+++ b/src/test/ui/pattern/bindings-after-at/nested-binding-mode-lint.rs
@@ -1,6 +1,5 @@
// check-pass
-#![feature(bindings_after_at)]
#![deny(unused_mut)]
fn main() {
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs
index 54f0411..e7d9953 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs
+++ b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.rs
@@ -1,5 +1,3 @@
-#![feature(bindings_after_at)]
-
fn main() {
let mut is_mut @ not_mut = 42;
&mut is_mut;
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
index a8d5e4c..3180bd0 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
+++ b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
@@ -1,5 +1,5 @@
error[E0596]: cannot borrow `not_mut` as mutable, as it is not declared as mutable
- --> $DIR/nested-binding-modes-mut.rs:6:5
+ --> $DIR/nested-binding-modes-mut.rs:4:5
|
LL | let mut is_mut @ not_mut = 42;
| ------- help: consider changing this to be mutable: `mut not_mut`
@@ -8,7 +8,7 @@
| ^^^^^^^^^^^^ cannot borrow as mutable
error[E0596]: cannot borrow `not_mut` as mutable, as it is not declared as mutable
- --> $DIR/nested-binding-modes-mut.rs:11:5
+ --> $DIR/nested-binding-modes-mut.rs:9:5
|
LL | let not_mut @ mut is_mut = 42;
| -------------------- help: consider changing this to be mutable: `mut not_mut`
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs
index d5086aec..adfb038 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs
+++ b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.rs
@@ -1,5 +1,3 @@
-#![feature(bindings_after_at)]
-
fn main() {
let ref is_ref @ is_val = 42;
*is_ref;
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr
index 9cc928d..b378fe3 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr
+++ b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-ref.stderr
@@ -1,11 +1,11 @@
error[E0614]: type `{integer}` cannot be dereferenced
- --> $DIR/nested-binding-modes-ref.rs:6:5
+ --> $DIR/nested-binding-modes-ref.rs:4:5
|
LL | *is_val;
| ^^^^^^^
error[E0614]: type `{integer}` cannot be dereferenced
- --> $DIR/nested-binding-modes-ref.rs:11:5
+ --> $DIR/nested-binding-modes-ref.rs:9:5
|
LL | *is_val;
| ^^^^^^^
diff --git a/src/test/ui/pattern/bindings-after-at/nested-patterns.rs b/src/test/ui/pattern/bindings-after-at/nested-patterns.rs
index 6296652..f06563d 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-patterns.rs
+++ b/src/test/ui/pattern/bindings-after-at/nested-patterns.rs
@@ -1,6 +1,5 @@
// run-pass
-#![feature(bindings_after_at)]
struct A { a: u8, b: u8 }
diff --git a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs b/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs
index dbec2f1..5c7769c 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs
+++ b/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.rs
@@ -1,7 +1,6 @@
// Here we check that type ascription is syntactically invalid when
// not in the top position of a ascribing a let binding or function parameter.
-#![feature(bindings_after_at)]
// This has no effect.
// We include it to demonstrate that this is the case:
diff --git a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr b/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr
index 1e957ed..27660ae 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr
+++ b/src/test/ui/pattern/bindings-after-at/nested-type-ascription-syntactically-invalid.stderr
@@ -1,23 +1,23 @@
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found `@`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:19:15
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:18:15
|
LL | let a: u8 @ b = 0;
| ^ expected one of 7 possible tokens
error: expected one of `)`, `,`, `@`, or `|`, found `:`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:25:15
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:24:15
|
LL | let a @ (b: u8);
| ^ expected one of `)`, `,`, `@`, or `|`
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found `)`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:25:19
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:24:19
|
LL | let a @ (b: u8);
| ^ expected one of 7 possible tokens
error: expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `=`, found `@`
- --> $DIR/nested-type-ascription-syntactically-invalid.rs:32:15
+ --> $DIR/nested-type-ascription-syntactically-invalid.rs:31:15
|
LL | let a: T1 @ Outer(b: T2);
| ^ expected one of 7 possible tokens
diff --git a/src/test/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs b/src/test/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs
index cffff80..383e377 100644
--- a/src/test/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs
+++ b/src/test/ui/pattern/bindings-after-at/or-patterns-box-patterns.rs
@@ -2,7 +2,6 @@
// run-pass
-#![feature(bindings_after_at)]
#![feature(box_patterns)]
#[derive(Debug, PartialEq)]
diff --git a/src/test/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs b/src/test/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs
index a99ec01..d315f7e 100644
--- a/src/test/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs
+++ b/src/test/ui/pattern/bindings-after-at/or-patterns-slice-patterns.rs
@@ -2,7 +2,6 @@
// run-pass
-#![feature(bindings_after_at)]
#[derive(Debug, PartialEq)]
enum MatchArm {
diff --git a/src/test/ui/pattern/bindings-after-at/or-patterns.rs b/src/test/ui/pattern/bindings-after-at/or-patterns.rs
index caf6d91..fcc3614 100644
--- a/src/test/ui/pattern/bindings-after-at/or-patterns.rs
+++ b/src/test/ui/pattern/bindings-after-at/or-patterns.rs
@@ -2,7 +2,6 @@
// run-pass
-#![feature(bindings_after_at)]
#[derive(Debug, PartialEq)]
enum MatchArm {
diff --git a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs b/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
index 09df15f..f167a39 100644
--- a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
+++ b/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.rs
@@ -1,7 +1,6 @@
// Test that `binding @ subpat` acts as a product context with respect to duplicate binding names.
// The code that is tested here lives in resolve (see `resolve_pattern_inner`).
-#![feature(bindings_after_at)]
fn main() {
fn f(a @ a @ a: ()) {}
diff --git a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr b/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr
index 77a4937..a165549f 100644
--- a/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr
+++ b/src/test/ui/pattern/bindings-after-at/pat-at-same-name-both.stderr
@@ -1,59 +1,59 @@
error[E0415]: identifier `a` is bound more than once in this parameter list
- --> $DIR/pat-at-same-name-both.rs:7:14
+ --> $DIR/pat-at-same-name-both.rs:6:14
|
LL | fn f(a @ a @ a: ()) {}
| ^ used as parameter more than once
error[E0415]: identifier `a` is bound more than once in this parameter list
- --> $DIR/pat-at-same-name-both.rs:7:18
+ --> $DIR/pat-at-same-name-both.rs:6:18
|
LL | fn f(a @ a @ a: ()) {}
| ^ used as parameter more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:12:20
+ --> $DIR/pat-at-same-name-both.rs:11:20
|
LL | Ok(a @ b @ a)
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:14:23
+ --> $DIR/pat-at-same-name-both.rs:13:23
|
LL | | Err(a @ b @ a)
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:19:13
+ --> $DIR/pat-at-same-name-both.rs:18:13
|
LL | let a @ a @ a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:19:17
+ --> $DIR/pat-at-same-name-both.rs:18:17
|
LL | let a @ a @ a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:22:21
+ --> $DIR/pat-at-same-name-both.rs:21:21
|
LL | let ref a @ ref a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:24:29
+ --> $DIR/pat-at-same-name-both.rs:23:29
|
LL | let ref mut a @ ref mut a = ();
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:27:17
+ --> $DIR/pat-at-same-name-both.rs:26:17
|
LL | let a @ (Ok(a) | Err(a)) = Ok(());
| ^ used in a pattern more than once
error[E0416]: identifier `a` is bound more than once in the same pattern
- --> $DIR/pat-at-same-name-both.rs:27:26
+ --> $DIR/pat-at-same-name-both.rs:26:26
|
LL | let a @ (Ok(a) | Err(a)) = Ok(());
| ^ used in a pattern more than once
diff --git a/src/test/ui/pattern/bindings-after-at/slice-patterns.rs b/src/test/ui/pattern/bindings-after-at/slice-patterns.rs
index 7e50527..4f4c96e 100644
--- a/src/test/ui/pattern/bindings-after-at/slice-patterns.rs
+++ b/src/test/ui/pattern/bindings-after-at/slice-patterns.rs
@@ -2,7 +2,6 @@
// run-pass
-#![feature(bindings_after_at)]
#[derive(Debug, PartialEq)]
enum MatchArm {
diff --git a/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr b/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
index 9bdbf0b..75a231f 100644
--- a/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
+++ b/src/test/ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.stderr
@@ -13,7 +13,7 @@
--> $DIR/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs:19:9
|
LL | struct P<T>(T); // 1 type parameter wanted
- | --------------- tuple struct defined here
+ | - tuple struct has 1 field
...
LL | let P() = U {};
| ^^^ expected 1 field, found 0
@@ -21,11 +21,11 @@
help: use `_` to explicitly ignore each field
|
LL | let P(_) = U {};
- | ^
+ | +
help: use `..` to ignore all fields
|
LL | let P(..) = U {};
- | ^^
+ | ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/pattern/issue-74539.stderr b/src/test/ui/pattern/issue-74539.stderr
index f7644c1..7443946 100644
--- a/src/test/ui/pattern/issue-74539.stderr
+++ b/src/test/ui/pattern/issue-74539.stderr
@@ -8,7 +8,7 @@
help: if you don't need to use the contents of x, discard the tuple's remaining fields
|
LL | E::A(..) => {
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-74539.rs:8:18
@@ -19,18 +19,18 @@
= note: only allowed in tuple, tuple struct, and slice patterns
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
- --> $DIR/issue-74539.rs:8:9
+ --> $DIR/issue-74539.rs:8:14
|
LL | A(u8, u8),
- | --------- tuple variant defined here
+ | -- -- tuple variant has 2 fields
...
LL | E::A(x @ ..) => {
- | ^^^^^^^^^^^^ expected 2 fields, found 1
+ | ^^^^^^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | E::A(x @ .., _) => {
- | ^^^
+ | +++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/pattern/issue-74702.stderr b/src/test/ui/pattern/issue-74702.stderr
index aca5c9a..f2e2c8f 100644
--- a/src/test/ui/pattern/issue-74702.stderr
+++ b/src/test/ui/pattern/issue-74702.stderr
@@ -8,7 +8,7 @@
help: if you don't need to use the contents of foo, discard the tuple's remaining fields
|
LL | let (..,) = (0, 0);
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-74702.rs:2:16
diff --git a/src/test/ui/pattern/issue-82290.rs b/src/test/ui/pattern/issue-82290.rs
index 67f0274..d8da0ac 100644
--- a/src/test/ui/pattern/issue-82290.rs
+++ b/src/test/ui/pattern/issue-82290.rs
@@ -1,7 +1,9 @@
+// check-pass
+
#![feature(let_chains)] //~ WARN the feature `let_chains` is incomplete
fn main() {
- if true && let x = 1 { //~ ERROR `let` expressions are not supported here
+ if true && let x = 1 { //~ WARN irrefutable `let` pattern
let _ = x;
}
}
diff --git a/src/test/ui/pattern/issue-82290.stderr b/src/test/ui/pattern/issue-82290.stderr
index 666b1e7..0a3cf2c 100644
--- a/src/test/ui/pattern/issue-82290.stderr
+++ b/src/test/ui/pattern/issue-82290.stderr
@@ -1,13 +1,5 @@
-error: `let` expressions are not supported here
- --> $DIR/issue-82290.rs:4:16
- |
-LL | if true && let x = 1 {
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-82290.rs:1:12
+ --> $DIR/issue-82290.rs:3:12
|
LL | #![feature(let_chains)]
| ^^^^^^^^^^
@@ -15,5 +7,15 @@
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
-error: aborting due to previous error; 1 warning emitted
+warning: irrefutable `let` pattern
+ --> $DIR/issue-82290.rs:6:16
+ |
+LL | if true && let x = 1 {
+ | ^^^^^^^^^
+ |
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
+ = note: this pattern will always match, so the `let` is useless
+ = help: consider removing `let`
+
+warning: 2 warnings emitted
diff --git a/src/test/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs b/src/test/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs
index 18663c3..ff7b625a6 100644
--- a/src/test/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs
+++ b/src/test/ui/pattern/move-ref-patterns/by-move-sub-pat-unreachable.rs
@@ -4,8 +4,6 @@
// check-pass
-#![feature(bindings_after_at)]
-
fn main() {
return;
diff --git a/src/test/ui/pattern/pat-tuple-field-count-cross.rs b/src/test/ui/pattern/pat-tuple-field-count-cross.rs
new file mode 100644
index 0000000..b63da4e
--- /dev/null
+++ b/src/test/ui/pattern/pat-tuple-field-count-cross.rs
@@ -0,0 +1,57 @@
+// aux-build:declarations-for-tuple-field-count-errors.rs
+
+extern crate declarations_for_tuple_field_count_errors;
+
+use declarations_for_tuple_field_count_errors::*;
+
+fn main() {
+ match Z0 {
+ Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0`
+ Z0(x) => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0`
+ }
+ match Z1() {
+ Z1 => {} //~ ERROR match bindings cannot shadow tuple structs
+ Z1(x) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 0 fields
+ }
+
+ match S(1, 2, 3) {
+ S() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple struct has 3 fields
+ S(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 3 fields
+ S(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple struct has 3 fields
+ S(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields
+ }
+ match M(1, 2, 3) {
+ M() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple struct has 3 fields
+ M(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 3 fields
+ M(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple struct has 3 fields
+ M(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields
+ }
+
+ match E1::Z0 {
+ E1::Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ E1::Z0(x) => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ }
+ match E1::Z1() {
+ E1::Z1 => {} //~ ERROR expected unit struct, unit variant or constant, found tuple variant `E1::Z1`
+ E1::Z1(x) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 0 fields
+ }
+ match E1::S(1, 2, 3) {
+ E1::S() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple variant has 3 fields
+ E1::S(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 3 fields
+ E1::S(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3 fields
+ E1::S(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple variant has 3 fields
+ }
+
+ match E2::S(1, 2, 3) {
+ E2::S() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple variant has 3 fields
+ E2::S(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 3 fields
+ E2::S(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3 fields
+ E2::S(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple variant has 3 fields
+ }
+ match E2::M(1, 2, 3) {
+ E2::M() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple variant has 3 fields
+ E2::M(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 3 fields
+ E2::M(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3 fields
+ E2::M(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple variant has 3 fields
+ }
+}
diff --git a/src/test/ui/pattern/pat-tuple-field-count-cross.stderr b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr
new file mode 100644
index 0000000..cab8d47
--- /dev/null
+++ b/src/test/ui/pattern/pat-tuple-field-count-cross.stderr
@@ -0,0 +1,536 @@
+error[E0530]: match bindings cannot shadow tuple structs
+ --> $DIR/pat-tuple-field-count-cross.rs:13:9
+ |
+LL | use declarations_for_tuple_field_count_errors::*;
+ | -------------------------------------------- the tuple struct `Z1` is imported here
+...
+LL | Z1 => {}
+ | ^^ cannot be named the same as a tuple struct
+
+error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
+ --> $DIR/pat-tuple-field-count-cross.rs:9:9
+ |
+LL | Z0() => {}
+ | ^^^^
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1
+ |
+LL | pub struct Z0;
+ | -------------- `Z0` defined here
+LL | pub struct Z1();
+ | ---------------- similarly named tuple struct `Z1` defined here
+ |
+help: use this syntax instead
+ |
+LL | Z0 => {}
+ | ~~
+help: a tuple struct with a similar name exists
+ |
+LL | Z1() => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
+ --> $DIR/pat-tuple-field-count-cross.rs:10:9
+ |
+LL | Z0(x) => {}
+ | ^^^^^
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:1:1
+ |
+LL | pub struct Z0;
+ | -------------- `Z0` defined here
+LL | pub struct Z1();
+ | ---------------- similarly named tuple struct `Z1` defined here
+ |
+help: use this syntax instead
+ |
+LL | Z0 => {}
+ | ~~
+help: a tuple struct with a similar name exists
+ |
+LL | Z1(x) => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ --> $DIR/pat-tuple-field-count-cross.rs:31:9
+ |
+LL | E1::Z0() => {}
+ | ^^^^^^^^
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:15
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | -- ---- similarly named tuple variant `Z1` defined here
+ | |
+ | `E1::Z0` defined here
+ |
+help: use this syntax instead
+ |
+LL | E1::Z0 => {}
+ | ~~~~~~
+help: a tuple variant with a similar name exists
+ |
+LL | E1::Z1() => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ --> $DIR/pat-tuple-field-count-cross.rs:32:9
+ |
+LL | E1::Z0(x) => {}
+ | ^^^^^^^^^
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:15
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | -- ---- similarly named tuple variant `Z1` defined here
+ | |
+ | `E1::Z0` defined here
+ |
+help: use this syntax instead
+ |
+LL | E1::Z0 => {}
+ | ~~~~~~
+help: a tuple variant with a similar name exists
+ |
+LL | E1::Z1(x) => {}
+ | ~~
+
+error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1`
+ --> $DIR/pat-tuple-field-count-cross.rs:35:9
+ |
+LL | E1::Z1 => {}
+ | ^^^^^^
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:19
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | -- ---- `E1::Z1` defined here
+ | |
+ | similarly named unit variant `Z0` defined here
+ |
+help: use the tuple variant pattern syntax instead
+ |
+LL | E1::Z1(/* fields */) => {}
+ | ~~~~~~~~~~~~~~~~~~~~
+help: a unit variant with a similar name exists
+ |
+LL | E1::Z0 => {}
+ | ~~
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:14:12
+ |
+LL | Z1(x) => {}
+ | ^ expected 0 fields, found 1
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:2:1
+ |
+LL | pub struct Z1();
+ | ---------------- tuple struct has 0 fields
+
+error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:18:9
+ |
+LL | S() => {}
+ | ^^^ expected 3 fields, found 0
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14
+ |
+LL | pub struct S(pub u8, pub u8, pub u8);
+ | ------ ------ ------ tuple struct has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | S(_, _, _) => {}
+ | +++++++
+help: use `..` to ignore all fields
+ |
+LL | S(..) => {}
+ | ++
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:19:11
+ |
+LL | S(1) => {}
+ | ^ expected 3 fields, found 1
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14
+ |
+LL | pub struct S(pub u8, pub u8, pub u8);
+ | ------ ------ ------ tuple struct has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | S(1, _, _) => {}
+ | ++++++
+help: use `..` to ignore the rest of the fields
+ |
+LL | S(1, ..) => {}
+ | ++++
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:20:11
+ |
+LL | S(xyz, abc) => {}
+ | ^^^ ^^^ expected 3 fields, found 2
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14
+ |
+LL | pub struct S(pub u8, pub u8, pub u8);
+ | ------ ------ ------ tuple struct has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | S(xyz, abc, _) => {}
+ | +++
+
+error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:21:11
+ |
+LL | S(1, 2, 3, 4) => {}
+ | ^ ^ ^ ^ expected 3 fields, found 4
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:4:14
+ |
+LL | pub struct S(pub u8, pub u8, pub u8);
+ | ------ ------ ------ tuple struct has 3 fields
+
+error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:24:9
+ |
+LL | M() => {}
+ | ^^^ expected 3 fields, found 0
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:1
+ |
+LL | / pub struct M(
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------ tuple struct has 3 fields
+LL | | );
+ | |__- tuple struct defined here
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | M(_, _, _) => {}
+ | +++++++
+help: use `..` to ignore all fields
+ |
+LL | M(..) => {}
+ | ++
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:25:11
+ |
+LL | M(1) => {}
+ | ^ expected 3 fields, found 1
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:1
+ |
+LL | / pub struct M(
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------ tuple struct has 3 fields
+LL | | );
+ | |__- tuple struct defined here
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | M(1, _, _) => {}
+ | ++++++
+help: use `..` to ignore the rest of the fields
+ |
+LL | M(1, ..) => {}
+ | ++++
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:26:11
+ |
+LL | M(xyz, abc) => {}
+ | ^^^ ^^^ expected 3 fields, found 2
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:1
+ |
+LL | / pub struct M(
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------ tuple struct has 3 fields
+LL | | );
+ | |__- tuple struct defined here
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | M(xyz, abc, _) => {}
+ | +++
+
+error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:27:11
+ |
+LL | M(1, 2, 3, 4) => {}
+ | ^ ^ ^ ^ expected 3 fields, found 4
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:5:1
+ |
+LL | / pub struct M(
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------
+LL | | pub u8,
+ | | ------ tuple struct has 3 fields
+LL | | );
+ | |__- tuple struct defined here
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 0 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:36:16
+ |
+LL | E1::Z1(x) => {}
+ | ^ expected 0 fields, found 1
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:19
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | ---- tuple variant has 0 fields
+
+error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:39:9
+ |
+LL | E1::S() => {}
+ | ^^^^^^^ expected 3 fields, found 0
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | -- -- -- tuple variant has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E1::S(_, _, _) => {}
+ | +++++++
+help: use `..` to ignore all fields
+ |
+LL | E1::S(..) => {}
+ | ++
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:40:15
+ |
+LL | E1::S(1) => {}
+ | ^ expected 3 fields, found 1
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | -- -- -- tuple variant has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E1::S(1, _, _) => {}
+ | ++++++
+help: use `..` to ignore the rest of the fields
+ |
+LL | E1::S(1, ..) => {}
+ | ++++
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:41:15
+ |
+LL | E1::S(xyz, abc) => {}
+ | ^^^ ^^^ expected 3 fields, found 2
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | -- -- -- tuple variant has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E1::S(xyz, abc, _) => {}
+ | +++
+
+error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:42:15
+ |
+LL | E1::S(1, 2, 3, 4) => {}
+ | ^ ^ ^ ^ expected 3 fields, found 4
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:11:27
+ |
+LL | pub enum E1 { Z0, Z1(), S(u8, u8, u8) }
+ | -- -- -- tuple variant has 3 fields
+
+error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:46:9
+ |
+LL | E2::S() => {}
+ | ^^^^^^^ expected 3 fields, found 0
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7
+ |
+LL | S(u8, u8, u8),
+ | -- -- -- tuple variant has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E2::S(_, _, _) => {}
+ | +++++++
+help: use `..` to ignore all fields
+ |
+LL | E2::S(..) => {}
+ | ++
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:47:15
+ |
+LL | E2::S(1) => {}
+ | ^ expected 3 fields, found 1
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7
+ |
+LL | S(u8, u8, u8),
+ | -- -- -- tuple variant has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E2::S(1, _, _) => {}
+ | ++++++
+help: use `..` to ignore the rest of the fields
+ |
+LL | E2::S(1, ..) => {}
+ | ++++
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:48:15
+ |
+LL | E2::S(xyz, abc) => {}
+ | ^^^ ^^^ expected 3 fields, found 2
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7
+ |
+LL | S(u8, u8, u8),
+ | -- -- -- tuple variant has 3 fields
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E2::S(xyz, abc, _) => {}
+ | +++
+
+error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:49:15
+ |
+LL | E2::S(1, 2, 3, 4) => {}
+ | ^ ^ ^ ^ expected 3 fields, found 4
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:14:7
+ |
+LL | S(u8, u8, u8),
+ | -- -- -- tuple variant has 3 fields
+
+error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:52:9
+ |
+LL | E2::M() => {}
+ | ^^^^^^^ expected 3 fields, found 0
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5
+ |
+LL | / M(
+LL | | u8,
+ | | --
+LL | | u8,
+ | | --
+LL | | u8,
+ | | -- tuple variant has 3 fields
+LL | | ),
+ | |_____- tuple variant defined here
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E2::M(_, _, _) => {}
+ | +++++++
+help: use `..` to ignore all fields
+ |
+LL | E2::M(..) => {}
+ | ++
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:53:15
+ |
+LL | E2::M(1) => {}
+ | ^ expected 3 fields, found 1
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5
+ |
+LL | / M(
+LL | | u8,
+ | | --
+LL | | u8,
+ | | --
+LL | | u8,
+ | | -- tuple variant has 3 fields
+LL | | ),
+ | |_____- tuple variant defined here
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E2::M(1, _, _) => {}
+ | ++++++
+help: use `..` to ignore the rest of the fields
+ |
+LL | E2::M(1, ..) => {}
+ | ++++
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:54:15
+ |
+LL | E2::M(xyz, abc) => {}
+ | ^^^ ^^^ expected 3 fields, found 2
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5
+ |
+LL | / M(
+LL | | u8,
+ | | --
+LL | | u8,
+ | | --
+LL | | u8,
+ | | -- tuple variant has 3 fields
+LL | | ),
+ | |_____- tuple variant defined here
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E2::M(xyz, abc, _) => {}
+ | +++
+
+error[E0023]: this pattern has 4 fields, but the corresponding tuple variant has 3 fields
+ --> $DIR/pat-tuple-field-count-cross.rs:55:15
+ |
+LL | E2::M(1, 2, 3, 4) => {}
+ | ^ ^ ^ ^ expected 3 fields, found 4
+ |
+ ::: $DIR/auxiliary/declarations-for-tuple-field-count-errors.rs:15:5
+ |
+LL | / M(
+LL | | u8,
+ | | --
+LL | | u8,
+ | | --
+LL | | u8,
+ | | -- tuple variant has 3 fields
+LL | | ),
+ | |_____- tuple variant defined here
+
+error: aborting due to 28 previous errors
+
+Some errors have detailed explanations: E0023, E0530, E0532.
+For more information about an error, try `rustc --explain E0023`.
diff --git a/src/test/ui/pattern/pat-tuple-overfield.rs b/src/test/ui/pattern/pat-tuple-overfield.rs
index 46a5e15..c863c65 100644
--- a/src/test/ui/pattern/pat-tuple-overfield.rs
+++ b/src/test/ui/pattern/pat-tuple-overfield.rs
@@ -1,4 +1,18 @@
struct S(u8, u8, u8);
+struct M(
+ u8,
+ u8,
+ u8,
+ u8,
+ u8,
+);
+
+struct Z0;
+struct Z1();
+enum E1 {
+ Z0,
+ Z1(),
+}
fn main() {
match (1, 2, 3) {
@@ -13,4 +27,48 @@
//~^ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields
_ => {}
}
+ match M(1, 2, 3, 4, 5) {
+ M(1, 2, 3, 4, 5, 6) => {}
+ //~^ ERROR this pattern has 6 fields, but the corresponding tuple struct has 5 fields
+ M(1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6) => {}
+ //~^ ERROR this pattern has 6 fields, but the corresponding tuple struct has 5 fields
+ M(
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ ) => {}
+ //~^^ ERROR this pattern has 6 fields, but the corresponding tuple struct has 5 fields
+ }
+ match Z0 {
+ Z0 => {}
+ Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0`
+ Z0(_) => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0`
+ Z0(_, _) => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0`
+ }
+ match Z1() {
+ Z1 => {} //~ ERROR match bindings cannot shadow tuple structs
+ Z1() => {}
+ Z1(_) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 0 fields
+ Z1(_, _) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple struct has 0 fields
+ }
+ match E1::Z0 {
+ E1::Z0 => {}
+ E1::Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ E1::Z0(_) => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ E1::Z0(_, _) => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ }
+ match E1::Z1() {
+ E1::Z1 => {} //~ ERROR expected unit struct, unit variant or constant, found tuple variant `E1::Z1`
+ E1::Z1() => {}
+ E1::Z1(_) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 0 fields
+ E1::Z1(_, _) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 0 fields
+ }
}
diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/src/test/ui/pattern/pat-tuple-overfield.stderr
index 45b6fd1..1c44f7e 100644
--- a/src/test/ui/pattern/pat-tuple-overfield.stderr
+++ b/src/test/ui/pattern/pat-tuple-overfield.stderr
@@ -1,5 +1,154 @@
+error[E0530]: match bindings cannot shadow tuple structs
+ --> $DIR/pat-tuple-overfield.rs:57:9
+ |
+LL | struct Z1();
+ | ------------ the tuple struct `Z1` is defined here
+...
+LL | Z1 => {}
+ | ^^ cannot be named the same as a tuple struct
+
+error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
+ --> $DIR/pat-tuple-overfield.rs:52:9
+ |
+LL | struct Z0;
+ | ---------- `Z0` defined here
+LL | struct Z1();
+ | ------------ similarly named tuple struct `Z1` defined here
+...
+LL | Z0() => {}
+ | ^^^^
+ |
+help: use this syntax instead
+ |
+LL | Z0 => {}
+ | ~~
+help: a tuple struct with a similar name exists
+ |
+LL | Z1() => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
+ --> $DIR/pat-tuple-overfield.rs:53:9
+ |
+LL | struct Z0;
+ | ---------- `Z0` defined here
+LL | struct Z1();
+ | ------------ similarly named tuple struct `Z1` defined here
+...
+LL | Z0(_) => {}
+ | ^^^^^
+ |
+help: use this syntax instead
+ |
+LL | Z0 => {}
+ | ~~
+help: a tuple struct with a similar name exists
+ |
+LL | Z1(_) => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit struct `Z0`
+ --> $DIR/pat-tuple-overfield.rs:54:9
+ |
+LL | struct Z0;
+ | ---------- `Z0` defined here
+LL | struct Z1();
+ | ------------ similarly named tuple struct `Z1` defined here
+...
+LL | Z0(_, _) => {}
+ | ^^^^^^^^
+ |
+help: use this syntax instead
+ |
+LL | Z0 => {}
+ | ~~
+help: a tuple struct with a similar name exists
+ |
+LL | Z1(_, _) => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ --> $DIR/pat-tuple-overfield.rs:64:9
+ |
+LL | Z0,
+ | -- `E1::Z0` defined here
+LL | Z1(),
+ | ---- similarly named tuple variant `Z1` defined here
+...
+LL | E1::Z0() => {}
+ | ^^^^^^^^
+ |
+help: use this syntax instead
+ |
+LL | E1::Z0 => {}
+ | ~~~~~~
+help: a tuple variant with a similar name exists
+ |
+LL | E1::Z1() => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ --> $DIR/pat-tuple-overfield.rs:65:9
+ |
+LL | Z0,
+ | -- `E1::Z0` defined here
+LL | Z1(),
+ | ---- similarly named tuple variant `Z1` defined here
+...
+LL | E1::Z0(_) => {}
+ | ^^^^^^^^^
+ |
+help: use this syntax instead
+ |
+LL | E1::Z0 => {}
+ | ~~~~~~
+help: a tuple variant with a similar name exists
+ |
+LL | E1::Z1(_) => {}
+ | ~~
+
+error[E0532]: expected tuple struct or tuple variant, found unit variant `E1::Z0`
+ --> $DIR/pat-tuple-overfield.rs:66:9
+ |
+LL | Z0,
+ | -- `E1::Z0` defined here
+LL | Z1(),
+ | ---- similarly named tuple variant `Z1` defined here
+...
+LL | E1::Z0(_, _) => {}
+ | ^^^^^^^^^^^^
+ |
+help: use this syntax instead
+ |
+LL | E1::Z0 => {}
+ | ~~~~~~
+help: a tuple variant with a similar name exists
+ |
+LL | E1::Z1(_, _) => {}
+ | ~~
+
+error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E1::Z1`
+ --> $DIR/pat-tuple-overfield.rs:69:9
+ |
+LL | Z0,
+ | -- similarly named unit variant `Z0` defined here
+LL | Z1(),
+ | ---- `E1::Z1` defined here
+...
+LL | E1::Z1 => {}
+ | ^^^^^^
+ |
+help: use the tuple variant pattern syntax instead
+ |
+LL | E1::Z1() => {}
+ | ~~~~~~~~
+help: a unit variant with a similar name exists
+ |
+LL | E1::Z0 => {}
+ | ~~
+
error[E0308]: mismatched types
- --> $DIR/pat-tuple-overfield.rs:5:9
+ --> $DIR/pat-tuple-overfield.rs:19:9
|
LL | match (1, 2, 3) {
| --------- this expression has type `({integer}, {integer}, {integer})`
@@ -10,7 +159,7 @@
found tuple `(_, _, _, _)`
error[E0308]: mismatched types
- --> $DIR/pat-tuple-overfield.rs:6:9
+ --> $DIR/pat-tuple-overfield.rs:20:9
|
LL | match (1, 2, 3) {
| --------- this expression has type `({integer}, {integer}, {integer})`
@@ -22,24 +171,139 @@
found tuple `(_, _, _, _)`
error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
- --> $DIR/pat-tuple-overfield.rs:10:9
+ --> $DIR/pat-tuple-overfield.rs:24:11
|
LL | struct S(u8, u8, u8);
- | --------------------- tuple struct defined here
+ | -- -- -- tuple struct has 3 fields
...
LL | S(1, 2, 3, 4) => {}
- | ^^^^^^^^^^^^^ expected 3 fields, found 4
+ | ^ ^ ^ ^ expected 3 fields, found 4
error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
- --> $DIR/pat-tuple-overfield.rs:12:9
+ --> $DIR/pat-tuple-overfield.rs:26:11
|
LL | struct S(u8, u8, u8);
- | --------------------- tuple struct defined here
+ | -- -- -- tuple struct has 3 fields
...
LL | S(1, 2, .., 3, 4) => {}
- | ^^^^^^^^^^^^^^^^^ expected 3 fields, found 4
+ | ^ ^ ^ ^ expected 3 fields, found 4
-error: aborting due to 4 previous errors
+error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
+ --> $DIR/pat-tuple-overfield.rs:31:11
+ |
+LL | struct M(
+ | - tuple struct defined here
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | -- tuple struct has 5 fields
+...
+LL | M(1, 2, 3, 4, 5, 6) => {}
+ | ^ ^ ^ ^ ^ ^ expected 5 fields, found 6
-Some errors have detailed explanations: E0023, E0308.
+error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
+ --> $DIR/pat-tuple-overfield.rs:33:11
+ |
+LL | struct M(
+ | - tuple struct defined here
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | -- tuple struct has 5 fields
+...
+LL | M(1,
+ | - ^
+LL | 2,
+ | ^
+LL | 3,
+ | ^
+LL | 4,
+ | ^
+LL | 5,
+ | ^
+LL | 6) => {}
+ | ^ expected 5 fields, found 6
+
+error[E0023]: this pattern has 6 fields, but the corresponding tuple struct has 5 fields
+ --> $DIR/pat-tuple-overfield.rs:41:13
+ |
+LL | struct M(
+ | - tuple struct defined here
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | --
+LL | u8,
+ | -- tuple struct has 5 fields
+...
+LL | M(
+ | -
+LL | 1,
+ | ^
+LL | 2,
+ | ^
+LL | 3,
+ | ^
+LL | 4,
+ | ^
+LL | 5,
+ | ^
+LL | 6,
+ | ^ expected 5 fields, found 6
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 0 fields
+ --> $DIR/pat-tuple-overfield.rs:59:12
+ |
+LL | struct Z1();
+ | ------------ tuple struct has 0 fields
+...
+LL | Z1(_) => {}
+ | ^ expected 0 fields, found 1
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 0 fields
+ --> $DIR/pat-tuple-overfield.rs:60:12
+ |
+LL | struct Z1();
+ | ------------ tuple struct has 0 fields
+...
+LL | Z1(_, _) => {}
+ | ^ ^ expected 0 fields, found 2
+
+error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 0 fields
+ --> $DIR/pat-tuple-overfield.rs:71:16
+ |
+LL | Z1(),
+ | ---- tuple variant has 0 fields
+...
+LL | E1::Z1(_) => {}
+ | ^ expected 0 fields, found 1
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 0 fields
+ --> $DIR/pat-tuple-overfield.rs:72:16
+ |
+LL | Z1(),
+ | ---- tuple variant has 0 fields
+...
+LL | E1::Z1(_, _) => {}
+ | ^ ^ expected 0 fields, found 2
+
+error: aborting due to 19 previous errors
+
+Some errors have detailed explanations: E0023, E0308, E0530, E0532.
For more information about an error, try `rustc --explain E0023`.
diff --git a/src/test/ui/pattern/pat-tuple-underfield.rs b/src/test/ui/pattern/pat-tuple-underfield.rs
index ed852a4..dac60e3 100644
--- a/src/test/ui/pattern/pat-tuple-underfield.rs
+++ b/src/test/ui/pattern/pat-tuple-underfield.rs
@@ -21,6 +21,12 @@
//~^ ERROR this pattern has 0 fields, but the corresponding tuple struct has 2 fields
//~| HELP use `_` to explicitly ignore each field
//~| HELP use `..` to ignore all fields
+
+ // Test non-standard formatting
+ S () => {}
+ //~^ ERROR this pattern has 0 fields, but the corresponding tuple struct has 2 fields
+ //~| HELP use `_` to explicitly ignore each field
+ //~| HELP use `..` to ignore all fields
}
match E::S(0, 1.0) {
@@ -39,6 +45,12 @@
//~^ ERROR this pattern has 0 fields, but the corresponding tuple variant has 2 fields
//~| HELP use `_` to explicitly ignore each field
//~| HELP use `..` to ignore all fields
+
+ // Test non-standard formatting
+ E::S () => {}
+ //~^ ERROR this pattern has 0 fields, but the corresponding tuple variant has 2 fields
+ //~| HELP use `_` to explicitly ignore each field
+ //~| HELP use `..` to ignore all fields
}
match E::S(0, 1.0) {
E::S => {}
diff --git a/src/test/ui/pattern/pat-tuple-underfield.stderr b/src/test/ui/pattern/pat-tuple-underfield.stderr
index 70c21db..e75f9b3 100644
--- a/src/test/ui/pattern/pat-tuple-underfield.stderr
+++ b/src/test/ui/pattern/pat-tuple-underfield.stderr
@@ -1,5 +1,5 @@
error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::S`
- --> $DIR/pat-tuple-underfield.rs:44:9
+ --> $DIR/pat-tuple-underfield.rs:56:9
|
LL | S(i32, f32),
| ----------- `E::S` defined here
@@ -8,42 +8,42 @@
| ^^^^ help: use the tuple variant pattern syntax instead: `E::S(_, _)`
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
- --> $DIR/pat-tuple-underfield.rs:9:9
+ --> $DIR/pat-tuple-underfield.rs:9:11
|
LL | struct S(i32, f32);
- | ------------------- tuple struct defined here
+ | --- --- tuple struct has 2 fields
...
LL | S(x) => {}
- | ^^^^ expected 2 fields, found 1
+ | ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | S(x, _) => {}
- | ^^^
+ | +++
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
- --> $DIR/pat-tuple-underfield.rs:14:9
+ --> $DIR/pat-tuple-underfield.rs:14:11
|
LL | struct S(i32, f32);
- | ------------------- tuple struct defined here
+ | --- --- tuple struct has 2 fields
...
LL | S(_) => {}
- | ^^^^ expected 2 fields, found 1
+ | ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | S(_, _) => {}
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | S(..) => {}
- | ^^
+ | ~~
error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
--> $DIR/pat-tuple-underfield.rs:20:9
|
LL | struct S(i32, f32);
- | ------------------- tuple struct defined here
+ | --- --- tuple struct has 2 fields
...
LL | S() => {}
| ^^^ expected 2 fields, found 0
@@ -51,49 +51,67 @@
help: use `_` to explicitly ignore each field
|
LL | S(_, _) => {}
- | ^^^^
+ | ++++
help: use `..` to ignore all fields
|
LL | S(..) => {}
- | ^^
+ | ++
+
+error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
+ --> $DIR/pat-tuple-underfield.rs:26:9
+ |
+LL | struct S(i32, f32);
+ | --- --- tuple struct has 2 fields
+...
+LL | S () => {}
+ | ^^^^ expected 2 fields, found 0
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | S (_, _) => {}
+ | ++++
+help: use `..` to ignore all fields
+ |
+LL | S (..) => {}
+ | ++
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
- --> $DIR/pat-tuple-underfield.rs:27:9
+ --> $DIR/pat-tuple-underfield.rs:33:14
|
LL | S(i32, f32),
- | ----------- tuple variant defined here
+ | --- --- tuple variant has 2 fields
...
LL | E::S(x) => {}
- | ^^^^^^^ expected 2 fields, found 1
+ | ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | E::S(x, _) => {}
- | ^^^
+ | +++
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
- --> $DIR/pat-tuple-underfield.rs:32:9
+ --> $DIR/pat-tuple-underfield.rs:38:14
|
LL | S(i32, f32),
- | ----------- tuple variant defined here
+ | --- --- tuple variant has 2 fields
...
LL | E::S(_) => {}
- | ^^^^^^^ expected 2 fields, found 1
+ | ^ expected 2 fields, found 1
|
help: use `_` to explicitly ignore each field
|
LL | E::S(_, _) => {}
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | E::S(..) => {}
- | ^^
+ | ~~
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
- --> $DIR/pat-tuple-underfield.rs:38:9
+ --> $DIR/pat-tuple-underfield.rs:44:9
|
LL | S(i32, f32),
- | ----------- tuple variant defined here
+ | --- --- tuple variant has 2 fields
...
LL | E::S() => {}
| ^^^^^^ expected 2 fields, found 0
@@ -101,31 +119,49 @@
help: use `_` to explicitly ignore each field
|
LL | E::S(_, _) => {}
- | ^^^^
+ | ++++
help: use `..` to ignore all fields
|
LL | E::S(..) => {}
- | ^^
+ | ++
-error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 4 fields
+error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
--> $DIR/pat-tuple-underfield.rs:50:9
|
+LL | S(i32, f32),
+ | --- --- tuple variant has 2 fields
+...
+LL | E::S () => {}
+ | ^^^^^^^ expected 2 fields, found 0
+ |
+help: use `_` to explicitly ignore each field
+ |
+LL | E::S (_, _) => {}
+ | ++++
+help: use `..` to ignore all fields
+ |
+LL | E::S (..) => {}
+ | ++
+
+error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 4 fields
+ --> $DIR/pat-tuple-underfield.rs:62:19
+ |
LL | struct Point4(i32, i32, i32, i32);
- | ---------------------------------- tuple struct defined here
+ | --- --- --- --- tuple struct has 4 fields
...
LL | Point4( a , _ ) => {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 4 fields, found 2
+ | ^ ^ expected 4 fields, found 2
|
help: use `_` to explicitly ignore each field
|
LL | Point4( a , _ , _, _) => {}
- | ^^^^^^
+ | ++++++
help: use `..` to ignore the rest of the fields
|
LL | Point4( a, ..) => {}
- | ^^^^
+ | ~~~~
-error: aborting due to 8 previous errors
+error: aborting due to 10 previous errors
Some errors have detailed explanations: E0023, E0532.
For more information about an error, try `rustc --explain E0023`.
diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr
index 44d6a85..c800afd 100644
--- a/src/test/ui/pattern/pattern-error-continue.stderr
+++ b/src/test/ui/pattern/pattern-error-continue.stderr
@@ -19,20 +19,20 @@
help: use this syntax instead
|
LL | A::D => (),
- | ^^^^
+ | ~~~~
help: a tuple variant with a similar name exists
|
LL | A::B(_) => (),
- | ^
+ | ~
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
- --> $DIR/pattern-error-continue.rs:17:9
+ --> $DIR/pattern-error-continue.rs:17:14
|
LL | B(isize, isize),
- | --------------- tuple variant defined here
+ | ----- ----- tuple variant has 2 fields
...
LL | A::B(_, _, _) => (),
- | ^^^^^^^^^^^^^ expected 2 fields, found 3
+ | ^ ^ ^ expected 2 fields, found 3
error[E0308]: mismatched types
--> $DIR/pattern-error-continue.rs:22:9
diff --git a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs b/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs
index 7549eae..c85af7f 100644
--- a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs
+++ b/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.rs
@@ -1,5 +1,4 @@
#![feature(if_let_guard)]
-#![allow(incomplete_features)]
#![deny(irrefutable_let_patterns)]
diff --git a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr b/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
index d6926ee..b976835 100644
--- a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
+++ b/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
@@ -1,11 +1,11 @@
error: irrefutable `if let` pattern
- --> $DIR/deny-irrefutable-let-patterns.rs:7:5
+ --> $DIR/deny-irrefutable-let-patterns.rs:6:8
|
LL | if let _ = 5 {}
- | ^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/deny-irrefutable-let-patterns.rs:4:9
+ --> $DIR/deny-irrefutable-let-patterns.rs:3:9
|
LL | #![deny(irrefutable_let_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,18 +13,16 @@
= help: consider replacing the `if let` with a `let`
error: irrefutable `while let` pattern
- --> $DIR/deny-irrefutable-let-patterns.rs:9:5
+ --> $DIR/deny-irrefutable-let-patterns.rs:8:11
|
-LL | / while let _ = 5 {
-LL | | break;
-LL | | }
- | |_____^
+LL | while let _ = 5 {
+ | ^^^^^^^^^
|
= note: this pattern will always match, so the loop will never exit
= help: consider instead using a `loop { ... }` with a `let` inside it
error: irrefutable `if let` guard pattern
- --> $DIR/deny-irrefutable-let-patterns.rs:14:18
+ --> $DIR/deny-irrefutable-let-patterns.rs:13:18
|
LL | _ if let _ = 2 => {}
| ^
diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr
index f515525..4a987cb 100644
--- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr
+++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr
@@ -12,7 +12,7 @@
|
LL | match Some(Some(North)) {
| ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered
- |
+ |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr
index cd157de..4efb419 100644
--- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr
+++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr
@@ -3,7 +3,7 @@
|
LL | match private::DATA {
| ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered
- |
+ |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
index 29aa0c1..02eff28 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
@@ -49,7 +49,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let E::A = e { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&B` and `&C` not covered
--> $DIR/non-exhaustive-defined-here.rs:40:11
@@ -102,7 +102,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let E::A = e { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
--> $DIR/non-exhaustive-defined-here.rs:48:11
@@ -198,7 +198,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Opt::Some(ref _x) = e { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 8 previous errors
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
index c953cd3..1ca0a33 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
@@ -27,7 +27,7 @@
|
LL | match Some(10) {
| ^^^^^^^^ pattern `Some(_)` not covered
- |
+ |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
diff --git a/src/test/ui/pattern/usefulness/top-level-alternation.rs b/src/test/ui/pattern/usefulness/top-level-alternation.rs
index 4b47b97..076de84 100644
--- a/src/test/ui/pattern/usefulness/top-level-alternation.rs
+++ b/src/test/ui/pattern/usefulness/top-level-alternation.rs
@@ -1,3 +1,5 @@
+#![feature(let_else)]
+
#![deny(unreachable_patterns)]
fn main() {
@@ -53,4 +55,5 @@
1..=2 => {}, //~ ERROR unreachable pattern
_ => {},
}
+ let (0 | 0) = 0 else { return }; //~ ERROR unreachable pattern
}
diff --git a/src/test/ui/pattern/usefulness/top-level-alternation.stderr b/src/test/ui/pattern/usefulness/top-level-alternation.stderr
index 76bc4f8..dd5936f 100644
--- a/src/test/ui/pattern/usefulness/top-level-alternation.stderr
+++ b/src/test/ui/pattern/usefulness/top-level-alternation.stderr
@@ -1,68 +1,74 @@
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:4:23
+ --> $DIR/top-level-alternation.rs:6:23
|
LL | while let 0..=2 | 1 = 0 {}
| ^
|
note: the lint level is defined here
- --> $DIR/top-level-alternation.rs:1:9
+ --> $DIR/top-level-alternation.rs:3:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:5:20
+ --> $DIR/top-level-alternation.rs:7:20
|
LL | if let 0..=2 | 1 = 0 {}
| ^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:9:15
+ --> $DIR/top-level-alternation.rs:11:15
|
LL | | 0 => {}
| ^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:14:15
+ --> $DIR/top-level-alternation.rs:16:15
|
LL | | Some(0) => {}
| ^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:19:9
+ --> $DIR/top-level-alternation.rs:21:9
|
LL | (0, 0) => {}
| ^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:39:9
+ --> $DIR/top-level-alternation.rs:41:9
|
LL | _ => {}
| ^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:43:9
+ --> $DIR/top-level-alternation.rs:45:9
|
LL | Some(_) => {}
| ^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:44:9
+ --> $DIR/top-level-alternation.rs:46:9
|
LL | None => {}
| ^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:49:9
+ --> $DIR/top-level-alternation.rs:51:9
|
LL | None | Some(_) => {}
| ^^^^^^^^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:53:9
+ --> $DIR/top-level-alternation.rs:55:9
|
LL | 1..=2 => {},
| ^^^^^
-error: aborting due to 10 previous errors
+error: unreachable pattern
+ --> $DIR/top-level-alternation.rs:58:14
+ |
+LL | let (0 | 0) = 0 else { return };
+ | ^
+
+error: aborting due to 11 previous errors
diff --git a/src/test/ui/phantom-auto-trait.stderr b/src/test/ui/phantom-auto-trait.stderr
index de13176..e7b5528 100644
--- a/src/test/ui/phantom-auto-trait.stderr
+++ b/src/test/ui/phantom-auto-trait.stderr
@@ -1,9 +1,6 @@
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-auto-trait.rs:21:12
|
-LL | fn is_zen<T: Zen>(_: T) {}
- | --- required by this bound in `is_zen`
-...
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely
|
@@ -18,17 +15,19 @@
|
LL | struct Guard<'a, T: 'a> {
| ^^^^^
+note: required by a bound in `is_zen`
+ --> $DIR/phantom-auto-trait.rs:18:14
+ |
+LL | fn is_zen<T: Zen>(_: T) {}
+ | ^^^ required by this bound in `is_zen`
help: consider restricting type parameter `T`
|
LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-auto-trait.rs:26:12
|
-LL | fn is_zen<T: Zen>(_: T) {}
- | --- required by this bound in `is_zen`
-...
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely
|
@@ -48,10 +47,15 @@
|
LL | struct Nested<T>(T);
| ^^^^^^
+note: required by a bound in `is_zen`
+ --> $DIR/phantom-auto-trait.rs:18:14
+ |
+LL | fn is_zen<T: Zen>(_: T) {}
+ | ^^^ required by this bound in `is_zen`
help: consider restricting type parameter `T`
|
LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/placement-syntax.stderr b/src/test/ui/placement-syntax.stderr
index 1a76f7c..3fdaf4c 100644
--- a/src/test/ui/placement-syntax.stderr
+++ b/src/test/ui/placement-syntax.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-`
|
LL | if x< -1 {
- | ^^^
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/polymorphization/const_parameters/closures.rs b/src/test/ui/polymorphization/const_parameters/closures.rs
index f20605e..2f41beeb 100644
--- a/src/test/ui/polymorphization/const_parameters/closures.rs
+++ b/src/test/ui/polymorphization/const_parameters/closures.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags:-Zpolymorphize=on
-#![feature(const_generics, rustc_attrs)]
-//~^ WARN the feature `const_generics` is incomplete
+#![feature(generic_const_exprs, rustc_attrs)]
+//~^ WARN the feature `generic_const_exprs` is incomplete
// This test checks that the polymorphization analysis correctly detects unused const
// parameters in closures.
diff --git a/src/test/ui/polymorphization/const_parameters/closures.stderr b/src/test/ui/polymorphization/const_parameters/closures.stderr
index 266b6e6..d0ee893 100644
--- a/src/test/ui/polymorphization/const_parameters/closures.stderr
+++ b/src/test/ui/polymorphization/const_parameters/closures.stderr
@@ -1,11 +1,11 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
+warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/closures.rs:3:12
|
-LL | #![feature(const_generics, rustc_attrs)]
- | ^^^^^^^^^^^^^^
+LL | #![feature(generic_const_exprs, rustc_attrs)]
+ | ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
error: item has unused generic parameters
--> $DIR/closures.rs:19:19
diff --git a/src/test/ui/polymorphization/const_parameters/functions.rs b/src/test/ui/polymorphization/const_parameters/functions.rs
index 04c279d..cbc1b63 100644
--- a/src/test/ui/polymorphization/const_parameters/functions.rs
+++ b/src/test/ui/polymorphization/const_parameters/functions.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags:-Zpolymorphize=on
-#![feature(const_generics, rustc_attrs)]
-//~^ WARN the feature `const_generics` is incomplete
+#![feature(generic_const_exprs, rustc_attrs)]
+//~^ WARN the feature `generic_const_exprs` is incomplete
// This test checks that the polymorphization analysis correctly detects unused const
// parameters in functions.
diff --git a/src/test/ui/polymorphization/const_parameters/functions.stderr b/src/test/ui/polymorphization/const_parameters/functions.stderr
index e379e32..03d0bbb 100644
--- a/src/test/ui/polymorphization/const_parameters/functions.stderr
+++ b/src/test/ui/polymorphization/const_parameters/functions.stderr
@@ -1,11 +1,11 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
+warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/functions.rs:3:12
|
-LL | #![feature(const_generics, rustc_attrs)]
- | ^^^^^^^^^^^^^^
+LL | #![feature(generic_const_exprs, rustc_attrs)]
+ | ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
error: item has unused generic parameters
--> $DIR/functions.rs:15:8
diff --git a/src/test/ui/polymorphization/generators.rs b/src/test/ui/polymorphization/generators.rs
index 9eb34fb..f295cf1 100644
--- a/src/test/ui/polymorphization/generators.rs
+++ b/src/test/ui/polymorphization/generators.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags:-Zpolymorphize=on
-#![feature(const_generics, generators, generator_trait, rustc_attrs)]
-//~^ WARN the feature `const_generics` is incomplete
+#![feature(generic_const_exprs, generators, generator_trait, rustc_attrs)]
+//~^ WARN the feature `generic_const_exprs` is incomplete
use std::marker::Unpin;
use std::ops::{Generator, GeneratorState};
diff --git a/src/test/ui/polymorphization/generators.stderr b/src/test/ui/polymorphization/generators.stderr
index c59055b..c4e566a 100644
--- a/src/test/ui/polymorphization/generators.stderr
+++ b/src/test/ui/polymorphization/generators.stderr
@@ -1,11 +1,11 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
+warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/generators.rs:3:12
|
-LL | #![feature(const_generics, generators, generator_trait, rustc_attrs)]
- | ^^^^^^^^^^^^^^
+LL | #![feature(generic_const_exprs, generators, generator_trait, rustc_attrs)]
+ | ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
error: item has unused generic parameters
--> $DIR/generators.rs:36:5
diff --git a/src/test/ui/polymorphization/promoted-function-2.rs b/src/test/ui/polymorphization/promoted-function-2.rs
index 2831f86..d2d0f33 100644
--- a/src/test/ui/polymorphization/promoted-function-2.rs
+++ b/src/test/ui/polymorphization/promoted-function-2.rs
@@ -1,8 +1,8 @@
// build-fail
// compile-flags:-Zpolymorphize=on
#![crate_type = "lib"]
-#![feature(lazy_normalization_consts, rustc_attrs)]
-//~^ WARN the feature `lazy_normalization_consts` is incomplete
+#![feature(generic_const_exprs, rustc_attrs)]
+//~^ WARN the feature `generic_const_exprs` is incomplete
#[rustc_polymorphize_error]
fn test<T>() {
diff --git a/src/test/ui/polymorphization/promoted-function-2.stderr b/src/test/ui/polymorphization/promoted-function-2.stderr
index 38d4808..4d7bab6 100644
--- a/src/test/ui/polymorphization/promoted-function-2.stderr
+++ b/src/test/ui/polymorphization/promoted-function-2.stderr
@@ -1,11 +1,11 @@
-warning: the feature `lazy_normalization_consts` is incomplete and may not be safe to use and/or cause compiler crashes
+warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/promoted-function-2.rs:4:12
|
-LL | #![feature(lazy_normalization_consts, rustc_attrs)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #![feature(generic_const_exprs, rustc_attrs)]
+ | ^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
- = note: see issue #72219 <https://github.com/rust-lang/rust/issues/72219> for more information
+ = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
error: item has unused generic parameters
--> $DIR/promoted-function-2.rs:8:4
diff --git a/src/test/ui/pptypedef.stderr b/src/test/ui/pptypedef.stderr
index 40155de..c42d9e6 100644
--- a/src/test/ui/pptypedef.stderr
+++ b/src/test/ui/pptypedef.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `i32` to `u32`
|
LL | let_in(3u32, |i| { assert!(i == 3u32); });
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/pptypedef.rs:8:37
@@ -18,7 +18,7 @@
help: change the type of the numeric literal from `u32` to `i32`
|
LL | let_in(3i32, |i| { assert!(i == 3i32); });
- | ^^^^
+ | ~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-13641.rs b/src/test/ui/privacy/issue-13641.rs
similarity index 100%
rename from src/test/ui/issues/issue-13641.rs
rename to src/test/ui/privacy/issue-13641.rs
diff --git a/src/test/ui/issues/issue-13641.stderr b/src/test/ui/privacy/issue-13641.stderr
similarity index 100%
rename from src/test/ui/issues/issue-13641.stderr
rename to src/test/ui/privacy/issue-13641.stderr
diff --git a/src/test/ui/privacy/privacy-ns1.stderr b/src/test/ui/privacy/privacy-ns1.stderr
index d09a8aa..91bc84e 100644
--- a/src/test/ui/privacy/privacy-ns1.stderr
+++ b/src/test/ui/privacy/privacy-ns1.stderr
@@ -10,7 +10,7 @@
help: a unit struct with a similar name exists
|
LL | Baz();
- | ^^^
+ | ~~~
help: consider importing this function instead
|
LL | use foo2::Bar;
@@ -28,7 +28,7 @@
help: a unit struct with a similar name exists
|
LL | Baz();
- | ^^^
+ | ~~~
help: consider importing this function
|
LL | use foo2::Bar;
@@ -46,7 +46,7 @@
help: a struct with a similar name exists
|
LL | let _x: Box<Baz>;
- | ^^^
+ | ~~~
help: consider importing this trait
|
LL | use foo1::Bar;
diff --git a/src/test/ui/privacy/privacy-ns2.stderr b/src/test/ui/privacy/privacy-ns2.stderr
index fdf0549..904e901 100644
--- a/src/test/ui/privacy/privacy-ns2.stderr
+++ b/src/test/ui/privacy/privacy-ns2.stderr
@@ -21,7 +21,7 @@
help: a unit struct with a similar name exists
|
LL | Baz();
- | ^^^
+ | ~~~
help: consider importing this function instead
|
LL | use foo2::Bar;
@@ -36,7 +36,7 @@
help: use `=` if you meant to assign
|
LL | let _x = Bar();
- | ^
+ | ~
help: consider importing this trait instead
|
LL | use foo1::Bar;
diff --git a/src/test/ui/privacy/privacy5.stderr b/src/test/ui/privacy/privacy5.stderr
index 216abfc..d0c0c6b 100644
--- a/src/test/ui/privacy/privacy5.stderr
+++ b/src/test/ui/privacy/privacy5.stderr
@@ -363,7 +363,7 @@
|
LL | let a = other::A(());
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
LL | pub struct A(());
@@ -380,7 +380,7 @@
|
LL | let b = other::B(2);
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -397,7 +397,7 @@
|
LL | let c = other::C(2, 3);
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -414,7 +414,7 @@
|
LL | let other::A(()) = a;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
LL | pub struct A(());
@@ -431,7 +431,7 @@
|
LL | let other::A(_) = a;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
LL | pub struct A(());
@@ -448,7 +448,7 @@
|
LL | match a { other::A(()) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
LL | pub struct A(());
@@ -465,7 +465,7 @@
|
LL | match a { other::A(_) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
LL | pub struct A(());
@@ -482,7 +482,7 @@
|
LL | let other::B(_) = b;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -499,7 +499,7 @@
|
LL | let other::B(_b) = b;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -516,7 +516,7 @@
|
LL | match b { other::B(_) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -533,7 +533,7 @@
|
LL | match b { other::B(_b) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -550,7 +550,7 @@
|
LL | match b { other::B(1) => {}
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -567,7 +567,7 @@
|
LL | other::B(_) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -584,7 +584,7 @@
|
LL | let other::C(_, _) = c;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -601,7 +601,7 @@
|
LL | let other::C(_a, _) = c;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -618,7 +618,7 @@
|
LL | let other::C(_, _b) = c;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -635,7 +635,7 @@
|
LL | let other::C(_a, _b) = c;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -652,7 +652,7 @@
|
LL | match c { other::C(_, _) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -669,7 +669,7 @@
|
LL | match c { other::C(_a, _) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -686,7 +686,7 @@
|
LL | match c { other::C(_, _b) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -703,7 +703,7 @@
|
LL | match c { other::C(_a, _b) => {} }
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
@@ -720,7 +720,7 @@
|
LL | let a2 = other::A;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14
|
LL | pub struct A(());
@@ -737,7 +737,7 @@
|
LL | let b2 = other::B;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14
|
LL | pub struct B(isize);
@@ -754,7 +754,7 @@
|
LL | let c2 = other::C;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14
|
LL | pub struct C(pub isize, isize);
diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.full_tait.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.full_tait.stderr
deleted file mode 100644
index a74c7c9..0000000
--- a/src/test/ui/privacy/private-in-public-assoc-ty.full_tait.stderr
+++ /dev/null
@@ -1,77 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/private-in-public-assoc-ty.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0446]: private type `Priv` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:20:9
- |
-LL | struct Priv;
- | ------------ `Priv` declared as private
-...
-LL | type A = Priv;
- | ^^^^^^^^^^^^^^ can't leak private type
-
-warning: private trait `PrivTr` in public interface (error E0445)
- --> $DIR/private-in-public-assoc-ty.rs:27:9
- |
-LL | type Alias1: PrivTr;
- | ^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(private_in_public)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-
-warning: private type `Priv` in public interface (error E0446)
- --> $DIR/private-in-public-assoc-ty.rs:30:9
- |
-LL | type Alias2: PubTrAux1<Priv> = u8;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-
-warning: private type `Priv` in public interface (error E0446)
- --> $DIR/private-in-public-assoc-ty.rs:33:9
- |
-LL | type Alias3: PubTrAux2<A = Priv> = u8;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-
-error[E0446]: private type `Priv` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:37:9
- |
-LL | struct Priv;
- | ------------ `Priv` declared as private
-...
-LL | type Alias4 = Priv;
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0446]: private type `Priv` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:44:9
- |
-LL | struct Priv;
- | ------------ `Priv` declared as private
-...
-LL | type Alias1 = Priv;
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0445]: private trait `PrivTr` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:47:9
- |
-LL | trait PrivTr {}
- | ------------ `PrivTr` declared as private
-...
-LL | type Exist = impl PrivTr;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
-
-error: aborting due to 4 previous errors; 4 warnings emitted
-
-Some errors have detailed explanations: E0445, E0446.
-For more information about an error, try `rustc --explain E0445`.
diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.min_tait.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.min_tait.stderr
deleted file mode 100644
index 36230ff..0000000
--- a/src/test/ui/privacy/private-in-public-assoc-ty.min_tait.stderr
+++ /dev/null
@@ -1,68 +0,0 @@
-error[E0446]: private type `Priv` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:20:9
- |
-LL | struct Priv;
- | ------------ `Priv` declared as private
-...
-LL | type A = Priv;
- | ^^^^^^^^^^^^^^ can't leak private type
-
-warning: private trait `PrivTr` in public interface (error E0445)
- --> $DIR/private-in-public-assoc-ty.rs:27:9
- |
-LL | type Alias1: PrivTr;
- | ^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(private_in_public)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-
-warning: private type `Priv` in public interface (error E0446)
- --> $DIR/private-in-public-assoc-ty.rs:30:9
- |
-LL | type Alias2: PubTrAux1<Priv> = u8;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-
-warning: private type `Priv` in public interface (error E0446)
- --> $DIR/private-in-public-assoc-ty.rs:33:9
- |
-LL | type Alias3: PubTrAux2<A = Priv> = u8;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
-
-error[E0446]: private type `Priv` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:37:9
- |
-LL | struct Priv;
- | ------------ `Priv` declared as private
-...
-LL | type Alias4 = Priv;
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0446]: private type `Priv` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:44:9
- |
-LL | struct Priv;
- | ------------ `Priv` declared as private
-...
-LL | type Alias1 = Priv;
- | ^^^^^^^^^^^^^^^^^^^ can't leak private type
-
-error[E0445]: private trait `PrivTr` in public interface
- --> $DIR/private-in-public-assoc-ty.rs:47:9
- |
-LL | trait PrivTr {}
- | ------------ `PrivTr` declared as private
-...
-LL | type Exist = impl PrivTr;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
-
-error: aborting due to 4 previous errors; 3 warnings emitted
-
-Some errors have detailed explanations: E0445, E0446.
-For more information about an error, try `rustc --explain E0445`.
diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.rs b/src/test/ui/privacy/private-in-public-assoc-ty.rs
index f8fb565..fba72c1 100644
--- a/src/test/ui/privacy/private-in-public-assoc-ty.rs
+++ b/src/test/ui/privacy/private-in-public-assoc-ty.rs
@@ -2,10 +2,7 @@
// This test also ensures that the checks are performed even inside private modules.
#![feature(associated_type_defaults)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
mod m {
struct Priv;
diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.stderr
new file mode 100644
index 0000000..ba62a22
--- /dev/null
+++ b/src/test/ui/privacy/private-in-public-assoc-ty.stderr
@@ -0,0 +1,68 @@
+error[E0446]: private type `Priv` in public interface
+ --> $DIR/private-in-public-assoc-ty.rs:17:9
+ |
+LL | struct Priv;
+ | ------------ `Priv` declared as private
+...
+LL | type A = Priv;
+ | ^^^^^^^^^^^^^^ can't leak private type
+
+warning: private trait `PrivTr` in public interface (error E0445)
+ --> $DIR/private-in-public-assoc-ty.rs:24:9
+ |
+LL | type Alias1: PrivTr;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(private_in_public)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+
+warning: private type `Priv` in public interface (error E0446)
+ --> $DIR/private-in-public-assoc-ty.rs:27:9
+ |
+LL | type Alias2: PubTrAux1<Priv> = u8;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+
+warning: private type `Priv` in public interface (error E0446)
+ --> $DIR/private-in-public-assoc-ty.rs:30:9
+ |
+LL | type Alias3: PubTrAux2<A = Priv> = u8;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+
+error[E0446]: private type `Priv` in public interface
+ --> $DIR/private-in-public-assoc-ty.rs:34:9
+ |
+LL | struct Priv;
+ | ------------ `Priv` declared as private
+...
+LL | type Alias4 = Priv;
+ | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+
+error[E0446]: private type `Priv` in public interface
+ --> $DIR/private-in-public-assoc-ty.rs:41:9
+ |
+LL | struct Priv;
+ | ------------ `Priv` declared as private
+...
+LL | type Alias1 = Priv;
+ | ^^^^^^^^^^^^^^^^^^^ can't leak private type
+
+error[E0445]: private trait `PrivTr` in public interface
+ --> $DIR/private-in-public-assoc-ty.rs:44:9
+ |
+LL | trait PrivTr {}
+ | ------------ `PrivTr` declared as private
+...
+LL | type Exist = impl PrivTr;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
+
+error: aborting due to 4 previous errors; 3 warnings emitted
+
+Some errors have detailed explanations: E0445, E0446.
+For more information about an error, try `rustc --explain E0445`.
diff --git a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.full_tait.stderr b/src/test/ui/privacy/private-in-public-type-alias-impl-trait.full_tait.stderr
deleted file mode 100644
index c419c7e..0000000
--- a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/private-in-public-type-alias-impl-trait.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs b/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs
index 8443631..c7df315 100644
--- a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs
+++ b/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs
@@ -1,9 +1,6 @@
// build-pass (FIXME(62277): could be check-pass?)
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![deny(private_in_public)]
pub type Pub = impl Default;
@@ -22,7 +19,9 @@
impl Trait for u8 {
type Pub = impl Default;
- fn method() -> Self::Pub { Priv }
+ fn method() -> Self::Pub {
+ Priv
+ }
}
fn main() {}
diff --git a/src/test/ui/privacy/private-in-public-warn.stderr b/src/test/ui/privacy/private-in-public-warn.stderr
index 8240cc3..f51cfc8 100644
--- a/src/test/ui/privacy/private-in-public-warn.stderr
+++ b/src/test/ui/privacy/private-in-public-warn.stderr
@@ -336,8 +336,9 @@
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | pub type Alias<T> = T;
- | --
+LL - pub type Alias<T: PrivTr> = T;
+LL + pub type Alias<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/private-in-public-warn.rs:75:29
@@ -347,8 +348,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | pub type Alias<T> = T;
- | --
+LL - pub type Alias<T> where T: PrivTr = T;
+LL + pub type Alias<T> = T;
+ |
error: aborting due to 36 previous errors; 2 warnings emitted
diff --git a/src/test/ui/privacy/private-method-cross-crate.stderr b/src/test/ui/privacy/private-method-cross-crate.stderr
index 6532932..93f6a7f 100644
--- a/src/test/ui/privacy/private-method-cross-crate.stderr
+++ b/src/test/ui/privacy/private-method-cross-crate.stderr
@@ -3,7 +3,7 @@
|
LL | nyan.nap();
| ^^^ private associated function
- |
+ |
::: $DIR/auxiliary/cci_class_5.rs:8:9
|
LL | fn nap(&self) {}
diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr
index 6950667..0f6003c 100644
--- a/src/test/ui/privacy/restricted/test.stderr
+++ b/src/test/ui/privacy/restricted/test.stderr
@@ -87,7 +87,7 @@
|
LL | u.g();
| ^ private associated function
- |
+ |
::: $DIR/auxiliary/pub_restricted.rs:14:5
|
LL | pub(crate) fn g(&self) {}
@@ -98,7 +98,7 @@
|
LL | u.h();
| ^ private associated function
- |
+ |
::: $DIR/auxiliary/pub_restricted.rs:15:5
|
LL | crate fn h(&self) {}
diff --git a/src/test/ui/proc-macro/attribute-with-error.stderr b/src/test/ui/proc-macro/attribute-with-error.stderr
index 7f3a7e6..127c499 100644
--- a/src/test/ui/proc-macro/attribute-with-error.stderr
+++ b/src/test/ui/proc-macro/attribute-with-error.stderr
@@ -1,4 +1,12 @@
error[E0308]: mismatched types
+ --> $DIR/attribute-with-error.rs:25:22
+ |
+LL | let a: i32 = "foo";
+ | --- ^^^^^ expected `i32`, found `&str`
+ | |
+ | expected due to this
+
+error[E0308]: mismatched types
--> $DIR/attribute-with-error.rs:10:18
|
LL | let a: i32 = "foo";
@@ -15,14 +23,6 @@
| expected due to this
error[E0308]: mismatched types
- --> $DIR/attribute-with-error.rs:25:22
- |
-LL | let a: i32 = "foo";
- | --- ^^^^^ expected `i32`, found `&str`
- | |
- | expected due to this
-
-error[E0308]: mismatched types
--> $DIR/attribute-with-error.rs:35:22
|
LL | let a: i32 = "foo";
diff --git a/src/test/ui/proc-macro/auxiliary/api/parse.rs b/src/test/ui/proc-macro/auxiliary/api/parse.rs
index 4105236..93551eb 100644
--- a/src/test/ui/proc-macro/auxiliary/api/parse.rs
+++ b/src/test/ui/proc-macro/auxiliary/api/parse.rs
@@ -1,9 +1,15 @@
use proc_macro::Literal;
pub fn test() {
+ test_display_literal();
test_parse_literal();
}
+fn test_display_literal() {
+ assert_eq!(Literal::isize_unsuffixed(-10).to_string(), "-10");
+ assert_eq!(Literal::isize_suffixed(-10).to_string(), "-10isize");
+}
+
fn test_parse_literal() {
assert_eq!("1".parse::<Literal>().unwrap().to_string(), "1");
assert_eq!("1.0".parse::<Literal>().unwrap().to_string(), "1.0");
@@ -12,7 +18,10 @@
assert_eq!("b\"\"".parse::<Literal>().unwrap().to_string(), "b\"\"");
assert_eq!("r##\"\"##".parse::<Literal>().unwrap().to_string(), "r##\"\"##");
assert_eq!("10ulong".parse::<Literal>().unwrap().to_string(), "10ulong");
+ assert_eq!("-10ulong".parse::<Literal>().unwrap().to_string(), "-10ulong");
+ assert!("true".parse::<Literal>().is_err());
+ assert!(".8".parse::<Literal>().is_err());
assert!("0 1".parse::<Literal>().is_err());
assert!("'a".parse::<Literal>().is_err());
assert!(" 0".parse::<Literal>().is_err());
@@ -20,4 +29,6 @@
assert!("/* comment */0".parse::<Literal>().is_err());
assert!("0/* comment */".parse::<Literal>().is_err());
assert!("0// comment".parse::<Literal>().is_err());
+ assert!("- 10".parse::<Literal>().is_err());
+ assert!("-'x'".parse::<Literal>().is_err());
}
diff --git a/src/test/ui/proc-macro/auxiliary/assert-span-pos.rs b/src/test/ui/proc-macro/auxiliary/assert-span-pos.rs
new file mode 100644
index 0000000..455c5c7
--- /dev/null
+++ b/src/test/ui/proc-macro/auxiliary/assert-span-pos.rs
@@ -0,0 +1,37 @@
+// force-host
+// no-prefer-dynamic
+
+#![feature(proc_macro_diagnostic, proc_macro_span)]
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::{TokenStream, TokenTree, Span};
+
+fn lit_span(tt: TokenTree) -> (Span, String) {
+ match tt {
+ TokenTree::Literal(..) |
+ TokenTree::Group(..) => (tt.span(), tt.to_string().trim().into()),
+ _ => panic!("expected a literal in token tree, got: {:?}", tt)
+ }
+}
+
+#[proc_macro]
+pub fn assert_span_pos(input: TokenStream) -> TokenStream {
+ let mut tokens = input.into_iter();
+ let (sp1, str1) = lit_span(tokens.next().expect("first argument"));
+ let _ = tokens.next();
+ let (_sp2, str2) = lit_span(tokens.next().expect("second argument"));
+
+ let line: usize = str1.parse().unwrap();
+ let col: usize = str2.parse().unwrap();
+
+ let sp1s = sp1.start();
+ if (line, col) != (sp1s.line, sp1s.column) {
+ let msg = format!("line/column mismatch: ({}, {}) != ({}, {})", line, col,
+ sp1s.line, sp1s.column);
+ sp1.error(msg).emit();
+ }
+
+ "".parse().unwrap()
+}
diff --git a/src/test/ui/proc-macro/crt-static.rs b/src/test/ui/proc-macro/crt-static.rs
index 4f11f81..8c1a9dc 100644
--- a/src/test/ui/proc-macro/crt-static.rs
+++ b/src/test/ui/proc-macro/crt-static.rs
@@ -1,12 +1,19 @@
// Test proc-macro crate can be built without additional RUSTFLAGS
// on musl target
// override -Ctarget-feature=-crt-static from compiletest
-// compile-flags: -Ctarget-feature=
+// compile-flags: --crate-type proc-macro -Ctarget-feature=
// ignore-wasm32
// ignore-sgx no support for proc-macro crate type
// build-pass
#![crate_type = "proc-macro"]
+// FIXME: This don't work when crate-type is specified by attribute
+// `#![crate_type = "proc-macro"]`, not by `--crate-type=proc-macro`
+// command line flag. This is beacuse the list of `cfg` symbols is generated
+// before attributes are parsed. See rustc_interface::util::add_configuration
+#[cfg(target_feature = "crt-static")]
+compile_error!("crt-static is enabled");
+
extern crate proc_macro;
use proc_macro::TokenStream;
diff --git a/src/test/ui/proc-macro/derive-helper-shadowing.stderr b/src/test/ui/proc-macro/derive-helper-shadowing.stderr
index 4115fec..3b16093 100644
--- a/src/test/ui/proc-macro/derive-helper-shadowing.stderr
+++ b/src/test/ui/proc-macro/derive-helper-shadowing.stderr
@@ -16,6 +16,8 @@
LL | #[derive(GenHelperUse)]
| ^^^^^^^^^^^^
|
+ = note: consider importing this attribute macro:
+ empty_helper
= note: this error originates in the derive macro `GenHelperUse` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot find attribute `empty_helper` in this scope
@@ -27,6 +29,8 @@
LL | gen_helper_use!();
| ------------------ in this macro invocation
|
+ = note: consider importing this attribute macro:
+ crate::empty_helper
= note: this error originates in the macro `gen_helper_use` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `empty_helper` is ambiguous (name vs any other name during import resolution)
diff --git a/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr b/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr
index 070b066..001b345 100644
--- a/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr
+++ b/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr
@@ -3,7 +3,7 @@
|
LL | #[my_macro] struct One($name);
| ^^^^^
- |
+ |
::: $DIR/group-compat-hack.rs:27:5
|
LL | impl_macros!(Foo);
@@ -20,7 +20,7 @@
|
LL | #[my_macro] struct One($name);
| ^^^^^
- |
+ |
::: $DIR/group-compat-hack.rs:44:5
|
LL | impl_macros!(Foo);
@@ -36,7 +36,7 @@
|
LL | #[my_macro] struct Two($name);
| ^^^^^
- |
+ |
::: $DIR/group-compat-hack.rs:46:5
|
LL | arrays!(Foo);
@@ -52,7 +52,7 @@
|
LL | #[my_macro] struct Three($T);
| ^^
- |
+ |
::: $DIR/group-compat-hack.rs:55:5
|
LL | tuple_from_req!(Foo);
@@ -68,7 +68,7 @@
|
LL | #[my_macro] struct Three($T);
| ^^
- |
+ |
::: $DIR/group-compat-hack.rs:63:5
|
LL | tuple_from_req!(Foo);
@@ -87,7 +87,7 @@
|
LL | #[my_macro] struct One($name);
| ^^^^^
- |
+ |
::: $DIR/group-compat-hack.rs:27:5
|
LL | impl_macros!(Foo);
@@ -105,7 +105,7 @@
|
LL | #[my_macro] struct One($name);
| ^^^^^
- |
+ |
::: $DIR/group-compat-hack.rs:44:5
|
LL | impl_macros!(Foo);
@@ -122,7 +122,7 @@
|
LL | #[my_macro] struct Two($name);
| ^^^^^
- |
+ |
::: $DIR/group-compat-hack.rs:46:5
|
LL | arrays!(Foo);
@@ -139,7 +139,7 @@
|
LL | #[my_macro] struct Three($T);
| ^^
- |
+ |
::: $DIR/group-compat-hack.rs:55:5
|
LL | tuple_from_req!(Foo);
@@ -156,7 +156,7 @@
|
LL | #[my_macro] struct Three($T);
| ^^
- |
+ |
::: $DIR/group-compat-hack.rs:63:5
|
LL | tuple_from_req!(Foo);
diff --git a/src/test/ui/proc-macro/item-error.stderr b/src/test/ui/proc-macro/item-error.stderr
index 27f7639..b544be6 100644
--- a/src/test/ui/proc-macro/item-error.stderr
+++ b/src/test/ui/proc-macro/item-error.stderr
@@ -6,8 +6,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | struct A<'a> {
-LL | a: &'a u64
+LL ~ struct A<'a> {
+LL ~ a: &'a u64
|
error: aborting due to previous error
diff --git a/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr b/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr
index a617319..633a6c6 100644
--- a/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr
+++ b/src/test/ui/proc-macro/macro-namespace-reserved-2.stderr
@@ -93,30 +93,40 @@
|
LL | my_macro_attr!();
| ^^^^^^^^^^^^^
+ |
+ = note: `my_macro_attr` is in scope, but it is an attribute: `#[my_macro_attr]`
error: cannot find macro `MyTrait` in this scope
--> $DIR/macro-namespace-reserved-2.rs:33:5
|
LL | MyTrait!();
| ^^^^^^^
+ |
+ = note: `MyTrait` is in scope, but it is a derive macro: `#[derive(MyTrait)]`
error: cannot find attribute `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:38:3
|
LL | #[my_macro]
| ^^^^^^^^
+ |
+ = note: `my_macro` is in scope, but it is a function-like macro
error: cannot find derive macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:48:10
|
LL | #[derive(my_macro)]
| ^^^^^^^^
+ |
+ = note: `my_macro` is in scope, but it is a function-like macro
error: cannot find derive macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:48:10
|
LL | #[derive(my_macro)]
| ^^^^^^^^
+ |
+ = note: `my_macro` is in scope, but it is a function-like macro
error: aborting due to 20 previous errors
diff --git a/src/test/ui/proc-macro/nested-nonterminal-tokens.rs b/src/test/ui/proc-macro/nested-nonterminal-tokens.rs
index 2f5af10..04d34e2 100644
--- a/src/test/ui/proc-macro/nested-nonterminal-tokens.rs
+++ b/src/test/ui/proc-macro/nested-nonterminal-tokens.rs
@@ -17,7 +17,7 @@
(first, $e:expr) => { wrap!(second, $e + 1) };
(second, $e:expr) => { wrap!(third, $e + 2) };
(third, $e:expr) => {
- print_bang!($e + 3);
+ print_bang!($e + 3)
};
}
diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr
index 0af1b4a..071e103 100644
--- a/src/test/ui/proc-macro/parent-source-spans.stderr
+++ b/src/test/ui/proc-macro/parent-source-spans.stderr
@@ -144,7 +144,7 @@
...
LL | one!("hello", "world");
| ----------------------- in this macro invocation
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
@@ -160,7 +160,7 @@
...
LL | two!("yay", "rust");
| -------------------- in this macro invocation
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
@@ -176,7 +176,7 @@
...
LL | three!("hip", "hop");
| --------------------- in this macro invocation
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr
index c5fbf0d..e518c6a 100644
--- a/src/test/ui/proc-macro/resolve-error.stderr
+++ b/src/test/ui/proc-macro/resolve-error.stderr
@@ -3,7 +3,7 @@
|
LL | bang_proc_macrp!();
| ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro`
- |
+ |
::: $DIR/auxiliary/test-macros.rs:15:1
|
LL | pub fn empty(_: TokenStream) -> TokenStream {
@@ -50,7 +50,7 @@
|
LL | #[derive(Dlona)]
| ^^^^^ help: a derive macro with a similar name exists: `Clona`
- |
+ |
::: $DIR/auxiliary/derive-clona.rs:11:1
|
LL | pub fn derive_clonea(input: TokenStream) -> TokenStream {
@@ -61,7 +61,7 @@
|
LL | #[derive(Dlona)]
| ^^^^^ help: a derive macro with a similar name exists: `Clona`
- |
+ |
::: $DIR/auxiliary/derive-clona.rs:11:1
|
LL | pub fn derive_clonea(input: TokenStream) -> TokenStream {
@@ -72,7 +72,7 @@
|
LL | #[derive(Dlone)]
| ^^^^^ help: a derive macro with a similar name exists: `Clone`
- |
+ |
::: $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | pub macro Clone($item:item) {
@@ -83,7 +83,7 @@
|
LL | #[derive(Dlone)]
| ^^^^^ help: a derive macro with a similar name exists: `Clone`
- |
+ |
::: $SRC_DIR/core/src/clone.rs:LL:COL
|
LL | pub macro Clone($item:item) {
@@ -100,7 +100,7 @@
|
LL | #[attr_proc_macra]
| ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro`
- |
+ |
::: $DIR/auxiliary/test-macros.rs:20:1
|
LL | pub fn empty_attr(_: TokenStream, _: TokenStream) -> TokenStream {
@@ -111,7 +111,7 @@
|
LL | #[derive(FooWithLongNan)]
| ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName`
- |
+ |
::: $DIR/auxiliary/derive-foo.rs:11:1
|
LL | pub fn derive_foo(input: TokenStream) -> TokenStream {
@@ -122,7 +122,7 @@
|
LL | #[derive(FooWithLongNan)]
| ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName`
- |
+ |
::: $DIR/auxiliary/derive-foo.rs:11:1
|
LL | pub fn derive_foo(input: TokenStream) -> TokenStream {
diff --git a/src/test/ui/proc-macro/span-absolute-posititions.rs b/src/test/ui/proc-macro/span-absolute-posititions.rs
new file mode 100644
index 0000000..6d70fe6
--- /dev/null
+++ b/src/test/ui/proc-macro/span-absolute-posititions.rs
@@ -0,0 +1,24 @@
+// aux-build:assert-span-pos.rs
+// ignore-tidy-tab
+extern crate assert_span_pos;
+
+assert_span_pos::assert_span_pos!(5, 35);
+
+// Test space indentation
+ assert_span_pos::assert_span_pos!(8, 39);
+// Test tab indentation
+ assert_span_pos::assert_span_pos!(10, 36);
+
+// Two tests to ensure the promise of the docs that the column is the number
+// of UTF-8 bytes instead of some other number like number of code points.
+
+// Test that multi byte UTF-8 characters indeed count as multiple bytes
+/*🌈*/assert_span_pos::assert_span_pos!(16, 40);
+// Test with a complete grapheme cluster
+/*🏳️🌈*/assert_span_pos::assert_span_pos!(18, 43);
+
+// Test that the macro actually emits an error on a mismatch:
+assert_span_pos::assert_span_pos!(0, 35); //~ ERROR line/column mismatch: (0, 35) != (21, 35)
+assert_span_pos::assert_span_pos!(22, 0); //~ ERROR line/column mismatch: (22, 0) != (22, 35)
+
+fn main() {}
diff --git a/src/test/ui/proc-macro/span-absolute-posititions.stderr b/src/test/ui/proc-macro/span-absolute-posititions.stderr
new file mode 100644
index 0000000..6aca44a
--- /dev/null
+++ b/src/test/ui/proc-macro/span-absolute-posititions.stderr
@@ -0,0 +1,14 @@
+error: line/column mismatch: (0, 35) != (21, 35)
+ --> $DIR/span-absolute-posititions.rs:21:35
+ |
+LL | assert_span_pos::assert_span_pos!(0, 35);
+ | ^
+
+error: line/column mismatch: (22, 0) != (22, 35)
+ --> $DIR/span-absolute-posititions.rs:22:35
+ |
+LL | assert_span_pos::assert_span_pos!(22, 0);
+ | ^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/proc-macro/span-from-proc-macro.stderr b/src/test/ui/proc-macro/span-from-proc-macro.stderr
index c3904d6..11ee20e 100644
--- a/src/test/ui/proc-macro/span-from-proc-macro.stderr
+++ b/src/test/ui/proc-macro/span-from-proc-macro.stderr
@@ -6,7 +6,7 @@
...
LL | field: MissingType
| ^^^^^^^^^^^ not found in this scope
- |
+ |
::: $DIR/span-from-proc-macro.rs:8:1
|
LL | #[error_from_attribute]
@@ -20,7 +20,7 @@
...
LL | Variant(OtherMissingType)
| ^^^^^^^^^^^^^^^^ not found in this scope
- |
+ |
::: $DIR/span-from-proc-macro.rs:11:10
|
LL | #[derive(ErrorFromDerive)]
@@ -34,7 +34,7 @@
LL | custom_quote::custom_quote! {
LL | my_ident
| ^^^^^^^^ not found in this scope
- |
+ |
::: $DIR/span-from-proc-macro.rs:16:5
|
LL | other_error_from_bang!();
@@ -50,7 +50,7 @@
...
LL | pub fn error_from_bang(_input: TokenStream) -> TokenStream {
| ---------------------------------------------------------- in this expansion of `error_from_bang!`
- |
+ |
::: $DIR/span-from-proc-macro.rs:15:5
|
LL | error_from_bang!();
diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr
index 9e91ed4..7135607 100644
--- a/src/test/ui/proc-macro/span-preservation.stderr
+++ b/src/test/ui/proc-macro/span-preservation.stderr
@@ -18,7 +18,7 @@
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | Some(x) => { return x.try_into().unwrap() },
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/span-preservation.rs:33:22
diff --git a/src/test/ui/process/process-panic-after-fork.rs b/src/test/ui/process/process-panic-after-fork.rs
index 1ccf6bb..ad74937 100644
--- a/src/test/ui/process/process-panic-after-fork.rs
+++ b/src/test/ui/process/process-panic-after-fork.rs
@@ -23,6 +23,21 @@
use libc::c_int;
+#[cfg(not(target_os = "linux"))]
+fn getpid() -> u32 {
+ process::id()
+}
+
+/// We need to directly use the getpid syscall instead of using `process::id()`
+/// because the libc wrapper might return incorrect values after a process was
+/// forked.
+#[cfg(target_os = "linux")]
+fn getpid() -> u32 {
+ unsafe {
+ libc::syscall(libc::SYS_getpid) as _
+ }
+}
+
/// This stunt allocator allows us to spot heap allocations in the child.
struct PidChecking<A> {
parent: A,
@@ -44,7 +59,7 @@
fn check(&self) {
let require_pid = self.require_pid.load(Ordering::Acquire);
if require_pid != 0 {
- let actual_pid = process::id();
+ let actual_pid = getpid();
if require_pid != actual_pid {
unsafe {
libc::raise(libc::SIGUSR1);
diff --git a/src/test/ui/pub/pub-ident-fn-2.stderr b/src/test/ui/pub/pub-ident-fn-2.stderr
index b830b0e..b5b667b 100644
--- a/src/test/ui/pub/pub-ident-fn-2.stderr
+++ b/src/test/ui/pub/pub-ident-fn-2.stderr
@@ -7,7 +7,7 @@
help: add `fn` here to parse `foo` as a public function
|
LL | pub fn foo(_s: usize) { bar() }
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr b/src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr
index 0df6c00..6a9aeaf 100644
--- a/src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr
+++ b/src/test/ui/pub/pub-ident-fn-with-lifetime-2.stderr
@@ -7,7 +7,7 @@
help: add `fn` here to parse `bar` as a public method
|
LL | pub fn bar<'a>(&self, _s: &'a usize) -> bool { true }
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/pub/pub-ident-fn-with-lifetime.stderr b/src/test/ui/pub/pub-ident-fn-with-lifetime.stderr
index 5b378df..c1ca013 100644
--- a/src/test/ui/pub/pub-ident-fn-with-lifetime.stderr
+++ b/src/test/ui/pub/pub-ident-fn-with-lifetime.stderr
@@ -7,7 +7,7 @@
help: add `fn` here to parse `foo` as a public function
|
LL | pub fn foo<'a>(_s: &'a usize) -> bool { true }
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/pub/pub-ident-fn.stderr b/src/test/ui/pub/pub-ident-fn.stderr
index 928f621..cb94c48 100644
--- a/src/test/ui/pub/pub-ident-fn.stderr
+++ b/src/test/ui/pub/pub-ident-fn.stderr
@@ -7,7 +7,7 @@
help: add `fn` here to parse `foo` as a public function
|
LL | pub fn foo(_s: usize) -> bool { true }
- | ^^
+ | ++
error: aborting due to previous error
diff --git a/src/test/ui/pub/pub-ident-struct-with-lifetime.stderr b/src/test/ui/pub/pub-ident-struct-with-lifetime.stderr
index 79597c5..562b68e 100644
--- a/src/test/ui/pub/pub-ident-struct-with-lifetime.stderr
+++ b/src/test/ui/pub/pub-ident-struct-with-lifetime.stderr
@@ -7,7 +7,7 @@
help: add `struct` here to parse `S` as a public struct
|
LL | pub struct S<'a> {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/pub/pub-ident-struct.stderr b/src/test/ui/pub/pub-ident-struct.stderr
index 8af2490..d3a3787 100644
--- a/src/test/ui/pub/pub-ident-struct.stderr
+++ b/src/test/ui/pub/pub-ident-struct.stderr
@@ -7,7 +7,7 @@
help: add `struct` here to parse `S` as a public struct
|
LL | pub struct S {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/question-mark-type-infer.stderr b/src/test/ui/question-mark-type-infer.stderr
index db5042b..86c533d 100644
--- a/src/test/ui/question-mark-type-infer.stderr
+++ b/src/test/ui/question-mark-type-infer.stderr
@@ -8,7 +8,7 @@
help: consider specifying the type argument in the method call
|
LL | l.iter().map(f).collect::<B>()?
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/range/range-1.stderr b/src/test/ui/range/range-1.stderr
index b282fa7..ff494d7 100644
--- a/src/test/ui/range/range-1.stderr
+++ b/src/test/ui/range/range-1.stderr
@@ -23,13 +23,13 @@
|
LL | let range = *arr..;
| ^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/ops/range.rs:LL:COL
- |
-LL | pub struct RangeFrom<Idx> {
- | --- required by this bound in `RangeFrom`
|
= help: the trait `Sized` is not implemented for `[{integer}]`
+note: required by a bound in `RangeFrom`
+ --> $SRC_DIR/core/src/ops/range.rs:LL:COL
+ |
+LL | pub struct RangeFrom<Idx> {
+ | ^^^ required by this bound in `RangeFrom`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/range/range-inclusive-pattern-precedence.stderr b/src/test/ui/range/range-inclusive-pattern-precedence.stderr
index 3330ced..8af1a57 100644
--- a/src/test/ui/range/range-inclusive-pattern-precedence.stderr
+++ b/src/test/ui/range/range-inclusive-pattern-precedence.stderr
@@ -16,7 +16,7 @@
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr
index 90a4aa6..009273c 100644
--- a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr
+++ b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr
@@ -16,7 +16,7 @@
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/reachable/expr_if.rs b/src/test/ui/reachable/expr_if.rs
index a3d5489..3c04eaf 100644
--- a/src/test/ui/reachable/expr_if.rs
+++ b/src/test/ui/reachable/expr_if.rs
@@ -4,7 +4,7 @@
#![deny(unreachable_code)]
fn foo() {
- if {return} { //~ ERROR unreachable block in `if` expression
+ if {return} { //~ ERROR unreachable block in `if`
println!("Hello, world!");
}
}
diff --git a/src/test/ui/reachable/expr_if.stderr b/src/test/ui/reachable/expr_if.stderr
index 71cc94b..1112273 100644
--- a/src/test/ui/reachable/expr_if.stderr
+++ b/src/test/ui/reachable/expr_if.stderr
@@ -1,4 +1,4 @@
-error: unreachable block in `if` expression
+error: unreachable block in `if` or `while` expression
--> $DIR/expr_if.rs:7:17
|
LL | if {return} {
@@ -7,7 +7,7 @@
| | any code following this expression is unreachable
LL | | println!("Hello, world!");
LL | | }
- | |_____^ unreachable block in `if` expression
+ | |_____^ unreachable block in `if` or `while` expression
|
note: the lint level is defined here
--> $DIR/expr_if.rs:4:9
diff --git a/src/test/ui/reachable/expr_while.rs b/src/test/ui/reachable/expr_while.rs
index 10a4b69..5005f38 100644
--- a/src/test/ui/reachable/expr_while.rs
+++ b/src/test/ui/reachable/expr_while.rs
@@ -5,7 +5,7 @@
fn foo() {
while {return} {
- //~^ ERROR unreachable block in `while` expression
+ //~^ ERROR unreachable block in `if`
println!("Hello, world!");
}
}
@@ -20,7 +20,7 @@
fn baz() {
// Here, we cite the `while` loop as dead.
while {return} {
- //~^ ERROR unreachable block in `while` expression
+ //~^ ERROR unreachable block in `if`
println!("I am dead.");
}
println!("I am, too.");
diff --git a/src/test/ui/reachable/expr_while.stderr b/src/test/ui/reachable/expr_while.stderr
index 8335457..b1859f6 100644
--- a/src/test/ui/reachable/expr_while.stderr
+++ b/src/test/ui/reachable/expr_while.stderr
@@ -1,4 +1,4 @@
-error: unreachable block in `while` expression
+error: unreachable block in `if` or `while` expression
--> $DIR/expr_while.rs:7:20
|
LL | while {return} {
@@ -8,7 +8,7 @@
LL | |
LL | | println!("Hello, world!");
LL | | }
- | |_____^ unreachable block in `while` expression
+ | |_____^ unreachable block in `if` or `while` expression
|
note: the lint level is defined here
--> $DIR/expr_while.rs:4:9
@@ -16,7 +16,7 @@
LL | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^
-error: unreachable block in `while` expression
+error: unreachable block in `if` or `while` expression
--> $DIR/expr_while.rs:22:20
|
LL | while {return} {
@@ -26,7 +26,7 @@
LL | |
LL | | println!("I am dead.");
LL | | }
- | |_____^ unreachable block in `while` expression
+ | |_____^ unreachable block in `if` or `while` expression
error: aborting due to 2 previous errors
diff --git a/src/test/ui/recursion/issue-26548-recursion-via-normalize.rs b/src/test/ui/recursion/issue-26548-recursion-via-normalize.rs
index 4d1cd05..03cb3e2 100644
--- a/src/test/ui/recursion/issue-26548-recursion-via-normalize.rs
+++ b/src/test/ui/recursion/issue-26548-recursion-via-normalize.rs
@@ -1,6 +1,8 @@
-//~ ERROR cycle detected when computing layout of
-//~| NOTE ...which requires computing layout of
-//~| NOTE ...which again requires computing layout of
+//~ ERROR cycle detected when computing layout of `S`
+//~| NOTE ...which requires computing layout of `std::option::Option<<S as Mirror>::It>`...
+//~| NOTE ...which requires computing layout of `std::option::Option<S>`...
+//~| NOTE ...which again requires computing layout of `S`, completing the cycle
+//~| NOTE cycle used when computing layout of `std::option::Option<S>`
// build-fail
@@ -13,6 +15,5 @@
struct S(Option<<S as Mirror>::It>);
fn main() {
- //~^ NOTE cycle used when optimizing MIR for `main`
let _s = S(None);
}
diff --git a/src/test/ui/recursion/issue-26548-recursion-via-normalize.stderr b/src/test/ui/recursion/issue-26548-recursion-via-normalize.stderr
index 7f197a2..21c0e1e 100644
--- a/src/test/ui/recursion/issue-26548-recursion-via-normalize.stderr
+++ b/src/test/ui/recursion/issue-26548-recursion-via-normalize.stderr
@@ -1,12 +1,9 @@
error[E0391]: cycle detected when computing layout of `S`
|
+ = note: ...which requires computing layout of `std::option::Option<<S as Mirror>::It>`...
= note: ...which requires computing layout of `std::option::Option<S>`...
= note: ...which again requires computing layout of `S`, completing the cycle
-note: cycle used when optimizing MIR for `main`
- --> $DIR/issue-26548-recursion-via-normalize.rs:15:1
- |
-LL | fn main() {
- | ^^^^^^^^^
+ = note: cycle used when computing layout of `std::option::Option<S>`
error: aborting due to previous error
diff --git a/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.polonius.stderr b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.polonius.stderr
new file mode 100644
index 0000000..4b4fc4f
--- /dev/null
+++ b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.polonius.stderr
@@ -0,0 +1,15 @@
+error: reached the recursion limit while instantiating `std::ptr::drop_in_place::<S<fn(f...)))))))))))))))))))))))))))))>))`
+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ |
+LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: `std::ptr::drop_in_place` defined here
+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ |
+LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-38591-non-regular-dropck-recursion.polonius/issue-38591-non-regular-dropck-recursion.long-type.txt'
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/recursion/recursion.polonius.stderr b/src/test/ui/recursion/recursion.polonius.stderr
new file mode 100644
index 0000000..c727fe5
--- /dev/null
+++ b/src/test/ui/recursion/recursion.polonius.stderr
@@ -0,0 +1,15 @@
+error: reached the recursion limit while instantiating `test::<Cons<Cons<Cons<Cons<Cons<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+ --> $DIR/recursion.rs:18:11
+ |
+LL | _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: `test` defined here
+ --> $DIR/recursion.rs:16:1
+ |
+LL | fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: the full type name has been written to '$TEST_BUILD_DIR/recursion/recursion.polonius/recursion.long-type.txt'
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/recursion/recursive-enum.stderr b/src/test/ui/recursion/recursive-enum.stderr
index ab4709d..f5d25c5 100644
--- a/src/test/ui/recursion/recursive-enum.stderr
+++ b/src/test/ui/recursion/recursive-enum.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `List` representable
|
LL | enum List<T> { Cons(T, Box<List<T>>), Nil }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/recursion/recursive-requirements.stderr b/src/test/ui/recursion/recursive-requirements.stderr
index 0518cc5..8ee154c 100644
--- a/src/test/ui/recursion/recursive-requirements.stderr
+++ b/src/test/ui/recursion/recursive-requirements.stderr
@@ -1,9 +1,6 @@
error[E0277]: `*const Bar` cannot be shared between threads safely
--> $DIR/recursive-requirements.rs:16:12
|
-LL | struct AssertSync<T: Sync>(PhantomData<T>);
- | ---- required by this bound in `AssertSync`
-...
LL | let _: AssertSync<Foo> = unimplemented!();
| ^^^^^^^^^^^^^^^ `*const Bar` cannot be shared between threads safely
|
@@ -13,13 +10,15 @@
|
LL | pub struct Foo {
| ^^^
+note: required by a bound in `AssertSync`
+ --> $DIR/recursive-requirements.rs:3:22
+ |
+LL | struct AssertSync<T: Sync>(PhantomData<T>);
+ | ^^^^ required by this bound in `AssertSync`
error[E0277]: `*const Foo` cannot be shared between threads safely
--> $DIR/recursive-requirements.rs:16:12
|
-LL | struct AssertSync<T: Sync>(PhantomData<T>);
- | ---- required by this bound in `AssertSync`
-...
LL | let _: AssertSync<Foo> = unimplemented!();
| ^^^^^^^^^^^^^^^ `*const Foo` cannot be shared between threads safely
|
@@ -35,6 +34,11 @@
|
LL | pub struct Foo {
| ^^^
+note: required by a bound in `AssertSync`
+ --> $DIR/recursive-requirements.rs:3:22
+ |
+LL | struct AssertSync<T: Sync>(PhantomData<T>);
+ | ^^^^ required by this bound in `AssertSync`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr
index dfb69a3..f904a0e 100644
--- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr
+++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr
@@ -3,7 +3,7 @@
|
LL | let Ok(x) = res;
| ^^^^^ pattern `Err(_)` not covered
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
diff --git a/src/test/ui/ref-suggestion.stderr b/src/test/ui/ref-suggestion.stderr
index 332dbb7..a973c58 100644
--- a/src/test/ui/ref-suggestion.stderr
+++ b/src/test/ui/ref-suggestion.stderr
@@ -31,7 +31,7 @@
help: borrow this field in the pattern to avoid moving `x.0.0`
|
LL | (Some(ref y), ()) => {},
- | ^^^
+ | +++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/regions/issue-78262.default.stderr b/src/test/ui/regions/issue-78262.default.stderr
index e97b8ec..5250848 100644
--- a/src/test/ui/regions/issue-78262.default.stderr
+++ b/src/test/ui/regions/issue-78262.default.stderr
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
- --> $DIR/issue-78262.rs:12:28
+ --> $DIR/issue-78262.rs:14:28
|
LL | let f = |x: &dyn TT| x.func();
| ^^^^ lifetime mismatch
|
= note: expected reference `&(dyn TT + 'static)`
found reference `&dyn TT`
-note: the anonymous lifetime #1 defined on the body at 12:13...
- --> $DIR/issue-78262.rs:12:13
+note: the anonymous lifetime #1 defined on the body at 14:13...
+ --> $DIR/issue-78262.rs:14:13
|
LL | let f = |x: &dyn TT| x.func();
| ^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/regions/issue-78262.nll.stderr b/src/test/ui/regions/issue-78262.nll.stderr
index fafff35..a35d6fd 100644
--- a/src/test/ui/regions/issue-78262.nll.stderr
+++ b/src/test/ui/regions/issue-78262.nll.stderr
@@ -1,5 +1,5 @@
error[E0521]: borrowed data escapes outside of closure
- --> $DIR/issue-78262.rs:12:26
+ --> $DIR/issue-78262.rs:14:26
|
LL | let f = |x: &dyn TT| x.func();
| - ^^^^^^^^ `x` escapes the closure body here
diff --git a/src/test/ui/regions/issue-78262.polonius.stderr b/src/test/ui/regions/issue-78262.polonius.stderr
new file mode 100644
index 0000000..a35d6fd
--- /dev/null
+++ b/src/test/ui/regions/issue-78262.polonius.stderr
@@ -0,0 +1,11 @@
+error[E0521]: borrowed data escapes outside of closure
+ --> $DIR/issue-78262.rs:14:26
+ |
+LL | let f = |x: &dyn TT| x.func();
+ | - ^^^^^^^^ `x` escapes the closure body here
+ | |
+ | `x` is a reference that is only valid in the closure body
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/regions/issue-78262.rs b/src/test/ui/regions/issue-78262.rs
index 0bdb0ab..b88ad67 100644
--- a/src/test/ui/regions/issue-78262.rs
+++ b/src/test/ui/regions/issue-78262.rs
@@ -1,6 +1,8 @@
-// revisions: nll default
+// revisions: default nll polonius
// ignore-compare-mode-nll
-//[nll]compile-flags: -Z borrowck=mir
+// ignore-compare-mode-polonius
+// [nll] compile-flags: -Z borrowck=mir
+// [polonius] compile-flags: -Z borrowck=mir -Z polonius
trait TT {}
@@ -11,4 +13,5 @@
fn main() {
let f = |x: &dyn TT| x.func(); //[default]~ ERROR: mismatched types
//[nll]~^ ERROR: borrowed data escapes outside of closure
+ //[polonius]~^^ ERROR: borrowed data escapes outside of closure
}
diff --git a/src/test/ui/regions/region-borrow-params-issue-29793-big.stderr b/src/test/ui/regions/region-borrow-params-issue-29793-big.stderr
index 328e602..561dd64 100644
--- a/src/test/ui/regions/region-borrow-params-issue-29793-big.stderr
+++ b/src/test/ui/regions/region-borrow-params-issue-29793-big.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | WrapB::new().set(move |t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-big.rs:67:26
@@ -32,7 +32,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | WrapB::new().set(move |t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/regions/region-borrow-params-issue-29793-small.stderr b/src/test/ui/regions/region-borrow-params-issue-29793-small.stderr
index 18610b7..e446f2a 100644
--- a/src/test/ui/regions/region-borrow-params-issue-29793-small.stderr
+++ b/src/test/ui/regions/region-borrow-params-issue-29793-small.stderr
@@ -14,7 +14,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:9:17
@@ -32,7 +32,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:24:17
@@ -50,7 +50,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:24:17
@@ -68,7 +68,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
@@ -86,7 +86,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
@@ -104,7 +104,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
@@ -122,7 +122,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
@@ -140,7 +140,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
@@ -158,7 +158,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
@@ -176,7 +176,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
@@ -194,7 +194,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
@@ -212,7 +212,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
@@ -230,7 +230,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
@@ -248,7 +248,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
@@ -266,7 +266,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
@@ -284,7 +284,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
@@ -302,7 +302,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
@@ -320,7 +320,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
@@ -338,7 +338,7 @@
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
@@ -356,7 +356,7 @@
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^^^^^^^^^^^
+ | ++++
error: aborting due to 20 previous errors
diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr
index 4ddea2c..a64ad46 100644
--- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr
+++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr
@@ -27,17 +27,24 @@
= note: mutable references are invariant over their type parameter
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
|
LL | let _: fn(&mut &isize, &mut &isize) = a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
+ found fn pointer `for<'r, 's> fn(&'r mut &isize, &'s mut &isize)`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:20:12
|
LL | let _: fn(&mut &isize, &mut &isize) = a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
+ found fn pointer `for<'r, 's> fn(&'r mut &isize, &'s mut &isize)`
error: aborting due to 4 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr
index a9cf128..ce5e7d0 100644
--- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr
+++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr
@@ -27,23 +27,33 @@
= note: mutable references are invariant over their type parameter
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
|
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
+ found fn pointer `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize)`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
|
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
+ found fn pointer `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize)`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
|
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
+ found fn pointer `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize)`
error: aborting due to 5 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.polonius.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.polonius.stderr
new file mode 100644
index 0000000..1374166
--- /dev/null
+++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.polonius.stderr
@@ -0,0 +1,82 @@
+error: lifetime may not live long enough
+ --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:9:5
+ |
+LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | // Illegal now because there is no `'b:'a` declaration.
+LL | *x = *y;
+ | ^^^^^^^ assignment requires that `'b` must outlive `'a`
+ |
+ = help: consider adding the following bound: `'b: 'a`
+
+error: lifetime may not live long enough
+ --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:10:5
+ |
+LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
+ | -- -- lifetime `'c` defined here
+ | |
+ | lifetime `'b` defined here
+...
+LL | *z = *y;
+ | ^^^^^^^ assignment requires that `'b` must outlive `'c`
+ |
+ = help: consider adding the following bound: `'b: 'c`
+
+help: add bound `'b: 'a + 'c`
+
+error: lifetime may not live long enough
+ --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:16:5
+ |
+LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+...
+LL | a(x, y, z);
+ | ^^^^^^^^^^ argument requires that `'b` must outlive `'a`
+ |
+ = help: consider adding the following bound: `'b: 'a`
+ = note: requirement occurs because of a mutable reference to &isize
+ = note: mutable references are invariant over their type parameter
+ = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+
+error: lifetime may not live long enough
+ --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:16:5
+ |
+LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) {
+ | -- -- lifetime `'c` defined here
+ | |
+ | lifetime `'b` defined here
+...
+LL | a(x, y, z);
+ | ^^^^^^^^^^ argument requires that `'b` must outlive `'c`
+ |
+ = help: consider adding the following bound: `'b: 'c`
+ = note: requirement occurs because of a mutable reference to &isize
+ = note: mutable references are invariant over their type parameter
+ = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+
+help: add bound `'b: 'a + 'c`
+
+error: higher-ranked subtype error
+ --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
+ |
+LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: higher-ranked subtype error
+ --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
+ |
+LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: higher-ranked subtype error
+ --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:22:12
+ |
+LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 7 previous errors
+
diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
index 3607d6a..1c8840f 100644
--- a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
+++ b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr
@@ -9,11 +9,11 @@
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn a(v: &[u8]) -> Box<dyn Foo + '_> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn a(v: &'static [u8]) -> Box<dyn Foo + 'static> {
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/region-object-lifetime-in-coercion.rs:13:14
@@ -26,11 +26,11 @@
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn b(v: &[u8]) -> Box<dyn Foo + '_> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn b(v: &'static [u8]) -> Box<dyn Foo + 'static> {
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/region-object-lifetime-in-coercion.rs:19:14
@@ -44,7 +44,7 @@
help: to declare that the trait object captures data from argument `v`, you can add an explicit `'_` lifetime bound
|
LL | fn c(v: &[u8]) -> Box<dyn Foo + '_> {
- | ^^^^
+ | ++++
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/region-object-lifetime-in-coercion.rs:23:14
diff --git a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
index 03da33a..5280284 100644
--- a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
+++ b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr
@@ -4,7 +4,11 @@
LL | type Value = &'a i32;
| ^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:5:17
+ |
+LL | type Value: 'a;
+ | ^^
error[E0477]: the type `&'a i32` does not fulfill the required lifetime
--> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:20:5
@@ -12,7 +16,7 @@
LL | type Value = &'a i32;
| ^^^^^^^^^^^^^^^^^^^^^
|
-note: type must outlive the lifetime `'b` as defined on the impl at 19:10
+note: type must outlive the lifetime `'b` as defined on the impl at 19:10 as required by this binding
--> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:10
|
LL | impl<'a, 'b> Foo<'b> for &'a i64 {
diff --git a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
index d8efeac..a03210d 100644
--- a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
+++ b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr
@@ -4,7 +4,11 @@
LL | type Value = &'a i32;
| ^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:5:17
+ |
+LL | type Value: 'static;
+ | ^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr
index 930bf60..68b90ee 100644
--- a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr
+++ b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr
@@ -4,7 +4,11 @@
LL | assert_send::<&'a isize>();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-bounded-by-trait-requiring-static.rs:6:18
+ |
+LL | fn assert_send<T:'static>() { }
+ | ^^^^^^^
error[E0477]: the type `&'a str` does not fulfill the required lifetime
--> $DIR/regions-bounded-by-trait-requiring-static.rs:26:5
@@ -12,7 +16,11 @@
LL | assert_send::<&'a str>();
| ^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-bounded-by-trait-requiring-static.rs:6:18
+ |
+LL | fn assert_send<T:'static>() { }
+ | ^^^^^^^
error[E0477]: the type `&'a [isize]` does not fulfill the required lifetime
--> $DIR/regions-bounded-by-trait-requiring-static.rs:30:5
@@ -20,7 +28,11 @@
LL | assert_send::<&'a [isize]>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-bounded-by-trait-requiring-static.rs:6:18
+ |
+LL | fn assert_send<T:'static>() { }
+ | ^^^^^^^
error[E0477]: the type `Box<&'a isize>` does not fulfill the required lifetime
--> $DIR/regions-bounded-by-trait-requiring-static.rs:44:5
@@ -28,7 +40,11 @@
LL | assert_send::<Box<&'a isize>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-bounded-by-trait-requiring-static.rs:6:18
+ |
+LL | fn assert_send<T:'static>() { }
+ | ^^^^^^^
error[E0477]: the type `*const &'a isize` does not fulfill the required lifetime
--> $DIR/regions-bounded-by-trait-requiring-static.rs:55:5
@@ -36,7 +52,11 @@
LL | assert_send::<*const &'a isize>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-bounded-by-trait-requiring-static.rs:6:18
+ |
+LL | fn assert_send<T:'static>() { }
+ | ^^^^^^^
error[E0477]: the type `*mut &'a isize` does not fulfill the required lifetime
--> $DIR/regions-bounded-by-trait-requiring-static.rs:59:5
@@ -44,7 +64,11 @@
LL | assert_send::<*mut &'a isize>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: type must satisfy the static lifetime
+note: type must satisfy the static lifetime as required by this binding
+ --> $DIR/regions-bounded-by-trait-requiring-static.rs:6:18
+ |
+LL | fn assert_send<T:'static>() { }
+ | ^^^^^^^
error: aborting due to 6 previous errors
diff --git a/src/test/ui/regions/regions-close-object-into-object-2.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr
index da995a9..78d2371 100644
--- a/src/test/ui/regions/regions-close-object-into-object-2.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-2.stderr
@@ -9,11 +9,11 @@
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'a> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn g<'a, T: 'static>(v: Box<(dyn A<T> + 'static)>) -> Box<dyn X + 'static> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/regions/regions-close-object-into-object-4.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr
index 7dc8808..8c94b44 100644
--- a/src/test/ui/regions/regions-close-object-into-object-4.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-4.stderr
@@ -9,11 +9,11 @@
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'a> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn i<'a, T, U>(v: Box<(dyn A<U> + 'static)>) -> Box<dyn X + 'static> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/regions/regions-close-object-into-object-5.stderr b/src/test/ui/regions/regions-close-object-into-object-5.stderr
index e5a80cb..5b692cd 100644
--- a/src/test/ui/regions/regions-close-object-into-object-5.stderr
+++ b/src/test/ui/regions/regions-close-object-into-object-5.stderr
@@ -23,7 +23,13 @@
| - help: consider adding an explicit lifetime bound...: `T: 'static`
LL | // oh dear!
LL | box B(&*v) as Box<X>
- | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+ | ^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/regions-close-object-into-object-5.rs:9:17
+ |
+LL | struct B<'a, T: 'a>(&'a (A<T> + 'a));
+ | ^^
error[E0310]: the parameter type `T` may not live long enough
--> $DIR/regions-close-object-into-object-5.rs:17:11
diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr
index d762f55..c2956cd 100644
--- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr
+++ b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.nll.stderr
@@ -1,8 +1,12 @@
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/regions-fn-subtyping-return-static-fail.rs:48:5
|
LL | want_G(baz);
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S`
+ found fn pointer `for<'r> fn(&'r S) -> &'r S`
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
index a427280..c1dab60 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
@@ -19,7 +19,7 @@
// since for it to be WF, we would need to know that `'y: 'x`, but we
// do not infer that.
fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
- //~^ ERROR reference has a longer lifetime than the data it references
+ //~^ the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
{
}
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
index 6470ebf..44ef13c 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
@@ -1,20 +1,14 @@
-error[E0491]: in type `&'x (dyn for<'z> Trait1<<T as Trait2<'y, 'z>>::Foo> + 'x)`, reference has a longer lifetime than the data it references
- --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:25
+error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
+ --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:4
|
LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
|
-note: the pointer is valid for the lifetime `'x` as defined on the function body at 21:11
- --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:11
+help: consider restricting type parameter `T`
|
-LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
- | ^^
-note: but the referenced data is only valid for the lifetime `'y` as defined on the function body at 21:15
- --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:15
- |
-LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
- | ^^
+LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
+ | ++++++++++++++++++++++++
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0491`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/regions/regions-in-enums-anon.stderr b/src/test/ui/regions/regions-in-enums-anon.stderr
index b3649c5..ed547aa 100644
--- a/src/test/ui/regions/regions-in-enums-anon.stderr
+++ b/src/test/ui/regions/regions-in-enums-anon.stderr
@@ -6,8 +6,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | enum Foo<'a> {
-LL | Bar(&'a isize)
+LL ~ enum Foo<'a> {
+LL ~ Bar(&'a isize)
|
error: aborting due to previous error
diff --git a/src/test/ui/regions/regions-in-structs-anon.stderr b/src/test/ui/regions/regions-in-structs-anon.stderr
index 60a6fb9..992d25c 100644
--- a/src/test/ui/regions/regions-in-structs-anon.stderr
+++ b/src/test/ui/regions/regions-in-structs-anon.stderr
@@ -6,8 +6,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: &'a isize
+LL ~ struct Foo<'a> {
+LL ~ x: &'a isize
|
error: aborting due to previous error
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr b/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr
index 4ca5ac2..97a3947 100644
--- a/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr
+++ b/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr
@@ -5,7 +5,12 @@
| ^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `Self: 'a`...
- = note: ...so that the type `Self` will meet its required lifetime bounds
+ = note: ...so that the type `Self` will meet its required lifetime bounds...
+note: ...that is required by this bound
+ --> $DIR/regions-infer-bound-from-trait-self.rs:12:21
+ |
+LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { }
+ | ^^
error: aborting due to previous error
diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.stderr
index 196ee8c..fd1090d 100644
--- a/src/test/ui/regions/regions-infer-bound-from-trait.stderr
+++ b/src/test/ui/regions/regions-infer-bound-from-trait.stderr
@@ -4,7 +4,13 @@
LL | fn bar1<'a,A>(x: Inv<'a>, a: A) {
| - help: consider adding an explicit lifetime bound...: `A: 'a`
LL | check_bound(x, a)
- | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
+ | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/regions-infer-bound-from-trait.rs:12:21
+ |
+LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { }
+ | ^^
error[E0309]: the parameter type `A` may not live long enough
--> $DIR/regions-infer-bound-from-trait.rs:37:5
@@ -12,7 +18,13 @@
LL | fn bar2<'a,'b,A:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
| -- help: consider adding an explicit lifetime bound...: `A: 'a +`
LL | check_bound(x, a)
- | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
+ | ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/regions-infer-bound-from-trait.rs:12:21
+ |
+LL | fn check_bound<'a,A:'a>(x: Inv<'a>, a: A) { }
+ | ^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr
index db86572..cae692a 100644
--- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr
+++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr
@@ -27,17 +27,24 @@
= note: mutable references are invariant over their type parameter
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/regions-lifetime-bounds-on-fns.rs:20:12
|
LL | let _: fn(&mut &isize, &mut &isize) = a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
+ found fn pointer `for<'r, 's> fn(&'r mut &isize, &'s mut &isize)`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/regions-lifetime-bounds-on-fns.rs:20:12
|
LL | let _: fn(&mut &isize, &mut &isize) = a;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
+ found fn pointer `for<'r, 's> fn(&'r mut &isize, &'s mut &isize)`
error: aborting due to 4 previous errors
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/regions-name-undeclared.stderr b/src/test/ui/regions/regions-name-undeclared.stderr
index 5f6ff28..250752c 100644
--- a/src/test/ui/regions/regions-name-undeclared.stderr
+++ b/src/test/ui/regions/regions-name-undeclared.stderr
@@ -28,11 +28,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> Foo<'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn m4<'b>(&self, arg: &'b isize) { }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/regions-name-undeclared.rs:17:12
@@ -44,11 +44,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> Foo<'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn m5<'b>(&'b self) { }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/regions-name-undeclared.rs:18:27
@@ -60,11 +60,11 @@
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> Foo<'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn m6<'b>(&self, arg: Foo<'b>) { }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/regions-name-undeclared.rs:26:22
@@ -107,11 +107,11 @@
help: consider introducing lifetime `'b` here
|
LL | fn fn_types<'b>(a: &'a isize,
- | ^^^^
+ | ++++
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | b: Box<dyn for<'a, 'b> FnOnce(&'a isize,
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/regions-name-undeclared.rs:46:36
@@ -124,11 +124,11 @@
help: consider introducing lifetime `'b` here
|
LL | fn fn_types<'b>(a: &'a isize,
- | ^^^^
+ | ++++
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | b: Box<dyn for<'a, 'b> FnOnce(&'a isize,
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/regions-name-undeclared.rs:47:17
@@ -151,11 +151,11 @@
help: consider introducing lifetime `'a` here
|
LL | impl<'a> Bug {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'a` here
|
LL | async fn buggy<'a>(&self) -> &'a str {
- | ^^^^
+ | ++++
error: aborting due to 12 previous errors
diff --git a/src/test/ui/regions/regions-proc-bound-capture.stderr b/src/test/ui/regions/regions-proc-bound-capture.stderr
index e76073f..50b3748 100644
--- a/src/test/ui/regions/regions-proc-bound-capture.stderr
+++ b/src/test/ui/regions/regions-proc-bound-capture.stderr
@@ -10,11 +10,11 @@
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + '_> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn static_proc(x: &'static isize) -> Box<dyn FnMut() -> (isize) + 'static> {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/reify-intrinsic.stderr b/src/test/ui/reify-intrinsic.stderr
index 69c11b5..dff4ca6 100644
--- a/src/test/ui/reify-intrinsic.stderr
+++ b/src/test/ui/reify-intrinsic.stderr
@@ -11,7 +11,7 @@
help: use parentheses to call this function
|
LL | let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute(...);
- | ^^^^^
+ | +++++
error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
--> $DIR/reify-intrinsic.rs:11:13
diff --git a/src/test/ui/remap-path-prefix.rs b/src/test/ui/remap-path-prefix.rs
new file mode 100644
index 0000000..2eef970
--- /dev/null
+++ b/src/test/ui/remap-path-prefix.rs
@@ -0,0 +1,9 @@
+// compile-flags: --remap-path-prefix={{src-base}}=remapped
+
+fn main() {
+ // We cannot actually put an ERROR marker here because
+ // the file name in the error message is not what the
+ // test framework expects (since the filename gets remapped).
+ // We still test the expected error in the stderr file.
+ ferris
+}
diff --git a/src/test/ui/remap-path-prefix.stderr b/src/test/ui/remap-path-prefix.stderr
new file mode 100644
index 0000000..ad6a35d
--- /dev/null
+++ b/src/test/ui/remap-path-prefix.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `ferris` in this scope
+ --> remapped/remap-path-prefix.rs:8:5
+ |
+LL | ferris
+ | ^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr
index e90754e..c85f057 100644
--- a/src/test/ui/repeat_count.stderr
+++ b/src/test/ui/repeat_count.stderr
@@ -31,12 +31,6 @@
| ^^^^^ expected `usize`, found `&str`
error[E0308]: mismatched types
- --> $DIR/repeat_count.rs:31:17
- |
-LL | let g = [0; G { g: () }];
- | ^^^^^^^^^^^ expected `usize`, found struct `G`
-
-error[E0308]: mismatched types
--> $DIR/repeat_count.rs:19:17
|
LL | let f = [0; -4_isize];
@@ -61,7 +55,13 @@
help: change the type of the numeric literal from `u8` to `usize`
|
LL | let f = [0; 4usize];
- | ^^^^^^
+ | ~~~~~~
+
+error[E0308]: mismatched types
+ --> $DIR/repeat_count.rs:31:17
+ |
+LL | let g = [0; G { g: () }];
+ | ^^^^^^^^^^^ expected `usize`, found struct `G`
error: aborting due to 9 previous errors
diff --git a/src/test/ui/repr/repr-no-niche.rs b/src/test/ui/repr/repr-no-niche.rs
index a7f0d50..2e6064a 100644
--- a/src/test/ui/repr/repr-no-niche.rs
+++ b/src/test/ui/repr/repr-no-niche.rs
@@ -73,8 +73,7 @@
// general; this test is relying on that.)
two_fifty_six_variant_enum!(Visible2, N8);
- #[repr(no_niche)]
- two_fifty_six_variant_enum!(Cloaked2, N8);
+ two_fifty_six_variant_enum!(#[repr(no_niche)] Cloaked2, N8);
}
mod enum_param {
@@ -96,8 +95,7 @@
// here as above (assuming `T` is instantiated with `NonZeroU8`).
two_fifty_six_variant_enum!(Visible2<T>);
- #[repr(no_niche)]
- two_fifty_six_variant_enum!(Cloaked2<T>);
+ two_fifty_six_variant_enum!(#[repr(no_niche)] Cloaked2<T>);
}
fn main() {
@@ -157,8 +155,8 @@
}
macro two_fifty_six_variant_enum {
- ($name:ident<$param:ident>) => {
- #[derive(Debug)]
+ ($(#[$attr:meta])* $name:ident<$param:ident>) => {
+ #[derive(Debug)] $(#[$attr])*
pub enum $name<$param> {
_V00($param, u16), _V01(u16, $param), _V02($param, u16), _V03(u16, $param),
_V04($param, u16), _V05(u16, $param), _V06($param, u16), _V07(u16, $param),
@@ -242,8 +240,8 @@
}
},
- ($name:ident, $param:ty) => {
- #[derive(Debug)]
+ ($(#[$attr:meta])* $name:ident, $param:ty) => {
+ #[derive(Debug)] $(#[$attr])*
pub enum $name {
_V00($param, u16), _V01(u16, $param), _V02($param, u16), _V03(u16, $param),
_V04($param, u16), _V05(u16, $param), _V06($param, u16), _V07(u16, $param),
diff --git a/src/test/ui/reserved/reserved-become.stderr b/src/test/ui/reserved/reserved-become.stderr
index 47e5b80..7878efe 100644
--- a/src/test/ui/reserved/reserved-become.stderr
+++ b/src/test/ui/reserved/reserved-become.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#become = 0;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/resolve/issue-19452.stderr b/src/test/ui/resolve/issue-19452.stderr
index 6c519d7..8df8406 100644
--- a/src/test/ui/resolve/issue-19452.stderr
+++ b/src/test/ui/resolve/issue-19452.stderr
@@ -12,7 +12,7 @@
|
LL | let homura = issue_19452_aux::Homura::Madoka;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `issue_19452_aux::Homura::Madoka { /* fields */ }`
- |
+ |
::: $DIR/auxiliary/issue-19452-aux.rs:2:5
|
LL | Madoka { age: u32 }
diff --git a/src/test/ui/resolve/issue-23305.stderr b/src/test/ui/resolve/issue-23305.stderr
index 525b5cf..0dcf018 100644
--- a/src/test/ui/resolve/issue-23305.stderr
+++ b/src/test/ui/resolve/issue-23305.stderr
@@ -4,7 +4,7 @@
LL | impl dyn ToNbt<Self> {}
| ^^^^
|
- = note: ...which again requires computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:24>`, completing the cycle
+ = note: ...which immediately requires computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:24>` again
note: cycle used when collecting item types in top-level module
--> $DIR/issue-23305.rs:1:1
|
diff --git a/src/test/ui/resolve/issue-2356.rs b/src/test/ui/resolve/issue-2356.rs
index f7b2dd1..fe9bf4d 100644
--- a/src/test/ui/resolve/issue-2356.rs
+++ b/src/test/ui/resolve/issue-2356.rs
@@ -29,7 +29,7 @@
impl Default for Cat {
fn default() -> Self {
default();
- //~^ ERROR cannot find function `default`
+ //~^ ERROR cannot find function `default` in this scope [E0425]
loop {}
}
}
diff --git a/src/test/ui/resolve/issue-2356.stderr b/src/test/ui/resolve/issue-2356.stderr
index 8083233..d187267 100644
--- a/src/test/ui/resolve/issue-2356.stderr
+++ b/src/test/ui/resolve/issue-2356.stderr
@@ -19,7 +19,7 @@
help: you might have meant to call the associated function
|
LL | Self::default();
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: consider importing this function
|
LL | use std::default::default;
@@ -78,7 +78,7 @@
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn meow(&self) {
- | ^^^^^
+ | +++++
error[E0425]: cannot find function `grow_older` in this scope
--> $DIR/issue-2356.rs:72:5
diff --git a/src/test/ui/resolve/issue-39226.stderr b/src/test/ui/resolve/issue-39226.stderr
index 72d66b0..5045ec6 100644
--- a/src/test/ui/resolve/issue-39226.stderr
+++ b/src/test/ui/resolve/issue-39226.stderr
@@ -10,11 +10,11 @@
help: use struct literal syntax instead
|
LL | handle: Handle {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a local variable with a similar name exists
|
LL | handle: handle
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/resolve/issue-5035-2.stderr b/src/test/ui/resolve/issue-5035-2.stderr
index e94877f..9393927 100644
--- a/src/test/ui/resolve/issue-5035-2.stderr
+++ b/src/test/ui/resolve/issue-5035-2.stderr
@@ -9,7 +9,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(_x: &K) {}
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/resolve/issue-5035.stderr b/src/test/ui/resolve/issue-5035.stderr
index a8aa50b..32b972b 100644
--- a/src/test/ui/resolve/issue-5035.stderr
+++ b/src/test/ui/resolve/issue-5035.stderr
@@ -20,7 +20,7 @@
help: a trait with a similar name exists
|
LL | impl I for isize {}
- | ^
+ | ~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs b/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs
index f09ab3b..f96c048 100644
--- a/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs
+++ b/src/test/ui/resolve/issue-65035-static-with-parent-generics.rs
@@ -1,6 +1,3 @@
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
-
fn f<T>() {
extern "C" {
static a: *const T;
diff --git a/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr b/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr
index 7f8151d..7ed572f 100644
--- a/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr
+++ b/src/test/ui/resolve/issue-65035-static-with-parent-generics.stderr
@@ -1,5 +1,5 @@
error[E0401]: can't use generic parameters from outer function
- --> $DIR/issue-65035-static-with-parent-generics.rs:6:26
+ --> $DIR/issue-65035-static-with-parent-generics.rs:3:26
|
LL | fn f<T>() {
| - type parameter from outer function
@@ -8,7 +8,7 @@
| ^ use of generic parameter from outer function
error[E0401]: can't use generic parameters from outer function
- --> $DIR/issue-65035-static-with-parent-generics.rs:12:22
+ --> $DIR/issue-65035-static-with-parent-generics.rs:9:22
|
LL | fn g<T: Default>() {
| - type parameter from outer function
@@ -16,7 +16,7 @@
| ^ use of generic parameter from outer function
error[E0401]: can't use generic parameters from outer function
- --> $DIR/issue-65035-static-with-parent-generics.rs:18:24
+ --> $DIR/issue-65035-static-with-parent-generics.rs:15:24
|
LL | fn h<const N: usize>() {
| - const parameter from outer function
@@ -25,7 +25,7 @@
| ^ use of generic parameter from outer function
error[E0401]: can't use generic parameters from outer function
- --> $DIR/issue-65035-static-with-parent-generics.rs:24:20
+ --> $DIR/issue-65035-static-with-parent-generics.rs:21:20
|
LL | fn i<const N: usize>() {
| - const parameter from outer function
@@ -33,22 +33,13 @@
| ^ use of generic parameter from outer function
error[E0401]: can't use generic parameters from outer function
- --> $DIR/issue-65035-static-with-parent-generics.rs:24:29
+ --> $DIR/issue-65035-static-with-parent-generics.rs:21:29
|
LL | fn i<const N: usize>() {
| - const parameter from outer function
LL | static a: [u8; N] = [0; N];
| ^ use of generic parameter from outer function
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-65035-static-with-parent-generics.rs:1:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-error: aborting due to 5 previous errors; 1 warning emitted
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0401`.
diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr
index 3c76f26..a7f10f7 100644
--- a/src/test/ui/resolve/levenshtein.stderr
+++ b/src/test/ui/resolve/levenshtein.stderr
@@ -18,7 +18,7 @@
|
LL | type B = Opiton<u8>; // Misspelled type name from the prelude.
| ^^^^^^ help: an enum with a similar name exists: `Option`
- |
+ |
::: $SRC_DIR/core/src/option.rs:LL:COL
|
LL | pub enum Option<T> {
diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr
index 807dadf..192349e 100644
--- a/src/test/ui/resolve/privacy-enum-ctor.stderr
+++ b/src/test/ui/resolve/privacy-enum-ctor.stderr
@@ -18,13 +18,13 @@
help: you might have meant to use the following enum variant
|
LL | m::Z::Unit;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: the following enum variants are available
|
LL | (m::Z::Fn(/* fields */));
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
LL | (m::Z::Struct { /* fields */ });
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `Z`
--> $DIR/privacy-enum-ctor.rs:25:9
@@ -46,13 +46,13 @@
help: you might have meant to use the following enum variant
|
LL | m::Z::Unit;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: the following enum variants are available
|
LL | (m::Z::Fn(/* fields */));
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
LL | (m::Z::Struct { /* fields */ });
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found struct variant `Z::Struct`
--> $DIR/privacy-enum-ctor.rs:29:20
@@ -88,17 +88,17 @@
help: you might have meant to use the following enum variant
|
LL | let _: E = E::Unit;
- | ^^^^^^^
+ | ~~~~~~~
help: the following enum variants are available
|
LL | let _: E = (E::Fn(/* fields */));
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
LL | let _: E = (E::Struct { /* fields */ });
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: a function with a similar name exists
|
LL | let _: E = m::f;
- | ^
+ | ~
help: consider importing one of these items instead
|
LL | use std::f32::consts::E;
@@ -137,13 +137,13 @@
help: you might have meant to use the following enum variant
|
LL | let _: E = E::Unit;
- | ^^^^^^^
+ | ~~~~~~~
help: the following enum variants are available
|
LL | let _: E = (E::Fn(/* fields */));
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
LL | let _: E = (E::Struct { /* fields */ });
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items instead
|
LL | use std::f32::consts::E;
@@ -174,7 +174,7 @@
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z;
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
@@ -200,13 +200,13 @@
help: you might have meant to use the following enum variant
|
LL | let _: Z = m::Z::Unit;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: the following enum variants are available
|
LL | let _: Z = (m::Z::Fn(/* fields */));
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
LL | let _: Z = (m::Z::Struct { /* fields */ });
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0412]: cannot find type `Z` in this scope
--> $DIR/privacy-enum-ctor.rs:61:12
@@ -220,7 +220,7 @@
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z::Fn;
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
@@ -238,7 +238,7 @@
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z::Struct;
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
@@ -267,7 +267,7 @@
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z::Unit {};
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
@@ -337,7 +337,7 @@
help: use parentheses to instantiate this tuple variant
|
LL | let _: Z = Z::Fn(_);
- | ^^^
+ | +++
error[E0618]: expected function, found enum variant `Z::Unit`
--> $DIR/privacy-enum-ctor.rs:31:17
@@ -353,7 +353,7 @@
help: `Z::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | let _ = Z::Unit;
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/privacy-enum-ctor.rs:43:16
@@ -371,7 +371,7 @@
help: use parentheses to instantiate this tuple variant
|
LL | let _: E = m::E::Fn(_);
- | ^^^
+ | +++
error[E0618]: expected function, found enum variant `m::E::Unit`
--> $DIR/privacy-enum-ctor.rs:47:16
@@ -387,7 +387,7 @@
help: `m::E::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | let _: E = m::E::Unit;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/privacy-enum-ctor.rs:51:16
@@ -405,7 +405,7 @@
help: use parentheses to instantiate this tuple variant
|
LL | let _: E = E::Fn(_);
- | ^^^
+ | +++
error[E0618]: expected function, found enum variant `E::Unit`
--> $DIR/privacy-enum-ctor.rs:55:16
@@ -421,7 +421,7 @@
help: `E::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | let _: E = E::Unit;
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 23 previous errors
diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr
index a72f69c..e5d6f7e 100644
--- a/src/test/ui/resolve/privacy-struct-ctor.stderr
+++ b/src/test/ui/resolve/privacy-struct-ctor.stderr
@@ -103,7 +103,7 @@
|
LL | xcrate::m::S;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18
|
LL | pub struct S(u8);
@@ -120,7 +120,7 @@
|
LL | xcrate::m::n::Z;
| ^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28
|
LL | pub(in m) struct Z(pub(in m::n) u8);
diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr b/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr
index a0a8582..abf068a 100644
--- a/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr
+++ b/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr
@@ -8,7 +8,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::slice as other_std;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr
index 83beb20..922753a 100644
--- a/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr
+++ b/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::mem::transmute as other_transmute;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr
index 104ed9b..b634954 100644
--- a/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr
+++ b/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | use std::slice::Iter as OtherIter;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/resolve/resolve-hint-macro.stderr b/src/test/ui/resolve/resolve-hint-macro.stderr
index efcfc71..78d7767 100644
--- a/src/test/ui/resolve/resolve-hint-macro.stderr
+++ b/src/test/ui/resolve/resolve-hint-macro.stderr
@@ -7,7 +7,7 @@
help: use `!` to invoke the macro
|
LL | assert_eq!(1, 1);
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/resolve/resolve-self-in-impl.stderr b/src/test/ui/resolve/resolve-self-in-impl.stderr
index 5b5c183..7f623e4 100644
--- a/src/test/ui/resolve/resolve-self-in-impl.stderr
+++ b/src/test/ui/resolve/resolve-self-in-impl.stderr
@@ -4,7 +4,7 @@
LL | impl Tr for Self {}
| ^^^^
|
- = note: ...which again requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:20>`, completing the cycle
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:20>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
@@ -23,7 +23,7 @@
LL | impl Tr for S<Self> {}
| ^^^^
|
- = note: ...which again requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:23>`, completing the cycle
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:23>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
@@ -42,7 +42,7 @@
LL | impl Self {}
| ^^^^
|
- = note: ...which again requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:13>`, completing the cycle
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:13>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
@@ -61,7 +61,7 @@
LL | impl S<Self> {}
| ^^^^
|
- = note: ...which again requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:16>`, completing the cycle
+ = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:16>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
@@ -80,7 +80,7 @@
LL | impl Tr<Self::A> for S {}
| ^^^^^^^^^^^^^^^^^^^^^^
|
- = note: ...which again requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:26>`, completing the cycle
+ = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:26>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
index 2d35159..54b2421 100644
--- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
+++ b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
@@ -38,7 +38,7 @@
help: a constant with a similar name exists
|
LL | a::I.J
- | ^
+ | ~
error[E0423]: expected value, found module `a`
--> $DIR/suggest-path-instead-of-mod-dot-item.rs:37:5
@@ -71,11 +71,11 @@
help: use the path separator to refer to an item
|
LL | a::b::f()
- | ^^^^^^^
+ | ~~~~~~~
help: a constant with a similar name exists
|
LL | a::I.f()
- | ^
+ | ~
error[E0423]: expected value, found module `a::b`
--> $DIR/suggest-path-instead-of-mod-dot-item.rs:50:5
diff --git a/src/test/ui/resolve/token-error-correct-2.stderr b/src/test/ui/resolve/token-error-correct-2.stderr
index 4014af2..cca9f2d 100644
--- a/src/test/ui/resolve/token-error-correct-2.stderr
+++ b/src/test/ui/resolve/token-error-correct-2.stderr
@@ -1,8 +1,8 @@
error: mismatched closing delimiter: `)`
- --> $DIR/token-error-correct-2.rs:6:5
+ --> $DIR/token-error-correct-2.rs:4:12
|
LL | if foo {
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL |
LL | )
| ^ mismatched closing delimiter
diff --git a/src/test/ui/resolve/token-error-correct-3.stderr b/src/test/ui/resolve/token-error-correct-3.stderr
index 31087e3..77c87c7 100644
--- a/src/test/ui/resolve/token-error-correct-3.stderr
+++ b/src/test/ui/resolve/token-error-correct-3.stderr
@@ -1,8 +1,8 @@
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
- --> $DIR/token-error-correct-3.rs:13:35
+ --> $DIR/token-error-correct-3.rs:13:21
|
LL | callback(path.as_ref();
- | - ^ help: `)` may belong here
+ | ^ ^ help: `)` may belong here
| |
| unclosed delimiter
diff --git a/src/test/ui/resolve/token-error-correct-4.stderr b/src/test/ui/resolve/token-error-correct-4.stderr
index 64aff54..81e5a13 100644
--- a/src/test/ui/resolve/token-error-correct-4.stderr
+++ b/src/test/ui/resolve/token-error-correct-4.stderr
@@ -1,8 +1,8 @@
error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;`
- --> $DIR/token-error-correct-4.rs:9:21
+ --> $DIR/token-error-correct-4.rs:9:12
|
LL | setsuna(kazusa();
- | - ^ help: `)` may belong here
+ | ^ ^ help: `)` may belong here
| |
| unclosed delimiter
diff --git a/src/test/ui/resolve/token-error-correct.stderr b/src/test/ui/resolve/token-error-correct.stderr
index bf300ec..ca0c4c1 100644
--- a/src/test/ui/resolve/token-error-correct.stderr
+++ b/src/test/ui/resolve/token-error-correct.stderr
@@ -1,10 +1,10 @@
error: mismatched closing delimiter: `}`
- --> $DIR/token-error-correct.rs:6:1
+ --> $DIR/token-error-correct.rs:4:12
|
LL | fn main() {
| - closing delimiter possibly meant for this
LL | foo(bar(;
- | - unclosed delimiter
+ | ^ unclosed delimiter
LL |
LL | }
| ^ mismatched closing delimiter
diff --git a/src/test/ui/return/issue-82612-return-mutable-reference.stderr b/src/test/ui/return/issue-82612-return-mutable-reference.stderr
index a8045e0..eb2322d 100644
--- a/src/test/ui/return/issue-82612-return-mutable-reference.stderr
+++ b/src/test/ui/return/issue-82612-return-mutable-reference.stderr
@@ -13,15 +13,15 @@
help: consider using a semicolon here
|
LL | value.get_or_insert_with(func);
- | ^
+ | +
help: consider using a semicolon here
|
LL | };
- | ^
+ | +
help: you might have meant to return this value
|
LL | return value.get_or_insert_with(func);
- | ^^^^^^ ^
+ | ++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/return/return-type.stderr b/src/test/ui/return/return-type.stderr
index 6ef921b..5af136e 100644
--- a/src/test/ui/return/return-type.stderr
+++ b/src/test/ui/return/return-type.stderr
@@ -9,11 +9,11 @@
help: consider using a semicolon here
|
LL | foo(4 as usize);
- | ^
+ | +
help: try adding a return type
|
LL | fn bar() -> S<usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/return/tail-expr-as-potential-return.stderr b/src/test/ui/return/tail-expr-as-potential-return.stderr
index f852796..87ef188 100644
--- a/src/test/ui/return/tail-expr-as-potential-return.stderr
+++ b/src/test/ui/return/tail-expr-as-potential-return.stderr
@@ -12,7 +12,7 @@
help: you might have meant to return this value
|
LL | return Err(42);
- | ^^^^^^ ^
+ | ++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
index e33253b..f8eaf61 100644
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
@@ -7,13 +7,13 @@
LL | | "0".parse()
LL | | }
| |_^ `main` can only return types that implement `Termination`
- |
- ::: $SRC_DIR/test/src/lib.rs:LL:COL
- |
-LL | pub fn assert_test_result<T: Termination>(result: T) {
- | ----------- required by this bound in `assert_test_result`
|
= help: the trait `Termination` is not implemented for `Result<f32, ParseFloatError>`
+note: required by a bound in `assert_test_result`
+ --> $SRC_DIR/test/src/lib.rs:LL:COL
+ |
+LL | pub fn assert_test_result<T: Termination>(result: T) {
+ | ^^^^^^^^^^^ required by this bound in `assert_test_result`
= note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs b/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs
index 00dcf89..2ad92b7 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs
+++ b/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs
@@ -10,8 +10,8 @@
let mut x = NonExhaustiveMonovariant::Variant(1);
let y = &mut x;
match x {
- NonExhaustiveMonovariant::Variant(_) => {},
//~^ ERROR cannot use `x` because it was mutably borrowed
+ NonExhaustiveMonovariant::Variant(_) => {},
_ => {},
}
drop(y);
diff --git a/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr b/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr
index 9edfa84..de730ce 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr
@@ -1,11 +1,10 @@
error[E0503]: cannot use `x` because it was mutably borrowed
- --> $DIR/borrowck-non-exhaustive.rs:13:9
+ --> $DIR/borrowck-non-exhaustive.rs:12:11
|
LL | let y = &mut x;
| ------ borrow of `x` occurs here
LL | match x {
-LL | NonExhaustiveMonovariant::Variant(_) => {},
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of borrowed `x`
+ | ^ use of borrowed `x`
...
LL | drop(y);
| - borrow later used here
diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum.rs b/src/test/ui/rfc-2008-non-exhaustive/enum.rs
index 73e0b98..9d2855f 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/enum.rs
+++ b/src/test/ui/rfc-2008-non-exhaustive/enum.rs
@@ -30,7 +30,7 @@
match enum_unit {
NonExhaustiveEnum::Unit => 1,
NonExhaustiveEnum::Tuple(_) => 2,
- // This particular arm tests that a enum marked as non-exhaustive
+ // This particular arm tests that an enum marked as non-exhaustive
// will not error if its variants are matched exhaustively.
NonExhaustiveEnum::Struct { field } => field,
_ => 0 // no error with wildcard
diff --git a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr
index d023ba3..b0c319f 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr
@@ -15,7 +15,7 @@
|
LL | let ts_explicit = structs::TupleStruct(640, 480);
| ^^^^^^^^^^^ private tuple struct constructor
- |
+ |
::: $DIR/auxiliary/structs.rs:11:24
|
LL | pub struct TupleStruct(pub u16, pub u16);
@@ -66,7 +66,7 @@
help: add `..` at the end of the field list to ignore all other fields
|
LL | let NormalStruct { first_field, second_field , .. } = ns;
- | ^^^^^^
+ | ~~~~~~
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:26:9
@@ -77,7 +77,7 @@
help: add `..` at the end of the field list to ignore all other fields
|
LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts;
- | ^^^^^^
+ | ~~~~~~
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:35:9
@@ -88,7 +88,7 @@
help: add `..` at the end of the field list to ignore all other fields
|
LL | let UnitStruct { .. } = us;
- | ^^^^
+ | ~~~~
error: aborting due to 9 previous errors
diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
index 746c1fd..d21a94a 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
@@ -30,7 +30,7 @@
|
LL | match x {}
| ^ patterns `Tuple(_)` and `Struct { .. }` not covered
- |
+ |
::: $DIR/auxiliary/uninhabited.rs:17:23
|
LL | #[non_exhaustive] Tuple(!),
diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
index 46e84dc..cc3dc6c 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
@@ -30,7 +30,7 @@
|
LL | match x {}
| ^ patterns `Tuple(_)` and `Struct { .. }` not covered
- |
+ |
::: $DIR/auxiliary/uninhabited.rs:17:23
|
LL | #[non_exhaustive] Tuple(!),
diff --git a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr
index fbdbb0c..64cae37 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr
@@ -73,7 +73,7 @@
help: add `..` at the end of the field list to ignore all other fields
|
LL | NonExhaustiveVariants::Struct { field , .. } => ""
- | ^^^^^^
+ | ~~~~~~
error[E0638]: `..` required with variant marked as non-exhaustive
--> $DIR/variant.rs:30:12
@@ -84,7 +84,7 @@
help: add `..` at the end of the field list to ignore all other fields
|
LL | if let NonExhaustiveVariants::Struct { field , .. } = variant_struct {
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 8 previous errors
diff --git a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
index a449fac..1f387a0 100644
--- a/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
@@ -4,7 +4,13 @@
LL | struct Foo<U> {
| - help: consider adding an explicit lifetime bound...: `U: 'static`
LL | bar: Bar<U>
- | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds
+ | ^^^^^^ ...so that the type `U` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/dont-infer-static.rs:10:15
+ |
+LL | struct Bar<T: 'static> {
+ | ^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
index dfa4400..09b51fe 100644
--- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
@@ -1,8 +1,8 @@
error[E0491]: in type `&'a Foo<'b>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-region-rev.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-region-rev.rs:17:20
|
LL | type Out = &'a Foo<'b>;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-region-rev.rs:16:10
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
index 3561379..957a9d6 100644
--- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
@@ -1,8 +1,8 @@
error[E0491]: in type `&'a Foo<'b>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-region.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-region.rs:17:20
|
LL | type Out = &'a Foo<'b>;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-region.rs:16:10
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
index 207686d..1589f93 100644
--- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
@@ -1,8 +1,8 @@
error[E0491]: in type `&'a Foo<&'b i32>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-type-rev.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-type-rev.rs:17:20
|
LL | type Out = &'a Foo<&'b i32>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-type-rev.rs:16:10
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
index c1c4e78..4bfaa1a 100644
--- a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
@@ -1,8 +1,8 @@
error[E0491]: in type `&'a Foo<&'b i32>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-type.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-type.rs:17:20
|
LL | type Out = &'a Foo<&'b i32>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-type.rs:16:10
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
index 44812a5..1b1a2f7 100644
--- a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
@@ -1,24 +1,30 @@
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/regions-struct-not-wf.rs:13:5
+ --> $DIR/regions-struct-not-wf.rs:13:16
|
LL | impl<'a, T> Trait<'a, T> for usize {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = &'a T;
- | ^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
+ | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/regions-struct-not-wf.rs:21:5
+ --> $DIR/regions-struct-not-wf.rs:21:16
|
LL | impl<'a, T> Trait<'a, T> for u32 {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = RefOk<'a, T>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+ | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/regions-struct-not-wf.rs:16:20
+ |
+LL | struct RefOk<'a, T:'a> {
+ | ^^
error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
- --> $DIR/regions-struct-not-wf.rs:25:5
+ --> $DIR/regions-struct-not-wf.rs:25:16
|
LL | type Out = &'a &'b T;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 24:6
--> $DIR/regions-struct-not-wf.rs:24:6
diff --git a/src/test/ui/rfc-2294-if-let-guard/bindings.rs b/src/test/ui/rfc-2294-if-let-guard/bindings.rs
index 4e2d70e..1f32e4a 100644
--- a/src/test/ui/rfc-2294-if-let-guard/bindings.rs
+++ b/src/test/ui/rfc-2294-if-let-guard/bindings.rs
@@ -1,5 +1,4 @@
#![feature(if_let_guard)]
-#![allow(incomplete_features)]
fn main() {
match Some(None) {
diff --git a/src/test/ui/rfc-2294-if-let-guard/bindings.stderr b/src/test/ui/rfc-2294-if-let-guard/bindings.stderr
index 9c5d92a..2463b7f 100644
--- a/src/test/ui/rfc-2294-if-let-guard/bindings.stderr
+++ b/src/test/ui/rfc-2294-if-let-guard/bindings.stderr
@@ -1,11 +1,11 @@
error[E0425]: cannot find value `y` in this scope
- --> $DIR/bindings.rs:7:14
+ --> $DIR/bindings.rs:6:14
|
LL | _ => y,
| ^ not found in this scope
error[E0425]: cannot find value `y` in this scope
- --> $DIR/bindings.rs:9:5
+ --> $DIR/bindings.rs:8:5
|
LL | y
| ^ not found in this scope
diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs b/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs
index 4ba7e1e..2a2c0be 100644
--- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs
+++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.rs
@@ -9,33 +9,25 @@
() if (let 0 = 1) => {}
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
() if (((let 0 = 1))) => {}
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
() if true && let 0 = 1 => {}
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
() if let 0 = 1 && true => {}
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
() if (let 0 = 1) && true => {}
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
() if true && (let 0 = 1) => {}
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
() if (let 0 = 1) && (let 0 = 1) => {}
//~^ ERROR `let` expressions in this position are experimental
//~| ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
() if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
//~^ ERROR `let` expressions in this position are experimental
@@ -43,15 +35,9 @@
//~| ERROR `let` expressions in this position are experimental
//~| ERROR `let` expressions in this position are experimental
//~| ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
() if let Range { start: _, end: _ } = (true..true) && false => {}
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
_ => {}
}
}
@@ -67,10 +53,8 @@
}
use_expr!((let 0 = 1 && 0 == 0));
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
use_expr!((let 0 = 1));
//~^ ERROR `let` expressions in this position are experimental
- //~| ERROR `let` expressions are not supported here
match () {
#[cfg(FALSE)]
() if let 0 = 1 => {}
diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr
index 00811fe..bedcdcb 100644
--- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr
+++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr
@@ -1,5 +1,5 @@
error: no rules expected the token `let`
- --> $DIR/feature-gate.rs:80:15
+ --> $DIR/feature-gate.rs:64:15
|
LL | macro_rules! use_expr {
| --------------------- when calling this macro
@@ -18,7 +18,7 @@
= help: you can write `if matches!(<expr>, <pattern>)` instead of `if let <pattern> = <expr>`
error[E0658]: `if let` guards are experimental
- --> $DIR/feature-gate.rs:76:12
+ --> $DIR/feature-gate.rs:60:12
|
LL | () if let 0 = 1 => {}
| ^^^^^^^^^^^^
@@ -38,7 +38,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:14:18
+ --> $DIR/feature-gate.rs:13:18
|
LL | () if (((let 0 = 1))) => {}
| ^^^^^^^^^
@@ -48,7 +48,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:18:23
+ --> $DIR/feature-gate.rs:16:23
|
LL | () if true && let 0 = 1 => {}
| ^^^^^^^^^
@@ -58,7 +58,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:22:15
+ --> $DIR/feature-gate.rs:19:15
|
LL | () if let 0 = 1 && true => {}
| ^^^^^^^^^
@@ -68,7 +68,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:26:16
+ --> $DIR/feature-gate.rs:22:16
|
LL | () if (let 0 = 1) && true => {}
| ^^^^^^^^^
@@ -78,7 +78,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:30:24
+ --> $DIR/feature-gate.rs:25:24
|
LL | () if true && (let 0 = 1) => {}
| ^^^^^^^^^
@@ -88,7 +88,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:34:16
+ --> $DIR/feature-gate.rs:28:16
|
LL | () if (let 0 = 1) && (let 0 = 1) => {}
| ^^^^^^^^^
@@ -98,7 +98,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:34:31
+ --> $DIR/feature-gate.rs:28:31
|
LL | () if (let 0 = 1) && (let 0 = 1) => {}
| ^^^^^^^^^
@@ -108,7 +108,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:40:15
+ --> $DIR/feature-gate.rs:32:15
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
@@ -118,7 +118,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:40:28
+ --> $DIR/feature-gate.rs:32:28
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
@@ -128,7 +128,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:40:42
+ --> $DIR/feature-gate.rs:32:42
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
@@ -138,7 +138,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:40:55
+ --> $DIR/feature-gate.rs:32:55
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
@@ -148,7 +148,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:40:68
+ --> $DIR/feature-gate.rs:32:68
|
LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
| ^^^^^^^^^
@@ -158,7 +158,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:52:15
+ --> $DIR/feature-gate.rs:39:15
|
LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -168,7 +168,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:68:16
+ --> $DIR/feature-gate.rs:54:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^^^^^^^
@@ -178,7 +178,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:71:16
+ --> $DIR/feature-gate.rs:56:16
|
LL | use_expr!((let 0 = 1));
| ^^^^^^^^^
@@ -187,134 +187,6 @@
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:10:16
- |
-LL | () if (let 0 = 1) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:14:18
- |
-LL | () if (((let 0 = 1))) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:18:23
- |
-LL | () if true && let 0 = 1 => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:22:15
- |
-LL | () if let 0 = 1 && true => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:26:16
- |
-LL | () if (let 0 = 1) && true => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:30:24
- |
-LL | () if true && (let 0 = 1) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:34:16
- |
-LL | () if (let 0 = 1) && (let 0 = 1) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:34:31
- |
-LL | () if (let 0 = 1) && (let 0 = 1) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:40:15
- |
-LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:40:28
- |
-LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:40:42
- |
-LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:40:55
- |
-LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:40:68
- |
-LL | () if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) => {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:52:15
- |
-LL | () if let Range { start: _, end: _ } = (true..true) && false => {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:68:16
- |
-LL | use_expr!((let 0 = 1 && 0 == 0));
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:71:16
- |
-LL | use_expr!((let 0 = 1));
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: aborting due to 35 previous errors
+error: aborting due to 19 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/rfc-2294-if-let-guard/run-pass.rs b/src/test/ui/rfc-2294-if-let-guard/run-pass.rs
index a366300..3da5798 100644
--- a/src/test/ui/rfc-2294-if-let-guard/run-pass.rs
+++ b/src/test/ui/rfc-2294-if-let-guard/run-pass.rs
@@ -1,7 +1,6 @@
// run-pass
#![feature(if_let_guard)]
-#![allow(incomplete_features)]
enum Foo {
Bar,
diff --git a/src/test/ui/rfc-2294-if-let-guard/typeck.rs b/src/test/ui/rfc-2294-if-let-guard/typeck.rs
index a4fc7f8..ad178df 100644
--- a/src/test/ui/rfc-2294-if-let-guard/typeck.rs
+++ b/src/test/ui/rfc-2294-if-let-guard/typeck.rs
@@ -1,5 +1,4 @@
#![feature(if_let_guard)]
-#![allow(incomplete_features)]
fn ok() -> Result<Option<bool>, ()> {
Ok(Some(true))
diff --git a/src/test/ui/rfc-2294-if-let-guard/typeck.stderr b/src/test/ui/rfc-2294-if-let-guard/typeck.stderr
index 6407128..fbb941f 100644
--- a/src/test/ui/rfc-2294-if-let-guard/typeck.stderr
+++ b/src/test/ui/rfc-2294-if-let-guard/typeck.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/typeck.rs:10:22
+ --> $DIR/typeck.rs:9:22
|
LL | Ok(x) if let Err(_) = x => {},
| ^^^^^^ expected enum `Option`, found enum `Result`
@@ -8,7 +8,7 @@
found enum `Result<_, _>`
error[E0308]: mismatched types
- --> $DIR/typeck.rs:12:22
+ --> $DIR/typeck.rs:11:22
|
LL | Ok(x) if let 0 = x => {},
| ^ expected enum `Option`, found integer
diff --git a/src/test/ui/rfc-2294-if-let-guard/warns.rs b/src/test/ui/rfc-2294-if-let-guard/warns.rs
index d921367..3ad1a50 100644
--- a/src/test/ui/rfc-2294-if-let-guard/warns.rs
+++ b/src/test/ui/rfc-2294-if-let-guard/warns.rs
@@ -1,5 +1,4 @@
#![feature(if_let_guard)]
-#![allow(incomplete_features)]
#[deny(irrefutable_let_patterns)]
fn irrefutable_let_guard() {
diff --git a/src/test/ui/rfc-2294-if-let-guard/warns.stderr b/src/test/ui/rfc-2294-if-let-guard/warns.stderr
index c7627f1..cf64513 100644
--- a/src/test/ui/rfc-2294-if-let-guard/warns.stderr
+++ b/src/test/ui/rfc-2294-if-let-guard/warns.stderr
@@ -1,11 +1,11 @@
error: irrefutable `if let` guard pattern
- --> $DIR/warns.rs:7:24
+ --> $DIR/warns.rs:6:24
|
LL | Some(x) if let () = x => {}
| ^^
|
note: the lint level is defined here
- --> $DIR/warns.rs:4:8
+ --> $DIR/warns.rs:3:8
|
LL | #[deny(irrefutable_let_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,13 +13,13 @@
= help: consider removing the guard and adding a `let` inside the match arm
error: unreachable pattern
- --> $DIR/warns.rs:16:25
+ --> $DIR/warns.rs:15:25
|
LL | x if let None | None = x => {}
| ^^^^
|
note: the lint level is defined here
- --> $DIR/warns.rs:13:8
+ --> $DIR/warns.rs:12:8
|
LL | #[deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs
index 0325d64..f4c126a 100644
--- a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs
+++ b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.rs
@@ -1,4 +1,20 @@
#[no_mangle]
pub fn řųśť() {} //~ `#[no_mangle]` requires ASCII identifier
+pub struct Foo;
+
+impl Foo {
+ #[no_mangle]
+ pub fn řųśť() {} //~ `#[no_mangle]` requires ASCII identifier
+}
+
+trait Bar {
+ fn řųśť();
+}
+
+impl Bar for Foo {
+ #[no_mangle]
+ fn řųśť() {} //~ `#[no_mangle]` requires ASCII identifier
+}
+
fn main() {}
diff --git a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr
index b4b2b0c..459d5d6 100644
--- a/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr
+++ b/src/test/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr
@@ -4,6 +4,18 @@
LL | pub fn řųśť() {}
| ^^^^^^^^^^^^^
-error: aborting due to previous error
+error[E0754]: `#[no_mangle]` requires ASCII identifier
+ --> $DIR/no_mangle_nonascii_forbidden.rs:8:5
+ |
+LL | pub fn řųśť() {}
+ | ^^^^^^^^^^^^^
+
+error[E0754]: `#[no_mangle]` requires ASCII identifier
+ --> $DIR/no_mangle_nonascii_forbidden.rs:17:5
+ |
+LL | fn řųśť() {}
+ | ^^^^^^^^^
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0754`.
diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs
index aeee27a..b0b3464 100644
--- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs
+++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.rs
@@ -17,8 +17,6 @@
//
// To that end, we check some positions which is not part of the language above.
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
#![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test.
//~^ WARN the feature `let_chains` is incomplete
@@ -201,7 +199,6 @@
(let true = let true = true);
//~^ ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
// Check function tail position.
&let 0 = 0
diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
index 4950b65..5ec4352 100644
--- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
@@ -1,5 +1,5 @@
error: expressions must be enclosed in braces to be used as const generic arguments
- --> $DIR/disallowed-positions.rs:236:9
+ --> $DIR/disallowed-positions.rs:233:9
|
LL | true && let 1 = 1
| ^^^^^^^^^^^^^^^^^
@@ -7,496 +7,538 @@
help: enclose the `const` expression in braces
|
LL | { true && let 1 = 1 }
- | ^ ^
+ | + +
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:32:9
+ --> $DIR/disallowed-positions.rs:30:9
|
LL | if &let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:35:9
+ --> $DIR/disallowed-positions.rs:33:9
|
LL | if !let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:36:9
+ --> $DIR/disallowed-positions.rs:34:9
|
LL | if *let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:38:9
+ --> $DIR/disallowed-positions.rs:36:9
|
LL | if -let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:46:9
+ --> $DIR/disallowed-positions.rs:44:9
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:50:16
+ --> $DIR/disallowed-positions.rs:48:16
|
LL | if true || let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:51:17
+ --> $DIR/disallowed-positions.rs:49:17
|
LL | if (true || let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:52:25
+ --> $DIR/disallowed-positions.rs:50:25
|
LL | if true && (true || let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:53:25
+ --> $DIR/disallowed-positions.rs:51:25
|
LL | if true || (true && let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:56:12
+ --> $DIR/disallowed-positions.rs:54:12
|
LL | if x = let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:59:15
+ --> $DIR/disallowed-positions.rs:57:15
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:61:11
+ --> $DIR/disallowed-positions.rs:59:11
|
LL | if ..(let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:63:9
+ --> $DIR/disallowed-positions.rs:61:9
|
LL | if (let 0 = 0).. {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:67:8
+ --> $DIR/disallowed-positions.rs:65:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:71:8
+ --> $DIR/disallowed-positions.rs:69:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:78:8
+ --> $DIR/disallowed-positions.rs:76:8
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:86:8
+ --> $DIR/disallowed-positions.rs:84:8
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:92:19
+ --> $DIR/disallowed-positions.rs:90:19
|
LL | if let true = let true = true {}
| ^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:96:12
+ --> $DIR/disallowed-positions.rs:94:12
|
LL | while &let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:99:12
+ --> $DIR/disallowed-positions.rs:97:12
|
LL | while !let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:100:12
+ --> $DIR/disallowed-positions.rs:98:12
|
LL | while *let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:102:12
+ --> $DIR/disallowed-positions.rs:100:12
|
LL | while -let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:110:12
+ --> $DIR/disallowed-positions.rs:108:12
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:114:19
+ --> $DIR/disallowed-positions.rs:112:19
|
LL | while true || let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:115:20
+ --> $DIR/disallowed-positions.rs:113:20
|
LL | while (true || let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:116:28
+ --> $DIR/disallowed-positions.rs:114:28
|
LL | while true && (true || let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:117:28
+ --> $DIR/disallowed-positions.rs:115:28
|
LL | while true || (true && let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:120:15
+ --> $DIR/disallowed-positions.rs:118:15
|
LL | while x = let 0 = 0 {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:123:18
+ --> $DIR/disallowed-positions.rs:121:18
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:125:14
+ --> $DIR/disallowed-positions.rs:123:14
|
LL | while ..(let 0 = 0) {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:127:12
+ --> $DIR/disallowed-positions.rs:125:12
|
LL | while (let 0 = 0).. {}
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:131:11
+ --> $DIR/disallowed-positions.rs:129:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:135:11
+ --> $DIR/disallowed-positions.rs:133:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:142:11
+ --> $DIR/disallowed-positions.rs:140:11
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:150:11
+ --> $DIR/disallowed-positions.rs:148:11
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:156:22
+ --> $DIR/disallowed-positions.rs:154:22
|
LL | while let true = let true = true {}
| ^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:170:6
+ --> $DIR/disallowed-positions.rs:168:6
|
LL | &let 0 = 0;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:172:6
+ --> $DIR/disallowed-positions.rs:170:6
|
LL | !let 0 = 0;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:173:6
+ --> $DIR/disallowed-positions.rs:171:6
|
LL | *let 0 = 0;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:175:6
+ --> $DIR/disallowed-positions.rs:173:6
|
LL | -let 0 = 0;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:183:6
+ --> $DIR/disallowed-positions.rs:181:6
|
LL | (let 0 = 0)?;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:187:13
+ --> $DIR/disallowed-positions.rs:185:13
|
LL | true || let 0 = 0;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:188:14
+ --> $DIR/disallowed-positions.rs:186:14
|
LL | (true || let 0 = 0);
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:189:22
+ --> $DIR/disallowed-positions.rs:187:22
|
LL | true && (true || let 0 = 0);
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:192:9
+ --> $DIR/disallowed-positions.rs:190:9
|
LL | x = let 0 = 0;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:194:12
+ --> $DIR/disallowed-positions.rs:192:12
|
LL | true..(let 0 = 0);
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:195:8
+ --> $DIR/disallowed-positions.rs:193:8
|
LL | ..(let 0 = 0);
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:196:6
+ --> $DIR/disallowed-positions.rs:194:6
|
LL | (let 0 = 0)..;
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:198:6
+ --> $DIR/disallowed-positions.rs:196:6
|
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:202:6
+ --> $DIR/disallowed-positions.rs:200:6
|
LL | (let true = let true = true);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:202:17
- |
-LL | (let true = let true = true);
- | ^^^^^^^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:207:6
+ --> $DIR/disallowed-positions.rs:204:6
|
LL | &let 0 = 0
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:218:17
+ --> $DIR/disallowed-positions.rs:215:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:222:17
+ --> $DIR/disallowed-positions.rs:219:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:226:17
+ --> $DIR/disallowed-positions.rs:223:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:236:17
+ --> $DIR/disallowed-positions.rs:233:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/disallowed-positions.rs:20:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
+ = note: only supported directly in conditions of `if`- and `while`-expressions
+ = note: as well as when nested within `&&` and parenthesis in those conditions
warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/disallowed-positions.rs:22:12
+ --> $DIR/disallowed-positions.rs:20:12
|
LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test.
| ^^^^^^^^^^
|
+ = note: `#[warn(incomplete_features)]` on by default
= note: see issue #53667 <https://github.com/rust-lang/rust/issues/53667> for more information
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:32:8
+ --> $DIR/disallowed-positions.rs:30:8
|
LL | if &let 0 = 0 {}
- | ^^^^^^^^^^
- | |
- | expected `bool`, found `&bool`
- | help: consider removing the borrow: `let 0 = 0`
+ | ^^^^^^^^^^ expected `bool`, found `&bool`
+ |
+help: consider removing the borrow
+ |
+LL - if &let 0 = 0 {}
+LL + if let 0 = 0 {}
+ |
error[E0614]: type `bool` cannot be dereferenced
- --> $DIR/disallowed-positions.rs:36:8
+ --> $DIR/disallowed-positions.rs:34:8
|
LL | if *let 0 = 0 {}
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
- --> $DIR/disallowed-positions.rs:38:8
+ --> $DIR/disallowed-positions.rs:36:8
|
LL | if -let 0 = 0 {}
| ^^^^^^^^^^ cannot apply unary operator `-`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/disallowed-positions.rs:46:8
+ --> $DIR/disallowed-positions.rs:44:8
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
@@ -509,7 +551,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
- --> $DIR/disallowed-positions.rs:46:19
+ --> $DIR/disallowed-positions.rs:44:19
|
LL | / fn nested_within_if_expr() {
LL | | if &let 0 = 0 {}
@@ -531,7 +573,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:56:8
+ --> $DIR/disallowed-positions.rs:54:8
|
LL | if x = let 0 = 0 {}
| ^^^^^^^^^^^^^ expected `bool`, found `()`
@@ -539,10 +581,10 @@
help: you might have meant to compare for equality
|
LL | if x == let 0 = 0 {}
- | ^^
+ | ~~
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:59:8
+ --> $DIR/disallowed-positions.rs:57:8
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -551,7 +593,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:61:8
+ --> $DIR/disallowed-positions.rs:59:8
|
LL | if ..(let 0 = 0) {}
| ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
@@ -560,7 +602,7 @@
found struct `RangeTo<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:63:8
+ --> $DIR/disallowed-positions.rs:61:8
|
LL | if (let 0 = 0).. {}
| ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
@@ -569,7 +611,7 @@
found struct `RangeFrom<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:67:12
+ --> $DIR/disallowed-positions.rs:65:12
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
@@ -580,7 +622,7 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:67:8
+ --> $DIR/disallowed-positions.rs:65:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -589,7 +631,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:71:12
+ --> $DIR/disallowed-positions.rs:69:12
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
@@ -600,7 +642,7 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:71:8
+ --> $DIR/disallowed-positions.rs:69:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -609,7 +651,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:78:12
+ --> $DIR/disallowed-positions.rs:76:12
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
@@ -618,16 +660,16 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:78:41
+ --> $DIR/disallowed-positions.rs:76:41
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^ expected `bool`, found closure
|
= note: expected type `bool`
- found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
+ found closure `[closure@$DIR/disallowed-positions.rs:76:41: 76:48]`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:78:8
+ --> $DIR/disallowed-positions.rs:76:8
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -636,7 +678,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:86:12
+ --> $DIR/disallowed-positions.rs:84:12
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
@@ -647,13 +689,13 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:86:44
+ --> $DIR/disallowed-positions.rs:84:44
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^ expected `bool`, found `&&bool`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:86:8
+ --> $DIR/disallowed-positions.rs:84:8
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -662,7 +704,7 @@
found struct `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/disallowed-positions.rs:42:20
+ --> $DIR/disallowed-positions.rs:40:20
|
LL | if let 0 = 0? {}
| ^^ the `?` operator cannot be applied to type `{integer}`
@@ -675,28 +717,31 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:96:11
+ --> $DIR/disallowed-positions.rs:94:11
|
LL | while &let 0 = 0 {}
- | ^^^^^^^^^^
- | |
- | expected `bool`, found `&bool`
- | help: consider removing the borrow: `let 0 = 0`
+ | ^^^^^^^^^^ expected `bool`, found `&bool`
+ |
+help: consider removing the borrow
+ |
+LL - while &let 0 = 0 {}
+LL + while let 0 = 0 {}
+ |
error[E0614]: type `bool` cannot be dereferenced
- --> $DIR/disallowed-positions.rs:100:11
+ --> $DIR/disallowed-positions.rs:98:11
|
LL | while *let 0 = 0 {}
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
- --> $DIR/disallowed-positions.rs:102:11
+ --> $DIR/disallowed-positions.rs:100:11
|
LL | while -let 0 = 0 {}
| ^^^^^^^^^^ cannot apply unary operator `-`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/disallowed-positions.rs:110:11
+ --> $DIR/disallowed-positions.rs:108:11
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
@@ -709,7 +754,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
- --> $DIR/disallowed-positions.rs:110:22
+ --> $DIR/disallowed-positions.rs:108:22
|
LL | / fn nested_within_while_expr() {
LL | | while &let 0 = 0 {}
@@ -731,7 +776,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:120:11
+ --> $DIR/disallowed-positions.rs:118:11
|
LL | while x = let 0 = 0 {}
| ^^^^^^^^^^^^^ expected `bool`, found `()`
@@ -739,10 +784,10 @@
help: you might have meant to compare for equality
|
LL | while x == let 0 = 0 {}
- | ^^
+ | ~~
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:123:11
+ --> $DIR/disallowed-positions.rs:121:11
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -751,7 +796,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:125:11
+ --> $DIR/disallowed-positions.rs:123:11
|
LL | while ..(let 0 = 0) {}
| ^^^^^^^^^^^^^ expected `bool`, found struct `RangeTo`
@@ -760,7 +805,7 @@
found struct `RangeTo<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:127:11
+ --> $DIR/disallowed-positions.rs:125:11
|
LL | while (let 0 = 0).. {}
| ^^^^^^^^^^^^^ expected `bool`, found struct `RangeFrom`
@@ -769,7 +814,7 @@
found struct `RangeFrom<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:131:15
+ --> $DIR/disallowed-positions.rs:129:15
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
@@ -780,7 +825,7 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:131:11
+ --> $DIR/disallowed-positions.rs:129:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -789,7 +834,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:135:15
+ --> $DIR/disallowed-positions.rs:133:15
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
@@ -800,7 +845,7 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:135:11
+ --> $DIR/disallowed-positions.rs:133:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -809,7 +854,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:142:15
+ --> $DIR/disallowed-positions.rs:140:15
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
@@ -818,16 +863,16 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:142:44
+ --> $DIR/disallowed-positions.rs:140:44
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^ expected `bool`, found closure
|
= note: expected type `bool`
- found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
+ found closure `[closure@$DIR/disallowed-positions.rs:140:44: 140:51]`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:142:11
+ --> $DIR/disallowed-positions.rs:140:11
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -836,7 +881,7 @@
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:150:15
+ --> $DIR/disallowed-positions.rs:148:15
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
@@ -847,13 +892,13 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:150:47
+ --> $DIR/disallowed-positions.rs:148:47
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^ expected `bool`, found `&&bool`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:150:11
+ --> $DIR/disallowed-positions.rs:148:11
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
@@ -862,7 +907,7 @@
found struct `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/disallowed-positions.rs:106:23
+ --> $DIR/disallowed-positions.rs:104:23
|
LL | while let 0 = 0? {}
| ^^ the `?` operator cannot be applied to type `{integer}`
@@ -875,19 +920,19 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0614]: type `bool` cannot be dereferenced
- --> $DIR/disallowed-positions.rs:173:5
+ --> $DIR/disallowed-positions.rs:171:5
|
LL | *let 0 = 0;
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
- --> $DIR/disallowed-positions.rs:175:5
+ --> $DIR/disallowed-positions.rs:173:5
|
LL | -let 0 = 0;
| ^^^^^^^^^^ cannot apply unary operator `-`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/disallowed-positions.rs:183:5
+ --> $DIR/disallowed-positions.rs:181:5
|
LL | (let 0 = 0)?;
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
@@ -900,7 +945,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
- --> $DIR/disallowed-positions.rs:183:16
+ --> $DIR/disallowed-positions.rs:181:16
|
LL | / fn outside_if_and_while_expr() {
LL | | &let 0 = 0;
@@ -922,7 +967,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:198:10
+ --> $DIR/disallowed-positions.rs:196:10
|
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
@@ -933,7 +978,7 @@
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
- --> $DIR/disallowed-positions.rs:207:5
+ --> $DIR/disallowed-positions.rs:204:5
|
LL | fn outside_if_and_while_expr() {
| - help: try adding a return type: `-> &bool`
@@ -942,7 +987,7 @@
| ^^^^^^^^^^ expected `()`, found `&bool`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
- --> $DIR/disallowed-positions.rs:179:17
+ --> $DIR/disallowed-positions.rs:177:17
|
LL | let 0 = 0?;
| ^^ the `?` operator cannot be applied to type `{integer}`
@@ -954,7 +999,7 @@
LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 104 previous errors; 2 warnings emitted
+error: aborting due to 103 previous errors; 1 warning emitted
Some errors have detailed explanations: E0277, E0308, E0600, E0614.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs b/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs
index 0b38b5f4..2b4259e 100644
--- a/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs
+++ b/src/test/ui/rfc-2497-if-let-chains/feature-gate.rs
@@ -13,33 +13,25 @@
if (let 0 = 1) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR invalid parentheses around `let` expression in `if let`
if (((let 0 = 1))) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR invalid parentheses around `let` expression in `if let`
if true && let 0 = 1 {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
if let 0 = 1 && true {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
if (let 0 = 1) && true {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
if true && (let 0 = 1) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
if (let 0 = 1) && (let 0 = 1) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
//~| ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
@@ -47,15 +39,9 @@
//~| ERROR `let` expressions in this position are experimental [E0658]
//~| ERROR `let` expressions in this position are experimental [E0658]
//~| ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
if let Range { start: _, end: _ } = (true..true) && false {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
}
fn _while() {
@@ -63,33 +49,25 @@
while (let 0 = 1) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
while (((let 0 = 1))) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
while true && let 0 = 1 {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
while let 0 = 1 && true {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
while (let 0 = 1) && true {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
while true && (let 0 = 1) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
while (let 0 = 1) && (let 0 = 1) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
//~| ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
@@ -97,15 +75,9 @@
//~| ERROR `let` expressions in this position are experimental [E0658]
//~| ERROR `let` expressions in this position are experimental [E0658]
//~| ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
while let Range { start: _, end: _ } = (true..true) && false {}
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
}
fn _macros() {
@@ -122,12 +94,8 @@
}
use_expr!((let 0 = 1 && 0 == 0));
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR `let` expressions are not supported here
- //~| ERROR `let` expressions are not supported here
use_expr!((let 0 = 1));
//~^ ERROR `let` expressions in this position are experimental [E0658]
- //~| ERROR invalid parentheses around `let` expression in `if let`
- //~| ERROR `let` expressions are not supported here
#[cfg(FALSE)] (let 0 = 1);
//~^ ERROR `let` expressions in this position are experimental [E0658]
use_expr!(let 0 = 1);
diff --git a/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr b/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr
index 7364f62..180eee0 100644
--- a/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/feature-gate.stderr
@@ -1,5 +1,5 @@
error: no rules expected the token `let`
- --> $DIR/feature-gate.rs:133:15
+ --> $DIR/feature-gate.rs:101:15
|
LL | macro_rules! use_expr {
| --------------------- when calling this macro
@@ -18,7 +18,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:18:11
+ --> $DIR/feature-gate.rs:17:11
|
LL | if (((let 0 = 1))) {}
| ^^^^^^^^^
@@ -28,7 +28,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:22:16
+ --> $DIR/feature-gate.rs:20:16
|
LL | if true && let 0 = 1 {}
| ^^^^^^^^^
@@ -38,7 +38,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:26:8
+ --> $DIR/feature-gate.rs:23:8
|
LL | if let 0 = 1 && true {}
| ^^^^^^^^^
@@ -48,7 +48,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:30:9
+ --> $DIR/feature-gate.rs:26:9
|
LL | if (let 0 = 1) && true {}
| ^^^^^^^^^
@@ -58,7 +58,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:34:17
+ --> $DIR/feature-gate.rs:29:17
|
LL | if true && (let 0 = 1) {}
| ^^^^^^^^^
@@ -68,7 +68,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:38:9
+ --> $DIR/feature-gate.rs:32:9
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
@@ -78,7 +78,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:38:24
+ --> $DIR/feature-gate.rs:32:24
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
@@ -88,7 +88,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:44:8
+ --> $DIR/feature-gate.rs:36:8
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -98,7 +98,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:44:21
+ --> $DIR/feature-gate.rs:36:21
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -108,7 +108,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:44:35
+ --> $DIR/feature-gate.rs:36:35
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -118,7 +118,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:44:48
+ --> $DIR/feature-gate.rs:36:48
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -128,7 +128,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:44:61
+ --> $DIR/feature-gate.rs:36:61
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -138,7 +138,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:56:8
+ --> $DIR/feature-gate.rs:43:8
|
LL | if let Range { start: _, end: _ } = (true..true) && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -148,7 +148,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:64:12
+ --> $DIR/feature-gate.rs:50:12
|
LL | while (let 0 = 1) {}
| ^^^^^^^^^
@@ -158,7 +158,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:68:14
+ --> $DIR/feature-gate.rs:53:14
|
LL | while (((let 0 = 1))) {}
| ^^^^^^^^^
@@ -168,7 +168,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:72:19
+ --> $DIR/feature-gate.rs:56:19
|
LL | while true && let 0 = 1 {}
| ^^^^^^^^^
@@ -178,7 +178,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:76:11
+ --> $DIR/feature-gate.rs:59:11
|
LL | while let 0 = 1 && true {}
| ^^^^^^^^^
@@ -188,7 +188,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:80:12
+ --> $DIR/feature-gate.rs:62:12
|
LL | while (let 0 = 1) && true {}
| ^^^^^^^^^
@@ -198,7 +198,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:84:20
+ --> $DIR/feature-gate.rs:65:20
|
LL | while true && (let 0 = 1) {}
| ^^^^^^^^^
@@ -208,7 +208,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:88:12
+ --> $DIR/feature-gate.rs:68:12
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
@@ -218,7 +218,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:88:27
+ --> $DIR/feature-gate.rs:68:27
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
@@ -228,7 +228,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:94:11
+ --> $DIR/feature-gate.rs:72:11
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -238,7 +238,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:94:24
+ --> $DIR/feature-gate.rs:72:24
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -248,7 +248,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:94:38
+ --> $DIR/feature-gate.rs:72:38
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -258,7 +258,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:94:51
+ --> $DIR/feature-gate.rs:72:51
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -268,7 +268,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:94:64
+ --> $DIR/feature-gate.rs:72:64
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
@@ -278,7 +278,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:106:11
+ --> $DIR/feature-gate.rs:79:11
|
LL | while let Range { start: _, end: _ } = (true..true) && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -288,7 +288,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:131:20
+ --> $DIR/feature-gate.rs:99:20
|
LL | #[cfg(FALSE)] (let 0 = 1);
| ^^^^^^^^^
@@ -298,7 +298,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:114:17
+ --> $DIR/feature-gate.rs:86:17
|
LL | noop_expr!((let 0 = 1));
| ^^^^^^^^^
@@ -308,7 +308,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:123:16
+ --> $DIR/feature-gate.rs:95:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^^^^^^^
@@ -318,7 +318,7 @@
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
error[E0658]: `let` expressions in this position are experimental
- --> $DIR/feature-gate.rs:127:16
+ --> $DIR/feature-gate.rs:97:16
|
LL | use_expr!((let 0 = 1));
| ^^^^^^^^^
@@ -327,271 +327,6 @@
= help: add `#![feature(let_chains)]` to the crate attributes to enable
= help: you can write `matches!(<expr>, <pattern>)` instead of `let <pattern> = <expr>`
-error: invalid parentheses around `let` expression in `if let`
- --> $DIR/feature-gate.rs:14:8
- |
-LL | if (let 0 = 1) {}
- | ^ ^
- |
-help: `if let` needs to be written without parentheses
- |
-LL | if let 0 = 1 {}
- | -- --
-
-error: invalid parentheses around `let` expression in `if let`
- --> $DIR/feature-gate.rs:18:8
- |
-LL | if (((let 0 = 1))) {}
- | ^^^ ^^^
- |
-help: `if let` needs to be written without parentheses
- |
-LL | if let 0 = 1 {}
- | -- --
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:22:16
- |
-LL | if true && let 0 = 1 {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:26:8
- |
-LL | if let 0 = 1 && true {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:30:9
- |
-LL | if (let 0 = 1) && true {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:34:17
- |
-LL | if true && (let 0 = 1) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:38:9
- |
-LL | if (let 0 = 1) && (let 0 = 1) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:38:24
- |
-LL | if (let 0 = 1) && (let 0 = 1) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:44:8
- |
-LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:44:21
- |
-LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:44:35
- |
-LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:44:48
- |
-LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:44:61
- |
-LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:56:8
- |
-LL | if let Range { start: _, end: _ } = (true..true) && false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:64:12
- |
-LL | while (let 0 = 1) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:68:14
- |
-LL | while (((let 0 = 1))) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:72:19
- |
-LL | while true && let 0 = 1 {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:76:11
- |
-LL | while let 0 = 1 && true {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:80:12
- |
-LL | while (let 0 = 1) && true {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:84:20
- |
-LL | while true && (let 0 = 1) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:88:12
- |
-LL | while (let 0 = 1) && (let 0 = 1) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:88:27
- |
-LL | while (let 0 = 1) && (let 0 = 1) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:94:11
- |
-LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:94:24
- |
-LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:94:38
- |
-LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:94:51
- |
-LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:94:64
- |
-LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:106:11
- |
-LL | while let Range { start: _, end: _ } = (true..true) && false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:123:16
- |
-LL | use_expr!((let 0 = 1 && 0 == 0));
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:123:16
- |
-LL | use_expr!((let 0 = 1 && 0 == 0));
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: invalid parentheses around `let` expression in `if let`
- --> $DIR/feature-gate.rs:127:15
- |
-LL | use_expr!((let 0 = 1));
- | ^ ^
- |
-help: `if let` needs to be written without parentheses
- |
-LL | use_expr!(let 0 = 1);
- | -- --
-
-error: `let` expressions are not supported here
- --> $DIR/feature-gate.rs:127:16
- |
-LL | use_expr!((let 0 = 1));
- | ^^^^^^^^^
- |
- = note: only supported directly without parentheses in conditions of `if`- and `while`-expressions, as well as in `let` chains within parentheses
-
-error: aborting due to 65 previous errors
+error: aborting due to 33 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs
index 4429836..fcc09b1 100644
--- a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs
+++ b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs
@@ -10,7 +10,8 @@
fn _f1() -> bool {
// Should associate as `(let _ = (return (true && false)))`.
- if let _ = return true && false {}; //~ WARNING unreachable_code
+ if let _ = return true && false {};
+ //~^ WARNING unreachable block in `if`
}
assert!(!_f1());
}
diff --git a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr
index 81cefdd..24b35a2 100644
--- a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr
@@ -1,8 +1,8 @@
-warning: unreachable block in `if` expression
+warning: unreachable block in `if` or `while` expression
--> $DIR/protect-precedences.rs:13:41
|
LL | if let _ = return true && false {};
- | -------------------- ^^ unreachable block in `if` expression
+ | -------------------- ^^ unreachable block in `if` or `while` expression
| |
| any code following this expression is unreachable
|
diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr
index 5516d4a..4514fd9 100644
--- a/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr
+++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr
@@ -8,15 +8,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | trait Trait2015 { fn foo(#[allow(C)] self: i32); }
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | trait Trait2015 { fn foo(#[allow(C)] i32: TypeName); }
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | trait Trait2015 { fn foo(#[allow(C)] _: i32); }
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
index 4a1bd5d..228b5ed 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
@@ -1,8 +1,4 @@
-// ignore-test
-
-// FIXME: This test should fail since, within a const impl of `Foo`, the bound on `Foo::Bar` should
-// require a const impl of `Add` for the associated type.
-
+// FIXME(fee1-dead): this should have a better error message
#![feature(const_trait_impl)]
struct NonConstAdd(i32);
@@ -16,11 +12,20 @@
}
trait Foo {
- type Bar: std::ops::Add;
+ type Bar: ~const std::ops::Add;
}
impl const Foo for NonConstAdd {
type Bar = NonConstAdd;
+ //~^ ERROR
+}
+
+trait Baz {
+ type Qux: std::ops::Add;
+}
+
+impl const Baz for NonConstAdd {
+ type Qux = NonConstAdd; // OK
}
fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr
new file mode 100644
index 0000000..b894092
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr
@@ -0,0 +1,20 @@
+error[E0277]: cannot add `NonConstAdd` to `NonConstAdd`
+ --> $DIR/assoc-type.rs:19:5
+ |
+LL | type Bar = NonConstAdd;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `NonConstAdd + NonConstAdd`
+ |
+ = help: the trait `Add` is not implemented for `NonConstAdd`
+note: required by a bound in `Foo::Bar`
+ --> $DIR/assoc-type.rs:15:15
+ |
+LL | type Bar: ~const std::ops::Add;
+ | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo::Bar`
+help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
+ |
+LL | impl const Foo for NonConstAdd where NonConstAdd: Add {
+ | ++++++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
index 536c1d7..4b706a1 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
@@ -6,7 +6,7 @@
fn eq(&self, other: &Self) -> bool;
}
-impl<T: PartialEq> const MyPartialEq for T {
+impl<T: ~const PartialEq> const MyPartialEq for T {
fn eq(&self, other: &Self) -> bool {
PartialEq::eq(self, other)
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs
index f3391aa..adf8d4f 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs
@@ -16,11 +16,11 @@
}
}
-const fn equals_self<T: PartialEq>(t: &T) -> bool {
+const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
*t == *t
}
-const fn equals_self_wrapper<T: PartialEq>(t: &T) -> bool {
+const fn equals_self_wrapper<T: ~const PartialEq>(t: &T) -> bool {
equals_self(t)
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs
index 00a3c7f..7185376 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs
@@ -1,9 +1,7 @@
// check-pass
#![feature(const_trait_impl)]
-#![feature(const_trait_bound_opt_out)]
#![feature(const_fn_trait_bound)]
-#![allow(incomplete_features)]
struct S;
@@ -16,9 +14,11 @@
}
}
-// This duplicate bound should not result in ambiguities. It should be equivalent to a single const
+// This duplicate bound should not result in ambiguities. It should be equivalent to a single ~const
// bound.
-const fn equals_self<T: PartialEq + ?const PartialEq>(t: &T) -> bool {
+// const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool {
+// FIXME(fee1-dead)^ why should the order matter here?
+const fn equals_self<T: ~const PartialEq + PartialEq>(t: &T) -> bool {
*t == *t
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs
index dc4d556..e96249f 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs
@@ -1,9 +1,7 @@
#![feature(const_fn_trait_bound)]
#![feature(const_trait_impl)]
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
-pub const fn equals_self<T: ?const PartialEq>(t: &T) -> bool {
+pub const fn equals_self<T: PartialEq>(t: &T) -> bool {
*t == *t
//~^ ERROR calls in constant functions are limited to constant functions
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
index 4b2fc56..818c582 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
@@ -1,5 +1,5 @@
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
- --> $DIR/call-generic-method-fail.rs:7:5
+ --> $DIR/call-generic-method-fail.rs:5:5
|
LL | *t == *t
| ^^^^^^^^
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
new file mode 100644
index 0000000..585b659
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs
@@ -0,0 +1,19 @@
+// check-pass
+
+#![feature(const_fn_trait_bound)]
+
+struct S;
+
+impl PartialEq for S {
+ fn eq(&self, _: &S) -> bool {
+ true
+ }
+}
+
+const fn equals_self<T: PartialEq>(t: &T) -> bool {
+ true
+}
+
+pub const EQ: bool = equals_self(&S);
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-opt-out.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-opt-out.rs
deleted file mode 100644
index 1fc2c4f..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-opt-out.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// check-pass
-
-#![feature(const_fn_trait_bound)]
-#![feature(const_trait_impl)]
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
-
-struct S;
-
-impl PartialEq for S {
- fn eq(&self, _: &S) -> bool {
- true
- }
-}
-
-const fn equals_self<T: ?const PartialEq>(t: &T) -> bool {
- true
-}
-
-pub const EQ: bool = equals_self(&S);
-
-// Calling `equals_self` with a type that only has a non-const impl is fine, because we opted out.
-
-fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
index 087f8fb..6881db0 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
@@ -1,7 +1,5 @@
-// FIXME(jschievink): this is not rejected correctly (only when the non-const impl is actually used)
-// ignore-test
-
#![feature(const_trait_impl)]
+#![feature(const_fn_trait_bound)]
struct S;
@@ -11,7 +9,7 @@
}
}
-const fn equals_self<T: PartialEq>(t: &T) -> bool {
+const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
true
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
new file mode 100644
index 0000000..9b9bda7
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
@@ -0,0 +1,16 @@
+error[E0277]: can't compare `S` with `S`
+ --> $DIR/call-generic-method-nonconst.rs:19:34
+ |
+LL | pub const EQ: bool = equals_self(&S);
+ | ^^ no implementation for `S == S`
+ |
+ = help: the trait `PartialEq` is not implemented for `S`
+note: required by a bound in `equals_self`
+ --> $DIR/call-generic-method-nonconst.rs:12:25
+ |
+LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
+ | ^^^^^^^^^^^^^^^^ required by this bound in `equals_self`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs
index aee88d6..aa9bd4d 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs
@@ -16,7 +16,7 @@
}
}
-const fn equals_self<T: PartialEq>(t: &T) -> bool {
+const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
*t == *t
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr
index f815389..79d170c 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr
@@ -6,8 +6,9 @@
|
help: you might have meant to write a const trait impl
|
-LL | impl const Foo for i32 {}
- |-- ^^^^^
+LL - const impl Foo for i32 {}
+LL + impl const Foo for i32 {}
+ |
error: expected identifier, found keyword `impl`
--> $DIR/const-impl-recovery.rs:9:7
@@ -17,8 +18,9 @@
|
help: you might have meant to write a const trait impl
|
-LL | impl<T: Foo> const Bar for T {}
- |-- ^^^^^
+LL - const impl<T: Foo> Bar for T {}
+LL + impl<T: Foo> const Bar for T {}
+ |
error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr
deleted file mode 100644
index 5804145..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.gated.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
- --> $DIR/feature-gate.rs:17:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs
deleted file mode 100644
index 4452ad7..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// revisions: stock gated
-// gate-test-const_trait_bound_opt_out
-
-#![cfg_attr(gated, feature(const_trait_bound_opt_out))]
-#![allow(incomplete_features)]
-#![feature(rustc_attrs)]
-#![feature(const_fn_trait_bound)]
-
-trait T {
- const CONST: i32;
-}
-
-const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
-//[stock]~^ ERROR `?const` on trait bounds is experimental
-
-#[rustc_error]
-fn main() {} //[gated]~ ERROR fatal error triggered by #[rustc_error]
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr
deleted file mode 100644
index 8ae8b88..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/feature-gate.stock.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: `?const` on trait bounds is experimental
- --> $DIR/feature-gate.rs:13:29
- |
-LL | const fn get_assoc_const<S: ?const T>() -> i32 { <S as T>::CONST }
- | ^^^^^^
- |
- = note: see issue #67794 <https://github.com/rust-lang/rust/issues/67794> for more information
- = help: add `#![feature(const_trait_bound_opt_out)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.rs
deleted file mode 100644
index f5561a9..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#![feature(const_trait_bound_opt_out)]
-#![feature(associated_type_bounds)]
-#![allow(incomplete_features)]
-
-trait T {}
-struct S;
-impl T for S {}
-
-fn rpit() -> impl ?const T { S }
-//~^ ERROR `?const` is not permitted in `impl Trait`
-
-fn apit(_: impl ?const T) {}
-//~^ ERROR `?const` is not permitted in `impl Trait`
-
-fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
-//~^ ERROR `?const` is not permitted in `impl Trait`
-
-fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
-//~^ ERROR `?const` is not permitted in `impl Trait`
-
-fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.stderr
deleted file mode 100644
index 06cd00a..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-impl-trait.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error: `?const` is not permitted in `impl Trait`
- --> $DIR/in-impl-trait.rs:9:19
- |
-LL | fn rpit() -> impl ?const T { S }
- | ^^^^^^^^
-
-error: `?const` is not permitted in `impl Trait`
- --> $DIR/in-impl-trait.rs:12:17
- |
-LL | fn apit(_: impl ?const T) {}
- | ^^^^^^^^
-
-error: `?const` is not permitted in `impl Trait`
- --> $DIR/in-impl-trait.rs:15:50
- |
-LL | fn rpit_assoc_bound() -> impl IntoIterator<Item: ?const T> { Some(S) }
- | ^^^^^^^^
-
-error: `?const` is not permitted in `impl Trait`
- --> $DIR/in-impl-trait.rs:18:48
- |
-LL | fn apit_assoc_bound(_: impl IntoIterator<Item: ?const T>) {}
- | ^^^^^^^^
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.rs
deleted file mode 100644
index fc9ed5b..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
-
-trait Super {}
-trait T: ?const Super {}
-//~^ ERROR `?const` is not permitted in supertraits
-
-fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.stderr
deleted file mode 100644
index a0d8f95..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-bounds.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: `?const` is not permitted in supertraits
- --> $DIR/in-trait-bounds.rs:5:10
- |
-LL | trait T: ?const Super {}
- | ^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.rs
deleted file mode 100644
index b3d1f48..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-#![feature(const_trait_bound_opt_out)]
-#![allow(bare_trait_objects)]
-#![allow(incomplete_features)]
-
-struct S;
-trait T {}
-impl T for S {}
-
-// An inherent impl for the trait object `?const T`.
-impl ?const T {}
-//~^ ERROR `?const` is not permitted in trait objects
-
-fn trait_object() -> &'static dyn ?const T { &S }
-//~^ ERROR `?const` is not permitted in trait objects
-
-fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
-//~^ ERROR `?const` is not permitted in trait objects
-
-fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.stderr
deleted file mode 100644
index 331fe04..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/in-trait-object.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: `?const` is not permitted in trait objects
- --> $DIR/in-trait-object.rs:10:6
- |
-LL | impl ?const T {}
- | ^^^^^^^^
-
-error: `?const` is not permitted in trait objects
- --> $DIR/in-trait-object.rs:13:35
- |
-LL | fn trait_object() -> &'static dyn ?const T { &S }
- | ^^^^^^^^
-
-error: `?const` is not permitted in trait objects
- --> $DIR/in-trait-object.rs:16:61
- |
-LL | fn trait_object_in_apit(_: impl IntoIterator<Item = Box<dyn ?const T>>) {}
- | ^^^^^^^^
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.rs
deleted file mode 100644
index 01e941a..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// compile-flags: -Z parse-only
-
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
-
-struct S<T: ?const ?const Tr>;
-//~^ ERROR expected identifier, found keyword `const`
-//~| ERROR expected one of `(`, `+`, `,`, `::`, `<`, `=`, or `>`
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.stderr
deleted file mode 100644
index f7924b3..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/opt-out-twice.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: expected identifier, found keyword `const`
- --> $DIR/opt-out-twice.rs:6:21
- |
-LL | struct S<T: ?const ?const Tr>;
- | ^^^^^ expected identifier, found keyword
-
-error: expected one of `(`, `+`, `,`, `::`, `<`, `=`, or `>`, found `Tr`
- --> $DIR/opt-out-twice.rs:6:27
- |
-LL | struct S<T: ?const ?const Tr>;
- | ^^ expected one of 7 possible tokens
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs
deleted file mode 100644
index a0d9610..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/syntax.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// compile-flags: -Z parse-only
-// check-pass
-
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
-
-struct S<
- T: ?const ?for<'a> Tr<'a> + 'static + ?const std::ops::Add,
- T: ?const ?for<'a: 'b> m::Trait<'a>,
->;
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.rs
deleted file mode 100644
index c2c8689..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
-
-struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
-//~^ ERROR `?const` and `?` are mutually exclusive
-
-fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.stderr
deleted file mode 100644
index e8e9d6c..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/with-maybe-sized.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: `?const` and `?` are mutually exclusive
- --> $DIR/with-maybe-sized.rs:4:13
- |
-LL | struct S<T: ?const ?Sized>(std::marker::PhantomData<T>);
- | ^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.rs b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.rs
deleted file mode 100644
index b904a2e..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// compile-flags: -Z parse-only
-
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
-
-struct S<T: const Tr>;
-//~^ ERROR expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, lifetime, or path
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.stderr
deleted file mode 100644
index 0dbca95..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/const-trait-bound-opt-out/without-question-mark.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, lifetime, or path, found keyword `const`
- --> $DIR/without-question-mark.rs:6:13
- |
-LL | struct S<T: const Tr>;
- | ^^^^^ expected one of 9 possible tokens
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs
new file mode 100644
index 0000000..d5b1a90
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+// This was an ICE, because the compiler ensures the
+// function to be const when performing const checking,
+// but functions marked with the attribute are not const
+// *and* subject to const checking.
+
+#![feature(staged_api)]
+#![feature(const_trait_impl)]
+#![feature(const_fn_trait_bound)]
+#![stable(since = "1", feature = "foo")]
+
+trait Tr {
+ #[default_method_body_is_const]
+ fn a() {}
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
index 3ec329c..32df63e 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
@@ -1,9 +1,12 @@
-error[E0744]: `?` is not allowed in a `const fn`
+error[E0658]: `?` is not allowed in a `const fn`
--> $DIR/hir-const-check.rs:11:9
|
LL | Some(())?;
| ^^^^^^^^^
+ |
+ = note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
+ = help: add `#![feature(const_try)]` to the crate attributes to enable
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0744`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/impl-opt-out-trait.rs b/src/test/ui/rfc-2632-const-trait-impl/impl-opt-out-trait.rs
deleted file mode 100644
index 98d3a22..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/impl-opt-out-trait.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#![feature(const_trait_bound_opt_out)]
-#![feature(const_trait_impl)]
-#![allow(incomplete_features)]
-
-struct S;
-trait T {}
-
-impl ?const T for S {}
-//~^ ERROR expected a trait, found type
-
-fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/impl-opt-out-trait.stderr b/src/test/ui/rfc-2632-const-trait-impl/impl-opt-out-trait.stderr
deleted file mode 100644
index 8f923ef..0000000
--- a/src/test/ui/rfc-2632-const-trait-impl/impl-opt-out-trait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: expected a trait, found type
- --> $DIR/impl-opt-out-trait.rs:8:6
- |
-LL | impl ?const T for S {}
- | ^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs b/src/test/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs
new file mode 100644
index 0000000..05b2646
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs
@@ -0,0 +1,9 @@
+#![feature(const_trait_impl)]
+
+struct S;
+trait T {}
+
+impl ~const T for S {}
+//~^ ERROR expected a trait, found type
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr b/src/test/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr
new file mode 100644
index 0000000..0a91719
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr
@@ -0,0 +1,8 @@
+error: expected a trait, found type
+ --> $DIR/impl-tilde-const-trait.rs:6:6
+ |
+LL | impl ~const T for S {}
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.rs b/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.rs
index 04123a5..afd0d13 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.rs
@@ -1,6 +1,4 @@
#![feature(const_trait_impl)]
-#![feature(const_trait_bound_opt_out)]
-#![allow(incomplete_features)]
#![allow(bare_trait_objects)]
struct S;
diff --git a/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.stderr b/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.stderr
index 834f6a4..8c55627 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/inherent-impl.stderr
@@ -1,5 +1,5 @@
error: inherent impls cannot be `const`
- --> $DIR/inherent-impl.rs:9:12
+ --> $DIR/inherent-impl.rs:7:12
|
LL | impl const S {}
| ----- ^ inherent impl for this type
@@ -9,7 +9,7 @@
= note: only trait implementations may be annotated with `const`
error: inherent impls cannot be `const`
- --> $DIR/inherent-impl.rs:12:12
+ --> $DIR/inherent-impl.rs:10:12
|
LL | impl const T {}
| ----- ^ inherent impl for this type
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-88155.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-88155.rs
new file mode 100644
index 0000000..157005b
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-88155.rs
@@ -0,0 +1,13 @@
+#![feature(const_fn_trait_bound)]
+#![feature(const_trait_impl)]
+
+pub trait A {
+ fn assoc() -> bool;
+}
+
+pub const fn foo<T: A>() -> bool {
+ T::assoc()
+ //~^ ERROR calls in constant functions are limited
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-88155.stderr b/src/test/ui/rfc-2632-const-trait-impl/issue-88155.stderr
new file mode 100644
index 0000000..931baac
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-88155.stderr
@@ -0,0 +1,9 @@
+error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/issue-88155.rs:9:5
+ |
+LL | T::assoc()
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0015`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/std-impl-gate.rs b/src/test/ui/rfc-2632-const-trait-impl/std-impl-gate.rs
new file mode 100644
index 0000000..c6975da
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/std-impl-gate.rs
@@ -0,0 +1,21 @@
+// This tests feature gates for const impls in the standard library.
+
+// revisions: stock gated
+//[gated] run-pass
+
+#![cfg_attr(gated, feature(const_trait_impl, const_default_impls))]
+
+fn non_const_context() -> Vec<usize> {
+ Default::default()
+}
+
+const fn const_context() -> Vec<usize> {
+ Default::default()
+ //[stock]~^ ERROR calls in constant functions are limited
+}
+
+fn main() {
+ const VAL: Vec<usize> = const_context();
+
+ assert_eq!(VAL, non_const_context());
+}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr b/src/test/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr
new file mode 100644
index 0000000..55a0daa
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr
@@ -0,0 +1,9 @@
+error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/std-impl-gate.rs:13:5
+ |
+LL | Default::default()
+ | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0015`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/syntax.rs b/src/test/ui/rfc-2632-const-trait-impl/syntax.rs
index 82a1275..7ac2458 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/syntax.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/syntax.rs
@@ -5,4 +5,4 @@
#![feature(const_trait_impl)]
// For now, this parses since an error does not occur until AST lowering.
-impl ?const T {}
+impl ~const T {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
new file mode 100644
index 0000000..b4302f3
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
@@ -0,0 +1,29 @@
+#![feature(const_trait_impl)]
+#![feature(associated_type_bounds)]
+
+trait T {}
+struct S;
+impl T for S {}
+
+fn rpit() -> impl ~const T { S }
+//~^ ERROR `~const` is not allowed
+
+fn apit(_: impl ~const T) {}
+//~^ ERROR `~const` is not allowed
+
+fn rpit_assoc_bound() -> impl IntoIterator<Item: ~const T> { Some(S) }
+//~^ ERROR `~const` is not allowed
+
+fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T>) {}
+//~^ ERROR `~const` is not allowed
+
+fn generic<P: ~const T>() {}
+//~^ ERROR `~const` is not allowed
+
+fn where_clause<P>() where P: ~const T {}
+//~^ ERROR `~const` is not allowed
+
+struct TildeQuestion<T: ~const ?Sized>(std::marker::PhantomData<T>);
+//~^ ERROR `~const` and `?` are mutually exclusive
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
new file mode 100644
index 0000000..033ec21
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
@@ -0,0 +1,56 @@
+error: `~const` is not allowed here
+ --> $DIR/tilde-const-invalid-places.rs:8:19
+ |
+LL | fn rpit() -> impl ~const T { S }
+ | ^^^^^^^^
+ |
+ = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+
+error: `~const` is not allowed here
+ --> $DIR/tilde-const-invalid-places.rs:11:17
+ |
+LL | fn apit(_: impl ~const T) {}
+ | ^^^^^^^^
+ |
+ = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+
+error: `~const` is not allowed here
+ --> $DIR/tilde-const-invalid-places.rs:14:50
+ |
+LL | fn rpit_assoc_bound() -> impl IntoIterator<Item: ~const T> { Some(S) }
+ | ^^^^^^^^
+ |
+ = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+
+error: `~const` is not allowed here
+ --> $DIR/tilde-const-invalid-places.rs:17:48
+ |
+LL | fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T>) {}
+ | ^^^^^^^^
+ |
+ = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+
+error: `~const` is not allowed here
+ --> $DIR/tilde-const-invalid-places.rs:20:15
+ |
+LL | fn generic<P: ~const T>() {}
+ | ^^^^^^^^
+ |
+ = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+
+error: `~const` is not allowed here
+ --> $DIR/tilde-const-invalid-places.rs:23:31
+ |
+LL | fn where_clause<P>() where P: ~const T {}
+ | ^^^^^^^^
+ |
+ = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+
+error: `~const` and `?` are mutually exclusive
+ --> $DIR/tilde-const-invalid-places.rs:26:25
+ |
+LL | struct TildeQuestion<T: ~const ?Sized>(std::marker::PhantomData<T>);
+ | ^^^^^^^^^^^^^
+
+error: aborting due to 7 previous errors
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs
new file mode 100644
index 0000000..9b3c2cf
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs
@@ -0,0 +1,9 @@
+// compile-flags: -Z parse-only
+// check-pass
+
+#![feature(const_trait_impl)]
+
+struct S<
+ T: ~const ?for<'a> Tr<'a> + 'static + ~const std::ops::Add,
+ T: ~const ?for<'a: 'b> m::Trait<'a>,
+>;
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.rs b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.rs
new file mode 100644
index 0000000..06e4ede
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.rs
@@ -0,0 +1,6 @@
+// compile-flags: -Z parse-only
+
+#![feature(const_trait_impl)]
+
+struct S<T: ~const ~const Tr>;
+//~^ ERROR expected identifier, found `~`
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.stderr b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.stderr
new file mode 100644
index 0000000..928d23e
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-twice.stderr
@@ -0,0 +1,8 @@
+error: expected identifier, found `~`
+ --> $DIR/tilde-twice.rs:5:20
+ |
+LL | struct S<T: ~const ~const Tr>;
+ | ^ expected identifier
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs
new file mode 100644
index 0000000..0cde5b6
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs
@@ -0,0 +1,41 @@
+// run-pass
+
+#![feature(const_trait_impl)]
+#![feature(const_fn_trait_bound)]
+
+trait Bar {
+ fn bar() -> u8;
+}
+
+trait Foo {
+ #[default_method_body_is_const]
+ fn foo() -> u8 where Self: ~const Bar {
+ <Self as Bar>::bar() * 6
+ }
+}
+
+struct NonConst;
+struct Const;
+
+impl Bar for NonConst {
+ fn bar() -> u8 {
+ 3
+ }
+}
+
+impl Foo for NonConst {}
+
+impl const Bar for Const {
+ fn bar() -> u8 {
+ 4
+ }
+}
+
+impl const Foo for Const {}
+
+fn main() {
+ const ANS1: u8 = Const::foo();
+ let ans2 = NonConst::foo();
+
+ assert_eq!(ANS1 + ans2, 42);
+}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
new file mode 100644
index 0000000..ae9ab26
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
@@ -0,0 +1,24 @@
+// check-pass
+
+#![feature(const_trait_impl)]
+#![feature(const_fn_trait_bound)]
+
+trait Foo {
+ fn bar() where Self: ~const Foo;
+}
+
+struct S;
+
+impl Foo for S {
+ fn bar() {}
+}
+
+fn baz<T: Foo>() {
+ T::bar();
+}
+
+const fn qux<T: ~const Foo>() {
+ T::bar();
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs
new file mode 100644
index 0000000..d64822d
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs
@@ -0,0 +1,40 @@
+#![feature(const_fn_trait_bound)]
+#![feature(const_trait_impl)]
+
+trait Bar {}
+
+trait Foo {
+ fn a();
+ fn b() where Self: ~const Bar;
+ fn c<T: ~const Bar>();
+}
+
+const fn test1<T: ~const Foo + Bar>() {
+ T::a();
+ T::b();
+ //~^ ERROR the trait bound
+ T::c::<T>();
+ //~^ ERROR the trait bound
+}
+
+const fn test2<T: ~const Foo + ~const Bar>() {
+ T::a();
+ T::b();
+ T::c::<T>();
+}
+
+fn test3<T: Foo>() {
+ T::a();
+ T::b();
+ //~^ ERROR the trait bound
+ T::c::<T>();
+ //~^ ERROR the trait bound
+}
+
+fn test4<T: Foo + Bar>() {
+ T::a();
+ T::b();
+ T::c::<T>();
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr
new file mode 100644
index 0000000..fffb91f
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr
@@ -0,0 +1,67 @@
+error[E0277]: the trait bound `T: Bar` is not satisfied
+ --> $DIR/trait-where-clause.rs:14:5
+ |
+LL | T::b();
+ | ^^^^ the trait `Bar` is not implemented for `T`
+ |
+note: required by `Foo::b`
+ --> $DIR/trait-where-clause.rs:8:5
+ |
+LL | fn b() where Self: ~const Bar;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: consider further restricting this bound
+ |
+LL | const fn test1<T: ~const Foo + Bar + Bar>() {
+ | +++++
+
+error[E0277]: the trait bound `T: Bar` is not satisfied
+ --> $DIR/trait-where-clause.rs:16:5
+ |
+LL | T::c::<T>();
+ | ^^^^^^^^^ the trait `Bar` is not implemented for `T`
+ |
+note: required by `Foo::c`
+ --> $DIR/trait-where-clause.rs:9:5
+ |
+LL | fn c<T: ~const Bar>();
+ | ^^^^^^^^^^^^^^^^^^^^^^
+help: consider further restricting this bound
+ |
+LL | const fn test1<T: ~const Foo + Bar + Bar>() {
+ | +++++
+
+error[E0277]: the trait bound `T: Bar` is not satisfied
+ --> $DIR/trait-where-clause.rs:28:5
+ |
+LL | T::b();
+ | ^^^^ the trait `Bar` is not implemented for `T`
+ |
+note: required by `Foo::b`
+ --> $DIR/trait-where-clause.rs:8:5
+ |
+LL | fn b() where Self: ~const Bar;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: consider further restricting this bound
+ |
+LL | fn test3<T: Foo + Bar>() {
+ | +++++
+
+error[E0277]: the trait bound `T: Bar` is not satisfied
+ --> $DIR/trait-where-clause.rs:30:5
+ |
+LL | T::c::<T>();
+ | ^^^^^^^^^ the trait `Bar` is not implemented for `T`
+ |
+note: required by `Foo::c`
+ --> $DIR/trait-where-clause.rs:9:5
+ |
+LL | fn c<T: ~const Bar>();
+ | ^^^^^^^^^^^^^^^^^^^^^^
+help: consider further restricting this bound
+ |
+LL | fn test3<T: Foo + Bar>() {
+ | +++++
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs
new file mode 100644
index 0000000..96ba393
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs
@@ -0,0 +1,6 @@
+// compiler-flags: -Z parse-only
+
+#![feature(const_trait_impl)]
+
+struct S<T: const Tr>;
+//~^ ERROR expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, `~`, lifetime, or path
diff --git a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr
new file mode 100644
index 0000000..b6b77ac
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr
@@ -0,0 +1,8 @@
+error: expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, `~`, lifetime, or path, found keyword `const`
+ --> $DIR/without-tilde.rs:5:13
+ |
+LL | struct S<T: const Tr>;
+ | ^^^^^ expected one of 10 possible tokens
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc1623-2.stderr b/src/test/ui/rfc1623-2.stderr
index 732bb61..65b9f68 100644
--- a/src/test/ui/rfc1623-2.stderr
+++ b/src/test/ui/rfc1623-2.stderr
@@ -9,7 +9,7 @@
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | static NON_ELIDABLE_FN: &for<'a> fn(&'a u8, &'a u8) -> &'a u8 =
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/rfc1623-2.rs:10:39
@@ -22,7 +22,7 @@
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | &(non_elidable as for<'a> fn(&'a u8, &'a u8) -> &'a u8);
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ++ ++ ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc1623.nll.stderr b/src/test/ui/rfc1623.nll.stderr
index a3d9467..cc247bb 100644
--- a/src/test/ui/rfc1623.nll.stderr
+++ b/src/test/ui/rfc1623.nll.stderr
@@ -19,7 +19,7 @@
= note: required because it appears within the type `&SomeStruct`
= note: shared static variables must have a type that implements `Sync`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/rfc1623.rs:21:35
|
LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
@@ -29,9 +29,12 @@
LL | | f: &id,
LL | |
LL | | };
- | |_^
+ | |_^ one type is more general than the other
+ |
+ = note: expected type `for<'r, 's> Fn<(&'r Foo<'s>,)>`
+ found type `Fn<(&Foo<'_>,)>`
-error: higher-ranked subtype error
+error[E0308]: mismatched types
--> $DIR/rfc1623.rs:21:35
|
LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
@@ -41,9 +44,12 @@
LL | | f: &id,
LL | |
LL | | };
- | |_^
+ | |_^ one type is more general than the other
+ |
+ = note: expected type `for<'r, 's> Fn<(&'r Foo<'s>,)>`
+ found type `Fn<(&Foo<'_>,)>`
-error: higher-ranked subtype error
+error: implementation of `FnOnce` is not general enough
--> $DIR/rfc1623.rs:21:35
|
LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
@@ -53,9 +59,12 @@
LL | | f: &id,
LL | |
LL | | };
- | |_^
+ | |_^ implementation of `FnOnce` is not general enough
+ |
+ = note: `fn(&'2 Foo<'_>) -> &'2 Foo<'_> {id::<&'2 Foo<'_>>}` must implement `FnOnce<(&'1 Foo<'_>,)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2`
-error: higher-ranked subtype error
+error: implementation of `FnOnce` is not general enough
--> $DIR/rfc1623.rs:21:35
|
LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
@@ -65,8 +74,12 @@
LL | | f: &id,
LL | |
LL | | };
- | |_^
+ | |_^ implementation of `FnOnce` is not general enough
+ |
+ = note: `fn(&Foo<'2>) -> &Foo<'2> {id::<&Foo<'2>>}` must implement `FnOnce<(&Foo<'1>,)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&Foo<'2>,)>`, for some specific lifetime `'2`
error: aborting due to 5 previous errors
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfcs/rfc-1789-as-cell/from-mut.rs b/src/test/ui/rfcs/rfc-1789-as-cell/from-mut.rs
index ea3ad7a..329fadb 100644
--- a/src/test/ui/rfcs/rfc-1789-as-cell/from-mut.rs
+++ b/src/test/ui/rfcs/rfc-1789-as-cell/from-mut.rs
@@ -1,5 +1,7 @@
// run-pass
+#![feature(as_array_of_cells)]
+
use std::cell::Cell;
fn main() {
@@ -8,4 +10,11 @@
let slice_cell: &[Cell<i32>] = cell_slice.as_slice_of_cells();
assert_eq!(slice_cell.len(), 3);
+
+ let mut array: [i32; 3] = [1, 2, 3];
+ let cell_array: &Cell<[i32; 3]> = Cell::from_mut(&mut array);
+ let array_cell: &[Cell<i32>; 3] = cell_array.as_array_of_cells();
+
+ array_cell[0].set(99);
+ assert_eq!(array, [99, 2, 3]);
}
diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
index 4ed86b3..81c0c4a 100644
--- a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
+++ b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
@@ -1,80 +1,92 @@
error[E0277]: expected a `Fn<()>` closure, found `fn() {foo}`
--> $DIR/fn-traits.rs:24:10
|
-LL | fn call(f: impl Fn()) {
- | ---- required by this bound in `call`
-...
LL | call(foo);
| ^^^ expected an `Fn<()>` closure, found `fn() {foo}`
|
= help: the trait `Fn<()>` is not implemented for `fn() {foo}`
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
+note: required by a bound in `call`
+ --> $DIR/fn-traits.rs:11:17
+ |
+LL | fn call(f: impl Fn()) {
+ | ^^^^ required by this bound in `call`
error[E0277]: expected a `FnMut<()>` closure, found `fn() {foo}`
--> $DIR/fn-traits.rs:25:14
|
-LL | fn call_mut(f: impl FnMut()) {
- | ------- required by this bound in `call_mut`
-...
LL | call_mut(foo);
| ^^^ expected an `FnMut<()>` closure, found `fn() {foo}`
|
= help: the trait `FnMut<()>` is not implemented for `fn() {foo}`
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
+note: required by a bound in `call_mut`
+ --> $DIR/fn-traits.rs:15:21
+ |
+LL | fn call_mut(f: impl FnMut()) {
+ | ^^^^^^^ required by this bound in `call_mut`
error[E0277]: expected a `FnOnce<()>` closure, found `fn() {foo}`
--> $DIR/fn-traits.rs:26:15
|
-LL | fn call_once(f: impl FnOnce()) {
- | -------- required by this bound in `call_once`
-...
LL | call_once(foo);
| ^^^ expected an `FnOnce<()>` closure, found `fn() {foo}`
|
= help: the trait `FnOnce<()>` is not implemented for `fn() {foo}`
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
+note: required by a bound in `call_once`
+ --> $DIR/fn-traits.rs:19:22
+ |
+LL | fn call_once(f: impl FnOnce()) {
+ | ^^^^^^^^ required by this bound in `call_once`
error[E0277]: expected a `Fn<()>` closure, found `unsafe fn() {foo_unsafe}`
--> $DIR/fn-traits.rs:28:10
|
-LL | fn call(f: impl Fn()) {
- | ---- required by this bound in `call`
-...
LL | call(foo_unsafe);
| ^^^^^^^^^^ expected an `Fn<()>` closure, found `unsafe fn() {foo_unsafe}`
|
= help: the trait `Fn<()>` is not implemented for `unsafe fn() {foo_unsafe}`
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
+note: required by a bound in `call`
+ --> $DIR/fn-traits.rs:11:17
+ |
+LL | fn call(f: impl Fn()) {
+ | ^^^^ required by this bound in `call`
error[E0277]: expected a `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}`
--> $DIR/fn-traits.rs:30:14
|
-LL | fn call_mut(f: impl FnMut()) {
- | ------- required by this bound in `call_mut`
-...
LL | call_mut(foo_unsafe);
| ^^^^^^^^^^ expected an `FnMut<()>` closure, found `unsafe fn() {foo_unsafe}`
|
= help: the trait `FnMut<()>` is not implemented for `unsafe fn() {foo_unsafe}`
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
+note: required by a bound in `call_mut`
+ --> $DIR/fn-traits.rs:15:21
+ |
+LL | fn call_mut(f: impl FnMut()) {
+ | ^^^^^^^ required by this bound in `call_mut`
error[E0277]: expected a `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}`
--> $DIR/fn-traits.rs:32:15
|
-LL | fn call_once(f: impl FnOnce()) {
- | -------- required by this bound in `call_once`
-...
LL | call_once(foo_unsafe);
| ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `unsafe fn() {foo_unsafe}`
|
= help: the trait `FnOnce<()>` is not implemented for `unsafe fn() {foo_unsafe}`
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
+note: required by a bound in `call_once`
+ --> $DIR/fn-traits.rs:19:22
+ |
+LL | fn call_once(f: impl FnOnce()) {
+ | ^^^^^^^^ required by this bound in `call_once`
error: aborting due to 6 previous errors
diff --git a/src/test/ui/rust-2018/dyn-trait-compatibility.stderr b/src/test/ui/rust-2018/dyn-trait-compatibility.stderr
index 01c4737..495b06f 100644
--- a/src/test/ui/rust-2018/dyn-trait-compatibility.stderr
+++ b/src/test/ui/rust-2018/dyn-trait-compatibility.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | type A1 = dyn::r#dyn;
- | ^^^^^
+ | ~~~~~
error: expected identifier, found `<`
--> $DIR/dyn-trait-compatibility.rs:5:14
diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr b/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr
index 45bc5db..b8eba3e 100644
--- a/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr
+++ b/src/test/ui/rust-2018/edition-lint-infer-outlives-multispan.stderr
@@ -11,8 +11,9 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: remove these bounds
|
-LL | struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- --
+LL - struct TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> {
+LL + struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:18:61
@@ -22,8 +23,9 @@
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- --
+LL - struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b {
+LL + struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:23:53
@@ -33,8 +35,9 @@
|
help: remove these bounds
|
-LL | struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> {
+LL + struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:29:48
@@ -44,8 +47,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
- | -- --
+LL - struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> {
+LL + struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:35:48
@@ -55,8 +59,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> {
+LL + struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:41:46
@@ -66,8 +71,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
- | -- --
+LL - struct TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b {
+LL + struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:47:67
@@ -77,8 +83,9 @@
|
help: remove these bounds
|
-LL | struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b {
+LL + struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:53:53
@@ -88,8 +95,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug {
+LL + struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:59:53
@@ -99,8 +107,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b {
+LL + struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:65:69
@@ -110,8 +119,9 @@
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug {
+LL + struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:71:69
@@ -121,8 +131,9 @@
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b {
+LL + struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:77:38
@@ -132,8 +143,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeBee<'a, 'b, T> {
- | -- --
+LL - struct BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b> {
+LL + struct BeeOutlivesAyTeeBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:82:40
@@ -143,8 +155,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeAyBee<'a, 'b, T> {
- | -- --
+LL - struct BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b> {
+LL + struct BeeOutlivesAyTeeAyBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:87:55
@@ -154,8 +167,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- -- --
+LL - struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b> {
+LL + struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:92:68
@@ -165,8 +179,9 @@
|
help: remove these bounds
|
-LL | struct BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- -- --
+LL - struct BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where 'b: 'a, T: 'a + Debug + 'b {
+LL + struct BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:97:58
@@ -176,8 +191,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- -- --
+LL - struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b> {
+LL + struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:104:18
@@ -187,8 +203,9 @@
|
help: remove these bounds
|
-LL | where U: Debug,
- | -- ----
+LL - where U: 'a + Debug + 'b, 'b: 'a
+LL + where U: Debug,
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:115:47
@@ -198,8 +215,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
- | -- --
+LL - struct TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b>(&'a &'b T);
+LL + struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:118:72
@@ -209,8 +227,9 @@
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
- | -- --
+LL - struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: 'a + Debug + 'b;
+LL + struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:121:53
@@ -220,8 +239,9 @@
|
help: remove these bounds
|
-LL | struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
- | -- --
+LL - struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b>(T, &'a &'b U);
+LL + struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:124:48
@@ -231,8 +251,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug>(&'a T, &'b U);
- | -- --
+LL - struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug>(&'a T, &'b U);
+LL + struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug>(&'a T, &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:127:48
@@ -242,8 +263,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug>(&'a T, &'b U);
- | -- --
+LL - struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b>(&'a T, &'b U);
+LL + struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug>(&'a T, &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:130:46
@@ -253,8 +275,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U>(&'a T, &'b U) ;
- | -- --
+LL - struct TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U>(&'a T, &'b U) where U: 'b;
+LL + struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U>(&'a T, &'b U) ;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:133:81
@@ -264,8 +287,9 @@
|
help: remove these bounds
|
-LL | struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U>(T, &'a &'b U) where U: Debug;
- | -- --
+LL - struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U>(T, &'a &'b U) where U: 'a + Debug + 'b;
+LL + struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U>(T, &'a &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:136:53
@@ -275,8 +299,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U>(&'a T, &'b U) where U: 'b + Debug;
+LL + struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:139:53
@@ -286,8 +311,9 @@
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U>(&'a T, &'b U) where U: Debug + 'b;
+LL + struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:142:75
@@ -297,8 +323,9 @@
|
help: remove these bounds
|
-LL | struct TeeWhereAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeWhereAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where T: 'a, U: 'b + Debug;
+LL + struct TeeWhereAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:145:75
@@ -308,8 +335,9 @@
|
help: remove these bounds
|
-LL | struct TeeWhereAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeWhereAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where T: 'a, U: Debug + 'b;
+LL + struct TeeWhereAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:148:38
@@ -319,8 +347,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeBee<'a, 'b, T>(&'a &'b T);
- | -- --
+LL - struct BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b>(&'a &'b T);
+LL + struct BeeOutlivesAyTeeBee<'a, 'b, T>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:151:40
@@ -330,8 +359,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeAyBee<'a, 'b, T>(&'a &'b T);
- | -- --
+LL - struct BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b>(&'a &'b T);
+LL + struct BeeOutlivesAyTeeAyBee<'a, 'b, T>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:154:55
@@ -341,8 +371,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
- | -- -- --
+LL - struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b>(&'a &'b T);
+LL + struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:157:71
@@ -352,8 +383,9 @@
|
help: remove these bounds
|
-LL | struct BeeWhereAyTeeWhereAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
- | -- -- --
+LL - struct BeeWhereAyTeeWhereAyIsDebugBee<'a, 'b, T>(&'a &'b T) where 'b: 'a, T: 'a + Debug + 'b;
+LL + struct BeeWhereAyTeeWhereAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:160:58
@@ -363,8 +395,9 @@
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
- | -- -- --
+LL - struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b>(T, &'a &'b U);
+LL + struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:164:18
@@ -374,8 +407,9 @@
|
help: remove these bounds
|
-LL | where U: Debug, ;
- | -- ----
+LL - where U: 'a + Debug + 'b, 'b: 'a;
+LL + where U: Debug, ;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:171:45
@@ -385,8 +419,9 @@
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- --
+LL - enum TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> {
+LL + enum TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:176:59
@@ -396,8 +431,9 @@
|
help: remove these bounds
|
-LL | enum TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- --
+LL - enum TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b {
+LL + enum TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:181:51
@@ -407,8 +443,9 @@
|
help: remove these bounds
|
-LL | enum TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - enum TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> {
+LL + enum TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:187:46
@@ -418,8 +455,9 @@
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
- | -- --
+LL - enum TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> {
+LL + enum TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:193:46
@@ -429,8 +467,9 @@
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - enum TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> {
+LL + enum TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:199:44
@@ -440,8 +479,9 @@
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
- | -- --
+LL - enum TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b {
+LL + enum TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:205:65
@@ -451,8 +491,9 @@
|
help: remove these bounds
|
-LL | enum TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b {
+LL + enum TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:211:51
@@ -462,8 +503,9 @@
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug {
+LL + enum TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:217:51
@@ -473,8 +515,9 @@
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b {
+LL + enum TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:223:67
@@ -484,8 +527,9 @@
|
help: remove these bounds
|
-LL | enum TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug {
+LL + enum TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:229:67
@@ -495,8 +539,9 @@
|
help: remove these bounds
|
-LL | enum TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b {
+LL + enum TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:235:36
@@ -506,8 +551,9 @@
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeBee<'a, 'b, T> {
- | -- --
+LL - enum BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b> {
+LL + enum BeeOutlivesAyTeeBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:240:38
@@ -517,8 +563,9 @@
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeAyBee<'a, 'b, T> {
- | -- --
+LL - enum BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b> {
+LL + enum BeeOutlivesAyTeeAyBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:246:53
@@ -528,8 +575,9 @@
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- -- --
+LL - enum BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b> {
+LL + enum BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:251:66
@@ -539,8 +587,9 @@
|
help: remove these bounds
|
-LL | enum BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- -- --
+LL - enum BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where 'b: 'a, T: 'a + Debug + 'b {
+LL + enum BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:256:56
@@ -550,8 +599,9 @@
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- -- --
+LL - enum BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b> {
+LL + enum BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:262:75
@@ -561,8 +611,9 @@
|
help: remove these bounds
|
-LL | enum BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
- | -- ----
+LL - enum BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b, 'b: 'a {
+LL + enum BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:271:46
@@ -572,8 +623,9 @@
|
help: remove these bounds
|
-LL | union TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- --
+LL - union TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> {
+LL + union TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:276:60
@@ -583,8 +635,9 @@
|
help: remove these bounds
|
-LL | union TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- --
+LL - union TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b {
+LL + union TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:281:52
@@ -594,8 +647,9 @@
|
help: remove these bounds
|
-LL | union TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - union TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> {
+LL + union TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:287:47
@@ -605,8 +659,9 @@
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
- | -- --
+LL - union TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> {
+LL + union TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:293:47
@@ -616,8 +671,9 @@
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - union TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> {
+LL + union TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:299:45
@@ -627,8 +683,9 @@
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
- | -- --
+LL - union TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b {
+LL + union TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:305:66
@@ -638,8 +695,9 @@
|
help: remove these bounds
|
-LL | union TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b {
+LL + union TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:311:52
@@ -649,8 +707,9 @@
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug {
+LL + union TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:317:52
@@ -660,8 +719,9 @@
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b {
+LL + union TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:323:68
@@ -671,8 +731,9 @@
|
help: remove these bounds
|
-LL | union TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug {
+LL + union TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:329:68
@@ -682,8 +743,9 @@
|
help: remove these bounds
|
-LL | union TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b {
+LL + union TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:335:37
@@ -693,8 +755,9 @@
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeBee<'a, 'b, T> {
- | -- --
+LL - union BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b> {
+LL + union BeeOutlivesAyTeeBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:340:39
@@ -704,8 +767,9 @@
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeAyBee<'a, 'b, T> {
- | -- --
+LL - union BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b> {
+LL + union BeeOutlivesAyTeeAyBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:345:54
@@ -715,8 +779,9 @@
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- -- --
+LL - union BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b> {
+LL + union BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:350:67
@@ -726,8 +791,9 @@
|
help: remove these bounds
|
-LL | union BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- -- --
+LL - union BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where 'b: 'a, T: 'a + Debug + 'b {
+LL + union BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:355:57
@@ -737,8 +803,9 @@
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- -- --
+LL - union BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b> {
+LL + union BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:361:76
@@ -748,8 +815,9 @@
|
help: remove these bounds
|
-LL | union BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
- | -- ----
+LL - union BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b, 'b: 'a {
+LL + union BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
+ |
error: aborting due to 68 previous errors
diff --git a/src/test/ui/rust-2021/array-into-iter-ambiguous.fixed b/src/test/ui/rust-2021/array-into-iter-ambiguous.fixed
new file mode 100644
index 0000000..76f661b
--- /dev/null
+++ b/src/test/ui/rust-2021/array-into-iter-ambiguous.fixed
@@ -0,0 +1,27 @@
+// See https://github.com/rust-lang/rust/issues/88475
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(array_into_iter)]
+#![allow(unused)]
+
+struct FooIter;
+
+trait MyIntoIter {
+ fn into_iter(self) -> FooIter;
+}
+
+impl<T, const N: usize> MyIntoIter for [T; N] {
+ fn into_iter(self) -> FooIter {
+ FooIter
+ }
+}
+
+struct Point;
+
+pub fn main() {
+ let points: [Point; 1] = [Point];
+ let y = MyIntoIter::into_iter(points);
+ //~^ WARNING trait method `into_iter` will become ambiguous in Rust 2021
+ //~| WARNING this changes meaning in Rust 2021
+}
diff --git a/src/test/ui/rust-2021/array-into-iter-ambiguous.rs b/src/test/ui/rust-2021/array-into-iter-ambiguous.rs
new file mode 100644
index 0000000..83fbf8f
--- /dev/null
+++ b/src/test/ui/rust-2021/array-into-iter-ambiguous.rs
@@ -0,0 +1,27 @@
+// See https://github.com/rust-lang/rust/issues/88475
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(array_into_iter)]
+#![allow(unused)]
+
+struct FooIter;
+
+trait MyIntoIter {
+ fn into_iter(self) -> FooIter;
+}
+
+impl<T, const N: usize> MyIntoIter for [T; N] {
+ fn into_iter(self) -> FooIter {
+ FooIter
+ }
+}
+
+struct Point;
+
+pub fn main() {
+ let points: [Point; 1] = [Point];
+ let y = points.into_iter();
+ //~^ WARNING trait method `into_iter` will become ambiguous in Rust 2021
+ //~| WARNING this changes meaning in Rust 2021
+}
diff --git a/src/test/ui/rust-2021/array-into-iter-ambiguous.stderr b/src/test/ui/rust-2021/array-into-iter-ambiguous.stderr
new file mode 100644
index 0000000..fac8d21
--- /dev/null
+++ b/src/test/ui/rust-2021/array-into-iter-ambiguous.stderr
@@ -0,0 +1,16 @@
+warning: trait method `into_iter` will become ambiguous in Rust 2021
+ --> $DIR/array-into-iter-ambiguous.rs:24:13
+ |
+LL | let y = points.into_iter();
+ | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyIntoIter::into_iter(points)`
+ |
+note: the lint level is defined here
+ --> $DIR/array-into-iter-ambiguous.rs:5:9
+ |
+LL | #![warn(array_into_iter)]
+ | ^^^^^^^^^^^^^^^
+ = warning: this changes meaning in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic-trait.fixed b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.fixed
new file mode 100644
index 0000000..a1b6f5b
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.fixed
@@ -0,0 +1,30 @@
+// See https://github.com/rust-lang/rust/issues/88470
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_prelude_collisions)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+pub trait PyTryFrom<'v, T>: Sized {
+ fn try_from<V>(value: V) -> Result<&'v Self, T>;
+}
+
+pub trait PyTryInto<T>: Sized {
+ fn try_into(&self) -> Result<&T, i32>;
+}
+
+struct Foo;
+
+impl<U> PyTryInto<U> for Foo
+where
+ U: for<'v> PyTryFrom<'v, i32>,
+{
+ fn try_into(&self) -> Result<&U, i32> {
+ <U as PyTryFrom<'_, _>>::try_from(self)
+ //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic-trait.rs b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.rs
new file mode 100644
index 0000000..142ba55
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.rs
@@ -0,0 +1,30 @@
+// See https://github.com/rust-lang/rust/issues/88470
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_prelude_collisions)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+pub trait PyTryFrom<'v, T>: Sized {
+ fn try_from<V>(value: V) -> Result<&'v Self, T>;
+}
+
+pub trait PyTryInto<T>: Sized {
+ fn try_into(&self) -> Result<&T, i32>;
+}
+
+struct Foo;
+
+impl<U> PyTryInto<U> for Foo
+where
+ U: for<'v> PyTryFrom<'v, i32>,
+{
+ fn try_into(&self) -> Result<&U, i32> {
+ U::try_from(self)
+ //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr
new file mode 100644
index 0000000..14ad9b0
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr
@@ -0,0 +1,16 @@
+warning: trait-associated function `try_from` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-generic-trait.rs:24:9
+ |
+LL | U::try_from(self)
+ | ^^^^^^^^^^^ help: disambiguate the associated function: `<U as PyTryFrom<'_, _>>::try_from`
+ |
+note: the lint level is defined here
+ --> $DIR/future-prelude-collision-generic-trait.rs:5:9
+ |
+LL | #![warn(rust_2021_prelude_collisions)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic.fixed b/src/test/ui/rust-2021/future-prelude-collision-generic.fixed
new file mode 100644
index 0000000..1bb9ba3
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic.fixed
@@ -0,0 +1,37 @@
+// test for https://github.com/rust-lang/rust/issues/86940
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_prelude_collisions)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+struct Generic<'a, U>(&'a U);
+
+trait MyFromIter {
+ fn from_iter(_: i32) -> Self;
+}
+
+impl MyFromIter for Generic<'static, i32> {
+ fn from_iter(_: i32) -> Self {
+ todo!()
+ }
+}
+
+impl std::iter::FromIterator<i32> for Generic<'static, i32> {
+ fn from_iter<T: IntoIterator<Item = i32>>(_: T) -> Self {
+ todo!()
+ }
+}
+
+fn main() {
+ <Generic<'_, _> as MyFromIter>::from_iter(1);
+ //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+ <Generic::<'static, i32> as MyFromIter>::from_iter(1);
+ //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+ <Generic::<'_, _> as MyFromIter>::from_iter(1);
+ //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic.rs b/src/test/ui/rust-2021/future-prelude-collision-generic.rs
new file mode 100644
index 0000000..d7f8aff
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic.rs
@@ -0,0 +1,37 @@
+// test for https://github.com/rust-lang/rust/issues/86940
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_prelude_collisions)]
+#![allow(dead_code)]
+#![allow(unused_imports)]
+
+struct Generic<'a, U>(&'a U);
+
+trait MyFromIter {
+ fn from_iter(_: i32) -> Self;
+}
+
+impl MyFromIter for Generic<'static, i32> {
+ fn from_iter(_: i32) -> Self {
+ todo!()
+ }
+}
+
+impl std::iter::FromIterator<i32> for Generic<'static, i32> {
+ fn from_iter<T: IntoIterator<Item = i32>>(_: T) -> Self {
+ todo!()
+ }
+}
+
+fn main() {
+ Generic::from_iter(1);
+ //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+ Generic::<'static, i32>::from_iter(1);
+ //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+ Generic::<'_, _>::from_iter(1);
+ //~^ WARNING trait-associated function `from_iter` will become ambiguous in Rust 2021
+ //~| this is accepted in the current edition (Rust 2018)
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic.stderr b/src/test/ui/rust-2021/future-prelude-collision-generic.stderr
new file mode 100644
index 0000000..e1d3f3c
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic.stderr
@@ -0,0 +1,34 @@
+warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-generic.rs:28:5
+ |
+LL | Generic::from_iter(1);
+ | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic<'_, _> as MyFromIter>::from_iter`
+ |
+note: the lint level is defined here
+ --> $DIR/future-prelude-collision-generic.rs:5:9
+ |
+LL | #![warn(rust_2021_prelude_collisions)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-generic.rs:31:5
+ |
+LL | Generic::<'static, i32>::from_iter(1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<'static, i32> as MyFromIter>::from_iter`
+ |
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-generic.rs:34:5
+ |
+LL | Generic::<'_, _>::from_iter(1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<'_, _> as MyFromIter>::from_iter`
+ |
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: 3 warnings emitted
+
diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.fixed b/src/test/ui/rust-2021/future-prelude-collision-imported.fixed
index c5ff0b4..15ccff7 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-imported.fixed
+++ b/src/test/ui/rust-2021/future-prelude-collision-imported.fixed
@@ -56,4 +56,15 @@
}
}
+mod d {
+ use super::m::*;
+
+ fn main() {
+ // See https://github.com/rust-lang/rust/issues/88471
+ let _: u32 = TryIntoU32::try_into(3u8).unwrap();
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~^^ WARNING this is accepted in the current edition
+ }
+}
+
fn main() {}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.rs b/src/test/ui/rust-2021/future-prelude-collision-imported.rs
index cd39eec..cdffcaf 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-imported.rs
+++ b/src/test/ui/rust-2021/future-prelude-collision-imported.rs
@@ -56,4 +56,15 @@
}
}
+mod d {
+ use super::m::*;
+
+ fn main() {
+ // See https://github.com/rust-lang/rust/issues/88471
+ let _: u32 = 3u8.try_into().unwrap();
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~^^ WARNING this is accepted in the current edition
+ }
+}
+
fn main() {}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
index 6197587..56abb8a 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
@@ -10,7 +10,7 @@
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-imported.rs:40:22
@@ -19,7 +19,7 @@
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `crate::m::TryIntoU32::try_into(3u8)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-imported.rs:53:22
@@ -28,7 +28,16 @@
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `super::m::TryIntoU32::try_into(3u8)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
-warning: 3 warnings emitted
+warning: trait method `try_into` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-imported.rs:64:22
+ |
+LL | let _: u32 = 3u8.try_into().unwrap();
+ | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)`
+ |
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: 4 warnings emitted
diff --git a/src/test/ui/rust-2021/future-prelude-collision-macros.fixed b/src/test/ui/rust-2021/future-prelude-collision-macros.fixed
new file mode 100644
index 0000000..a97dc17
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-macros.fixed
@@ -0,0 +1,45 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_prelude_collisions)]
+#![allow(unreachable_code)]
+
+macro_rules! foo {
+ () => {{
+ 123;
+ S
+ }};
+}
+
+trait MyTry<T> {
+ fn try_into(self, _: u8);
+}
+
+struct S;
+
+impl MyTry<i32> for S {
+ fn try_into(self, _: u8) {}
+}
+
+trait TryFromU8: Sized {
+ fn try_from(_: u8);
+}
+
+impl TryFromU8 for u32 {
+ fn try_from(_: u8) {}
+}
+
+macro_rules! bar {
+ () => {
+ u32
+ };
+}
+
+fn main() {
+ MyTry::try_into(foo!(), todo!());
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition
+ <bar!() as TryFromU8>::try_from(0);
+ //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-macros.rs b/src/test/ui/rust-2021/future-prelude-collision-macros.rs
new file mode 100644
index 0000000..82484b5
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-macros.rs
@@ -0,0 +1,45 @@
+// run-rustfix
+// edition:2018
+// check-pass
+#![warn(rust_2021_prelude_collisions)]
+#![allow(unreachable_code)]
+
+macro_rules! foo {
+ () => {{
+ 123;
+ S
+ }};
+}
+
+trait MyTry<T> {
+ fn try_into(self, _: u8);
+}
+
+struct S;
+
+impl MyTry<i32> for S {
+ fn try_into(self, _: u8) {}
+}
+
+trait TryFromU8: Sized {
+ fn try_from(_: u8);
+}
+
+impl TryFromU8 for u32 {
+ fn try_from(_: u8) {}
+}
+
+macro_rules! bar {
+ () => {
+ u32
+ };
+}
+
+fn main() {
+ foo!().try_into(todo!());
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition
+ <bar!()>::try_from(0);
+ //~^ WARNING trait-associated function `try_from` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-macros.stderr b/src/test/ui/rust-2021/future-prelude-collision-macros.stderr
new file mode 100644
index 0000000..4c3543c
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-macros.stderr
@@ -0,0 +1,25 @@
+warning: trait method `try_into` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-macros.rs:39:5
+ |
+LL | foo!().try_into(todo!());
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyTry::try_into(foo!(), todo!())`
+ |
+note: the lint level is defined here
+ --> $DIR/future-prelude-collision-macros.rs:4:9
+ |
+LL | #![warn(rust_2021_prelude_collisions)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: trait-associated function `try_from` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-macros.rs:42:5
+ |
+LL | <bar!()>::try_from(0);
+ | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<bar!() as TryFromU8>::try_from`
+ |
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr b/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr
index ad9b8af..e60f9c0 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr
@@ -3,7 +3,7 @@
|
LL | let _: u32 = 3u8.try_into().unwrap();
| ^^^^^^^^ method not found in `u8`
- |
+ |
::: $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn try_into(self) -> Result<T, Self::Error>;
@@ -21,19 +21,19 @@
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Box::new(3u8).try_into().unwrap();
- | ^^^^^^^^^ ^
+ | +++++++++ +
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Pin::new(3u8).try_into().unwrap();
- | ^^^^^^^^^ ^
+ | +++++++++ +
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Arc::new(3u8).try_into().unwrap();
- | ^^^^^^^^^ ^
+ | +++++++++ +
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Rc::new(3u8).try_into().unwrap();
- | ^^^^^^^^ ^
+ | ++++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/rust-2021/future-prelude-collision-turbofish.fixed b/src/test/ui/rust-2021/future-prelude-collision-turbofish.fixed
new file mode 100644
index 0000000..3e76fce
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-turbofish.fixed
@@ -0,0 +1,28 @@
+// See https://github.com/rust-lang/rust/issues/88442
+// run-rustfix
+// edition:2018
+// check-pass
+#![allow(unused)]
+#![warn(rust_2021_prelude_collisions)]
+
+trait AnnotatableTryInto {
+ fn try_into<T>(self) -> Result<T, Self::Error>
+ where Self: std::convert::TryInto<T> {
+ std::convert::TryInto::try_into(self)
+ }
+}
+
+impl<T> AnnotatableTryInto for T where T: From<u8> {}
+
+fn main() -> Result<(), &'static str> {
+ let x: u64 = 1;
+ AnnotatableTryInto::try_into::<usize>(x).or(Err("foo"))?.checked_sub(1);
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+
+ AnnotatableTryInto::try_into::<usize>(x).or(Err("foo"))?;
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+
+ Ok(())
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-turbofish.rs b/src/test/ui/rust-2021/future-prelude-collision-turbofish.rs
new file mode 100644
index 0000000..abb292e
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-turbofish.rs
@@ -0,0 +1,28 @@
+// See https://github.com/rust-lang/rust/issues/88442
+// run-rustfix
+// edition:2018
+// check-pass
+#![allow(unused)]
+#![warn(rust_2021_prelude_collisions)]
+
+trait AnnotatableTryInto {
+ fn try_into<T>(self) -> Result<T, Self::Error>
+ where Self: std::convert::TryInto<T> {
+ std::convert::TryInto::try_into(self)
+ }
+}
+
+impl<T> AnnotatableTryInto for T where T: From<u8> {}
+
+fn main() -> Result<(), &'static str> {
+ let x: u64 = 1;
+ x.try_into::<usize>().or(Err("foo"))?.checked_sub(1);
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+
+ x.try_into::<usize>().or(Err("foo"))?;
+ //~^ WARNING trait method `try_into` will become ambiguous in Rust 2021
+ //~| WARNING this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+
+ Ok(())
+}
diff --git a/src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr b/src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr
new file mode 100644
index 0000000..2de9020
--- /dev/null
+++ b/src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr
@@ -0,0 +1,25 @@
+warning: trait method `try_into` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-turbofish.rs:19:5
+ |
+LL | x.try_into::<usize>().or(Err("foo"))?.checked_sub(1);
+ | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `AnnotatableTryInto::try_into::<usize>(x)`
+ |
+note: the lint level is defined here
+ --> $DIR/future-prelude-collision-turbofish.rs:6:9
+ |
+LL | #![warn(rust_2021_prelude_collisions)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: trait method `try_into` will become ambiguous in Rust 2021
+ --> $DIR/future-prelude-collision-turbofish.rs:23:5
+ |
+LL | x.try_into::<usize>().or(Err("foo"))?;
+ | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `AnnotatableTryInto::try_into::<usize>(x)`
+ |
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/rust-2021/future-prelude-collision.stderr b/src/test/ui/rust-2021/future-prelude-collision.stderr
index 03b89da..889e66d 100644
--- a/src/test/ui/rust-2021/future-prelude-collision.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision.stderr
@@ -10,7 +10,7 @@
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:61:13
@@ -19,7 +19,7 @@
| ^^^^^^^^^^^^^ help: disambiguate the associated function: `<u32 as TryFromU8>::try_from`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:66:13
@@ -28,7 +28,7 @@
| ^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Vec<u8> as FromByteIterator>::from_iter`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:74:18
@@ -37,7 +37,7 @@
| ^^^^^^^^^^^^^ help: disambiguate the associated function: `<_ as TryFromU8>::try_from`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:79:18
@@ -46,7 +46,7 @@
| ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(*(&3u8))`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:84:18
@@ -55,7 +55,7 @@
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(&3.0)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:90:18
@@ -64,7 +64,7 @@
| ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(mut_ptr as *const _)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:95:13
@@ -73,7 +73,7 @@
| ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<U32Alias as TryFromU8>::try_from`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 8 warnings emitted
diff --git a/src/test/ui/rust-2021/generic-type-collision.stderr b/src/test/ui/rust-2021/generic-type-collision.stderr
index d499920..e6ea28d 100644
--- a/src/test/ui/rust-2021/generic-type-collision.stderr
+++ b/src/test/ui/rust-2021/generic-type-collision.stderr
@@ -10,7 +10,7 @@
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 1 warning emitted
diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.stderr b/src/test/ui/rust-2021/inherent-dyn-collision.stderr
index 605f9ce..77b4c38 100644
--- a/src/test/ui/rust-2021/inherent-dyn-collision.stderr
+++ b/src/test/ui/rust-2021/inherent-dyn-collision.stderr
@@ -10,7 +10,7 @@
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 1 warning emitted
diff --git a/src/test/ui/rust-2021/panic.rs b/src/test/ui/rust-2021/panic.rs
new file mode 100644
index 0000000..394fc3c8
--- /dev/null
+++ b/src/test/ui/rust-2021/panic.rs
@@ -0,0 +1,24 @@
+// edition:2021
+
+fn main() {
+ debug_assert!(false, 123);
+ //~^ ERROR must be a string literal
+ assert!(false, 123);
+ //~^ ERROR must be a string literal
+ panic!(false, 123);
+ //~^ ERROR must be a string literal
+
+ std::debug_assert!(false, 123);
+ //~^ ERROR must be a string literal
+ std::assert!(false, 123);
+ //~^ ERROR must be a string literal
+ std::panic!(false, 123);
+ //~^ ERROR must be a string literal
+
+ core::debug_assert!(false, 123);
+ //~^ ERROR must be a string literal
+ core::assert!(false, 123);
+ //~^ ERROR must be a string literal
+ core::panic!(false, 123);
+ //~^ ERROR must be a string literal
+}
diff --git a/src/test/ui/rust-2021/panic.stderr b/src/test/ui/rust-2021/panic.stderr
new file mode 100644
index 0000000..40b62d2
--- /dev/null
+++ b/src/test/ui/rust-2021/panic.stderr
@@ -0,0 +1,101 @@
+error: format argument must be a string literal
+ --> $DIR/panic.rs:4:26
+ |
+LL | debug_assert!(false, 123);
+ | ^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | debug_assert!(false, "{}", 123);
+ | +++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:6:20
+ |
+LL | assert!(false, 123);
+ | ^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | assert!(false, "{}", 123);
+ | +++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:8:12
+ |
+LL | panic!(false, 123);
+ | ^^^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | panic!("{} {}", false, 123);
+ | ++++++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:11:31
+ |
+LL | std::debug_assert!(false, 123);
+ | ^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | std::debug_assert!(false, "{}", 123);
+ | +++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:13:25
+ |
+LL | std::assert!(false, 123);
+ | ^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | std::assert!(false, "{}", 123);
+ | +++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:15:17
+ |
+LL | std::panic!(false, 123);
+ | ^^^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | std::panic!("{} {}", false, 123);
+ | ++++++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:18:32
+ |
+LL | core::debug_assert!(false, 123);
+ | ^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | core::debug_assert!(false, "{}", 123);
+ | +++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:20:26
+ |
+LL | core::assert!(false, 123);
+ | ^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | core::assert!(false, "{}", 123);
+ | +++++
+
+error: format argument must be a string literal
+ --> $DIR/panic.rs:22:18
+ |
+LL | core::panic!(false, 123);
+ | ^^^^^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | core::panic!("{} {}", false, 123);
+ | ++++++++
+
+error: aborting due to 9 previous errors
+
diff --git a/src/test/ui/prelude2021.rs b/src/test/ui/rust-2021/prelude2021.rs
similarity index 100%
rename from src/test/ui/prelude2021.rs
rename to src/test/ui/rust-2021/prelude2021.rs
diff --git a/src/test/ui/rust-2021/reserved-prefixes-migration.stderr b/src/test/ui/rust-2021/reserved-prefixes-migration.stderr
index 95105f9..dc11526 100644
--- a/src/test/ui/rust-2021/reserved-prefixes-migration.stderr
+++ b/src/test/ui/rust-2021/reserved-prefixes-migration.stderr
@@ -10,11 +10,12 @@
LL | #![warn(rust_2021_prefixes_incompatible_syntax)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m2!(z "hey");
- | --
+LL - m2!(z"hey");
+LL + m2!(z "hey");
+ |
warning: prefix `prefix` is unknown
--> $DIR/reserved-prefixes-migration.rs:19:9
@@ -23,11 +24,12 @@
| ^^^^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m2!(prefix "hey");
- | --
+LL - m2!(prefix"hey");
+LL + m2!(prefix "hey");
+ |
warning: prefix `hey` is unknown
--> $DIR/reserved-prefixes-migration.rs:22:9
@@ -36,11 +38,12 @@
| ^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m3!(hey #123);
- | --
+LL - m3!(hey#123);
+LL + m3!(hey #123);
+ |
warning: prefix `hey` is unknown
--> $DIR/reserved-prefixes-migration.rs:25:9
@@ -49,11 +52,12 @@
| ^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m3!(hey #hey);
- | --
+LL - m3!(hey#hey);
+LL + m3!(hey #hey);
+ |
warning: prefix `kind` is unknown
--> $DIR/reserved-prefixes-migration.rs:35:14
@@ -62,11 +66,12 @@
| ^^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | #name = #kind #value
- | --
+LL - #name = #kind#value
+LL + #name = #kind #value
+ |
warning: 5 warnings emitted
diff --git a/src/test/ui/rust-2021/reserved-prefixes.rs b/src/test/ui/rust-2021/reserved-prefixes.rs
index 5882c7d..1994f25 100644
--- a/src/test/ui/rust-2021/reserved-prefixes.rs
+++ b/src/test/ui/rust-2021/reserved-prefixes.rs
@@ -1,4 +1,4 @@
-// compile-flags: -Z unstable-options --edition 2021
+// edition:2021
macro_rules! demo2 {
( $a:tt $b:tt ) => { println!("two tokens") };
diff --git a/src/test/ui/rust-2021/reserved-prefixes.stderr b/src/test/ui/rust-2021/reserved-prefixes.stderr
index 32e1856..2755688 100644
--- a/src/test/ui/rust-2021/reserved-prefixes.stderr
+++ b/src/test/ui/rust-2021/reserved-prefixes.stderr
@@ -7,8 +7,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo3!(foo #bar);
- | --
+LL - demo3!(foo#bar);
+LL + demo3!(foo #bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:17:12
@@ -19,8 +20,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo2!(foo "bar");
- | --
+LL - demo2!(foo"bar");
+LL + demo2!(foo "bar");
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:18:12
@@ -31,8 +33,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo2!(foo 'b');
- | --
+LL - demo2!(foo'b');
+LL + demo2!(foo 'b');
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:20:12
@@ -43,8 +46,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo2!(foo 'b);
- | --
+LL - demo2!(foo'b);
+LL + demo2!(foo 'b);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:21:12
@@ -55,8 +59,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo3!(foo # bar);
- | --
+LL - demo3!(foo# bar);
+LL + demo3!(foo # bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:22:12
@@ -67,8 +72,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo #! bar);
- | --
+LL - demo4!(foo#! bar);
+LL + demo4!(foo #! bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:23:12
@@ -79,8 +85,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo ## bar);
- | --
+LL - demo4!(foo## bar);
+LL + demo4!(foo ## bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:25:12
@@ -91,8 +98,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo #bar#);
- | --
+LL - demo4!(foo#bar#);
+LL + demo4!(foo #bar#);
+ |
error: prefix `bar` is unknown
--> $DIR/reserved-prefixes.rs:25:16
@@ -103,8 +111,9 @@
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo#bar #);
- | --
+LL - demo4!(foo#bar#);
+LL + demo4!(foo#bar #);
+ |
error: aborting due to 9 previous errors
diff --git a/src/test/ui/rustdoc/doc-test-attr-pass.rs b/src/test/ui/rustdoc/doc-test-attr-pass.rs
new file mode 100644
index 0000000..7884add
--- /dev/null
+++ b/src/test/ui/rustdoc/doc-test-attr-pass.rs
@@ -0,0 +1,9 @@
+// check-pass
+
+#![crate_type = "lib"]
+#![deny(invalid_doc_attributes)]
+#![doc(test(no_crate_inject))]
+#![doc(test(attr(deny(warnings))))]
+#![doc(test())]
+
+pub fn foo() {}
diff --git a/src/test/ui/rustdoc/doc-test-attr.rs b/src/test/ui/rustdoc/doc-test-attr.rs
new file mode 100644
index 0000000..46178ad
--- /dev/null
+++ b/src/test/ui/rustdoc/doc-test-attr.rs
@@ -0,0 +1,14 @@
+#![crate_type = "lib"]
+#![deny(invalid_doc_attributes)]
+
+#![doc(test)]
+//~^ ERROR `#[doc(test(...)]` takes a list of attributes
+//~^^ WARN this was previously accepted by the compiler
+#![doc(test = "hello")]
+//~^ ERROR `#[doc(test(...)]` takes a list of attributes
+//~^^ WARN this was previously accepted by the compiler
+#![doc(test(a))]
+//~^ ERROR unknown `doc(test)` attribute `a`
+//~^^ WARN this was previously accepted by the compiler
+
+pub fn foo() {}
diff --git a/src/test/ui/rustdoc/doc-test-attr.stderr b/src/test/ui/rustdoc/doc-test-attr.stderr
new file mode 100644
index 0000000..7f5e2d6
--- /dev/null
+++ b/src/test/ui/rustdoc/doc-test-attr.stderr
@@ -0,0 +1,34 @@
+error: `#[doc(test(...)]` takes a list of attributes
+ --> $DIR/doc-test-attr.rs:4:8
+ |
+LL | #![doc(test)]
+ | ^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/doc-test-attr.rs:2:9
+ |
+LL | #![deny(invalid_doc_attributes)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+
+error: `#[doc(test(...)]` takes a list of attributes
+ --> $DIR/doc-test-attr.rs:7:8
+ |
+LL | #![doc(test = "hello")]
+ | ^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+
+error: unknown `doc(test)` attribute `a`
+ --> $DIR/doc-test-attr.rs:10:13
+ |
+LL | #![doc(test(a))]
+ | ^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/rustdoc/feature-gate-doc_primitive.rs b/src/test/ui/rustdoc/feature-gate-doc_primitive.rs
new file mode 100644
index 0000000..18e99e7
--- /dev/null
+++ b/src/test/ui/rustdoc/feature-gate-doc_primitive.rs
@@ -0,0 +1,8 @@
+// check-pass
+#[doc(primitive = "usize")]
+//~^ WARNING `doc(primitive)` should never have been stable
+//~| WARNING hard error in a future release
+/// Some docs
+mod usize {}
+
+fn main() {}
diff --git a/src/test/ui/rustdoc/feature-gate-doc_primitive.stderr b/src/test/ui/rustdoc/feature-gate-doc_primitive.stderr
new file mode 100644
index 0000000..736bf29
--- /dev/null
+++ b/src/test/ui/rustdoc/feature-gate-doc_primitive.stderr
@@ -0,0 +1,12 @@
+warning: `doc(primitive)` should never have been stable
+ --> $DIR/feature-gate-doc_primitive.rs:2:7
+ |
+LL | #[doc(primitive = "usize")]
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(invalid_doc_attributes)]` on by default
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/sanitize/memory.rs b/src/test/ui/sanitize/memory.rs
index 48a482a..b53f19a 100644
--- a/src/test/ui/sanitize/memory.rs
+++ b/src/test/ui/sanitize/memory.rs
@@ -6,7 +6,7 @@
// run-fail
// error-pattern: MemorySanitizer: use-of-uninitialized-value
// error-pattern: Uninitialized value was created by an allocation
-// error-pattern: in the stack frame of function 'random'
+// error-pattern: in the stack frame of function 'main'
//
// This test case intentionally limits the usage of the std,
// since it will be linked with an uninstrumented version of it.
diff --git a/src/test/ui/save-analysis/issue-68621.full_tait.stderr b/src/test/ui/save-analysis/issue-68621.full_tait.stderr
deleted file mode 100644
index 193aed2..0000000
--- a/src/test/ui/save-analysis/issue-68621.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-68621.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: could not find defining uses
- --> $DIR/issue-68621.rs:17:19
- |
-LL | type Future = impl Trait;
- | ^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/save-analysis/issue-68621.min_tait.stderr b/src/test/ui/save-analysis/issue-68621.min_tait.stderr
deleted file mode 100644
index cccfb3d..0000000
--- a/src/test/ui/save-analysis/issue-68621.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: could not find defining uses
- --> $DIR/issue-68621.rs:17:19
- |
-LL | type Future = impl Trait;
- | ^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/save-analysis/issue-68621.rs b/src/test/ui/save-analysis/issue-68621.rs
index 1f4a908..96af085 100644
--- a/src/test/ui/save-analysis/issue-68621.rs
+++ b/src/test/ui/save-analysis/issue-68621.rs
@@ -1,9 +1,6 @@
// compile-flags: -Zsave-analysis
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Trait {}
diff --git a/src/test/ui/save-analysis/issue-68621.stderr b/src/test/ui/save-analysis/issue-68621.stderr
new file mode 100644
index 0000000..3af6d0a
--- /dev/null
+++ b/src/test/ui/save-analysis/issue-68621.stderr
@@ -0,0 +1,8 @@
+error: could not find defining uses
+ --> $DIR/issue-68621.rs:14:19
+ |
+LL | type Future = impl Trait;
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr b/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr
deleted file mode 100644
index 353da8f..0000000
--- a/src/test/ui/self/arbitrary-self-types-not-object-safe.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/arbitrary-self-types-not-object-safe.rs:29:32
- |
-LL | fn foo(self: &Rc<Self>) -> usize;
- | --- method `foo`'s `self` parameter cannot be dispatched on
-...
-LL | let x = Rc::new(5usize) as Rc<dyn Foo>;
- | ^^^^^^^^^^^ the trait `Foo` cannot be made into an object
-
-error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/arbitrary-self-types-not-object-safe.rs:29:13
- |
-LL | fn foo(self: &Rc<Self>) -> usize;
- | --- method `foo`'s `self` parameter cannot be dispatched on
-...
-LL | let x = Rc::new(5usize) as Rc<dyn Foo>;
- | ^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
- |
- = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::rc::Rc<dyn Foo>>` for `std::rc::Rc<usize>`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.nll.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.nll.stderr
index e25c636..5d0b2c2 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.nll.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.nll.stderr
@@ -9,7 +9,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | async fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
index 9cd0fd3..04cd2b7 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
@@ -10,7 +10,7 @@
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | async fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.nll.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.nll.stderr
index 962593e..4301d8f 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.nll.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.nll.stderr
@@ -9,7 +9,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
index cb9d5b5..54e75ae 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
@@ -14,7 +14,7 @@
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/self/point-at-arbitrary-self-type-method.stderr b/src/test/ui/self/point-at-arbitrary-self-type-method.stderr
index b804ddfb..a0ef7e3 100644
--- a/src/test/ui/self/point-at-arbitrary-self-type-method.stderr
+++ b/src/test/ui/self/point-at-arbitrary-self-type-method.stderr
@@ -13,7 +13,7 @@
help: consider wrapping the receiver expression with the appropriate type
|
LL | Box::new(A).foo();
- | ^^^^^^^^^ ^
+ | +++++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr b/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr
index e1ed0e4..4406764 100644
--- a/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr
+++ b/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr
@@ -14,7 +14,7 @@
help: consider wrapping the receiver expression with the appropriate type
|
LL | Box::new(A).foo()
- | ^^^^^^^^^ ^
+ | +++++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/self/self-infer.stderr b/src/test/ui/self/self-infer.stderr
index 8d70c62..d3bf63e 100644
--- a/src/test/ui/self/self-infer.stderr
+++ b/src/test/ui/self/self-infer.stderr
@@ -7,7 +7,7 @@
help: use type parameters instead
|
LL | fn f<T>(self: T) {}
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/self-infer.rs:5:17
@@ -18,7 +18,7 @@
help: use type parameters instead
|
LL | fn g<T>(self: &T) {}
- | ^^^ ^
+ | +++ ~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/shift-various-bad-types.stderr b/src/test/ui/shift-various-bad-types.stderr
index 63b70f7..7c16581 100644
--- a/src/test/ui/shift-various-bad-types.stderr
+++ b/src/test/ui/shift-various-bad-types.stderr
@@ -33,7 +33,7 @@
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | let _: i32 = (22_i64 >> 1_i32).try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/simd/simd-array-trait.rs b/src/test/ui/simd/simd-array-trait.rs
index d6ed5f6..45c10b3 100644
--- a/src/test/ui/simd/simd-array-trait.rs
+++ b/src/test/ui/simd/simd-array-trait.rs
@@ -4,7 +4,7 @@
// pretty-expanded FIXME #23616
-#![feature(repr_simd, platform_intrinsics, const_generics)]
+#![feature(repr_simd, platform_intrinsics, generic_const_exprs)]
#![allow(non_camel_case_types, incomplete_features)]
pub trait Simd {
@@ -21,7 +21,7 @@
#[repr(simd)]
#[derive(Copy, Clone)]
pub struct T<S: Simd>([S::Lane; S::SIZE]);
-//~^ ERROR constant expression depends on a generic parameter
+//~^ ERROR unconstrained generic constant
extern "platform-intrinsic" {
fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
diff --git a/src/test/ui/simd/simd-array-trait.stderr b/src/test/ui/simd/simd-array-trait.stderr
index c100e02..0e02883 100644
--- a/src/test/ui/simd/simd-array-trait.stderr
+++ b/src/test/ui/simd/simd-array-trait.stderr
@@ -1,10 +1,10 @@
-error: constant expression depends on a generic parameter
+error: unconstrained generic constant
--> $DIR/simd-array-trait.rs:23:23
|
LL | pub struct T<S: Simd>([S::Lane; S::SIZE]);
| ^^^^^^^^^^^^^^^^^^
|
- = note: this may fail depending on what value the parameter takes
+ = help: try adding a `where` bound using this expression: `where [(); S::SIZE]:`
error: aborting due to previous error
diff --git a/src/test/ui/simd/simd-generics.rs b/src/test/ui/simd/simd-generics.rs
index 50a4bfd..fa9d35e 100644
--- a/src/test/ui/simd/simd-generics.rs
+++ b/src/test/ui/simd/simd-generics.rs
@@ -10,7 +10,15 @@
#[repr(simd)]
#[derive(Copy, Clone)]
-struct S<const N: usize>([f32; N]);
+struct A<const N: usize>([f32; N]);
+
+#[repr(simd)]
+#[derive(Copy, Clone)]
+struct B<T>([T; 4]);
+
+#[repr(simd)]
+#[derive(Copy, Clone)]
+struct C<T, const N: usize>([T; N]);
extern "platform-intrinsic" {
@@ -29,7 +37,23 @@
}
}
-impl ops::Add for S<4> {
+impl ops::Add for A<4> {
+ type Output = Self;
+
+ fn add(self, rhs: Self) -> Self {
+ unsafe { simd_add(self, rhs) }
+ }
+}
+
+impl ops::Add for B<f32> {
+ type Output = Self;
+
+ fn add(self, rhs: Self) -> Self {
+ unsafe { simd_add(self, rhs) }
+ }
+}
+
+impl ops::Add for C<f32, 4> {
type Output = Self;
fn add(self, rhs: Self) -> Self {
@@ -39,19 +63,23 @@
pub fn main() {
- let lr = f32x4(1.0f32, 2.0f32, 3.0f32, 4.0f32);
+ let x = [1.0f32, 2.0f32, 3.0f32, 4.0f32];
+ let y = [2.0f32, 4.0f32, 6.0f32, 8.0f32];
// lame-o
- let f32x4(x, y, z, w) = add(lr, lr);
- assert_eq!(x, 2.0f32);
- assert_eq!(y, 4.0f32);
- assert_eq!(z, 6.0f32);
- assert_eq!(w, 8.0f32);
+ let a = f32x4(1.0f32, 2.0f32, 3.0f32, 4.0f32);
+ let f32x4(a0, a1, a2, a3) = add(a, a);
+ assert_eq!(a0, 2.0f32);
+ assert_eq!(a1, 4.0f32);
+ assert_eq!(a2, 6.0f32);
+ assert_eq!(a3, 8.0f32);
- let lr2 = S::<4>([1.0f32, 2.0f32, 3.0f32, 4.0f32]);
- let [x, y, z, w] = add(lr2, lr2).0;
- assert_eq!(x, 2.0f32);
- assert_eq!(y, 4.0f32);
- assert_eq!(z, 6.0f32);
- assert_eq!(w, 8.0f32);
+ let a = A(x);
+ assert_eq!(add(a, a).0, y);
+
+ let b = B(x);
+ assert_eq!(add(b, b).0, y);
+
+ let c = C(x);
+ assert_eq!(add(c, c).0, y);
}
diff --git a/src/test/ui/simd/simd-type-generic-monomorphisation-non-primitive.rs b/src/test/ui/simd/simd-type-generic-monomorphisation-non-primitive.rs
new file mode 100644
index 0000000..0bc73b1
--- /dev/null
+++ b/src/test/ui/simd/simd-type-generic-monomorphisation-non-primitive.rs
@@ -0,0 +1,14 @@
+// build-fail
+
+#![feature(repr_simd)]
+
+struct E;
+
+// error-pattern:monomorphising SIMD type `S<E>` with a non-primitive-scalar (integer/float/pointer) element type `E`
+
+#[repr(simd)]
+struct S<T>([T; 4]);
+
+fn main() {
+ let _v: Option<S<E>> = None;
+}
diff --git a/src/test/ui/simd/simd-type-generic-monomorphisation-non-primitive.stderr b/src/test/ui/simd/simd-type-generic-monomorphisation-non-primitive.stderr
new file mode 100644
index 0000000..9e8f06b
--- /dev/null
+++ b/src/test/ui/simd/simd-type-generic-monomorphisation-non-primitive.stderr
@@ -0,0 +1,4 @@
+error: monomorphising SIMD type `S<E>` with a non-primitive-scalar (integer/float/pointer) element type `E`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/single-use-lifetime/one-use-in-fn-argument.stderr b/src/test/ui/single-use-lifetime/one-use-in-fn-argument.stderr
index f78970a..d225089 100644
--- a/src/test/ui/single-use-lifetime/one-use-in-fn-argument.stderr
+++ b/src/test/ui/single-use-lifetime/one-use-in-fn-argument.stderr
@@ -13,8 +13,9 @@
| ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn a(x: &u32) {
- | -- --
+LL - fn a<'a>(x: &'a u32) {
+LL + fn a(x: &u32) {
+ |
error: lifetime parameter `'m` only used once
--> $DIR/one-use-in-fn-argument.rs:15:11
@@ -26,8 +27,9 @@
|
help: elide the single-use lifetime
|
-LL | fn center(_: Single<'_>) {}
- | -- ^^
+LL - fn center<'m>(_: Single<'m>) {}
+LL + fn center(_: Single<'_>) {}
+ |
error: lifetime parameter `'y` only used once
--> $DIR/one-use-in-fn-argument.rs:17:13
@@ -37,8 +39,9 @@
|
help: elide the single-use lifetime
|
-LL | fn left<'x>(foo: Double<'x, '_>) -> &'x u32 { foo.f }
- | -- ^^
+LL - fn left<'x, 'y>(foo: Double<'x, 'y>) -> &'x u32 { foo.f }
+LL + fn left<'x>(foo: Double<'x, '_>) -> &'x u32 { foo.f }
+ |
error: lifetime parameter `'x` only used once
--> $DIR/one-use-in-fn-argument.rs:19:10
@@ -48,8 +51,9 @@
|
help: elide the single-use lifetime
|
-LL | fn right<'y>(foo: Double<'_, 'y>) -> &'y u32 { foo.f }
- | -- ^^
+LL - fn right<'x, 'y>(foo: Double<'x, 'y>) -> &'y u32 { foo.f }
+LL + fn right<'y>(foo: Double<'_, 'y>) -> &'y u32 { foo.f }
+ |
error: aborting due to 4 previous errors
diff --git a/src/test/ui/single-use-lifetime/one-use-in-inherent-method-argument.stderr b/src/test/ui/single-use-lifetime/one-use-in-inherent-method-argument.stderr
index 10fb40b..b8b78cd 100644
--- a/src/test/ui/single-use-lifetime/one-use-in-inherent-method-argument.stderr
+++ b/src/test/ui/single-use-lifetime/one-use-in-inherent-method-argument.stderr
@@ -13,8 +13,9 @@
| ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn inherent_a(&self, data: &u32) {
- | -- --
+LL - fn inherent_a<'a>(&self, data: &'a u32) {
+LL + fn inherent_a(&self, data: &u32) {
+ |
error: lifetime parameter `'f` only used once
--> $DIR/one-use-in-inherent-method-argument.rs:11:6
diff --git a/src/test/ui/single-use-lifetime/one-use-in-trait-method-argument.stderr b/src/test/ui/single-use-lifetime/one-use-in-trait-method-argument.stderr
index 55d11ad..05944e0 100644
--- a/src/test/ui/single-use-lifetime/one-use-in-trait-method-argument.stderr
+++ b/src/test/ui/single-use-lifetime/one-use-in-trait-method-argument.stderr
@@ -13,8 +13,9 @@
| ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn next(&mut self) -> Option<Self::Item> {
- | ----
+LL - fn next<'g>(&'g mut self) -> Option<Self::Item> {
+LL + fn next(&mut self) -> Option<Self::Item> {
+ |
error: aborting due to previous error
diff --git a/src/test/ui/sized-cycle-note.stderr b/src/test/ui/sized-cycle-note.stderr
index 45062c2..0726b16 100644
--- a/src/test/ui/sized-cycle-note.stderr
+++ b/src/test/ui/sized-cycle-note.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Baz` representable
|
LL | struct Baz { q: Box<Option<Foo>> }
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `Foo` has infinite size
--> $DIR/sized-cycle-note.rs:11:1
@@ -22,7 +22,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { q: Box<Option<Baz>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/span/E0072.stderr b/src/test/ui/span/E0072.stderr
index 06493f0..98e9275 100644
--- a/src/test/ui/span/E0072.stderr
+++ b/src/test/ui/span/E0072.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
|
LL | tail: Box<Option<ListNode>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr
index 0e40ca6..2487684 100644
--- a/src/test/ui/span/coerce-suggestions.stderr
+++ b/src/test/ui/span/coerce-suggestions.stderr
@@ -38,10 +38,12 @@
--> $DIR/coerce-suggestions.rs:17:9
|
LL | f = box f;
- | ^^^^^
- | |
- | cyclic type of infinite size
- | help: try using a conversion method: `(box f).to_string()`
+ | ^^^^^ cyclic type of infinite size
+ |
+help: try using a conversion method
+ |
+LL | f = (box f).to_string();
+ | + +++++++++++++
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:21:9
diff --git a/src/test/ui/span/destructor-restrictions.stderr b/src/test/ui/span/destructor-restrictions.stderr
index f63d977..8f75c38 100644
--- a/src/test/ui/span/destructor-restrictions.stderr
+++ b/src/test/ui/span/destructor-restrictions.stderr
@@ -16,7 +16,7 @@
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = *a.borrow() + 1; x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to previous error
diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
index e04ca0f..8d4709d 100644
--- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
+++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
@@ -17,7 +17,7 @@
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = y.borrow().clone(); x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error[E0597]: `y` does not live long enough
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:17:9
@@ -37,7 +37,7 @@
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = y.borrow().clone(); x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr
index 5cda17f..da0a3c8 100644
--- a/src/test/ui/span/issue-34264.stderr
+++ b/src/test/ui/span/issue-34264.stderr
@@ -8,11 +8,11 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: Option<i32>, String) {}
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(_: Option<i32>, String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/issue-34264.rs:1:27
@@ -24,11 +24,11 @@
help: if this is a parameter name, give it a type
|
LL | fn foo(Option<i32>, String: TypeName) {}
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(Option<i32>, _: String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/issue-34264.rs:3:9
@@ -40,15 +40,15 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn bar(self: x, y: usize) {}
- | ^^^^^^^
+ | ~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn bar(x: TypeName, y: usize) {}
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar(_: x, y: usize) {}
- | ^^^^
+ | ~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/issue-34264.rs:7:5
diff --git a/src/test/ui/span/issue-37767.stderr b/src/test/ui/span/issue-37767.stderr
index fc6c556..f773284 100644
--- a/src/test/ui/span/issue-37767.stderr
+++ b/src/test/ui/span/issue-37767.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | A::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> $DIR/issue-37767.rs:22:7
@@ -42,11 +42,11 @@
help: disambiguate the associated function for candidate #1
|
LL | C::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | D::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> $DIR/issue-37767.rs:34:7
@@ -67,11 +67,11 @@
help: disambiguate the associated function for candidate #1
|
LL | E::foo(a)
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | F::foo(a)
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr
index a7131ab..c5a0448 100644
--- a/src/test/ui/span/issue-39018.stderr
+++ b/src/test/ui/span/issue-39018.stderr
@@ -10,7 +10,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let x = "Hello ".to_owned() + "World!";
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error[E0369]: cannot add `World` to `World`
--> $DIR/issue-39018.rs:8:26
@@ -34,7 +34,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let x = "Hello ".to_owned() + &"World!".to_owned();
- | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
error[E0369]: cannot add `&String` to `&String`
--> $DIR/issue-39018.rs:26:16
@@ -48,7 +48,7 @@
help: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = a + &b;
- | ^
+ | ~
error[E0369]: cannot add `String` to `&String`
--> $DIR/issue-39018.rs:27:16
@@ -62,7 +62,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = a + &b;
- | ^ ^^
+ | ~ ~~
error[E0308]: mismatched types
--> $DIR/issue-39018.rs:29:17
@@ -85,7 +85,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + &b;
- | ^^^^^^^^^^^^ ^^
+ | ~~~~~~~~~~~~ ~~
error[E0369]: cannot add `&String` to `&String`
--> $DIR/issue-39018.rs:31:15
@@ -99,7 +99,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + &b;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&str` to `&String`
--> $DIR/issue-39018.rs:32:15
@@ -113,7 +113,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&&str` to `&String`
--> $DIR/issue-39018.rs:33:15
@@ -127,7 +127,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + &d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&&str` to `&&str`
--> $DIR/issue-39018.rs:34:16
@@ -157,7 +157,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = c.to_owned() + &d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&str` to `&str`
--> $DIR/issue-39018.rs:37:15
@@ -171,7 +171,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = c.to_owned() + d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to 14 previous errors
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr b/src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr
new file mode 100644
index 0000000..278d049
--- /dev/null
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.full.stderr
@@ -0,0 +1,21 @@
+error[E0282]: type annotations needed for `Option<_>`
+ --> $DIR/issue-42234-unknown-receiver-type.rs:10:7
+ |
+LL | let x: Option<_> = None;
+ | - consider giving `x` the explicit type `Option<_>`, where the type parameter `T` is specified
+LL | x.unwrap().method_that_could_exist_on_some_type();
+ | ^^^^^^ cannot infer type for type parameter `T`
+ |
+ = note: type must be known at this point
+
+error[E0282]: type annotations needed
+ --> $DIR/issue-42234-unknown-receiver-type.rs:16:10
+ |
+LL | .sum::<_>()
+ | ^^^ cannot infer type
+ |
+ = note: type must be known at this point
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr b/src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr
new file mode 100644
index 0000000..8d4ed4a
--- /dev/null
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.generic_arg.stderr
@@ -0,0 +1,21 @@
+error[E0282]: type annotations needed for `Option<_>`
+ --> $DIR/issue-42234-unknown-receiver-type.rs:10:7
+ |
+LL | let x: Option<_> = None;
+ | - consider giving `x` the explicit type `Option<_>`, where the type parameter `T` is specified
+LL | x.unwrap().method_that_could_exist_on_some_type();
+ | ^^^^^^ cannot infer type for type parameter `T`
+ |
+ = note: type must be known at this point
+
+error[E0282]: type annotations needed
+ --> $DIR/issue-42234-unknown-receiver-type.rs:16:16
+ |
+LL | .sum::<_>()
+ | ^ cannot infer type for type parameter `S` declared on the associated function `sum`
+ |
+ = note: type must be known at this point
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.rs b/src/test/ui/span/issue-42234-unknown-receiver-type.rs
index d3292bb..15b00de 100644
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.rs
+++ b/src/test/ui/span/issue-42234-unknown-receiver-type.rs
@@ -1,3 +1,6 @@
+// revisions: full generic_arg
+#![cfg_attr(generic_arg, feature(generic_arg_infer))]
+
// When the type of a method call's receiver is unknown, the span should point
// to the receiver (and not the entire call, as was previously the case before
// the fix of which this tests).
diff --git a/src/test/ui/span/issue-42234-unknown-receiver-type.stderr b/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
deleted file mode 100644
index c64c5b1..0000000
--- a/src/test/ui/span/issue-42234-unknown-receiver-type.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0282]: type annotations needed for `Option<_>`
- --> $DIR/issue-42234-unknown-receiver-type.rs:7:7
- |
-LL | let x: Option<_> = None;
- | - consider giving `x` the explicit type `Option<_>`, where the type parameter `T` is specified
-LL | x.unwrap().method_that_could_exist_on_some_type();
- | ^^^^^^ cannot infer type for type parameter `T`
- |
- = note: type must be known at this point
-
-error[E0282]: type annotations needed
- --> $DIR/issue-42234-unknown-receiver-type.rs:13:10
- |
-LL | .sum::<_>()
- | ^^^ cannot infer type
- |
- = note: type must be known at this point
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr
index 16a1ac6..288c104 100644
--- a/src/test/ui/span/issue-7575.stderr
+++ b/src/test/ui/span/issue-7575.stderr
@@ -28,15 +28,15 @@
help: disambiguate the associated function for candidate #1
|
LL | u.f8(42) + CtxtFn::f9(u, 342) + m.fff(42)
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | u.f8(42) + OtherTrait::f9(u, 342) + m.fff(42)
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #3
|
LL | u.f8(42) + UnusedTrait::f9(u, 342) + m.fff(42)
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0599]: no method named `fff` found for struct `Myisize` in the current scope
--> $DIR/issue-7575.rs:62:30
@@ -61,10 +61,7 @@
--> $DIR/issue-7575.rs:70:7
|
LL | t.is_str()
- | --^^^^^^--
- | | |
- | | this is an associated function, not a method
- | help: disambiguate the associated function for the candidate: `ManyImplTrait::is_str(t)`
+ | ^^^^^^ this is an associated function, not a method
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in the trait `ManyImplTrait`
@@ -73,6 +70,10 @@
LL | fn is_str() -> bool {
| ^^^^^^^^^^^^^^^^^^^
= help: items from traits can only be used if the type parameter is bounded by the trait
+help: disambiguate the associated function for the candidate
+ |
+LL | ManyImplTrait::is_str(t)
+ |
error: aborting due to 3 previous errors
diff --git a/src/test/ui/span/issue-81800.stderr b/src/test/ui/span/issue-81800.stderr
index d37f13a..86c6457 100644
--- a/src/test/ui/span/issue-81800.stderr
+++ b/src/test/ui/span/issue-81800.stderr
@@ -7,7 +7,7 @@
help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not
|
LL | fn x<-
- | ^
+ | ~
error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `-`
--> $DIR/issue-81800.rs:1:6
diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr
index 7a24ffb..99c5732 100644
--- a/src/test/ui/span/missing-unit-argument.stderr
+++ b/src/test/ui/span/missing-unit-argument.stderr
@@ -7,7 +7,7 @@
help: expected the unit value `()`; create it with empty parentheses
|
LL | let _: Result<(), String> = Ok(());
- | ^^
+ | ++
error[E0061]: this function takes 2 arguments but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:12:5
@@ -51,7 +51,7 @@
help: expected the unit value `()`; create it with empty parentheses
|
LL | bar(());
- | ^^
+ | ++
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:15:7
@@ -67,7 +67,7 @@
help: expected the unit value `()`; create it with empty parentheses
|
LL | S.baz(());
- | ^^
+ | ++
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:16:7
@@ -83,7 +83,7 @@
help: expected the unit value `()`; create it with empty parentheses
|
LL | S.generic::<()>(());
- | ^^
+ | ++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr
index 5512834..cb71a55 100644
--- a/src/test/ui/span/multiline-span-E0072.stderr
+++ b/src/test/ui/span/multiline-span-E0072.stderr
@@ -13,7 +13,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
|
LL | tail: Box<Option<ListNode>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/span/recursive-type-field.stderr b/src/test/ui/span/recursive-type-field.stderr
index fb1d98b..08e97e7 100644
--- a/src/test/ui/span/recursive-type-field.stderr
+++ b/src/test/ui/span/recursive-type-field.stderr
@@ -9,7 +9,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | bar: Box<Bar<'a>>,
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `Bar` has infinite size
--> $DIR/recursive-type-field.rs:8:1
diff --git a/src/test/ui/span/transitive-dep-span.stderr b/src/test/ui/span/transitive-dep-span.stderr
index 68d8911..1787b0e 100644
--- a/src/test/ui/span/transitive-dep-span.stderr
+++ b/src/test/ui/span/transitive-dep-span.stderr
@@ -6,7 +6,7 @@
| | ^^^^^ expected one of `!` or `::`
LL | | }
| |_________- in this expansion of `transitive_dep_two::parse_error!`
- |
+ |
::: $DIR/transitive-dep-span.rs:13:1
|
LL | transitive_dep_two::parse_error!();
diff --git a/src/test/ui/span/type-annotations-needed-expr.stderr b/src/test/ui/span/type-annotations-needed-expr.stderr
index 3e6d350..fbfbefd 100644
--- a/src/test/ui/span/type-annotations-needed-expr.stderr
+++ b/src/test/ui/span/type-annotations-needed-expr.stderr
@@ -8,7 +8,7 @@
help: consider specifying the type argument in the method call
|
LL | let _ = (vec![1,2,3]).into_iter().sum::<S>() as f64;
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/specialization/deafult-associated-type-bound-1.stderr b/src/test/ui/specialization/deafult-associated-type-bound-1.stderr
index 4ca3d83..b3dba0d 100644
--- a/src/test/ui/specialization/deafult-associated-type-bound-1.stderr
+++ b/src/test/ui/specialization/deafult-associated-type-bound-1.stderr
@@ -11,11 +11,14 @@
error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/deafult-associated-type-bound-1.rs:19:5
|
-LL | type U: Clone;
- | ----- required by this bound in `X::U`
-...
LL | default type U = str;
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `X::U`
+ --> $DIR/deafult-associated-type-bound-1.rs:9:13
+ |
+LL | type U: Clone;
+ | ^^^^^ required by this bound in `X::U`
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/specialization/deafult-associated-type-bound-2.stderr b/src/test/ui/specialization/deafult-associated-type-bound-2.stderr
index 0e8a774..d425fae 100644
--- a/src/test/ui/specialization/deafult-associated-type-bound-2.stderr
+++ b/src/test/ui/specialization/deafult-associated-type-bound-2.stderr
@@ -11,17 +11,19 @@
error[E0277]: can't compare `&'static B` with `B`
--> $DIR/deafult-associated-type-bound-2.rs:16:5
|
-LL | type U: PartialEq<T>;
- | ------------ required by this bound in `X::U`
-...
LL | default type U = &'static B;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `&'static B == B`
|
= help: the trait `PartialEq<B>` is not implemented for `&'static B`
+note: required by a bound in `X::U`
+ --> $DIR/deafult-associated-type-bound-2.rs:6:13
+ |
+LL | type U: PartialEq<T>;
+ | ^^^^^^^^^^^^ required by this bound in `X::U`
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | impl<B: 'static, T> X<B> for T where &'static B: PartialEq<B> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr b/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr
index e646c16..8cfce7f 100644
--- a/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr
+++ b/src/test/ui/specialization/deafult-generic-associated-type-bound.stderr
@@ -11,17 +11,19 @@
error[E0277]: can't compare `T` with `T`
--> $DIR/deafult-generic-associated-type-bound.rs:18:5
|
-LL | type U<'a>: PartialEq<&'a Self> where Self: 'a;
- | ------------------- required by this bound in `X::U`
-...
LL | default type U<'a> = &'a T;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `T == T`
|
= note: required because of the requirements on the impl of `PartialEq` for `&'a T`
+note: required by a bound in `X::U`
+ --> $DIR/deafult-generic-associated-type-bound.rs:8:17
+ |
+LL | type U<'a>: PartialEq<&'a Self> where Self: 'a;
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `X::U`
help: consider further restricting this bound
|
LL | impl<T: 'static + std::cmp::PartialEq> X for T {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr b/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr
index e416f30..a8fdbc5 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr
@@ -11,16 +11,18 @@
error[E0277]: the trait bound `U: Eq` is not satisfied
--> $DIR/specialization-wfcheck.rs:7:17
|
-LL | trait Foo<'a, T: Eq + 'a> { }
- | -- required by this bound in `Foo`
-LL |
LL | default impl<U> Foo<'static, U> for () {}
| ^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `U`
|
+note: required by a bound in `Foo`
+ --> $DIR/specialization-wfcheck.rs:5:18
+ |
+LL | trait Foo<'a, T: Eq + 'a> { }
+ | ^^ required by this bound in `Foo`
help: consider restricting type parameter `U`
|
LL | default impl<U: std::cmp::Eq> Foo<'static, U> for () {}
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/specialization/issue-33017.stderr b/src/test/ui/specialization/issue-33017.stderr
index bff4618..44e7581 100644
--- a/src/test/ui/specialization/issue-33017.stderr
+++ b/src/test/ui/specialization/issue-33017.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-33017.rs:12:5
|
-LL | type Output: From<Self> + Copy + Into<Self>;
- | ---- required by this bound in `UncheckedCopy::Output`
-...
LL | default type Output = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `UncheckedCopy::Output`
+ --> $DIR/issue-33017.rs:8:31
+ |
+LL | type Output: From<Self> + Copy + Into<Self>;
+ | ^^^^ required by this bound in `UncheckedCopy::Output`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> UncheckedCopy for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/specialization/issue-38091.stderr b/src/test/ui/specialization/issue-38091.stderr
index 97e5775..d5452e1 100644
--- a/src/test/ui/specialization/issue-38091.stderr
+++ b/src/test/ui/specialization/issue-38091.stderr
@@ -11,11 +11,14 @@
error[E0277]: the trait bound `(): Valid` is not satisfied
--> $DIR/issue-38091.rs:12:5
|
-LL | type Ty: Valid;
- | ----- required by this bound in `Iterate::Ty`
-...
LL | default type Ty = ();
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Valid` is not implemented for `()`
+ |
+note: required by a bound in `Iterate::Ty`
+ --> $DIR/issue-38091.rs:5:14
+ |
+LL | type Ty: Valid;
+ | ^^^^^ required by this bound in `Iterate::Ty`
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/specialization/issue-44861.stderr b/src/test/ui/specialization/issue-44861.stderr
index 3935a4a..114504b 100644
--- a/src/test/ui/specialization/issue-44861.stderr
+++ b/src/test/ui/specialization/issue-44861.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `(): CoerceUnsized<*const [u8]>` is not satisfied
--> $DIR/issue-44861.rs:21:5
|
-LL | type Data2: CoerceUnsized<*const [u8]>;
- | -------------------------- required by this bound in `Smartass::Data2`
-...
LL | default type Data2 = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `CoerceUnsized<*const [u8]>` is not implemented for `()`
+ |
+note: required by a bound in `Smartass::Data2`
+ --> $DIR/issue-44861.rs:12:17
+ |
+LL | type Data2: CoerceUnsized<*const [u8]>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Smartass::Data2`
error: aborting due to previous error
diff --git a/src/test/ui/specialization/issue-51892.rs b/src/test/ui/specialization/issue-51892.rs
index 3cd0711..5c06254 100644
--- a/src/test/ui/specialization/issue-51892.rs
+++ b/src/test/ui/specialization/issue-51892.rs
@@ -1,6 +1,5 @@
#![allow(incomplete_features)]
-#![feature(const_generics)]
-#![feature(const_evaluatable_checked)]
+#![feature(generic_const_exprs)]
#![feature(specialization)]
pub trait Trait {
diff --git a/src/test/ui/specialization/issue-51892.stderr b/src/test/ui/specialization/issue-51892.stderr
index 2d30164..cb46db8 100644
--- a/src/test/ui/specialization/issue-51892.stderr
+++ b/src/test/ui/specialization/issue-51892.stderr
@@ -1,8 +1,8 @@
error: unconstrained generic constant
- --> $DIR/issue-51892.rs:15:5
+ --> $DIR/issue-51892.rs:14:17
|
LL | type Type = [u8; std::mem::size_of::<<T as Trait>::Type>()];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<<T as Trait>::Type>()]:`
diff --git a/src/test/ui/specialization/issue-59435.stderr b/src/test/ui/specialization/issue-59435.stderr
index f3f8b02..606d22e 100644
--- a/src/test/ui/specialization/issue-59435.stderr
+++ b/src/test/ui/specialization/issue-59435.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `MyStruct: Default` is not satisfied
--> $DIR/issue-59435.rs:11:5
|
-LL | type MyType: Default;
- | ------- required by this bound in `MyTrait::MyType`
-...
LL | default type MyType = MyStruct;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `MyStruct`
+ |
+note: required by a bound in `MyTrait::MyType`
+ --> $DIR/issue-59435.rs:7:18
+ |
+LL | type MyType: Default;
+ | ^^^^^^^ required by this bound in `MyTrait::MyType`
error: aborting due to previous error
diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr
index ddf65f3..4dc6866 100644
--- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr
+++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr
@@ -122,5 +122,5 @@
error: aborting due to 19 previous errors
-Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0546, E0547, E0549, E0550.
+Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0544, E0546, E0547, E0549, E0550.
For more information about an error, try `rustc --explain E0539`.
diff --git a/src/test/ui/static/bad-const-type.stderr b/src/test/ui/static/bad-const-type.stderr
index a9c84b4..dcc1ee0 100644
--- a/src/test/ui/static/bad-const-type.stderr
+++ b/src/test/ui/static/bad-const-type.stderr
@@ -2,10 +2,9 @@
--> $DIR/bad-const-type.rs:1:20
|
LL | static i: String = 10;
- | ^^
+ | ^^- help: try using a conversion method: `.to_string()`
| |
| expected struct `String`, found integer
- | help: try using a conversion method: `10.to_string()`
error: aborting due to previous error
diff --git a/src/test/ui/str/str-array-assignment.stderr b/src/test/ui/str/str-array-assignment.stderr
index 73c03f0..c23400a 100644
--- a/src/test/ui/str/str-array-assignment.stderr
+++ b/src/test/ui/str/str-array-assignment.stderr
@@ -27,7 +27,7 @@
help: consider borrowing here
|
LL | let v = &s[..2];
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/str-array-assignment.rs:9:17
diff --git a/src/test/ui/str/str-as-char.stderr b/src/test/ui/str/str-as-char.stderr
index 27d6336..c3cb488 100644
--- a/src/test/ui/str/str-as-char.stderr
+++ b/src/test/ui/str/str-as-char.stderr
@@ -7,7 +7,7 @@
help: if you meant to write a `str` literal, use double quotes
|
LL | println!("●●");
- | ^^^^
+ | ~~~~
error: aborting due to previous error
diff --git a/src/test/ui/str/str-concat-on-double-ref.stderr b/src/test/ui/str/str-concat-on-double-ref.stderr
index ac87d6e..dee2889 100644
--- a/src/test/ui/str/str-concat-on-double-ref.stderr
+++ b/src/test/ui/str/str-concat-on-double-ref.stderr
@@ -10,7 +10,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let c = a.to_owned() + b;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/str/str-escape.rs b/src/test/ui/str/str-escape.rs
new file mode 100644
index 0000000..0264632
--- /dev/null
+++ b/src/test/ui/str/str-escape.rs
@@ -0,0 +1,11 @@
+// check-pass
+fn main() {
+ let s = "\
+
+ ";
+ //~^^^ WARNING multiple lines skipped by escaped newline
+ let s = "foo\
+ bar
+ ";
+ //~^^^ WARNING non-ASCII whitespace symbol '\u{a0}' is not skipped
+}
diff --git a/src/test/ui/str/str-escape.stderr b/src/test/ui/str/str-escape.stderr
new file mode 100644
index 0000000..b2501f1
--- /dev/null
+++ b/src/test/ui/str/str-escape.stderr
@@ -0,0 +1,21 @@
+warning: multiple lines skipped by escaped newline
+ --> $DIR/str-escape.rs:3:14
+ |
+LL | let s = "\
+ | ______________^
+LL | |
+LL | | ";
+ | |_____________^ skipping everything up to and including this point
+
+warning: non-ASCII whitespace symbol '\u{a0}' is not skipped
+ --> $DIR/str-escape.rs:7:17
+ |
+LL | let s = "foo\
+ | _________________^
+LL | | bar
+ | | ^ non-ASCII whitespace symbol '\u{a0}' is not skipped
+ | |___|
+ |
+
+warning: 2 warnings emitted
+
diff --git a/src/test/ui/str/str-lit-type-mismatch.stderr b/src/test/ui/str/str-lit-type-mismatch.stderr
index 64ddfcc..90590b7 100644
--- a/src/test/ui/str/str-lit-type-mismatch.stderr
+++ b/src/test/ui/str/str-lit-type-mismatch.stderr
@@ -2,40 +2,47 @@
--> $DIR/str-lit-type-mismatch.rs:2:20
|
LL | let x: &[u8] = "foo";
- | ----- ^^^^^
- | | |
- | | expected slice `[u8]`, found `str`
- | | help: consider adding a leading `b`: `b"foo"`
+ | ----- ^^^^^ expected slice `[u8]`, found `str`
+ | |
| expected due to this
|
= note: expected reference `&[u8]`
found reference `&'static str`
+help: consider adding a leading `b`
+ |
+LL | let x: &[u8] = b"foo";
+ | +
error[E0308]: mismatched types
--> $DIR/str-lit-type-mismatch.rs:3:23
|
LL | let y: &[u8; 4] = "baaa";
- | -------- ^^^^^^
- | | |
- | | expected array `[u8; 4]`, found `str`
- | | help: consider adding a leading `b`: `b"baaa"`
+ | -------- ^^^^^^ expected array `[u8; 4]`, found `str`
+ | |
| expected due to this
|
= note: expected reference `&[u8; 4]`
found reference `&'static str`
+help: consider adding a leading `b`
+ |
+LL | let y: &[u8; 4] = b"baaa";
+ | +
error[E0308]: mismatched types
--> $DIR/str-lit-type-mismatch.rs:4:19
|
LL | let z: &str = b"foo";
- | ---- ^^^^^^
- | | |
- | | expected `str`, found array `[u8; 3]`
- | | help: consider removing the leading `b`: `"foo"`
+ | ---- ^^^^^^ expected `str`, found array `[u8; 3]`
+ | |
| expected due to this
|
= note: expected reference `&str`
found reference `&'static [u8; 3]`
+help: consider removing the leading `b`
+ |
+LL - let z: &str = b"foo";
+LL + let z: &str = "foo";
+ |
error: aborting due to 3 previous errors
diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr
index 4055428..3e49c83 100644
--- a/src/test/ui/str/str-mut-idx.stderr
+++ b/src/test/ui/str/str-mut-idx.stderr
@@ -1,17 +1,19 @@
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/str-mut-idx.rs:4:15
|
-LL | fn bot<T>() -> T { loop {} }
- | - required by this bound in `bot`
-...
LL | s[1..2] = bot();
| ^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
+note: required by a bound in `bot`
+ --> $DIR/str-mut-idx.rs:1:8
+ |
+LL | fn bot<T>() -> T { loop {} }
+ | ^ required by this bound in `bot`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn bot<T: ?Sized>() -> T { loop {} }
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/str-mut-idx.rs:4:5
diff --git a/src/test/ui/structs-enums/struct-rec/issue-74224.stderr b/src/test/ui/structs-enums/struct-rec/issue-74224.stderr
index d61ab19..6199178 100644
--- a/src/test/ui/structs-enums/struct-rec/issue-74224.stderr
+++ b/src/test/ui/structs-enums/struct-rec/issue-74224.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable
|
LL | y: Box<A<A<T>>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/structs-enums/struct-rec/issue-84611.stderr b/src/test/ui/structs-enums/struct-rec/issue-84611.stderr
index 0a898e5..2e99435 100644
--- a/src/test/ui/structs-enums/struct-rec/issue-84611.stderr
+++ b/src/test/ui/structs-enums/struct-rec/issue-84611.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | x: Box<Foo<[T; 1]>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
index efc4ba9..c6d2434 100644
--- a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
+++ b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable
|
LL | y: Box<B<T>>,
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `B` has infinite size
--> $DIR/mutual-struct-recursion.rs:7:1
@@ -24,7 +24,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `B` representable
|
LL | z: Box<A<T>>
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `C` has infinite size
--> $DIR/mutual-struct-recursion.rs:12:1
@@ -38,7 +38,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `C` representable
|
LL | y: Box<Option<Option<D<T>>>>,
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `D` has infinite size
--> $DIR/mutual-struct-recursion.rs:18:1
@@ -52,7 +52,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `D` representable
|
LL | z: Box<Option<Option<C<T>>>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 4 previous errors
diff --git a/src/test/ui/structs/struct-field-cfg.stderr b/src/test/ui/structs/struct-field-cfg.stderr
index 740ea38..5ec47c0 100644
--- a/src/test/ui/structs/struct-field-cfg.stderr
+++ b/src/test/ui/structs/struct-field-cfg.stderr
@@ -21,11 +21,11 @@
help: include the missing field in the pattern
|
LL | let Foo { present } = foo;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | let Foo { .. } = foo;
- | ^^^^^^
+ | ~~~~~~
error[E0026]: struct `Foo` does not have a field named `absent`
--> $DIR/struct-field-cfg.rs:16:42
diff --git a/src/test/ui/structs/struct-pat-derived-error.stderr b/src/test/ui/structs/struct-pat-derived-error.stderr
index c1a9563..a91e476 100644
--- a/src/test/ui/structs/struct-pat-derived-error.stderr
+++ b/src/test/ui/structs/struct-pat-derived-error.stderr
@@ -19,11 +19,11 @@
help: include the missing fields in the pattern
|
LL | let A { x, y, b, c } = self.d;
- | ^^^^^^^^
+ | ~~~~~~~~
help: if you don't care about these missing fields, you can explicitly ignore them
|
LL | let A { x, y, .. } = self.d;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/structs/struct-tuple-field-names.stderr b/src/test/ui/structs/struct-tuple-field-names.stderr
index 29e7214..5494c29 100644
--- a/src/test/ui/structs/struct-tuple-field-names.stderr
+++ b/src/test/ui/structs/struct-tuple-field-names.stderr
@@ -7,7 +7,7 @@
help: use the tuple variant pattern syntax instead
|
LL | E::S(_, _) => {}
- | ^^^^^^
+ | ~~~~~~
error[E0769]: tuple variant `S` written as struct variant
--> $DIR/struct-tuple-field-names.rs:13:9
@@ -18,7 +18,7 @@
help: use the tuple variant pattern syntax instead
|
LL | S(_, _) => {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr
index 5bbf422..97caa83 100644
--- a/src/test/ui/substs-ppaux.normal.stderr
+++ b/src/test/ui/substs-ppaux.normal.stderr
@@ -14,7 +14,7 @@
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:25:17
@@ -32,7 +32,7 @@
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:33:17
@@ -50,7 +50,7 @@
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:41:17
@@ -68,14 +68,11 @@
help: use parentheses to call this function
|
LL | let x: () = foo::<'static>();
- | ^^
+ | ++
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/substs-ppaux.rs:49:5
|
-LL | fn bar<'a, T>() where T: 'a {}
- | -- required by this bound in `Foo::bar`
-...
LL | <str as Foo<u8>>::bar;
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -85,6 +82,11 @@
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
| ^^^^^^^^^^^^^^ ^
+note: required by a bound in `Foo::bar`
+ --> $DIR/substs-ppaux.rs:7:30
+ |
+LL | fn bar<'a, T>() where T: 'a {}
+ | ^^ required by this bound in `Foo::bar`
error: aborting due to 5 previous errors
diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr
index 20d7655..5829073 100644
--- a/src/test/ui/substs-ppaux.verbose.stderr
+++ b/src/test/ui/substs-ppaux.verbose.stderr
@@ -14,7 +14,7 @@
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:25:17
@@ -32,7 +32,7 @@
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:33:17
@@ -50,7 +50,7 @@
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:41:17
@@ -68,14 +68,11 @@
help: use parentheses to call this function
|
LL | let x: () = foo::<'static>();
- | ^^
+ | ++
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/substs-ppaux.rs:49:5
|
-LL | fn bar<'a, T>() where T: 'a {}
- | -- required by this bound in `Foo::bar`
-...
LL | <str as Foo<u8>>::bar;
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
@@ -85,6 +82,11 @@
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
| ^^^^^^^^^^^^^^ ^
+note: required by a bound in `Foo::bar`
+ --> $DIR/substs-ppaux.rs:7:30
+ |
+LL | fn bar<'a, T>() where T: 'a {}
+ | ^^ required by this bound in `Foo::bar`
error: aborting due to 5 previous errors
diff --git a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr b/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
index 5cb3a40..fb40c26 100644
--- a/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
+++ b/src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
@@ -1,67 +1,54 @@
-error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
- |
-LL | struct X<T>(T);
- | - required by this bound in `X`
-...
-LL | struct Struct5<T: ?Sized>{
- | - this type parameter needs to be `std::marker::Sized`
-LL | _t: X<T>,
- | ^^^^ doesn't have a size known at compile-time
- |
-help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
- --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
- |
-LL | struct X<T>(T);
- | ^ - ...if indirection were used here: `Box<T>`
- | |
- | this could be changed to `T: ?Sized`...
-
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:2:19
|
LL | fn func1() -> Struct1<Self>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-...
-LL | struct Struct1<T>{
- | - required by this bound in `Struct1`
|
+note: required by a bound in `Struct1`
+ --> $DIR/adt-param-with-implicit-sized-bound.rs:8:16
+ |
+LL | struct Struct1<T>{
+ | ^ required by this bound in `Struct1`
help: consider further restricting `Self`
|
LL | fn func1() -> Struct1<Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct1<T: ?Sized>{
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
|
LL | fn func2<'a>() -> Struct2<'a, Self>;
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
-...
-LL | struct Struct2<'a, T>{
- | - required by this bound in `Struct2`
|
+note: required by a bound in `Struct2`
+ --> $DIR/adt-param-with-implicit-sized-bound.rs:11:20
+ |
+LL | struct Struct2<'a, T>{
+ | ^ required by this bound in `Struct2`
help: consider further restricting `Self`
|
LL | fn func2<'a>() -> Struct2<'a, Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct2<'a, T: ?Sized>{
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
|
LL | fn func3() -> Struct3<Self>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-...
-LL | struct Struct3<T>{
- | - required by this bound in `Struct3`
|
+note: required by a bound in `Struct3`
+ --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
+ |
+LL | struct Struct3<T>{
+ | ^ required by this bound in `Struct3`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
|
@@ -72,25 +59,53 @@
help: consider further restricting `Self`
|
LL | fn func3() -> Struct3<Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
|
LL | fn func4() -> Struct4<Self>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-...
-LL | struct Struct4<T>{
- | - required by this bound in `Struct4`
|
+note: required by a bound in `Struct4`
+ --> $DIR/adt-param-with-implicit-sized-bound.rs:20:16
+ |
+LL | struct Struct4<T>{
+ | ^ required by this bound in `Struct4`
help: consider further restricting `Self`
|
LL | fn func4() -> Struct4<Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct4<T: ?Sized>{
- | ^^^^^^^^
+ | ++++++++
+
+error[E0277]: the size for values of type `T` cannot be known at compilation time
+ --> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
+ |
+LL | struct Struct5<T: ?Sized>{
+ | - this type parameter needs to be `std::marker::Sized`
+LL | _t: X<T>,
+ | ^^^^ doesn't have a size known at compile-time
+ |
+note: required by a bound in `X`
+ --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
+ |
+LL | struct X<T>(T);
+ | ^ required by this bound in `X`
+help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
+ --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
+ |
+LL | struct X<T>(T);
+ | ^ - ...if indirection were used here: `Box<T>`
+ | |
+ | this could be changed to `T: ?Sized`...
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - struct Struct5<T: ?Sized>{
+LL + struct Struct5<T>{
+ |
error: aborting due to 5 previous errors
diff --git a/src/test/ui/suggestions/as-ref-2.stderr b/src/test/ui/suggestions/as-ref-2.stderr
index f2eddf2..86a1750 100644
--- a/src/test/ui/suggestions/as-ref-2.stderr
+++ b/src/test/ui/suggestions/as-ref-2.stderr
@@ -16,7 +16,7 @@
help: consider calling `.as_ref()` to borrow the type's contents
|
LL | let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s));
- | ^^^^^^^^^
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/as-ref.stderr b/src/test/ui/suggestions/as-ref.stderr
index dc5d7ef..8d93ac5 100644
--- a/src/test/ui/suggestions/as-ref.stderr
+++ b/src/test/ui/suggestions/as-ref.stderr
@@ -56,7 +56,7 @@
help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`
|
LL | let y: Result<&usize, &usize> = x.as_ref();
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/as-ref.rs:19:36
diff --git a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
index cb4acc4..300c2a6 100644
--- a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
+++ b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
@@ -3,35 +3,39 @@
|
LL | async fn foo() {}
| --- consider calling this function
-LL |
-LL | fn bar(f: impl Future<Output=()>) {}
- | ----------------- required by this bound in `bar`
...
LL | bar(foo);
| ^^^ `fn() -> impl Future {foo}` is not a future
|
= help: the trait `Future` is not implemented for `fn() -> impl Future {foo}`
+note: required by a bound in `bar`
+ --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
+ |
+LL | fn bar(f: impl Future<Output=()>) {}
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
help: use parentheses to call the function
|
LL | bar(foo());
- | ^^
+ | ++
error[E0277]: `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:12:9
|
-LL | fn bar(f: impl Future<Output=()>) {}
- | ----------------- required by this bound in `bar`
-...
LL | let async_closure = async || ();
| -------- consider calling this closure
LL | bar(async_closure);
| ^^^^^^^^^^^^^ `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
|
= help: the trait `Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]`
+note: required by a bound in `bar`
+ --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
+ |
+LL | fn bar(f: impl Future<Output=()>) {}
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
help: use parentheses to call the closure
|
LL | bar(async_closure());
- | ^^
+ | ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr
index 6a825c5..d6163a5 100644
--- a/src/test/ui/suggestions/attribute-typos.stderr
+++ b/src/test/ui/suggestions/attribute-typos.stderr
@@ -15,7 +15,7 @@
|
LL | #[tests]
| ^^^^^ help: an attribute macro with a similar name exists: `test`
- |
+ |
::: $SRC_DIR/core/src/macros/mod.rs:LL:COL
|
LL | pub macro test($item:item) {
diff --git a/src/test/ui/suggestions/const-in-struct-pat.stderr b/src/test/ui/suggestions/const-in-struct-pat.stderr
index df9c230..784f1bd 100644
--- a/src/test/ui/suggestions/const-in-struct-pat.stderr
+++ b/src/test/ui/suggestions/const-in-struct-pat.stderr
@@ -13,7 +13,7 @@
help: bind the struct field to a different name instead
|
LL | let Thing { foo: other_foo } = t;
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/constrain-trait.stderr b/src/test/ui/suggestions/constrain-trait.stderr
index f1c50e5..a26f869 100644
--- a/src/test/ui/suggestions/constrain-trait.stderr
+++ b/src/test/ui/suggestions/constrain-trait.stderr
@@ -8,7 +8,7 @@
help: the following trait defines an item `get_a`, perhaps you need to add another supertrait for it:
|
LL | trait UseString: std::fmt::Debug + GetString {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0599]: no method named `get_a` found for reference `&Self` in the current scope
--> $DIR/constrain-trait.rs:21:31
@@ -20,7 +20,7 @@
help: the following trait defines an item `get_a`, perhaps you need to add a supertrait for it:
|
LL | trait UseString2: GetString {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr b/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr
index 59ccb29..7bdc8e0 100644
--- a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr
+++ b/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr
@@ -3,7 +3,7 @@
|
LL | impl result {
| ^^^^^^ help: an enum with a similar name exists: `Result`
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | pub enum Result<T, E> {
diff --git a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr
index 612fae2..40ad671 100644
--- a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr
+++ b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr
@@ -52,11 +52,11 @@
help: consider removing the `&`
|
LL | (Either::One(_t), Either::Two(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider removing the `&`
|
LL | (Either::Two(_t), Either::One(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0507]: cannot move out of a shared reference
--> $DIR/duplicate-suggestions.rs:61:11
@@ -72,10 +72,10 @@
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the `&`
|
-LL | (Either::One(_t), Either::Two(_u))
-LL |
-LL |
-LL | | &(Either::Two(_t), Either::One(_u)) => (),
+LL ~ (Either::One(_t), Either::Two(_u))
+LL +
+LL +
+LL ~ | &(Either::Two(_t), Either::One(_u)) => (),
|
error[E0507]: cannot move out of a shared reference
@@ -162,11 +162,11 @@
help: consider removing the `&mut`
|
LL | (Either::One(_t), Either::Two(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider removing the `&mut`
|
LL | (Either::Two(_t), Either::One(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0507]: cannot move out of a mutable reference
--> $DIR/duplicate-suggestions.rs:113:11
@@ -182,10 +182,10 @@
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the `&mut`
|
-LL | (Either::One(_t), Either::Two(_u))
-LL |
-LL |
-LL | | &mut (Either::Two(_t), Either::One(_u)) => (),
+LL ~ (Either::One(_t), Either::Two(_u))
+LL +
+LL +
+LL ~ | &mut (Either::Two(_t), Either::One(_u)) => (),
|
error[E0507]: cannot move out of a mutable reference
diff --git a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr
index f7528b5..ca09c3d 100644
--- a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr
+++ b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr
@@ -270,10 +270,10 @@
|
help: consider removing the `&`
|
-LL | Either::One(_t)
-LL |
-LL |
-LL | | &Either::Two(_t) => (),
+LL ~ Either::One(_t)
+LL +
+LL +
+LL ~ | &Either::Two(_t) => (),
|
error[E0507]: cannot move out of `r.0` which is behind a shared reference
@@ -348,11 +348,11 @@
help: consider removing the `&mut`
|
LL | Either::One(_t) => (),
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: consider removing the `&mut`
|
LL | Either::Two(_t) => (),
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0507]: cannot move out of `rm.0` which is behind a mutable reference
--> $DIR/simple.rs:228:11
@@ -516,10 +516,10 @@
|
help: consider removing the `&`
|
-LL | Either::One(_t)
-LL |
-LL |
-LL | | &Either::Two(_t) => (),
+LL ~ Either::One(_t)
+LL +
+LL +
+LL ~ | &Either::Two(_t) => (),
|
error[E0507]: cannot move out of a shared reference
@@ -592,10 +592,10 @@
|
help: consider removing the `&mut`
|
-LL | Either::One(_t)
-LL |
-LL |
-LL | | &mut Either::Two(_t) => (),
+LL ~ Either::One(_t)
+LL +
+LL +
+LL ~ | &mut Either::Two(_t) => (),
|
error[E0507]: cannot move out of a mutable reference
diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
index d5d5132..ff08178 100644
--- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
+++ b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
@@ -5,13 +5,14 @@
| - this type parameter ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type
LL | // We could instead use an `async` block, but this way we have no std spans.
LL | x
- | ^
- | |
- | expected struct `Pin`, found type parameter `F`
- | help: you need to pin and box this expression: `Box::pin(x)`
+ | ^ expected struct `Pin`, found type parameter `F`
|
= note: expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>`
found type parameter `F`
+help: you need to pin and box this expression
+ |
+LL | Box::pin(x)
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/expected-boxed-future-isnt-pinned.rs:18:5
@@ -31,14 +32,15 @@
LL | fn baz<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static, i32> {
| - this type parameter
LL | Pin::new(x)
- | ^
- | |
- | expected struct `Box`, found type parameter `F`
- | help: store this in the heap by calling `Box::new`: `Box::new(x)`
+ | ^ expected struct `Box`, found type parameter `F`
|
= note: expected struct `Box<dyn Future<Output = i32> + Send>`
found type parameter `F`
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+ |
+LL | Pin::new(Box::new(x))
+ | +++++++++ +
error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned
--> $DIR/expected-boxed-future-isnt-pinned.rs:22:5
@@ -75,7 +77,7 @@
LL | | 42
LL | | }
| |_____^ expected struct `Pin`, found opaque type
- |
+ |
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
|
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
@@ -85,9 +87,9 @@
found opaque type `impl Future`
help: you need to pin and box this expression
|
-LL | Box::pin(async {
+LL ~ Box::pin(async {
LL | 42
-LL | })
+LL ~ })
|
error: aborting due to 6 previous errors
diff --git a/src/test/ui/suggestions/field-access.stderr b/src/test/ui/suggestions/field-access.stderr
index b113b37..b9f0f78 100644
--- a/src/test/ui/suggestions/field-access.stderr
+++ b/src/test/ui/suggestions/field-access.stderr
@@ -12,7 +12,7 @@
help: you might have meant to use field `b` whose type is `B`
|
LL | if let B::Fst = a.b {};
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/field-access.rs:25:9
@@ -29,7 +29,7 @@
help: you might have meant to use field `b` whose type is `B`
|
LL | match a.b {
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/field-access.rs:26:9
@@ -46,7 +46,7 @@
help: you might have meant to use field `b` whose type is `B`
|
LL | match a.b {
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/field-access.rs:32:9
@@ -60,7 +60,7 @@
help: you might have meant to use field `bar` whose type is `u32`
|
LL | match unsafe { foo.bar } {
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
index 8589a27..9304810 100644
--- a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
+++ b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
@@ -3,33 +3,37 @@
|
LL | fn foo() -> impl T<O=()> { S }
| --- consider calling this function
-LL |
-LL | fn bar(f: impl T<O=()>) {}
- | ------- required by this bound in `bar`
...
LL | bar(foo);
| ^^^ the trait `T` is not implemented for `fn() -> impl T {foo}`
|
+note: required by a bound in `bar`
+ --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:14:16
+ |
+LL | fn bar(f: impl T<O=()>) {}
+ | ^^^^^^^ required by this bound in `bar`
help: use parentheses to call the function
|
LL | bar(foo());
- | ^^
+ | ++
error[E0277]: the trait bound `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]: T` is not satisfied
--> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9
|
-LL | fn bar(f: impl T<O=()>) {}
- | ------- required by this bound in `bar`
-...
LL | let closure = || S;
| -- consider calling this closure
LL | bar(closure);
| ^^^^^^^ the trait `T` is not implemented for `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]`
|
+note: required by a bound in `bar`
+ --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:14:16
+ |
+LL | fn bar(f: impl T<O=()>) {}
+ | ^^^^^^^ required by this bound in `bar`
help: use parentheses to call the closure
|
LL | bar(closure());
- | ^^
+ | ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr b/src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr
index fe9c344..7c0f8d1 100644
--- a/src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr
+++ b/src/test/ui/suggestions/fn-missing-lifetime-in-item.stderr
@@ -8,11 +8,11 @@
help: consider introducing lifetime `'a` here
|
LL | struct S1<'a, F: Fn(&i32, &i32) -> &'a i32>(F);
- | ^^^
+ | +++
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | struct S1<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
- | ^^^^^^^
+ | +++++++
error[E0106]: missing lifetime specifier
--> $DIR/fn-missing-lifetime-in-item.rs:2:32
@@ -25,11 +25,11 @@
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | struct S2<F: for<'a> Fn(&'a i32, &'a i32) -> &'a i32>(F);
- | ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | +++++++ ++ ++ ++
help: consider introducing a named lifetime parameter
|
LL | struct S2<'a, F: Fn(&'a i32, &'a i32) -> &'a i32>(F);
- | ^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | +++ ++ ++ ++
error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
--> $DIR/fn-missing-lifetime-in-item.rs:3:40
diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
index 9b2febb..1ed784e 100644
--- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
+++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
@@ -12,11 +12,11 @@
help: use struct literal syntax instead
|
LL | let _: E = E::B { a: val };
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | let _: E = E::A;
- | ^
+ | ~
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:29:20
@@ -34,7 +34,7 @@
help: use parentheses to call this function
|
LL | let _: usize = foo(a, b);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:30:16
@@ -52,7 +52,7 @@
help: use parentheses to instantiate this tuple struct
|
LL | let _: S = S(_, _);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:31:20
@@ -70,7 +70,7 @@
help: use parentheses to call this function
|
LL | let _: usize = bar();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:32:16
@@ -88,7 +88,7 @@
help: use parentheses to instantiate this tuple struct
|
LL | let _: V = V();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:33:20
@@ -106,7 +106,7 @@
help: use parentheses to call this function
|
LL | let _: usize = T::baz(x, y);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:34:20
@@ -124,7 +124,7 @@
help: use parentheses to call this function
|
LL | let _: usize = T::bat(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:35:16
@@ -142,7 +142,7 @@
help: use parentheses to instantiate this tuple variant
|
LL | let _: E = E::A(_);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:37:20
@@ -160,7 +160,7 @@
help: use parentheses to call this function
|
LL | let _: usize = X::baz(x, y);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:38:20
@@ -178,7 +178,7 @@
help: use parentheses to call this function
|
LL | let _: usize = X::bat(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:39:20
@@ -196,7 +196,7 @@
help: use parentheses to call this function
|
LL | let _: usize = X::bax(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:40:20
@@ -214,7 +214,7 @@
help: use parentheses to call this function
|
LL | let _: usize = X::bach(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:41:20
@@ -232,7 +232,7 @@
help: use parentheses to call this function
|
LL | let _: usize = X::ban(_);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:42:20
@@ -250,7 +250,7 @@
help: use parentheses to call this function
|
LL | let _: usize = X::bal(_);
- | ^^^
+ | +++
error[E0615]: attempted to take value of method `ban` on type `X`
--> $DIR/fn-or-tuple-struct-without-args.rs:43:22
@@ -261,7 +261,7 @@
help: use parentheses to call the method
|
LL | let _: usize = X.ban();
- | ^^
+ | ++
error[E0615]: attempted to take value of method `bal` on type `X`
--> $DIR/fn-or-tuple-struct-without-args.rs:44:22
@@ -272,7 +272,7 @@
help: use parentheses to call the method
|
LL | let _: usize = X.bal();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:46:20
@@ -289,7 +289,7 @@
help: use parentheses to call this closure
|
LL | let _: usize = closure();
- | ^^
+ | ++
error: aborting due to 17 previous errors
diff --git a/src/test/ui/suggestions/for-i-in-vec.fixed b/src/test/ui/suggestions/for-i-in-vec.fixed
index ec7358b..4f2007b 100644
--- a/src/test/ui/suggestions/for-i-in-vec.fixed
+++ b/src/test/ui/suggestions/for-i-in-vec.fixed
@@ -3,13 +3,25 @@
struct Foo {
v: Vec<u32>,
+ h: std::collections::HashMap<i32, i32>,
}
impl Foo {
fn bar(&self) {
for _ in &self.v { //~ ERROR cannot move out of `self.v` which is behind a shared reference
}
+ for _ in &self.h { //~ ERROR cannot move out of `self.h` which is behind a shared reference
+ }
}
}
+const LOADERS: &Vec<&'static u8> = &Vec::new();
+
+pub fn break_code() -> Option<&'static u8> {
+ for loader in &*LOADERS { //~ ERROR cannot move out of a shared reference
+ return Some(loader);
+ }
+ None
+}
+
fn main() {}
diff --git a/src/test/ui/suggestions/for-i-in-vec.rs b/src/test/ui/suggestions/for-i-in-vec.rs
index 304fe8c..55fc7ad 100644
--- a/src/test/ui/suggestions/for-i-in-vec.rs
+++ b/src/test/ui/suggestions/for-i-in-vec.rs
@@ -3,13 +3,25 @@
struct Foo {
v: Vec<u32>,
+ h: std::collections::HashMap<i32, i32>,
}
impl Foo {
fn bar(&self) {
for _ in self.v { //~ ERROR cannot move out of `self.v` which is behind a shared reference
}
+ for _ in self.h { //~ ERROR cannot move out of `self.h` which is behind a shared reference
+ }
}
}
+const LOADERS: &Vec<&'static u8> = &Vec::new();
+
+pub fn break_code() -> Option<&'static u8> {
+ for loader in *LOADERS { //~ ERROR cannot move out of a shared reference
+ return Some(loader);
+ }
+ None
+}
+
fn main() {}
diff --git a/src/test/ui/suggestions/for-i-in-vec.stderr b/src/test/ui/suggestions/for-i-in-vec.stderr
index 48f3f42..c39363f 100644
--- a/src/test/ui/suggestions/for-i-in-vec.stderr
+++ b/src/test/ui/suggestions/for-i-in-vec.stderr
@@ -1,12 +1,36 @@
error[E0507]: cannot move out of `self.v` which is behind a shared reference
- --> $DIR/for-i-in-vec.rs:10:18
+ --> $DIR/for-i-in-vec.rs:11:18
|
LL | for _ in self.v {
- | ^^^^^^
- | |
- | move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait
- | help: consider iterating over a slice of the `Vec<_>`'s content: `&self.v`
+ | ^^^^^^ move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait
+ |
+help: consider iterating over a slice of the `Vec<u32>`'s content
+ |
+LL | for _ in &self.v {
+ | +
-error: aborting due to previous error
+error[E0507]: cannot move out of `self.h` which is behind a shared reference
+ --> $DIR/for-i-in-vec.rs:13:18
+ |
+LL | for _ in self.h {
+ | ^^^^^^ move occurs because `self.h` has type `HashMap<i32, i32>`, which does not implement the `Copy` trait
+ |
+help: consider iterating over a slice of the `HashMap<i32, i32>`'s content
+ |
+LL | for _ in &self.h {
+ | +
+
+error[E0507]: cannot move out of a shared reference
+ --> $DIR/for-i-in-vec.rs:21:19
+ |
+LL | for loader in *LOADERS {
+ | ^^^^^^^^ move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait
+ |
+help: consider iterating over a slice of the `Vec<&u8>`'s content
+ |
+LL | for loader in &*LOADERS {
+ | +
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0507`.
diff --git a/src/test/ui/suggestions/format-borrow.stderr b/src/test/ui/suggestions/format-borrow.stderr
index 0881b02..8a2941c 100644
--- a/src/test/ui/suggestions/format-borrow.stderr
+++ b/src/test/ui/suggestions/format-borrow.stderr
@@ -2,41 +2,57 @@
--> $DIR/format-borrow.rs:2:21
|
LL | let a: String = &String::from("a");
- | ------ ^^^^^^^^^^^^^^^^^^
- | | |
- | | expected struct `String`, found `&String`
- | | help: consider removing the borrow: `String::from("a")`
+ | ------ ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+ | |
| expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let a: String = &String::from("a");
+LL + let a: String = String::from("a");
+ |
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:4:21
|
LL | let b: String = &format!("b");
- | ------ ^^^^^^^^^^^^^
- | | |
- | | expected struct `String`, found `&String`
- | | help: consider removing the borrow: `format!("b")`
+ | ------ ^^^^^^^^^^^^^ expected struct `String`, found `&String`
+ | |
| expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let b: String = &format!("b");
+LL + let b: String = format!("b");
+ |
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:6:21
|
LL | let c: String = &mut format!("c");
- | ------ ^^^^^^^^^^^^^^^^^
- | | |
- | | expected struct `String`, found `&mut String`
- | | help: consider removing the borrow: `format!("c")`
+ | ------ ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+ | |
| expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let c: String = &mut format!("c");
+LL + let c: String = format!("c");
+ |
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:8:21
|
LL | let d: String = &mut (format!("d"));
- | ------ ^^^^^^^^^^^^^^^^^^^
- | | |
- | | expected struct `String`, found `&mut String`
- | | help: consider removing the borrow: `format!("d")`
+ | ------ ^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+ | |
| expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let d: String = &mut (format!("d"));
+LL + let d: String = format!("d"));
+ |
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/if-let-typo.rs b/src/test/ui/suggestions/if-let-typo.rs
index 688b6e8..b9714b6 100644
--- a/src/test/ui/suggestions/if-let-typo.rs
+++ b/src/test/ui/suggestions/if-let-typo.rs
@@ -10,4 +10,5 @@
if Some(3) = foo {} //~ ERROR mismatched types
//~^ ERROR destructuring assignments are unstable
//~^^ ERROR invalid left-hand side of assignment
+ if x = 5 {} //~ ERROR cannot find value `x` in this scope
}
diff --git a/src/test/ui/suggestions/if-let-typo.stderr b/src/test/ui/suggestions/if-let-typo.stderr
index ce1ee0c..7f71cb4 100644
--- a/src/test/ui/suggestions/if-let-typo.stderr
+++ b/src/test/ui/suggestions/if-let-typo.stderr
@@ -7,7 +7,18 @@
help: you might have meant to use pattern matching
|
LL | if let Some(x) = foo {}
- | ^^^
+ | +++
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/if-let-typo.rs:13:8
+ |
+LL | if x = 5 {}
+ | ^ not found in this scope
+ |
+help: you might have meant to use pattern matching
+ |
+LL | if let x = 5 {}
+ | +++
error[E0658]: destructuring assignments are unstable
--> $DIR/if-let-typo.rs:4:16
@@ -63,7 +74,7 @@
help: you might have meant to use pattern matching
|
LL | if let 3 = foo {}
- | ^^^
+ | +++
error[E0070]: invalid left-hand side of assignment
--> $DIR/if-let-typo.rs:10:16
@@ -79,7 +90,7 @@
LL | if Some(3) = foo {}
| ^^^^^^^^^^^^^ expected `bool`, found `()`
-error: aborting due to 9 previous errors
+error: aborting due to 10 previous errors
Some errors have detailed explanations: E0070, E0308, E0425, E0658.
For more information about an error, try `rustc --explain E0070`.
diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr b/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr
index 83de3c4..64a6252 100644
--- a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr
+++ b/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr
@@ -1,17 +1,19 @@
error[E0277]: the trait bound `for<'b> &'b S: Trait` is not satisfied
--> $DIR/imm-ref-trait-object-literal-bound-regions.rs:17:5
|
-LL | fn foo<X>(_: X)
- | --- required by a bound in this
-LL | where
-LL | for<'b> &'b X: Trait,
- | ----- required by this bound in `foo`
-...
LL | foo::<S>(s);
| ^^^^^^^^ the trait `for<'b> Trait` is not implemented for `&'b S`
|
= help: the following implementations were found:
<&'a mut S as Trait>
+note: required by a bound in `foo`
+ --> $DIR/imm-ref-trait-object-literal-bound-regions.rs:11:20
+ |
+LL | fn foo<X>(_: X)
+ | --- required by a bound in this
+LL | where
+LL | for<'b> &'b X: Trait,
+ | ^^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr b/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
index bd060c9..39bde52 100644
--- a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
+++ b/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
@@ -1,30 +1,35 @@
error[E0277]: the trait bound `&S: Trait` is not satisfied
--> $DIR/imm-ref-trait-object-literal.rs:12:7
|
-LL | fn foo<X: Trait>(_: X) {}
- | ----- required by this bound in `foo`
-...
LL | foo(&s);
| ^^ the trait `Trait` is not implemented for `&S`
|
= help: the following implementations were found:
<&'a mut S as Trait>
+note: required by a bound in `foo`
+ --> $DIR/imm-ref-trait-object-literal.rs:7:11
+ |
+LL | fn foo<X: Trait>(_: X) {}
+ | ^^^^^ required by this bound in `foo`
help: consider changing this borrow's mutability
|
LL | foo(&mut s);
- | ^^^^
+ | ~~~~
error[E0277]: the trait bound `S: Trait` is not satisfied
--> $DIR/imm-ref-trait-object-literal.rs:13:7
|
-LL | fn foo<X: Trait>(_: X) {}
- | ----- required by this bound in `foo`
-...
LL | foo(s);
| ^
| |
| expected an implementor of trait `Trait`
| help: consider mutably borrowing here: `&mut s`
+ |
+note: required by a bound in `foo`
+ --> $DIR/imm-ref-trait-object-literal.rs:7:11
+ |
+LL | fn foo<X: Trait>(_: X) {}
+ | ^^^^^ required by this bound in `foo`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/imm-ref-trait-object.stderr b/src/test/ui/suggestions/imm-ref-trait-object.stderr
index 9f89dcd..42ca3a7 100644
--- a/src/test/ui/suggestions/imm-ref-trait-object.stderr
+++ b/src/test/ui/suggestions/imm-ref-trait-object.stderr
@@ -3,7 +3,7 @@
|
LL | t.min().unwrap()
| ^^^
- |
+ |
::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | Self: Sized,
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr
index acf0c0e..043a771 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.nll.stderr
@@ -11,7 +11,7 @@
help: you can add a bound to the opaque type to make it last less than `'static` and match `'a`
|
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> + 'a {
- | ^^^^
+ | ++++
error[E0515]: cannot return value referencing function parameter `val`
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr
index 00971b4..29991b6 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.stderr
@@ -11,7 +11,7 @@
help: you can add a bound to the opaque type to make it last less than `'static` and match `'a`
|
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> + 'a {
- | ^^^^
+ | ++++
error[E0515]: cannot return value referencing function parameter `val`
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9
@@ -49,7 +49,7 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for Box<dyn ObjectTrait<Assoc = i32> + '_> {
- | ^^^^
+ | ++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr
index 2fb6c25..6d9f081 100644
--- a/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr
+++ b/src/test/ui/suggestions/impl-on-dyn-trait-with-implicit-static-bound.stderr
@@ -16,7 +16,7 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
- | ^^^^
+ | ++++
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:13
@@ -36,7 +36,7 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl dyn ObjectTrait + '_ {
- | ^^^^
+ | ++++
error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:88:13
@@ -57,11 +57,11 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for dyn ObjectTrait + '_ {}
- | ^^^^
+ | ++++
help: to declare that the `impl Trait` captures data from argument `val`, you can add an explicit `'a` lifetime bound
|
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
- | ^^^^
+ | ++++
error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108:27
@@ -87,7 +87,7 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for dyn ObjectTrait + '_ {}
- | ^^^^
+ | ++++
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:37:13
@@ -107,7 +107,7 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for dyn ObjectTrait + '_ {
- | ^^^^
+ | ++++
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:54:13
@@ -127,7 +127,7 @@
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for Box<dyn ObjectTrait + '_> {
- | ^^^^
+ | ++++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/suggestions/impl-trait-missing-lifetime.stderr b/src/test/ui/suggestions/impl-trait-missing-lifetime.stderr
index e31f25a..a3a339b 100644
--- a/src/test/ui/suggestions/impl-trait-missing-lifetime.stderr
+++ b/src/test/ui/suggestions/impl-trait-missing-lifetime.stderr
@@ -7,7 +7,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn f<'a>(_: impl Iterator<Item = &'a ()>) {}
- | ^^^^ ^^
+ | ++++ ~~
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr b/src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr
index 0de3b9a..bb7919e 100644
--- a/src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr
+++ b/src/test/ui/suggestions/impl-trait-with-missing-bounds.stderr
@@ -1,92 +1,104 @@
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
- --> $DIR/impl-trait-with-missing-bounds.rs:6:13
- |
-LL | qux(constraint);
- | ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
-...
-LL | fn qux(_: impl std::fmt::Debug) {}
- | --------------- required by this bound in `qux`
- |
- = help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
-help: introduce a type parameter with a trait bound instead of using `impl Trait`
- |
-LL | fn foo<I: Iterator>(constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:14:13
|
LL | qux(constraint);
| ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
-...
-LL | fn qux(_: impl std::fmt::Debug) {}
- | --------------- required by this bound in `qux`
|
= help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
+note: required by a bound in `qux`
+ --> $DIR/impl-trait-with-missing-bounds.rs:50:16
+ |
+LL | fn qux(_: impl std::fmt::Debug) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `qux`
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn bar<T, I: Iterator>(t: T, constraints: I) where T: std::fmt::Debug, <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:22:13
|
LL | qux(constraint);
| ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
-...
-LL | fn qux(_: impl std::fmt::Debug) {}
- | --------------- required by this bound in `qux`
|
= help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
+note: required by a bound in `qux`
+ --> $DIR/impl-trait-with-missing-bounds.rs:50:16
+ |
+LL | fn qux(_: impl std::fmt::Debug) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `qux`
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn baz<I: Iterator>(t: impl std::fmt::Debug, constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:30:13
|
LL | qux(constraint);
| ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
-...
-LL | fn qux(_: impl std::fmt::Debug) {}
- | --------------- required by this bound in `qux`
|
= help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
+note: required by a bound in `qux`
+ --> $DIR/impl-trait-with-missing-bounds.rs:50:16
+ |
+LL | fn qux(_: impl std::fmt::Debug) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `qux`
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn bat<I, T: std::fmt::Debug, U: Iterator>(t: T, constraints: U, _: I) where <U as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator + std::fmt::Debug as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:37:13
|
LL | qux(constraint);
| ^^^^^^^^^^ `<impl Iterator + std::fmt::Debug as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
-...
-LL | fn qux(_: impl std::fmt::Debug) {}
- | --------------- required by this bound in `qux`
|
= help: the trait `Debug` is not implemented for `<impl Iterator + std::fmt::Debug as Iterator>::Item`
+note: required by a bound in `qux`
+ --> $DIR/impl-trait-with-missing-bounds.rs:50:16
+ |
+LL | fn qux(_: impl std::fmt::Debug) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `qux`
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn bak<I: Iterator + std::fmt::Debug>(constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++ ~ ++++++++++++++++++++++++++++++++++
+
+error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
+ --> $DIR/impl-trait-with-missing-bounds.rs:6:13
+ |
+LL | qux(constraint);
+ | ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
+note: required by a bound in `qux`
+ --> $DIR/impl-trait-with-missing-bounds.rs:50:16
+ |
+LL | fn qux(_: impl std::fmt::Debug) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `qux`
+help: introduce a type parameter with a trait bound instead of using `impl Trait`
+ |
+LL | fn foo<I: Iterator>(constraints: I) where <I as Iterator>::Item: Debug {
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:45:13
|
LL | qux(constraint);
| ^^^^^^^^^^ `<impl Iterator as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug`
-...
-LL | fn qux(_: impl std::fmt::Debug) {}
- | --------------- required by this bound in `qux`
|
= help: the trait `Debug` is not implemented for `<impl Iterator as Iterator>::Item`
+note: required by a bound in `qux`
+ --> $DIR/impl-trait-with-missing-bounds.rs:50:16
+ |
+LL | fn qux(_: impl std::fmt::Debug) {}
+ | ^^^^^^^^^^^^^^^ required by this bound in `qux`
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn baw<I: Iterator>(constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~ ~ ++++++++++++++++++++++++++++++++++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr b/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr
index db54d04..6255df0 100644
--- a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr
+++ b/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr
@@ -8,7 +8,7 @@
help: the following trait defines an item `hello`, perhaps you need to restrict type parameter `impl Foo` with it:
|
LL | fn test(foo: impl Foo + Bar) {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/import-trait-for-method-call.stderr b/src/test/ui/suggestions/import-trait-for-method-call.stderr
index a2b9b9d..bac8de7 100644
--- a/src/test/ui/suggestions/import-trait-for-method-call.stderr
+++ b/src/test/ui/suggestions/import-trait-for-method-call.stderr
@@ -3,7 +3,7 @@
|
LL | h.finish()
| ^^^^^^ method not found in `DefaultHasher`
- |
+ |
::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
|
LL | fn finish(&self) -> u64;
diff --git a/src/test/ui/suggestions/into-str.stderr b/src/test/ui/suggestions/into-str.stderr
index 26efd50..263d509 100644
--- a/src/test/ui/suggestions/into-str.stderr
+++ b/src/test/ui/suggestions/into-str.stderr
@@ -1,14 +1,16 @@
error[E0277]: the trait bound `&str: From<String>` is not satisfied
--> $DIR/into-str.rs:4:5
|
-LL | fn foo<'a, T>(_t: T) where T: Into<&'a str> {}
- | ------------- required by this bound in `foo`
-...
LL | foo(String::new());
| ^^^ the trait `From<String>` is not implemented for `&str`
|
= note: to coerce a `String` into a `&str`, use `&*` as a prefix
= note: required because of the requirements on the impl of `Into<&str>` for `String`
+note: required by a bound in `foo`
+ --> $DIR/into-str.rs:1:31
+ |
+LL | fn foo<'a, T>(_t: T) where T: Into<&'a str> {}
+ | ^^^^^^^^^^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/issue-21673.stderr b/src/test/ui/suggestions/issue-21673.stderr
index 14c7b18..eda29f8 100644
--- a/src/test/ui/suggestions/issue-21673.stderr
+++ b/src/test/ui/suggestions/issue-21673.stderr
@@ -8,7 +8,7 @@
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it:
|
LL | fn call_method<T: Foo + std::fmt::Debug>(x: &T) {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0599]: no method named `method` found for type parameter `T` in the current scope
--> $DIR/issue-21673.rs:10:7
@@ -20,7 +20,7 @@
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it:
|
LL | fn call_method_2<T: Foo>(x: T) {
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/issue-52820.stderr b/src/test/ui/suggestions/issue-52820.stderr
index ece784d..7b46584 100644
--- a/src/test/ui/suggestions/issue-52820.stderr
+++ b/src/test/ui/suggestions/issue-52820.stderr
@@ -2,10 +2,12 @@
--> $DIR/issue-52820.rs:9:9
|
LL | guts,
- | ^^^^
- | |
- | expected struct `String`, found `&str`
- | help: try using a conversion method: `guts: guts.to_string()`
+ | ^^^^ expected struct `String`, found `&str`
+ |
+help: try using a conversion method
+ |
+LL | guts: guts.to_string(),
+ | +++++ ++++++++++++
error[E0308]: mismatched types
--> $DIR/issue-52820.rs:10:17
diff --git a/src/test/ui/suggestions/issue-59819.stderr b/src/test/ui/suggestions/issue-59819.stderr
index 43e0016..40e4c7b 100644
--- a/src/test/ui/suggestions/issue-59819.stderr
+++ b/src/test/ui/suggestions/issue-59819.stderr
@@ -2,30 +2,35 @@
--> $DIR/issue-59819.rs:28:18
|
LL | let y: i32 = x;
- | --- ^
- | | |
- | | expected `i32`, found struct `Foo`
- | | help: consider dereferencing the type: `*x`
+ | --- ^ expected `i32`, found struct `Foo`
+ | |
| expected due to this
+ |
+help: consider dereferencing the type
+ |
+LL | let y: i32 = *x;
+ | +
error[E0308]: mismatched types
--> $DIR/issue-59819.rs:30:18
|
LL | let b: i32 = a;
- | --- ^
- | | |
- | | expected `i32`, found `&{integer}`
- | | help: consider dereferencing the borrow: `*a`
+ | --- ^ expected `i32`, found `&{integer}`
+ | |
| expected due to this
+ |
+help: consider dereferencing the borrow
+ |
+LL | let b: i32 = *a;
+ | +
error[E0308]: mismatched types
--> $DIR/issue-59819.rs:34:21
|
LL | let g: String = f;
- | ------ ^
+ | ------ ^- help: try using a conversion method: `.to_string()`
| | |
| | expected struct `String`, found struct `Bar`
- | | help: try using a conversion method: `f.to_string()`
| expected due to this
error: aborting due to 3 previous errors
diff --git a/src/test/ui/suggestions/issue-61963.stderr b/src/test/ui/suggestions/issue-61963.stderr
index 6282a693..bb48792 100644
--- a/src/test/ui/suggestions/issue-61963.stderr
+++ b/src/test/ui/suggestions/issue-61963.stderr
@@ -10,7 +10,7 @@
LL | #![deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:18:1
@@ -19,7 +19,7 @@
| ^^^ help: use `dyn`: `dyn pub`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/issue-64252-self-type.stderr b/src/test/ui/suggestions/issue-64252-self-type.stderr
index e96db3f..009707a 100644
--- a/src/test/ui/suggestions/issue-64252-self-type.stderr
+++ b/src/test/ui/suggestions/issue-64252-self-type.stderr
@@ -8,11 +8,11 @@
help: if this is a `self` type, give it a parameter name
|
LL | pub fn foo(self: Box<Self>) { }
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | pub fn foo(_: Box<Self>) { }
- | ^^^^^^
+ | ~~~~~~
error: expected one of `:`, `@`, or `|`, found `<`
--> $DIR/issue-64252-self-type.rs:10:15
@@ -24,11 +24,11 @@
help: if this is a `self` type, give it a parameter name
|
LL | fn bar(self: Box<Self>) { }
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar(_: Box<Self>) { }
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/issue-72766.stderr b/src/test/ui/suggestions/issue-72766.stderr
index fcc49ef..43ba35d0 100644
--- a/src/test/ui/suggestions/issue-72766.stderr
+++ b/src/test/ui/suggestions/issue-72766.stderr
@@ -13,7 +13,7 @@
help: consider `await`ing on the `Future`
|
LL | SadGirl {}.call().await?;
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr b/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr
index 9404c3b..cd1a8c4 100644
--- a/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr
+++ b/src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr
@@ -3,30 +3,34 @@
|
LL | assert_is_send(&bar);
| ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
-...
-LL | fn assert_is_send<T: Send>(_: &T) {}
- | ---- required by this bound in `assert_is_send`
|
= help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
+note: required by a bound in `assert_is_send`
+ --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
+ |
+LL | fn assert_is_send<T: Send>(_: &T) {}
+ | ^^^^ required by this bound in `assert_is_send`
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | async fn run<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
- | ^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++ ~ +++++++++++++++++++++++++++
error[E0277]: `<impl Foo as Foo>::Bar` cannot be sent between threads safely
--> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:24:20
|
LL | assert_is_send(&bar);
| ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
-...
-LL | fn assert_is_send<T: Send>(_: &T) {}
- | ---- required by this bound in `assert_is_send`
|
= help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
+note: required by a bound in `assert_is_send`
+ --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
+ |
+LL | fn assert_is_send<T: Send>(_: &T) {}
+ | ^^^^ required by this bound in `assert_is_send`
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | async fn run2<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
- | ^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~ ~ +++++++++++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/issue-81839.stderr b/src/test/ui/suggestions/issue-81839.stderr
index f907658..1e0aa9c 100644
--- a/src/test/ui/suggestions/issue-81839.stderr
+++ b/src/test/ui/suggestions/issue-81839.stderr
@@ -13,13 +13,12 @@
| | ^^^^^^^^^^^^^^^^^^^ expected `()`, found opaque type
LL | | }
| |_____- `match` arms have incompatible types
- |
- ::: $DIR/auxiliary/issue-81839.rs:6:49
|
-LL | pub async fn answer_str(&self, _s: &str) -> Test {
- | ---- checked the `Output` of this `async fn`, found opaque type
+note: while checking the return type of the `async fn`
+ --> $DIR/auxiliary/issue-81839.rs:6:49
|
- = note: while checking the return type of the `async fn`
+LL | pub async fn answer_str(&self, _s: &str) -> Test {
+ | ^^^^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `()`
found opaque type `impl Future`
diff --git a/src/test/ui/suggestions/issue-82361.stderr b/src/test/ui/suggestions/issue-82361.stderr
index 4c78293..c09ad17 100644
--- a/src/test/ui/suggestions/issue-82361.stderr
+++ b/src/test/ui/suggestions/issue-82361.stderr
@@ -6,12 +6,14 @@
| | - expected because of this
LL | | } else {
LL | | b
- | | ^
- | | |
- | | expected `usize`, found `&usize`
- | | help: consider dereferencing the borrow: `*b`
+ | | ^ expected `usize`, found `&usize`
LL | | };
| |_____- `if` and `else` have incompatible types
+ |
+help: consider dereferencing the borrow
+ |
+LL | *b
+ | +
error[E0308]: `if` and `else` have incompatible types
--> $DIR/issue-82361.rs:16:9
@@ -21,12 +23,15 @@
| | - expected because of this
LL | | } else {
LL | | &1
- | | ^^
- | | |
- | | expected integer, found `&{integer}`
- | | help: consider removing the borrow: `1`
+ | | ^^ expected integer, found `&{integer}`
LL | | };
| |_____- `if` and `else` have incompatible types
+ |
+help: consider removing the borrow
+ |
+LL - &1
+LL + 1
+ |
error[E0308]: `if` and `else` have incompatible types
--> $DIR/issue-82361.rs:22:9
@@ -36,12 +41,15 @@
| | - expected because of this
LL | | } else {
LL | | &mut 1
- | | ^^^^^^
- | | |
- | | expected integer, found `&mut {integer}`
- | | help: consider removing the borrow: `1`
+ | | ^^^^^^ expected integer, found `&mut {integer}`
LL | | };
| |_____- `if` and `else` have incompatible types
+ |
+help: consider removing the borrow
+ |
+LL - &mut 1
+LL + 1
+ |
error: aborting due to 3 previous errors
diff --git a/src/test/ui/suggestions/issue-82566-1.stderr b/src/test/ui/suggestions/issue-82566-1.stderr
index 5a9099a..a05c59c 100644
--- a/src/test/ui/suggestions/issue-82566-1.stderr
+++ b/src/test/ui/suggestions/issue-82566-1.stderr
@@ -7,7 +7,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | T1::<1>::C;
- | ^^
+ | ++
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
--> $DIR/issue-82566-1.rs:19:9
@@ -18,7 +18,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | T2::<1, 2>::C;
- | ^^
+ | ++
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
--> $DIR/issue-82566-1.rs:20:9
@@ -29,7 +29,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | T3::<1, 2, 3>::C;
- | ^^
+ | ++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/suggestions/issue-82566-2.stderr b/src/test/ui/suggestions/issue-82566-2.stderr
index ea391ee..8f30a30 100644
--- a/src/test/ui/suggestions/issue-82566-2.stderr
+++ b/src/test/ui/suggestions/issue-82566-2.stderr
@@ -7,7 +7,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | fn foo1() -> [(); Foo1::<10>::SUM] {
- | ^^
+ | ++
error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> $DIR/issue-82566-2.rs:21:26
@@ -18,7 +18,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | fn foo2() -> [(); Foo2::<10, 20>::SUM] {
- | ^^
+ | ++
error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> $DIR/issue-82566-2.rs:26:26
@@ -29,7 +29,7 @@
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | fn foo3() -> [(); Foo3::<10, 20, 30>::SUM] {
- | ^^
+ | ++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/suggestions/issue-83943.stderr b/src/test/ui/suggestions/issue-83943.stderr
index a26700e..885106e 100644
--- a/src/test/ui/suggestions/issue-83943.stderr
+++ b/src/test/ui/suggestions/issue-83943.stderr
@@ -6,10 +6,9 @@
| | --------------- expected because of this
LL | | } else {
LL | | "B"
- | | ^^^
+ | | ^^^- help: try using a conversion method: `.to_string()`
| | |
| | expected struct `String`, found `&str`
- | | help: try using a conversion method: `"B".to_string()`
LL | | };
| |_____- `if` and `else` have incompatible types
diff --git a/src/test/ui/suggestions/issue-84592.stderr b/src/test/ui/suggestions/issue-84592.stderr
index 02f9241..70c96fe 100644
--- a/src/test/ui/suggestions/issue-84592.stderr
+++ b/src/test/ui/suggestions/issue-84592.stderr
@@ -10,7 +10,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn two_lifetimes_needed<'a>(a: &'a (), b: &'a ()) -> TwoLifetimes<'a, 'a> {
- | ^^^^ ^^^^^^ ^^^^^^ ^^ ^^
+ | ++++ ++ ++ ~~ ~~
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/issue-84973-2.stderr b/src/test/ui/suggestions/issue-84973-2.stderr
index b6ed437..df1eeb7 100644
--- a/src/test/ui/suggestions/issue-84973-2.stderr
+++ b/src/test/ui/suggestions/issue-84973-2.stderr
@@ -1,14 +1,17 @@
error[E0277]: the trait bound `i32: Tr` is not satisfied
--> $DIR/issue-84973-2.rs:11:9
|
-LL | fn foo<T: Tr>(i: T) {}
- | -- required by this bound in `foo`
-...
LL | foo(a);
| ^
| |
| expected an implementor of trait `Tr`
| help: consider mutably borrowing here: `&mut a`
+ |
+note: required by a bound in `foo`
+ --> $DIR/issue-84973-2.rs:7:11
+ |
+LL | fn foo<T: Tr>(i: T) {}
+ | ^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/issue-84973-blacklist.stderr b/src/test/ui/suggestions/issue-84973-blacklist.stderr
index f1e6ef8..2ffe2f5 100644
--- a/src/test/ui/suggestions/issue-84973-blacklist.stderr
+++ b/src/test/ui/suggestions/issue-84973-blacklist.stderr
@@ -1,53 +1,65 @@
error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/issue-84973-blacklist.rs:15:12
|
-LL | fn f_copy<T: Copy>(t: T) {}
- | ---- required by this bound in `f_copy`
-...
LL | f_copy("".to_string());
| ^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+ |
+note: required by a bound in `f_copy`
+ --> $DIR/issue-84973-blacklist.rs:6:14
+ |
+LL | fn f_copy<T: Copy>(t: T) {}
+ | ^^^^ required by this bound in `f_copy`
error[E0277]: the trait bound `S: Clone` is not satisfied
--> $DIR/issue-84973-blacklist.rs:16:13
|
-LL | fn f_clone<T: Clone>(t: T) {}
- | ----- required by this bound in `f_clone`
-...
LL | f_clone(S);
| ^ the trait `Clone` is not implemented for `S`
+ |
+note: required by a bound in `f_clone`
+ --> $DIR/issue-84973-blacklist.rs:7:15
+ |
+LL | fn f_clone<T: Clone>(t: T) {}
+ | ^^^^^ required by this bound in `f_clone`
error[E0277]: `[static generator@$DIR/issue-84973-blacklist.rs:17:13: 17:33]` cannot be unpinned
--> $DIR/issue-84973-blacklist.rs:17:5
|
-LL | fn f_unpin<T: Unpin>(t: T) {}
- | ----- required by this bound in `f_unpin`
-...
LL | f_unpin(static || { yield; });
| ^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/issue-84973-blacklist.rs:17:13: 17:33]`
|
= note: consider using `Box::pin`
+note: required by a bound in `f_unpin`
+ --> $DIR/issue-84973-blacklist.rs:8:15
+ |
+LL | fn f_unpin<T: Unpin>(t: T) {}
+ | ^^^^^ required by this bound in `f_unpin`
error[E0277]: the size for values of type `dyn Fn()` cannot be known at compilation time
--> $DIR/issue-84973-blacklist.rs:22:13
|
-LL | fn f_sized<T: Sized>(t: T) {}
- | - required by this bound in `f_sized`
-...
LL | f_sized(*ref_cl);
| ^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `dyn Fn()`
+note: required by a bound in `f_sized`
+ --> $DIR/issue-84973-blacklist.rs:9:12
+ |
+LL | fn f_sized<T: Sized>(t: T) {}
+ | ^ required by this bound in `f_sized`
error[E0277]: `Rc<{integer}>` cannot be sent between threads safely
--> $DIR/issue-84973-blacklist.rs:28:12
|
-LL | fn f_send<T: Send>(t: T) {}
- | ---- required by this bound in `f_send`
-...
LL | f_send(rc);
| ^^ `Rc<{integer}>` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Rc<{integer}>`
+note: required by a bound in `f_send`
+ --> $DIR/issue-84973-blacklist.rs:10:14
+ |
+LL | fn f_send<T: Send>(t: T) {}
+ | ^^^^ required by this bound in `f_send`
error[E0277]: the size for values of type `dyn Fn()` cannot be known at compilation time
--> $DIR/issue-84973-blacklist.rs:22:5
diff --git a/src/test/ui/suggestions/issue-84973-negative.stderr b/src/test/ui/suggestions/issue-84973-negative.stderr
index 94513ec..bd1cf6b 100644
--- a/src/test/ui/suggestions/issue-84973-negative.stderr
+++ b/src/test/ui/suggestions/issue-84973-negative.stderr
@@ -1,23 +1,29 @@
error[E0277]: the trait bound `i32: Tr` is not satisfied
--> $DIR/issue-84973-negative.rs:10:9
|
-LL | fn bar<T: Tr>(t: T) {}
- | -- required by this bound in `bar`
-...
LL | bar(a);
| ^ the trait `Tr` is not implemented for `i32`
+ |
+note: required by a bound in `bar`
+ --> $DIR/issue-84973-negative.rs:5:11
+ |
+LL | fn bar<T: Tr>(t: T) {}
+ | ^^ required by this bound in `bar`
error[E0277]: the trait bound `f32: Tr` is not satisfied
--> $DIR/issue-84973-negative.rs:11:9
|
-LL | fn bar<T: Tr>(t: T) {}
- | -- required by this bound in `bar`
-...
LL | bar(b);
| ^
| |
| expected an implementor of trait `Tr`
| help: consider borrowing here: `&b`
+ |
+note: required by a bound in `bar`
+ --> $DIR/issue-84973-negative.rs:5:11
+ |
+LL | fn bar<T: Tr>(t: T) {}
+ | ^^ required by this bound in `bar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/issue-85347.stderr b/src/test/ui/suggestions/issue-85347.stderr
index 60594ba..fccd2ef 100644
--- a/src/test/ui/suggestions/issue-85347.stderr
+++ b/src/test/ui/suggestions/issue-85347.stderr
@@ -12,7 +12,7 @@
help: add missing lifetime argument
|
LL | type Bar<'a>: Deref<Target = <Self>::Bar<'a, Target = Self>>;
- | ^^^
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr b/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr
index 735aeb0..752533c 100644
--- a/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr
+++ b/src/test/ui/suggestions/issue-85943-no-suggest-unsized-indirection-in-where-clause.stderr
@@ -1,12 +1,15 @@
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs:5:10
|
-LL | struct A<T>(T) where T: Send;
- | - required by this bound in `A`
LL | struct B(A<[u8]>);
| ^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
+note: required by a bound in `A`
+ --> $DIR/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs:4:10
+ |
+LL | struct A<T>(T) where T: Send;
+ | ^ required by this bound in `A`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs:4:10
|
diff --git a/src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr b/src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr
index 5753796..9c8356a 100644
--- a/src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr
+++ b/src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr
@@ -11,7 +11,7 @@
help: use a trailing comma to create a tuple with one element
|
LL | let _x: (i32,) = (5,);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/issue-86100-tuple-paren-comma.rs:13:9
@@ -24,7 +24,7 @@
help: use a trailing comma to create a tuple with one element
|
LL | foo((Some(3),));
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-86100-tuple-paren-comma.rs:17:22
@@ -37,7 +37,7 @@
help: use a trailing comma to create a tuple with one element
|
LL | let _s = S { _s: ("abc".to_string(),) };
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-86100-tuple-paren-comma.rs:23:22
diff --git a/src/test/ui/suggestions/issue-86667.stderr b/src/test/ui/suggestions/issue-86667.stderr
index 77f7f87..14dbbff 100644
--- a/src/test/ui/suggestions/issue-86667.stderr
+++ b/src/test/ui/suggestions/issue-86667.stderr
@@ -8,7 +8,7 @@
help: consider introducing a named lifetime parameter
|
LL | async fn a<'a>(s1: &'a str, s2: &'a str) -> &'a str {
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | ++++ ++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/issue-86667.rs:11:29
@@ -20,7 +20,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn b<'a>(s1: &'a str, s2: &'a str) -> &'a str {
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | ++++ ++ ++ ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr
index 05ba780..b279803 100644
--- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr
+++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.nll.stderr
@@ -9,7 +9,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/trait-object-nested-in-impl-trait.rs:39:9
@@ -47,7 +47,7 @@
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
- | ^^^^
+ | ++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
index 9f30787..1ca22eb 100644
--- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
+++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
@@ -17,11 +17,11 @@
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
- | ^^^^
+ | ++++
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> {
- | ^^^^
+ | ++++
error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/trait-object-nested-in-impl-trait.rs:41:31
@@ -42,7 +42,7 @@
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> + '_ {
- | ^^^^
+ | ++++
error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/trait-object-nested-in-impl-trait.rs:52:31
@@ -63,7 +63,7 @@
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo + 'a>> + 'a {
- | ^^^^
+ | ++++
error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/trait-object-nested-in-impl-trait.rs:63:31
@@ -84,11 +84,11 @@
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
- | ^^^^
+ | ++++
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo + 'a>> {
- | ^^^^
+ | ++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/match-ergonomics.stderr b/src/test/ui/suggestions/match-ergonomics.stderr
index ca7562b..4eab2df 100644
--- a/src/test/ui/suggestions/match-ergonomics.stderr
+++ b/src/test/ui/suggestions/match-ergonomics.stderr
@@ -15,12 +15,16 @@
error[E0529]: expected an array or slice, found `Vec<i32>`
--> $DIR/match-ergonomics.rs:8:9
|
+LL | match x {
+ | - help: consider slicing here: `x[..]`
LL | [&v] => {},
| ^^^^ pattern cannot match with input type `Vec<i32>`
error[E0529]: expected an array or slice, found `Vec<i32>`
--> $DIR/match-ergonomics.rs:20:9
|
+LL | match x {
+ | - help: consider slicing here: `x[..]`
LL | [v] => {},
| ^^^ pattern cannot match with input type `Vec<i32>`
diff --git a/src/test/ui/suggestions/match-needing-semi.stderr b/src/test/ui/suggestions/match-needing-semi.stderr
index 3739c99..b5f01d7 100644
--- a/src/test/ui/suggestions/match-needing-semi.stderr
+++ b/src/test/ui/suggestions/match-needing-semi.stderr
@@ -14,11 +14,11 @@
help: consider using a semicolon here
|
LL | foo();
- | ^
+ | +
help: consider using a semicolon here
|
LL | };
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/match-needing-semi.rs:11:5
diff --git a/src/test/ui/suggestions/match-prev-arm-needing-semi.rs b/src/test/ui/suggestions/match-prev-arm-needing-semi.rs
index 3b2cff3..990a446 100644
--- a/src/test/ui/suggestions/match-prev-arm-needing-semi.rs
+++ b/src/test/ui/suggestions/match-prev-arm-needing-semi.rs
@@ -14,8 +14,14 @@
}
async fn async_dummy() {} //~ NOTE checked the `Output` of this `async fn`, found opaque type
+//~| NOTE while checking the return type of the `async fn`
+//~| NOTE in this expansion of desugaring of `async` block or function
async fn async_dummy2() {} //~ NOTE checked the `Output` of this `async fn`, found opaque type
//~| NOTE checked the `Output` of this `async fn`, found opaque type
+//~| NOTE while checking the return type of the `async fn`
+//~| NOTE in this expansion of desugaring of `async` block or function
+//~| NOTE while checking the return type of the `async fn`
+//~| NOTE in this expansion of desugaring of `async` block or function
async fn async_extra_semicolon_same() {
let _ = match true { //~ NOTE `match` arms have incompatible types
@@ -26,7 +32,6 @@
false => async_dummy(), //~ ERROR `match` arms have incompatible types
//~^ NOTE expected `()`, found opaque type
//~| NOTE expected type `()`
- //~| NOTE while checking the return type of the `async fn`
//~| HELP consider `await`ing on the `Future`
};
}
@@ -40,7 +45,6 @@
false => async_dummy2(), //~ ERROR `match` arms have incompatible types
//~^ NOTE expected `()`, found opaque type
//~| NOTE expected type `()`
- //~| NOTE while checking the return type of the `async fn`
//~| HELP consider `await`ing on the `Future`
};
}
@@ -53,7 +57,6 @@
//~^ NOTE expected opaque type, found a different opaque type
//~| NOTE expected type `impl Future`
//~| NOTE distinct uses of `impl Trait` result in different opaque types
- //~| NOTE while checking the return type of the `async fn`
};
}
diff --git a/src/test/ui/suggestions/match-prev-arm-needing-semi.stderr b/src/test/ui/suggestions/match-prev-arm-needing-semi.stderr
index e31ea96..a8f7f3c 100644
--- a/src/test/ui/suggestions/match-prev-arm-needing-semi.stderr
+++ b/src/test/ui/suggestions/match-prev-arm-needing-semi.stderr
@@ -1,9 +1,6 @@
error[E0308]: `match` arms have incompatible types
- --> $DIR/match-prev-arm-needing-semi.rs:26:18
+ --> $DIR/match-prev-arm-needing-semi.rs:32:18
|
-LL | async fn async_dummy() {}
- | - checked the `Output` of this `async fn`, found opaque type
-...
LL | let _ = match true {
| _____________-
LL | | true => {
@@ -18,24 +15,26 @@
LL | | };
| |_____- `match` arms have incompatible types
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/match-prev-arm-needing-semi.rs:16:24
+ |
+LL | async fn async_dummy() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `()`
found opaque type `impl Future`
help: consider `await`ing on the `Future`
|
LL | false => async_dummy().await,
- | ^^^^^^
+ | ++++++
help: consider removing this semicolon
|
-LL | async_dummy()
- | --
+LL - async_dummy();
+LL + async_dummy()
+ |
error[E0308]: `match` arms have incompatible types
- --> $DIR/match-prev-arm-needing-semi.rs:40:18
+ --> $DIR/match-prev-arm-needing-semi.rs:45:18
|
-LL | async fn async_dummy2() {}
- | - checked the `Output` of this `async fn`, found opaque type
-...
LL | let _ = match true {
| _____________-
LL | | true => {
@@ -50,27 +49,28 @@
LL | | };
| |_____- `match` arms have incompatible types
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/match-prev-arm-needing-semi.rs:19:25
+ |
+LL | async fn async_dummy2() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `()`
found opaque type `impl Future`
help: consider `await`ing on the `Future`
|
LL | false => async_dummy2().await,
- | ^^^^^^
+ | ++++++
help: consider removing this semicolon and boxing the expressions
|
-LL | Box::new(async_dummy())
+LL ~ Box::new(async_dummy())
LL |
LL | }
-LL | false => Box::new(async_dummy2()),
+LL ~ false => Box::new(async_dummy2()),
|
error[E0308]: `match` arms have incompatible types
- --> $DIR/match-prev-arm-needing-semi.rs:52:18
+ --> $DIR/match-prev-arm-needing-semi.rs:56:18
|
-LL | async fn async_dummy2() {}
- | - checked the `Output` of this `async fn`, found opaque type
-...
LL | let _ = match true {
| _____________-
LL | | true => async_dummy(),
@@ -83,15 +83,19 @@
LL | | };
| |_____- `match` arms have incompatible types
|
- = note: while checking the return type of the `async fn`
+note: while checking the return type of the `async fn`
+ --> $DIR/match-prev-arm-needing-semi.rs:19:25
+ |
+LL | async fn async_dummy2() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
= note: expected type `impl Future` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:16:24>)
- found opaque type `impl Future` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:17:25>)
+ found opaque type `impl Future` (opaque type at <$DIR/match-prev-arm-needing-semi.rs:19:25>)
= note: distinct uses of `impl Trait` result in different opaque types
help: consider `await`ing on both `Future`s
|
-LL | true => async_dummy().await,
+LL ~ true => async_dummy().await,
LL |
-LL | false => async_dummy2().await,
+LL ~ false => async_dummy2().await,
|
error[E0308]: `match` arms have incompatible types
diff --git a/src/test/ui/suggestions/method-missing-parentheses.stderr b/src/test/ui/suggestions/method-missing-parentheses.stderr
index 04c67ec..1bfff56 100644
--- a/src/test/ui/suggestions/method-missing-parentheses.stderr
+++ b/src/test/ui/suggestions/method-missing-parentheses.stderr
@@ -13,7 +13,7 @@
help: use parentheses to call the method
|
LL | let _ = vec![].into_iter().collect::<usize>();
- | ^^
+ | ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr b/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr
index b20778c..1ecaade 100644
--- a/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr
+++ b/src/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr
@@ -7,11 +7,11 @@
help: consider using the `'static` lifetime
|
LL | const A: &'static str = "";
- | ^^^^^^^
+ | +++++++
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
-LL | const A: &'a str = "";
+LL ~ trait ZstAssert<'a>: Sized {
+LL ~ const A: &'a str = "";
|
error[E0106]: missing lifetime specifier
@@ -23,12 +23,12 @@
help: consider using the `'static` lifetime
|
LL | const B: S<'static> = S { s: &() };
- | ^^^^^^^^^
+ | +++++++++
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
+LL ~ trait ZstAssert<'a>: Sized {
LL | const A: &str = "";
-LL | const B: S<'a> = S { s: &() };
+LL ~ const B: S<'a> = S { s: &() };
|
error[E0106]: missing lifetime specifier
@@ -40,13 +40,13 @@
help: consider using the `'static` lifetime
|
LL | const C: &'static str = "";
- | ^^^^^^^
+ | ~~~~~~~
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
+LL ~ trait ZstAssert<'a>: Sized {
LL | const A: &str = "";
LL | const B: S = S { s: &() };
-LL | const C: &'a str = "";
+LL ~ const C: &'a str = "";
|
error[E0106]: missing lifetime specifiers
@@ -58,14 +58,14 @@
help: consider using the `'static` lifetime
|
LL | const D: T<'static, 'static> = T { a: &(), b: &() };
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
+LL ~ trait ZstAssert<'a>: Sized {
LL | const A: &str = "";
LL | const B: S = S { s: &() };
LL | const C: &'_ str = "";
-LL | const D: T<'a, 'a> = T { a: &(), b: &() };
+LL ~ const D: T<'a, 'a> = T { a: &(), b: &() };
|
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/missing-lifetime-specifier.stderr b/src/test/ui/suggestions/missing-lifetime-specifier.stderr
index 8ddd2f7..bf54638 100644
--- a/src/test/ui/suggestions/missing-lifetime-specifier.stderr
+++ b/src/test/ui/suggestions/missing-lifetime-specifier.stderr
@@ -8,7 +8,7 @@
help: consider using the `'static` lifetime
|
LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:18:44
@@ -20,7 +20,7 @@
help: consider using the `'static` lifetime
|
LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:23:44
@@ -32,7 +32,7 @@
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:23:45
@@ -44,7 +44,7 @@
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:23:44
@@ -56,7 +56,7 @@
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:23:45
@@ -68,7 +68,7 @@
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:30:48
@@ -80,7 +80,7 @@
help: consider using the `'static` lifetime
|
LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:30:48
@@ -92,7 +92,7 @@
help: consider using the `'static` lifetime
|
LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:35:44
@@ -104,7 +104,7 @@
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:35:49
@@ -116,7 +116,7 @@
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:35:44
@@ -128,7 +128,7 @@
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:35:49
@@ -140,7 +140,7 @@
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
@@ -158,7 +158,7 @@
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
@@ -176,7 +176,7 @@
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
@@ -194,7 +194,7 @@
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
@@ -212,7 +212,7 @@
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
@@ -230,7 +230,7 @@
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:50:44
@@ -242,7 +242,7 @@
help: consider using the `'static` lifetime
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
@@ -260,7 +260,7 @@
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:50:44
@@ -272,7 +272,7 @@
help: consider using the `'static` lifetime
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
@@ -290,7 +290,7 @@
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
@@ -308,7 +308,7 @@
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error: aborting due to 22 previous errors
diff --git a/src/test/ui/suggestions/missing-lt-for-hrtb.stderr b/src/test/ui/suggestions/missing-lt-for-hrtb.stderr
index a7a44b5..33f9d09 100644
--- a/src/test/ui/suggestions/missing-lt-for-hrtb.stderr
+++ b/src/test/ui/suggestions/missing-lt-for-hrtb.stderr
@@ -9,11 +9,11 @@
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | struct S<'a>(&'a dyn for<'b> Fn(&'b X) -> &'b X);
- | ^^^^^^^ ^^^^^ ^^^
+ | +++++++ ~~~~~ ~~~
help: consider using the `'a` lifetime
|
LL | struct S<'a>(&'a dyn Fn(&X) -> &'a X);
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lt-for-hrtb.rs:2:33
@@ -26,11 +26,11 @@
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | struct S<'a>(&'a dyn for<'b> Fn(&'b X) -> &X<'b>);
- | ^^^^^^^ ^^^^^ ^^^^^
+ | +++++++ ~~~~~ ~~~~~
help: consider using the `'a` lifetime
|
LL | struct S<'a>(&'a dyn Fn(&X) -> &X<'a>);
- | ^^^^^
+ | ~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lt-for-hrtb.rs:5:40
@@ -47,7 +47,7 @@
help: consider using one of the available lifetimes here
|
LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &'lifetime X);
- | ^^^^^^^^^^
+ | +++++++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lt-for-hrtb.rs:5:41
diff --git a/src/test/ui/suggestions/missing-trait-bound-for-op.stderr b/src/test/ui/suggestions/missing-trait-bound-for-op.stderr
index 0e0d397..cde0755 100644
--- a/src/test/ui/suggestions/missing-trait-bound-for-op.stderr
+++ b/src/test/ui/suggestions/missing-trait-bound-for-op.stderr
@@ -9,7 +9,7 @@
help: consider restricting type parameter `T`
|
LL | pub fn foo<T: std::cmp::PartialEq>(s: &[T], t: &[T]) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/missing-trait-bounds-for-method-call.stderr b/src/test/ui/suggestions/missing-trait-bounds-for-method-call.stderr
index 0a64a0d..2f0fd69 100644
--- a/src/test/ui/suggestions/missing-trait-bounds-for-method-call.stderr
+++ b/src/test/ui/suggestions/missing-trait-bounds-for-method-call.stderr
@@ -15,7 +15,7 @@
help: consider restricting the type parameters to satisfy the trait bounds
|
LL | struct Foo<T> where T: Bar, T: Default {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++
error[E0599]: the method `foo` exists for reference `&Fin<T>`, but its trait bounds were not satisfied
--> $DIR/missing-trait-bounds-for-method-call.rs:27:14
@@ -32,7 +32,7 @@
help: consider restricting the type parameter to satisfy the trait bound
|
LL | struct Fin<T> where T: Bar, T: Default {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/multibyte-escapes.rs b/src/test/ui/suggestions/multibyte-escapes.rs
new file mode 100644
index 0000000..fd5d46a
--- /dev/null
+++ b/src/test/ui/suggestions/multibyte-escapes.rs
@@ -0,0 +1,18 @@
+// Regression test for #87397.
+
+fn main() {
+ b'µ';
+ //~^ ERROR: non-ASCII character in byte constant
+ //~| HELP: if you meant to use the unicode code point for 'µ', use a \xHH escape
+ //~| NOTE: byte constant must be ASCII
+
+ b'字';
+ //~^ ERROR: non-ASCII character in byte constant
+ //~| NOTE: this multibyte character does not fit into a single byte
+ //~| NOTE: byte constant must be ASCII
+
+ b"字";
+ //~^ ERROR: non-ASCII character in byte constant
+ //~| HELP: if you meant to use the UTF-8 encoding of '字', use \xHH escapes
+ //~| NOTE: byte constant must be ASCII
+}
diff --git a/src/test/ui/suggestions/multibyte-escapes.stderr b/src/test/ui/suggestions/multibyte-escapes.stderr
new file mode 100644
index 0000000..6e26bc1
--- /dev/null
+++ b/src/test/ui/suggestions/multibyte-escapes.stderr
@@ -0,0 +1,33 @@
+error: non-ASCII character in byte constant
+ --> $DIR/multibyte-escapes.rs:4:7
+ |
+LL | b'µ';
+ | ^ byte constant must be ASCII
+ |
+help: if you meant to use the unicode code point for 'µ', use a \xHH escape
+ |
+LL | b'\xB5';
+ | ~~~~
+
+error: non-ASCII character in byte constant
+ --> $DIR/multibyte-escapes.rs:9:7
+ |
+LL | b'字';
+ | ^^
+ | |
+ | byte constant must be ASCII
+ | this multibyte character does not fit into a single byte
+
+error: non-ASCII character in byte constant
+ --> $DIR/multibyte-escapes.rs:14:7
+ |
+LL | b"字";
+ | ^^ byte constant must be ASCII
+ |
+help: if you meant to use the UTF-8 encoding of '字', use \xHH escapes
+ |
+LL | b"\xE5\xAD\x97";
+ | ~~~~~~~~~~~~
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
index 4d1b530..3b71d5c 100644
--- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
+++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
@@ -16,20 +16,20 @@
|
LL | let fp = BufWriter::new(fp);
| ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
- |
- ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
- |
-LL | pub struct BufWriter<W: Write> {
- | ----- required by this bound in `BufWriter`
|
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
+note: required by a bound in `BufWriter`
+ --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
+ |
+LL | pub struct BufWriter<W: Write> {
+ | ^^^^^ required by this bound in `BufWriter`
error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn std::io::Write>`, but its trait bounds were not satisfied
--> $DIR/mut-borrow-needed-by-trait.rs:21:5
|
LL | writeln!(fp, "hello world").unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn std::io::Write>` due to unsatisfied trait bounds
- |
+ |
::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
|
LL | pub struct BufWriter<W: Write> {
diff --git a/src/test/ui/suggestions/mut-ref-reassignment.stderr b/src/test/ui/suggestions/mut-ref-reassignment.stderr
index 327bbee..fd56778 100644
--- a/src/test/ui/suggestions/mut-ref-reassignment.stderr
+++ b/src/test/ui/suggestions/mut-ref-reassignment.stderr
@@ -9,7 +9,7 @@
help: consider dereferencing here to assign to the mutable borrowed piece of memory
|
LL | *opt = None;
- | ^^^^
+ | +
error[E0308]: mismatched types
--> $DIR/mut-ref-reassignment.rs:6:11
@@ -31,7 +31,7 @@
help: consider dereferencing here to assign to the mutable borrowed piece of memory
|
LL | *opt = Some(String::new())
- | ^^^^
+ | +
error[E0308]: mismatched types
--> $DIR/mut-ref-reassignment.rs:14:11
diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield.stderr b/src/test/ui/suggestions/non-existent-field-present-in-subfield.stderr
index ddb7476..cc991b9 100644
--- a/src/test/ui/suggestions/non-existent-field-present-in-subfield.stderr
+++ b/src/test/ui/suggestions/non-existent-field-present-in-subfield.stderr
@@ -8,7 +8,7 @@
help: one of the expressions' fields has a field of the same name
|
LL | let _test = &fooer.first.bar.c;
- | ^^^^^^^^^^
+ | ++++++++++
error[E0609]: no field `test` on type `Foo`
--> $DIR/non-existent-field-present-in-subfield.rs:40:24
@@ -20,7 +20,7 @@
help: one of the expressions' fields has a field of the same name
|
LL | let _test2 = fooer.first.bar.c.test;
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/object-unsafe-trait-should-use-self.stderr b/src/test/ui/suggestions/object-unsafe-trait-should-use-self.stderr
index 67491b0..55047b4 100644
--- a/src/test/ui/suggestions/object-unsafe-trait-should-use-self.stderr
+++ b/src/test/ui/suggestions/object-unsafe-trait-should-use-self.stderr
@@ -9,7 +9,7 @@
help: you might have meant to use `Self` to refer to the implementing type
|
LL | fn f(a: Self) -> Self;
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error[E0038]: the trait `A` cannot be made into an object
--> $DIR/object-unsafe-trait-should-use-self.rs:3:13
@@ -36,7 +36,7 @@
help: you might have meant to use `Self` to refer to the implementing type
|
LL | fn f(a: Self) -> Self;
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error[E0038]: the trait `B` cannot be made into an object
--> $DIR/object-unsafe-trait-should-use-self.rs:8:13
@@ -54,11 +54,11 @@
help: consider turning `f` into a method by giving it a `&self` argument
|
LL | fn f(&self, a: B) -> B;
- | ^^^^^^
+ | ++++++
help: alternatively, consider constraining `f` so it does not apply to trait objects
|
LL | fn f(a: B) -> B where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr b/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr
index 4c18f6d..74237e6 100644
--- a/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr
+++ b/src/test/ui/suggestions/object-unsafe-trait-should-use-where-sized.stderr
@@ -1,3 +1,12 @@
+error[E0307]: invalid `self` parameter type: ()
+ --> $DIR/object-unsafe-trait-should-use-where-sized.rs:6:18
+ |
+LL | fn bar(self: ()) {}
+ | ^^
+ |
+ = note: type of `self` must be `Self` or a type that dereferences to it
+ = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
+
error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/object-unsafe-trait-should-use-where-sized.rs:9:12
|
@@ -16,24 +25,15 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) where Self: Other, { }
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Other, Self: Sized, { }
- | ^^^^^^^^^^^^^
+ | +++++++++++++
help: consider changing method `bar`'s `self` parameter to be `&self`
|
LL | fn bar(self: &Self) {}
- | ^^^^^
-
-error[E0307]: invalid `self` parameter type: ()
- --> $DIR/object-unsafe-trait-should-use-where-sized.rs:6:18
- |
-LL | fn bar(self: ()) {}
- | ^^
- |
- = note: type of `self` must be `Self` or a type that dereferences to it
- = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
+ | ~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/opaque-type-error.stderr b/src/test/ui/suggestions/opaque-type-error.stderr
index d74076c..8510737 100644
--- a/src/test/ui/suggestions/opaque-type-error.stderr
+++ b/src/test/ui/suggestions/opaque-type-error.stderr
@@ -18,9 +18,9 @@
= note: distinct uses of `impl Trait` result in different opaque types
help: consider `await`ing on both `Future`s
|
-LL | thing_one().await
+LL ~ thing_one().await
LL | } else {
-LL | thing_two().await
+LL ~ thing_two().await
|
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/option-content-move.stderr b/src/test/ui/suggestions/option-content-move.stderr
index c00a0f1..a9e5400 100644
--- a/src/test/ui/suggestions/option-content-move.stderr
+++ b/src/test/ui/suggestions/option-content-move.stderr
@@ -2,19 +2,23 @@
--> $DIR/option-content-move.rs:11:20
|
LL | if selection.1.unwrap().contains(selection.0) {
- | ^^^^^^^^^^^
- | |
- | move occurs because `selection.1` has type `Option<String>`, which does not implement the `Copy` trait
- | help: consider borrowing the `Option`'s content: `selection.1.as_ref()`
+ | ^^^^^^^^^^^ move occurs because `selection.1` has type `Option<String>`, which does not implement the `Copy` trait
+ |
+help: consider borrowing the `Option`'s content
+ |
+LL | if selection.1.as_ref().unwrap().contains(selection.0) {
+ | +++++++++
error[E0507]: cannot move out of `selection.1` which is behind a shared reference
--> $DIR/option-content-move.rs:29:20
|
LL | if selection.1.unwrap().contains(selection.0) {
- | ^^^^^^^^^^^
- | |
- | move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait
- | help: consider borrowing the `Result`'s content: `selection.1.as_ref()`
+ | ^^^^^^^^^^^ move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait
+ |
+help: consider borrowing the `Result`'s content
+ |
+LL | if selection.1.as_ref().unwrap().contains(selection.0) {
+ | +++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/path-by-value.stderr b/src/test/ui/suggestions/path-by-value.stderr
index 5919a6f..bbeaa26 100644
--- a/src/test/ui/suggestions/path-by-value.stderr
+++ b/src/test/ui/suggestions/path-by-value.stderr
@@ -10,7 +10,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f(p: &Path) { }
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/pattern-slice-vec.fixed b/src/test/ui/suggestions/pattern-slice-vec.fixed
new file mode 100644
index 0000000..447337c
--- /dev/null
+++ b/src/test/ui/suggestions/pattern-slice-vec.fixed
@@ -0,0 +1,27 @@
+// Regression test for #87017.
+
+// run-rustfix
+
+fn main() {
+ fn foo() -> Vec<i32> { vec![1, 2, 3] }
+
+ if let [_, _, _] = foo()[..] {}
+ //~^ ERROR: expected an array or slice
+ //~| HELP: consider slicing here
+
+ if let [] = &foo()[..] {}
+ //~^ ERROR: expected an array or slice
+ //~| HELP: consider slicing here
+
+ if let [] = foo()[..] {}
+ //~^ ERROR: expected an array or slice
+ //~| HELP: consider slicing here
+
+ let v = vec![];
+ match &v[..] {
+ //~^ HELP: consider slicing here
+ [5] => {}
+ //~^ ERROR: expected an array or slice
+ _ => {}
+ }
+}
diff --git a/src/test/ui/suggestions/pattern-slice-vec.rs b/src/test/ui/suggestions/pattern-slice-vec.rs
new file mode 100644
index 0000000..1153ca0
--- /dev/null
+++ b/src/test/ui/suggestions/pattern-slice-vec.rs
@@ -0,0 +1,27 @@
+// Regression test for #87017.
+
+// run-rustfix
+
+fn main() {
+ fn foo() -> Vec<i32> { vec![1, 2, 3] }
+
+ if let [_, _, _] = foo() {}
+ //~^ ERROR: expected an array or slice
+ //~| HELP: consider slicing here
+
+ if let [] = &foo() {}
+ //~^ ERROR: expected an array or slice
+ //~| HELP: consider slicing here
+
+ if let [] = foo() {}
+ //~^ ERROR: expected an array or slice
+ //~| HELP: consider slicing here
+
+ let v = vec![];
+ match &v {
+ //~^ HELP: consider slicing here
+ [5] => {}
+ //~^ ERROR: expected an array or slice
+ _ => {}
+ }
+}
diff --git a/src/test/ui/suggestions/pattern-slice-vec.stderr b/src/test/ui/suggestions/pattern-slice-vec.stderr
new file mode 100644
index 0000000..403a816
--- /dev/null
+++ b/src/test/ui/suggestions/pattern-slice-vec.stderr
@@ -0,0 +1,36 @@
+error[E0529]: expected an array or slice, found `Vec<i32>`
+ --> $DIR/pattern-slice-vec.rs:8:12
+ |
+LL | if let [_, _, _] = foo() {}
+ | ^^^^^^^^^ ----- help: consider slicing here: `foo()[..]`
+ | |
+ | pattern cannot match with input type `Vec<i32>`
+
+error[E0529]: expected an array or slice, found `Vec<i32>`
+ --> $DIR/pattern-slice-vec.rs:12:12
+ |
+LL | if let [] = &foo() {}
+ | ^^ ------ help: consider slicing here: `&foo()[..]`
+ | |
+ | pattern cannot match with input type `Vec<i32>`
+
+error[E0529]: expected an array or slice, found `Vec<i32>`
+ --> $DIR/pattern-slice-vec.rs:16:12
+ |
+LL | if let [] = foo() {}
+ | ^^ ----- help: consider slicing here: `foo()[..]`
+ | |
+ | pattern cannot match with input type `Vec<i32>`
+
+error[E0529]: expected an array or slice, found `Vec<_>`
+ --> $DIR/pattern-slice-vec.rs:23:9
+ |
+LL | match &v {
+ | -- help: consider slicing here: `&v[..]`
+LL |
+LL | [5] => {}
+ | ^^^ pattern cannot match with input type `Vec<_>`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0529`.
diff --git a/src/test/ui/suggestions/raw-byte-string-prefix.rs b/src/test/ui/suggestions/raw-byte-string-prefix.rs
new file mode 100644
index 0000000..576561c
--- /dev/null
+++ b/src/test/ui/suggestions/raw-byte-string-prefix.rs
@@ -0,0 +1,10 @@
+// `br` and `rb` are easy to confuse; check that we issue a suggestion to help.
+
+// edition:2021
+
+fn main() {
+ rb"abc";
+ //~^ ERROR: prefix `rb` is unknown
+ //~| HELP: use `br` for a raw byte string
+ //~| ERROR: expected one of
+}
diff --git a/src/test/ui/suggestions/raw-byte-string-prefix.stderr b/src/test/ui/suggestions/raw-byte-string-prefix.stderr
new file mode 100644
index 0000000..4f51068
--- /dev/null
+++ b/src/test/ui/suggestions/raw-byte-string-prefix.stderr
@@ -0,0 +1,20 @@
+error: prefix `rb` is unknown
+ --> $DIR/raw-byte-string-prefix.rs:6:5
+ |
+LL | rb"abc";
+ | ^^ unknown prefix
+ |
+ = note: prefixed identifiers and literals are reserved since Rust 2021
+help: use `br` for a raw byte string
+ |
+LL | br"abc";
+ | ~~
+
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"abc"`
+ --> $DIR/raw-byte-string-prefix.rs:6:7
+ |
+LL | rb"abc";
+ | ^^^^^ expected one of 8 possible tokens
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/suggestions/raw-name-use-suggestion.stderr b/src/test/ui/suggestions/raw-name-use-suggestion.stderr
index 7447cf8..bfefc14 100644
--- a/src/test/ui/suggestions/raw-name-use-suggestion.stderr
+++ b/src/test/ui/suggestions/raw-name-use-suggestion.stderr
@@ -7,7 +7,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | pub fn r#break() {}
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `let`
--> $DIR/raw-name-use-suggestion.rs:7:10
@@ -18,7 +18,7 @@
help: you can escape reserved keywords to use them as identifiers
|
LL | foo::r#let();
- | ^^^^^
+ | ~~~~~
error[E0425]: cannot find function `r#break` in this scope
--> $DIR/raw-name-use-suggestion.rs:8:5
diff --git a/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr b/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr
index 981f957..618ccba 100644
--- a/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr
+++ b/src/test/ui/suggestions/recover-missing-turbofish-surrounding-angle-braket.stderr
@@ -7,7 +7,7 @@
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + +
error: generic parameters without surrounding angle brackets
--> $DIR/recover-missing-turbofish-surrounding-angle-braket.rs:4:48
@@ -18,7 +18,7 @@
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + ~
error: generic parameters without surrounding angle brackets
--> $DIR/recover-missing-turbofish-surrounding-angle-braket.rs:6:48
@@ -29,7 +29,7 @@
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + ~
error: generic parameters without surrounding angle brackets
--> $DIR/recover-missing-turbofish-surrounding-angle-braket.rs:8:48
@@ -40,7 +40,7 @@
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + ~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/restrict-type-argument.stderr b/src/test/ui/suggestions/restrict-type-argument.stderr
index 33af13d..b62502f 100644
--- a/src/test/ui/suggestions/restrict-type-argument.stderr
+++ b/src/test/ui/suggestions/restrict-type-argument.stderr
@@ -1,86 +1,98 @@
error[E0277]: `impl Sync` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:4:13
|
-LL | fn is_send<T: Send>(val: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(val);
| ^^^ `impl Sync` cannot be sent between threads safely
|
+note: required by a bound in `is_send`
+ --> $DIR/restrict-type-argument.rs:1:15
+ |
+LL | fn is_send<T: Send>(val: T) {}
+ | ^^^^ required by this bound in `is_send`
help: consider further restricting this bound
|
LL | fn use_impl_sync(val: impl Sync + std::marker::Send) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:8:13
|
-LL | fn is_send<T: Send>(val: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
+note: required by a bound in `is_send`
+ --> $DIR/restrict-type-argument.rs:1:15
+ |
+LL | fn is_send<T: Send>(val: T) {}
+ | ^^^^ required by this bound in `is_send`
help: consider further restricting this bound
|
LL | fn use_where<S>(val: S) where S: Sync + std::marker::Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:12:13
|
-LL | fn is_send<T: Send>(val: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
+note: required by a bound in `is_send`
+ --> $DIR/restrict-type-argument.rs:1:15
+ |
+LL | fn is_send<T: Send>(val: T) {}
+ | ^^^^ required by this bound in `is_send`
help: consider further restricting this bound
|
LL | fn use_bound<S: Sync + std::marker::Send>(val: S) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:20:13
|
-LL | fn is_send<T: Send>(val: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
+note: required by a bound in `is_send`
+ --> $DIR/restrict-type-argument.rs:1:15
+ |
+LL | fn is_send<T: Send>(val: T) {}
+ | ^^^^ required by this bound in `is_send`
help: consider further restricting this bound
|
LL | Sync + std::marker::Send
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:24:13
|
-LL | fn is_send<T: Send>(val: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
+note: required by a bound in `is_send`
+ --> $DIR/restrict-type-argument.rs:1:15
+ |
+LL | fn is_send<T: Send>(val: T) {}
+ | ^^^^ required by this bound in `is_send`
help: consider further restricting this bound
|
LL | fn use_bound_and_where<S: Sync>(val: S) where S: std::fmt::Debug + std::marker::Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:28:13
|
-LL | fn is_send<T: Send>(val: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(val);
| ^^^ `S` cannot be sent between threads safely
|
+note: required by a bound in `is_send`
+ --> $DIR/restrict-type-argument.rs:1:15
+ |
+LL | fn is_send<T: Send>(val: T) {}
+ | ^^^^ required by this bound in `is_send`
help: consider restricting type parameter `S`
|
LL | fn use_unbound<S: std::marker::Send>(val: S) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/suggestions/return-elided-lifetime.stderr b/src/test/ui/suggestions/return-elided-lifetime.stderr
index 888cd5e..f147b44 100644
--- a/src/test/ui/suggestions/return-elided-lifetime.stderr
+++ b/src/test/ui/suggestions/return-elided-lifetime.stderr
@@ -8,7 +8,7 @@
help: consider using the `'static` lifetime
|
LL | fn f1() -> &'static i32 { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:8:14
@@ -20,7 +20,7 @@
help: consider using the `'static` lifetime
|
LL | fn f1_() -> (&'static i32, &i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:8:20
@@ -32,7 +32,7 @@
help: consider using the `'static` lifetime
|
LL | fn f1_() -> (&i32, &'static i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:12:26
@@ -44,7 +44,7 @@
help: consider using the `'static` lifetime
|
LL | fn f2(a: i32, b: i32) -> &'static i32 { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:14:28
@@ -56,7 +56,7 @@
help: consider using the `'static` lifetime
|
LL | fn f2_(a: i32, b: i32) -> (&'static i32, &i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:14:34
@@ -68,7 +68,7 @@
help: consider using the `'static` lifetime
|
LL | fn f2_(a: i32, b: i32) -> (&i32, &'static i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:19:17
@@ -80,7 +80,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn f3<'a>(s: &'a S) -> &'a i32 { loop {} }
- | ^^^^ ^^^^^ ^^^
+ | ++++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:21:26
@@ -92,7 +92,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&'a i32, &i32) { loop {} }
- | ^^^^ ^^^^^ ^^^^^ ^^^
+ | ++++ ++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:21:32
@@ -104,7 +104,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&i32, &'a i32) { loop {} }
- | ^^^^ ^^^^^ ^^^^^ ^^^
+ | ++++ ++ ++ ++
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:25:42
@@ -121,7 +121,7 @@
help: consider using one of the available lifetimes here
|
LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &'lifetime i32 { loop {} }
- | ^^^^^^^^^^
+ | +++++++++
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:27:44
@@ -138,7 +138,7 @@
help: consider using one of the available lifetimes here
|
LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&'lifetime i32, &i32) { loop {} }
- | ^^^^^^^^^^
+ | +++++++++
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:27:50
@@ -155,7 +155,7 @@
help: consider using one of the available lifetimes here
|
LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &'lifetime i32) { loop {} }
- | ^^^^^^^^^^
+ | +++++++++
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:31:35
@@ -167,7 +167,7 @@
help: consider using the `'a` lifetime
|
LL | fn f5<'a>(a: &'a i32, b: &i32) -> &'a i32 { loop {} }
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:33:37
@@ -179,7 +179,7 @@
help: consider using the `'a` lifetime
|
LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&'a i32, &i32) { loop {} }
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:33:43
@@ -191,7 +191,7 @@
help: consider using the `'a` lifetime
|
LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &'a i32) { loop {} }
- | ^^^
+ | ~~~
error: aborting due to 15 previous errors
diff --git a/src/test/ui/suggestions/return-without-lifetime.stderr b/src/test/ui/suggestions/return-without-lifetime.stderr
index 2a237d6..449a61d 100644
--- a/src/test/ui/suggestions/return-without-lifetime.stderr
+++ b/src/test/ui/suggestions/return-without-lifetime.stderr
@@ -7,7 +7,7 @@
help: consider using the `'a` lifetime
|
LL | struct Foo<'a>(&'a usize);
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-without-lifetime.rs:5:34
@@ -19,7 +19,7 @@
help: consider using the `'a` lifetime
|
LL | fn func1<'a>(_arg: &'a Thing) -> &'a () { unimplemented!() }
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-without-lifetime.rs:7:35
@@ -31,7 +31,7 @@
help: consider using the `'a` lifetime
|
LL | fn func2<'a>(_arg: &Thing<'a>) -> &'a () { unimplemented!() }
- | ^^^
+ | ~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/suggestions/suggest-box.stderr b/src/test/ui/suggestions/suggest-box.stderr
index 8107fd8..d5c49a4 100644
--- a/src/test/ui/suggestions/suggest-box.stderr
+++ b/src/test/ui/suggestions/suggest-box.stderr
@@ -15,10 +15,10 @@
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
help: store this in the heap by calling `Box::new`
|
-LL | let _x: Box<dyn Fn() -> Result<(), ()>> = Box::new(|| {
+LL ~ let _x: Box<dyn Fn() -> Result<(), ()>> = Box::new(|| {
LL | Err(())?;
LL | Ok(())
-LL | });
+LL ~ });
|
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-change-mut.stderr b/src/test/ui/suggestions/suggest-change-mut.stderr
index e68152d..1f14eba 100644
--- a/src/test/ui/suggestions/suggest-change-mut.stderr
+++ b/src/test/ui/suggestions/suggest-change-mut.stderr
@@ -11,23 +11,24 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider removing the leading `&`-reference
|
-LL | let mut stream_reader = BufReader::new(stream);
- | --
+LL - let mut stream_reader = BufReader::new(&stream);
+LL + let mut stream_reader = BufReader::new(stream);
+ |
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn issue_81421<T: Read + Write>(mut stream: T) where &T: std::io::Read {
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++
help: consider changing this borrow's mutability
|
LL | let mut stream_reader = BufReader::new(&mut stream);
- | ^^^^
+ | ~~~~
error[E0599]: the method `read_until` exists for struct `BufReader<&T>`, but its trait bounds were not satisfied
--> $DIR/suggest-change-mut.rs:16:23
|
LL | stream_reader.read_until(b'\n', &mut buffer).expect("Reading into buffer failed");
| ^^^^^^^^^^ method cannot be called on `BufReader<&T>` due to unsatisfied trait bounds
- |
+ |
::: $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL
|
LL | pub struct BufReader<R> {
diff --git a/src/test/ui/suggestions/suggest-closure-return-type-1.stderr b/src/test/ui/suggestions/suggest-closure-return-type-1.stderr
index 7ef9590..7161ca3 100644
--- a/src/test/ui/suggestions/suggest-closure-return-type-1.stderr
+++ b/src/test/ui/suggestions/suggest-closure-return-type-1.stderr
@@ -7,7 +7,7 @@
help: give this closure an explicit return type without `_` placeholders
|
LL | let _v = || -> [_; 0] { [] };
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-closure-return-type-2.stderr b/src/test/ui/suggestions/suggest-closure-return-type-2.stderr
index 2a8d7dd..a7f5b58 100644
--- a/src/test/ui/suggestions/suggest-closure-return-type-2.stderr
+++ b/src/test/ui/suggestions/suggest-closure-return-type-2.stderr
@@ -7,7 +7,7 @@
help: give this closure an explicit return type without `_` placeholders
|
LL | let _v = || -> [_; 0] { [] };
- | ^^^^^^^^^
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-closure-return-type-3.stderr b/src/test/ui/suggestions/suggest-closure-return-type-3.stderr
index 67dc4d8..eeec23e 100644
--- a/src/test/ui/suggestions/suggest-closure-return-type-3.stderr
+++ b/src/test/ui/suggestions/suggest-closure-return-type-3.stderr
@@ -7,7 +7,7 @@
help: give this closure an explicit return type without `_` placeholders
|
LL | let _v = || -> [_; 0] { [] };
- | ^^^^^^^^^^^ ^
+ | +++++++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
index 589ee1a..65aab97 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.fixed
@@ -9,7 +9,7 @@
//~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
}
-fn bar(d: impl Debug + 'static) {
+fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound
println!("{:?}", d)
}
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
index 9a87129..fb1848d 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.rs
@@ -9,7 +9,7 @@
//~| NOTE ...so that the type `impl Debug` will meet its required lifetime bounds
}
-fn bar(d: impl Debug + 'static) {
+fn bar(d: impl Debug + 'static) { //~ NOTE ...that is required by this bound
println!("{:?}", d)
}
diff --git a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
index 643dac2..e4a2479 100644
--- a/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
+++ b/src/test/ui/suggestions/suggest-impl-trait-lifetime.stderr
@@ -5,7 +5,13 @@
| ---------- help: consider adding an explicit lifetime bound...: `impl Debug + 'static`
LL |
LL | bar(d);
- | ^^^ ...so that the type `impl Debug` will meet its required lifetime bounds
+ | ^^^ ...so that the type `impl Debug` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/suggest-impl-trait-lifetime.rs:12:24
+ |
+LL | fn bar(d: impl Debug + 'static) {
+ | ^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-move-types.stderr b/src/test/ui/suggestions/suggest-move-types.stderr
index df064f2..1a6032d 100644
--- a/src/test/ui/suggestions/suggest-move-types.stderr
+++ b/src/test/ui/suggestions/suggest-move-types.stderr
@@ -9,7 +9,7 @@
help: move the constraint after the generic argument
|
LL | struct A<T, M: One<T, A = ()>> {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:33:43
@@ -22,7 +22,7 @@
help: move the constraint after the generic arguments
|
LL | struct Al<'a, T, M: OneWithLifetime<'a, T, A = ()>> {
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:40:46
@@ -35,7 +35,7 @@
help: move the constraints after the generic arguments
|
LL | struct B<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:48:71
@@ -48,7 +48,7 @@
help: move the constraints after the generic arguments
|
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:57:28
@@ -61,7 +61,7 @@
help: move the constraints after the generic arguments
|
LL | struct C<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:65:53
@@ -74,7 +74,7 @@
help: move the constraints after the generic arguments
|
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:74:28
@@ -87,7 +87,7 @@
help: move the constraints after the generic arguments
|
LL | struct D<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:82:53
@@ -100,7 +100,7 @@
help: move the constraints after the generic arguments
|
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0747]: type provided when a lifetime was expected
--> $DIR/suggest-move-types.rs:33:43
diff --git a/src/test/ui/suggestions/suggest-on-bare-closure-call.stderr b/src/test/ui/suggestions/suggest-on-bare-closure-call.stderr
index 28fef51..0c91e2f 100644
--- a/src/test/ui/suggestions/suggest-on-bare-closure-call.stderr
+++ b/src/test/ui/suggestions/suggest-on-bare-closure-call.stderr
@@ -9,7 +9,7 @@
help: if you meant to create this closure and immediately call it, surround the closure with parenthesis
|
LL | let _ = (||{})();
- | ^ ^
+ | + +
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-ref-macro.stderr b/src/test/ui/suggestions/suggest-ref-macro.stderr
index 147001f..1f41d23 100644
--- a/src/test/ui/suggestions/suggest-ref-macro.stderr
+++ b/src/test/ui/suggestions/suggest-ref-macro.stderr
@@ -1,12 +1,4 @@
error[E0308]: mismatched types
- --> $DIR/suggest-ref-macro.rs:8:1
- |
-LL | #[hello]
- | ^^^^^^^^ expected `&mut i32`, found integer
- |
- = note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error[E0308]: mismatched types
--> $DIR/suggest-ref-macro.rs:15:11
|
LL | x(123);
@@ -29,6 +21,14 @@
| expected `&mut i32`, found integer
| help: consider mutably borrowing here: `&mut 456`
+error[E0308]: mismatched types
+ --> $DIR/suggest-ref-macro.rs:8:1
+ |
+LL | #[hello]
+ | ^^^^^^^^ expected `&mut i32`, found integer
+ |
+ = note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/suggest-std-when-using-type.stderr b/src/test/ui/suggestions/suggest-std-when-using-type.stderr
index 7f4c80f..4255281 100644
--- a/src/test/ui/suggestions/suggest-std-when-using-type.stderr
+++ b/src/test/ui/suggestions/suggest-std-when-using-type.stderr
@@ -7,7 +7,7 @@
help: you are looking for the module in `std`, not the primitive type
|
LL | let pi = std::f32::consts::PI;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0599]: no function or associated item named `from_utf8` found for type `str` in the current scope
--> $DIR/suggest-std-when-using-type.rs:5:14
@@ -18,7 +18,7 @@
help: you are looking for the module in `std`, not the primitive type
|
LL | std::str::from_utf8(bytes)
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr b/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr
index f785f7b..19fc772 100644
--- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr
+++ b/src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr
@@ -9,7 +9,7 @@
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
|
LL | fn foo<'a, T: Trait + 'a>(&self, _: impl Trait, x: impl Trait<A = usize>, _: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:17:13
@@ -22,7 +22,7 @@
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn ban<T>(x: T) where T: Trait<A = usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:22:9
@@ -35,7 +35,7 @@
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
|
LL | fn foo<'a, T: Trait + 'a>(_: impl Trait, x: impl Trait<A = usize>, _: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:26:9
@@ -48,7 +48,7 @@
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn bar<T: Trait<A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:30:9
@@ -61,7 +61,7 @@
help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
|
LL | fn foo2(x: impl Trait<i32, A = usize>) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:34:9
@@ -74,7 +74,7 @@
help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
|
LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:38:9
@@ -87,7 +87,7 @@
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn ban<T>(x: T) where T: Trait<A = usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to 7 previous errors
diff --git a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr b/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr
index e629f8f..943cbcb 100644
--- a/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr
+++ b/src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr
@@ -23,7 +23,7 @@
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
|
LL | fn foo(_: impl Trait, x: impl Trait<A = usize>) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:18:9
@@ -36,7 +36,7 @@
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn bar<T: Trait<A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:22:9
@@ -49,7 +49,7 @@
help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
|
LL | fn foo2(x: impl Trait<i32, A = usize>) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:26:12
@@ -70,7 +70,7 @@
help: consider constraining the associated type `<T as Trait<i32>>::A` to `{integer}`
|
LL | fn bar2<T: Trait<i32, A = {integer}>>(x: T) {
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:27:9
@@ -83,7 +83,7 @@
help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
|
LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:31:9
@@ -113,7 +113,7 @@
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn ban<T>(x: T) where T: Trait<A = usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to 9 previous errors
diff --git a/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr b/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr
index 4f7e187..9392854 100644
--- a/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr
+++ b/src/test/ui/suggestions/try-operator-dont-suggest-semicolon.stderr
@@ -22,11 +22,11 @@
help: consider using a semicolon here
|
LL | x?;
- | ^
+ | +
help: consider using a semicolon here
|
LL | };
- | ^
+ | +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/unsized-function-parameter.stderr b/src/test/ui/suggestions/unsized-function-parameter.stderr
index 8cbd8bf..55d8d1a 100644
--- a/src/test/ui/suggestions/unsized-function-parameter.stderr
+++ b/src/test/ui/suggestions/unsized-function-parameter.stderr
@@ -9,7 +9,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo1(bar: &str) {}
- | ^
+ | +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized-function-parameter.rs:11:9
@@ -22,7 +22,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo2(_bar: &str) {}
- | ^
+ | +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized-function-parameter.rs:17:9
@@ -35,7 +35,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo3(_: &str) {}
- | ^
+ | +
error: aborting due to 3 previous errors
diff --git a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
index f124864..5a158e5 100644
--- a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
+++ b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
@@ -27,7 +27,7 @@
help: specify the associated types
|
LL | i: Box<dyn T<usize, usize, A = usize, C = usize, B=usize>>,
- | ^^^^^^^^^ ^^^^^^^^^
+ | ~~~~~~~~~ ~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/symbol-names/basic.stderr b/src/test/ui/symbol-names/basic.stderr
deleted file mode 100644
index 7539cba..0000000
--- a/src/test/ui/symbol-names/basic.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: symbol-name(_ZN5basic4main17hd72940ef9669d526E)
- --> $DIR/basic.rs:3:1
- |
-LL | #[rustc_symbol_name]
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: def-path(main)
- --> $DIR/basic.rs:4:1
- |
-LL | #[rustc_def_path]
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/symbol-names/const-generics-demangling.rs b/src/test/ui/symbol-names/const-generics-demangling.rs
index 05c6b83..38b07ac 100644
--- a/src/test/ui/symbol-names/const-generics-demangling.rs
+++ b/src/test/ui/symbol-names/const-generics-demangling.rs
@@ -1,37 +1,37 @@
// build-fail
-// compile-flags: -Z symbol-mangling-version=v0
+// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c
#![feature(rustc_attrs)]
pub struct Unsigned<const F: u8>;
#[rustc_symbol_name]
-//~^ ERROR symbol-name(_RMCsaP8qXevlYG3_25const_generics_demanglingINtB0_8UnsignedKhb_E)
-//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Unsigned<11: u8>>)
-//~| ERROR demangling-alt(<const_generics_demangling::Unsigned<11>>)
+//~^ ERROR symbol-name(_RMCsno73SFvQKx_1cINtB0_8UnsignedKhb_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Unsigned<11u8>>)
+//~| ERROR demangling-alt(<c::Unsigned<11>>)
impl Unsigned<11> {}
pub struct Signed<const F: i16>;
#[rustc_symbol_name]
-//~^ ERROR symbol-name(_RMs_CsaP8qXevlYG3_25const_generics_demanglingINtB2_6SignedKsn98_E)
-//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Signed<-152: i16>>)
-//~| ERROR demangling-alt(<const_generics_demangling::Signed<-152>>)
+//~^ ERROR symbol-name(_RMs_Csno73SFvQKx_1cINtB2_6SignedKsn98_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Signed<-152i16>>)
+//~| ERROR demangling-alt(<c::Signed<-152>>)
impl Signed<-152> {}
pub struct Bool<const F: bool>;
#[rustc_symbol_name]
-//~^ ERROR symbol-name(_RMs0_CsaP8qXevlYG3_25const_generics_demanglingINtB3_4BoolKb1_E)
-//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Bool<true: bool>>)
-//~| ERROR demangling-alt(<const_generics_demangling::Bool<true>>)
+//~^ ERROR symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_4BoolKb1_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Bool<true>>)
+//~| ERROR demangling-alt(<c::Bool<true>>)
impl Bool<true> {}
pub struct Char<const F: char>;
#[rustc_symbol_name]
-//~^ ERROR symbol-name(_RMs1_CsaP8qXevlYG3_25const_generics_demanglingINtB3_4CharKc2202_E)
-//~| ERROR demangling(<const_generics_demangling[7e153590edc26969]::Char<'∂': char>>)
-//~| ERROR demangling-alt(<const_generics_demangling::Char<'∂'>>)
+//~^ ERROR symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_4CharKc2202_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Char<'∂'>>)
+//~| ERROR demangling-alt(<c::Char<'∂'>>)
impl Char<'∂'> {}
fn main() {}
diff --git a/src/test/ui/symbol-names/const-generics-demangling.stderr b/src/test/ui/symbol-names/const-generics-demangling.stderr
index 05c485d..2abf293 100644
--- a/src/test/ui/symbol-names/const-generics-demangling.stderr
+++ b/src/test/ui/symbol-names/const-generics-demangling.stderr
@@ -1,70 +1,70 @@
-error: symbol-name(_RMCsaP8qXevlYG3_25const_generics_demanglingINtB0_8UnsignedKhb_E)
+error: symbol-name(_RMCsno73SFvQKx_1cINtB0_8UnsignedKhb_E)
--> $DIR/const-generics-demangling.rs:7:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<const_generics_demangling[7e153590edc26969]::Unsigned<11: u8>>)
+error: demangling(<c[464da6a86cb672f]::Unsigned<11u8>>)
--> $DIR/const-generics-demangling.rs:7:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling-alt(<const_generics_demangling::Unsigned<11>>)
+error: demangling-alt(<c::Unsigned<11>>)
--> $DIR/const-generics-demangling.rs:7:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: symbol-name(_RMs_CsaP8qXevlYG3_25const_generics_demanglingINtB2_6SignedKsn98_E)
+error: symbol-name(_RMs_Csno73SFvQKx_1cINtB2_6SignedKsn98_E)
--> $DIR/const-generics-demangling.rs:15:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<const_generics_demangling[7e153590edc26969]::Signed<-152: i16>>)
+error: demangling(<c[464da6a86cb672f]::Signed<-152i16>>)
--> $DIR/const-generics-demangling.rs:15:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling-alt(<const_generics_demangling::Signed<-152>>)
+error: demangling-alt(<c::Signed<-152>>)
--> $DIR/const-generics-demangling.rs:15:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: symbol-name(_RMs0_CsaP8qXevlYG3_25const_generics_demanglingINtB3_4BoolKb1_E)
+error: symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_4BoolKb1_E)
--> $DIR/const-generics-demangling.rs:23:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<const_generics_demangling[7e153590edc26969]::Bool<true: bool>>)
+error: demangling(<c[464da6a86cb672f]::Bool<true>>)
--> $DIR/const-generics-demangling.rs:23:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling-alt(<const_generics_demangling::Bool<true>>)
+error: demangling-alt(<c::Bool<true>>)
--> $DIR/const-generics-demangling.rs:23:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: symbol-name(_RMs1_CsaP8qXevlYG3_25const_generics_demanglingINtB3_4CharKc2202_E)
+error: symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_4CharKc2202_E)
--> $DIR/const-generics-demangling.rs:31:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<const_generics_demangling[7e153590edc26969]::Char<'∂': char>>)
+error: demangling(<c[464da6a86cb672f]::Char<'∂'>>)
--> $DIR/const-generics-demangling.rs:31:1
|
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling-alt(<const_generics_demangling::Char<'∂'>>)
+error: demangling-alt(<c::Char<'∂'>>)
--> $DIR/const-generics-demangling.rs:31:1
|
LL | #[rustc_symbol_name]
diff --git a/src/test/ui/symbol-names/const-generics-str-demangling.rs b/src/test/ui/symbol-names/const-generics-str-demangling.rs
new file mode 100644
index 0000000..f450dfe
--- /dev/null
+++ b/src/test/ui/symbol-names/const-generics-str-demangling.rs
@@ -0,0 +1,44 @@
+// build-fail
+// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c
+#![feature(adt_const_params, rustc_attrs)]
+#![allow(incomplete_features)]
+
+pub struct Str<const S: &'static str>;
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMCsno73SFvQKx_1cINtB0_3StrKRe616263_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Str<"abc">>)
+//~| ERROR demangling-alt(<c::Str<"abc">>)
+impl Str<"abc"> {}
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs_Csno73SFvQKx_1cINtB2_3StrKRe27_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Str<"'">>)
+//~| ERROR demangling-alt(<c::Str<"'">>)
+impl Str<"'"> {}
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_3StrKRe090a_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Str<"\t\n">>)
+//~| ERROR demangling-alt(<c::Str<"\t\n">>)
+impl Str<"\t\n"> {}
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_3StrKRee28882c3bc_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Str<"∂ü">>)
+//~| ERROR demangling-alt(<c::Str<"∂ü">>)
+impl Str<"∂ü"> {}
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs2_Csno73SFvQKx_1cINtB3_3StrKRee183a1e18390e183ade1839be18394e1839ae18390e183935fe18392e18394e1839be183a0e18398e18394e1839ae183985fe183a1e18390e18393e18398e1839ae18398_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Str<"საჭმელად_გემრიელი_სადილი">>)
+//~| ERROR demangling-alt(<c::Str<"საჭმელად_გემრიელი_სადილი">>)
+impl Str<"საჭმელად_გემრიელი_სადილი"> {}
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs3_Csno73SFvQKx_1cINtB3_3StrKRef09f908af09fa688f09fa686f09f90ae20c2a720f09f90b6f09f9192e29895f09f94a520c2a720f09fa7a1f09f929bf09f929af09f9299f09f929c_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
+//~| ERROR demangling-alt(<c::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
+impl Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜"> {}
+
+fn main() {}
diff --git a/src/test/ui/symbol-names/const-generics-str-demangling.stderr b/src/test/ui/symbol-names/const-generics-str-demangling.stderr
new file mode 100644
index 0000000..f401997
--- /dev/null
+++ b/src/test/ui/symbol-names/const-generics-str-demangling.stderr
@@ -0,0 +1,110 @@
+error: symbol-name(_RMCsno73SFvQKx_1cINtB0_3StrKRe616263_E)
+ --> $DIR/const-generics-str-demangling.rs:8:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Str<"abc">>)
+ --> $DIR/const-generics-str-demangling.rs:8:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Str<"abc">>)
+ --> $DIR/const-generics-str-demangling.rs:8:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs_Csno73SFvQKx_1cINtB2_3StrKRe27_E)
+ --> $DIR/const-generics-str-demangling.rs:14:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Str<"'">>)
+ --> $DIR/const-generics-str-demangling.rs:14:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Str<"'">>)
+ --> $DIR/const-generics-str-demangling.rs:14:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_3StrKRe090a_E)
+ --> $DIR/const-generics-str-demangling.rs:20:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Str<"\t\n">>)
+ --> $DIR/const-generics-str-demangling.rs:20:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Str<"\t\n">>)
+ --> $DIR/const-generics-str-demangling.rs:20:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_3StrKRee28882c3bc_E)
+ --> $DIR/const-generics-str-demangling.rs:26:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Str<"∂ü">>)
+ --> $DIR/const-generics-str-demangling.rs:26:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Str<"∂ü">>)
+ --> $DIR/const-generics-str-demangling.rs:26:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs2_Csno73SFvQKx_1cINtB3_3StrKRee183a1e18390e183ade1839be18394e1839ae18390e183935fe18392e18394e1839be183a0e18398e18394e1839ae183985fe183a1e18390e18393e18398e1839ae18398_E)
+ --> $DIR/const-generics-str-demangling.rs:32:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Str<"საჭმელად_გემრიელი_სადილი">>)
+ --> $DIR/const-generics-str-demangling.rs:32:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Str<"საჭმელად_გემრიელი_სადილი">>)
+ --> $DIR/const-generics-str-demangling.rs:32:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs3_Csno73SFvQKx_1cINtB3_3StrKRef09f908af09fa688f09fa686f09f90ae20c2a720f09f90b6f09f9192e29895f09f94a520c2a720f09fa7a1f09f929bf09f929af09f9299f09f929c_E)
+ --> $DIR/const-generics-str-demangling.rs:38:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
+ --> $DIR/const-generics-str-demangling.rs:38:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Str<"🐊🦈🦆🐮 § 🐶👒☕🔥 § 🧡💛💚💙💜">>)
+ --> $DIR/const-generics-str-demangling.rs:38:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 18 previous errors
+
diff --git a/src/test/ui/symbol-names/const-generics-structural-demangling.rs b/src/test/ui/symbol-names/const-generics-structural-demangling.rs
new file mode 100644
index 0000000..fa38848
--- /dev/null
+++ b/src/test/ui/symbol-names/const-generics-structural-demangling.rs
@@ -0,0 +1,96 @@
+// build-fail
+// compile-flags: -Z symbol-mangling-version=v0 --crate-name=c
+
+// NOTE(eddyb) we need `core` for `core::option::Option`, normalize away its
+// disambiguator hash, which can/should change (including between stage{1,2}).
+// normalize-stderr-test: "Cs[0-9a-zA-Z]+_4core" -> "Cs$$HASH_4core"
+// normalize-stderr-test: "core\[[0-9a-f]+\]" -> "core[$$HASH_HEX]"
+
+#![feature(adt_const_params, decl_macro, rustc_attrs)]
+#![allow(incomplete_features)]
+
+pub struct RefByte<const RB: &'static u8>;
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMCsno73SFvQKx_1cINtB0_7RefByteKRh7b_E)
+//~| ERROR demangling(<c[464da6a86cb672f]::RefByte<{&123u8}>>)
+//~| ERROR demangling-alt(<c::RefByte<{&123}>>)
+impl RefByte<{&123}> {}
+
+// FIXME(eddyb) this was supposed to be `RefMutZst` with `&mut []`,
+// but that is currently not allowed in const generics.
+pub struct RefZst<const RMZ: &'static [u8; 0]>;
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs_Csno73SFvQKx_1cINtB2_6RefZstKRAEE)
+//~| ERROR demangling(<c[464da6a86cb672f]::RefZst<{&[]}>>)
+//~| ERROR demangling-alt(<c::RefZst<{&[]}>>)
+impl RefZst<{&[]}> {}
+
+pub struct Array3Bytes<const A3B: [u8; 3]>;
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_11Array3BytesKAh1_h2_h3_EE)
+//~| ERROR demangling(<c[464da6a86cb672f]::Array3Bytes<{[1u8, 2u8, 3u8]}>>)
+//~| ERROR demangling-alt(<c::Array3Bytes<{[1, 2, 3]}>>)
+impl Array3Bytes<{[1, 2, 3]}> {}
+
+pub struct TupleByteBool<const TBB: (u8, bool)>;
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_13TupleByteBoolKTh1_b0_EE)
+//~| ERROR demangling(<c[464da6a86cb672f]::TupleByteBool<{(1u8, false)}>>)
+//~| ERROR demangling-alt(<c::TupleByteBool<{(1, false)}>>)
+impl TupleByteBool<{(1, false)}> {}
+
+pub struct OptionUsize<const OU: Option<usize>>;
+
+// HACK(eddyb) the full mangling is only in `.stderr` because we can normalize
+// the `core` disambiguator hash away there, but not here.
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs2_Csno73SFvQKx_1cINtB3_11OptionUsizeKVNtINtNtCs
+//~| ERROR demangling(<c[464da6a86cb672f]::OptionUsize<{core[
+//~| ERROR demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::None}>>)
+impl OptionUsize<{None}> {}
+
+// HACK(eddyb) the full mangling is only in `.stderr` because we can normalize
+// the `core` disambiguator hash away there, but not here.
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs3_Csno73SFvQKx_1cINtB3_11OptionUsizeKVNtINtNtCs
+//~| ERROR demangling(<c[464da6a86cb672f]::OptionUsize<{core[
+//~| ERROR demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::Some(0)}>>)
+impl OptionUsize<{Some(0)}> {}
+
+#[derive(PartialEq, Eq)]
+pub struct Foo {
+ s: &'static str,
+ ch: char,
+ slice: &'static [u8],
+}
+pub struct Foo_<const F: Foo>;
+
+#[rustc_symbol_name]
+//~^ ERROR symbol-name(_RMs4_Csno73SFvQKx_1cINtB3_4Foo_KVNtB3_3FooS1sRe616263_2chc78_5sliceRAh1_h2_h3_EEE)
+//~| ERROR demangling(<c[464da6a86cb672f]::Foo_<{c[464da6a86cb672f]::Foo { s: "abc", ch: 'x', slice: &[1u8, 2u8, 3u8] }}>>)
+//~| ERROR demangling-alt(<c::Foo_<{c::Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] }}>>)
+impl Foo_<{Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] }}> {}
+
+// NOTE(eddyb) this tests specifically the use of disambiguators in field names,
+// using macros 2.0 hygiene to create a `struct` with conflicting field names.
+macro duplicate_field_name_test($x:ident) {
+ #[derive(PartialEq, Eq)]
+ pub struct Bar {
+ $x: u8,
+ x: u16,
+ }
+ pub struct Bar_<const B: Bar>;
+
+ #[rustc_symbol_name]
+ //~^ ERROR symbol-name(_RMs9_Csno73SFvQKx_1cINtB3_4Bar_KVNtB3_3BarS1xh7b_s_1xt1000_EE)
+ //~| ERROR demangling(<c[464da6a86cb672f]::Bar_<{c[464da6a86cb672f]::Bar { x: 123u8, x: 4096u16 }}>>)
+ //~| ERROR demangling-alt(<c::Bar_<{c::Bar { x: 123, x: 4096 }}>>)
+ impl Bar_<{Bar { $x: 123, x: 4096 }}> {}
+}
+duplicate_field_name_test!(x);
+
+fn main() {}
diff --git a/src/test/ui/symbol-names/const-generics-structural-demangling.stderr b/src/test/ui/symbol-names/const-generics-structural-demangling.stderr
new file mode 100644
index 0000000..b3c5bd2
--- /dev/null
+++ b/src/test/ui/symbol-names/const-generics-structural-demangling.stderr
@@ -0,0 +1,161 @@
+error: symbol-name(_RMCsno73SFvQKx_1cINtB0_7RefByteKRh7b_E)
+ --> $DIR/const-generics-structural-demangling.rs:14:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::RefByte<{&123u8}>>)
+ --> $DIR/const-generics-structural-demangling.rs:14:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::RefByte<{&123}>>)
+ --> $DIR/const-generics-structural-demangling.rs:14:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs_Csno73SFvQKx_1cINtB2_6RefZstKRAEE)
+ --> $DIR/const-generics-structural-demangling.rs:24:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::RefZst<{&[]}>>)
+ --> $DIR/const-generics-structural-demangling.rs:24:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::RefZst<{&[]}>>)
+ --> $DIR/const-generics-structural-demangling.rs:24:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs0_Csno73SFvQKx_1cINtB3_11Array3BytesKAh1_h2_h3_EE)
+ --> $DIR/const-generics-structural-demangling.rs:32:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Array3Bytes<{[1u8, 2u8, 3u8]}>>)
+ --> $DIR/const-generics-structural-demangling.rs:32:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Array3Bytes<{[1, 2, 3]}>>)
+ --> $DIR/const-generics-structural-demangling.rs:32:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs1_Csno73SFvQKx_1cINtB3_13TupleByteBoolKTh1_b0_EE)
+ --> $DIR/const-generics-structural-demangling.rs:40:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::TupleByteBool<{(1u8, false)}>>)
+ --> $DIR/const-generics-structural-demangling.rs:40:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::TupleByteBool<{(1, false)}>>)
+ --> $DIR/const-generics-structural-demangling.rs:40:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs2_Csno73SFvQKx_1cINtB3_11OptionUsizeKVNtINtNtCs$HASH_4core6option6OptionjE4NoneUE)
+ --> $DIR/const-generics-structural-demangling.rs:50:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::OptionUsize<{core[$HASH_HEX]::option::Option::<usize>::None}>>)
+ --> $DIR/const-generics-structural-demangling.rs:50:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::None}>>)
+ --> $DIR/const-generics-structural-demangling.rs:50:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs3_Csno73SFvQKx_1cINtB3_11OptionUsizeKVNtINtNtCs$HASH_4core6option6OptionjE4SomeTj0_EE)
+ --> $DIR/const-generics-structural-demangling.rs:58:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::OptionUsize<{core[$HASH_HEX]::option::Option::<usize>::Some(0usize)}>>)
+ --> $DIR/const-generics-structural-demangling.rs:58:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::OptionUsize<{core::option::Option::<usize>::Some(0)}>>)
+ --> $DIR/const-generics-structural-demangling.rs:58:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs4_Csno73SFvQKx_1cINtB3_4Foo_KVNtB3_3FooS1sRe616263_2chc78_5sliceRAh1_h2_h3_EEE)
+ --> $DIR/const-generics-structural-demangling.rs:72:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling(<c[464da6a86cb672f]::Foo_<{c[464da6a86cb672f]::Foo { s: "abc", ch: 'x', slice: &[1u8, 2u8, 3u8] }}>>)
+ --> $DIR/const-generics-structural-demangling.rs:72:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: demangling-alt(<c::Foo_<{c::Foo { s: "abc", ch: 'x', slice: &[1, 2, 3] }}>>)
+ --> $DIR/const-generics-structural-demangling.rs:72:1
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: symbol-name(_RMs9_Csno73SFvQKx_1cINtB3_4Bar_KVNtB3_3BarS1xh7b_s_1xt1000_EE)
+ --> $DIR/const-generics-structural-demangling.rs:88:5
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+...
+LL | duplicate_field_name_test!(x);
+ | ------------------------------ in this macro invocation
+ |
+ = note: this error originates in the macro `duplicate_field_name_test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: demangling(<c[464da6a86cb672f]::Bar_<{c[464da6a86cb672f]::Bar { x: 123u8, x: 4096u16 }}>>)
+ --> $DIR/const-generics-structural-demangling.rs:88:5
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+...
+LL | duplicate_field_name_test!(x);
+ | ------------------------------ in this macro invocation
+ |
+ = note: this error originates in the macro `duplicate_field_name_test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: demangling-alt(<c::Bar_<{c::Bar { x: 123, x: 4096 }}>>)
+ --> $DIR/const-generics-structural-demangling.rs:88:5
+ |
+LL | #[rustc_symbol_name]
+ | ^^^^^^^^^^^^^^^^^^^^
+...
+LL | duplicate_field_name_test!(x);
+ | ------------------------------ in this macro invocation
+ |
+ = note: this error originates in the macro `duplicate_field_name_test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 24 previous errors
+
diff --git a/src/test/ui/symbol-names/impl1.rs b/src/test/ui/symbol-names/impl1.rs
index 960049b..60f1926 100644
--- a/src/test/ui/symbol-names/impl1.rs
+++ b/src/test/ui/symbol-names/impl1.rs
@@ -64,7 +64,7 @@
//[legacy]~| ERROR demangling(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method
//[legacy]~| ERROR demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::AutoTrait; 3] as impl1::main::{{closure}}::Bar>::method)
//[v0]~^^^^ ERROR symbol-name(_RNvXNCNvCs2qSCrjELJET_5impl14mains_0ARDNtB6_3Foop5AssocFG_KCRL0_hvEuNtB6_9AutoTraitEL_j3_NtB2_3Bar6method)
- //[v0]~| ERROR demangling(<[&dyn impl1[1c5860ab79c9e305]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[1c5860ab79c9e305]::AutoTrait; 3: usize] as impl1[1c5860ab79c9e305]::main::{closure#1}::Bar>::method)
+ //[v0]~| ERROR demangling(<[&dyn impl1[1c5860ab79c9e305]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[1c5860ab79c9e305]::AutoTrait; 3usize] as impl1[1c5860ab79c9e305]::main::{closure#1}::Bar>::method)
//[v0]~| ERROR demangling-alt(<[&dyn impl1::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1::AutoTrait; 3] as impl1::main::{closure#1}::Bar>::method)
#[rustc_def_path]
//[legacy]~^ ERROR def-path(<[&dyn Foo<Assoc = for<'r> extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
diff --git a/src/test/ui/symbol-names/impl1.v0.stderr b/src/test/ui/symbol-names/impl1.v0.stderr
index a7c3a38..926e750 100644
--- a/src/test/ui/symbol-names/impl1.v0.stderr
+++ b/src/test/ui/symbol-names/impl1.v0.stderr
@@ -52,7 +52,7 @@
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: demangling(<[&dyn impl1[1c5860ab79c9e305]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[1c5860ab79c9e305]::AutoTrait; 3: usize] as impl1[1c5860ab79c9e305]::main::{closure#1}::Bar>::method)
+error: demangling(<[&dyn impl1[1c5860ab79c9e305]::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1[1c5860ab79c9e305]::AutoTrait; 3usize] as impl1[1c5860ab79c9e305]::main::{closure#1}::Bar>::method)
--> $DIR/impl1.rs:62:13
|
LL | #[rustc_symbol_name]
diff --git a/src/test/ui/tag-type-args.stderr b/src/test/ui/tag-type-args.stderr
index 7523a93..107af76 100644
--- a/src/test/ui/tag-type-args.stderr
+++ b/src/test/ui/tag-type-args.stderr
@@ -12,7 +12,7 @@
help: add missing generic argument
|
LL | fn foo(c: Quux<T>) { assert!((false)); }
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/tail-typeck.stderr b/src/test/ui/tail-typeck.stderr
index cff0991..422aa90 100644
--- a/src/test/ui/tail-typeck.stderr
+++ b/src/test/ui/tail-typeck.stderr
@@ -9,7 +9,7 @@
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | fn f() -> isize { return g().try_into().unwrap(); }
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr b/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr
index 69daa93..480f442 100644
--- a/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr
+++ b/src/test/ui/terminal-width/non-1-width-unicode-multiline-label.stderr
@@ -10,7 +10,7 @@
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = "ༀ༁༂༃༄༅༆༇༈༉༊་༌།༎༏༐༑༒༓༔༕༖༗༘༙༚༛༜༝༞༟༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿ཀཁགགྷངཅཆཇཉཊཋཌཌྷཎཏཐདདྷནཔཕབབྷམཙཚཛཛྷཝཞཟའཡརལཤཥསཧཨཀྵཪཫཬཱཱཱིིུུྲྀཷླྀཹེཻོཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun.to_owned() + " really fun!";
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/thir-tree.rs b/src/test/ui/thir-tree.rs
new file mode 100644
index 0000000..32df790
--- /dev/null
+++ b/src/test/ui/thir-tree.rs
@@ -0,0 +1,4 @@
+// compile-flags: -Z unpretty=thir-tree
+// check-pass
+
+pub fn main() {}
diff --git a/src/test/ui/thir-tree.stdout b/src/test/ui/thir-tree.stdout
new file mode 100644
index 0000000..389eaf5
--- /dev/null
+++ b/src/test/ui/thir-tree.stdout
@@ -0,0 +1,55 @@
+DefId(0:3 ~ thir_tree[348d]::main):
+Thir {
+ arms: [],
+ exprs: [
+ Expr {
+ ty: (),
+ temp_lifetime: Some(
+ Node(2),
+ ),
+ span: $DIR/thir-tree.rs:4:15: 4:17 (#0),
+ kind: Block {
+ body: Block {
+ targeted_by_break: false,
+ region_scope: Node(1),
+ opt_destruction_scope: None,
+ span: $DIR/thir-tree.rs:4:15: 4:17 (#0),
+ stmts: [],
+ expr: None,
+ safety_mode: Safe,
+ },
+ },
+ },
+ Expr {
+ ty: (),
+ temp_lifetime: Some(
+ Node(2),
+ ),
+ span: $DIR/thir-tree.rs:4:15: 4:17 (#0),
+ kind: Scope {
+ region_scope: Node(2),
+ lint_level: Explicit(
+ HirId {
+ owner: DefId(0:3 ~ thir_tree[348d]::main),
+ local_id: 2,
+ },
+ ),
+ value: e0,
+ },
+ },
+ Expr {
+ ty: (),
+ temp_lifetime: Some(
+ Node(2),
+ ),
+ span: $DIR/thir-tree.rs:4:15: 4:17 (#0),
+ kind: Scope {
+ region_scope: Destruction(2),
+ lint_level: Inherited,
+ value: e1,
+ },
+ },
+ ],
+ stmts: [],
+}
+
diff --git a/src/test/ui/thread-local-in-ctfe.stderr b/src/test/ui/thread-local-in-ctfe.stderr
index 9890597..fd96760 100644
--- a/src/test/ui/thread-local-in-ctfe.stderr
+++ b/src/test/ui/thread-local-in-ctfe.stderr
@@ -30,3 +30,4 @@
error: aborting due to 5 previous errors
+For more information about this error, try `rustc --explain E0625`.
diff --git a/src/test/ui/thread-local-static.stderr b/src/test/ui/thread-local-static.stderr
index 08bf593..712050a 100644
--- a/src/test/ui/thread-local-static.stderr
+++ b/src/test/ui/thread-local-static.stderr
@@ -40,5 +40,5 @@
error: aborting due to 5 previous errors
-Some errors have detailed explanations: E0013, E0133, E0658.
+Some errors have detailed explanations: E0013, E0133, E0625, E0658.
For more information about an error, try `rustc --explain E0013`.
diff --git a/src/test/ui/trait-bounds/unsized-bound.rs b/src/test/ui/trait-bounds/unsized-bound.rs
new file mode 100644
index 0000000..035b8ef
--- /dev/null
+++ b/src/test/ui/trait-bounds/unsized-bound.rs
@@ -0,0 +1,32 @@
+trait Trait<A> {}
+impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
+//~^ ERROR E0277
+//~| ERROR E0277
+impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+//~^ ERROR E0277
+//~| ERROR E0277
+//~| ERROR E0277
+trait Trait2<A> {}
+impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+//~^ ERROR E0277
+//~| ERROR E0277
+trait Trait3<A> {}
+impl<A> Trait3<A> for A where A: ?Sized {}
+//~^ ERROR E0277
+trait Trait4<A> {}
+impl<A: ?Sized> Trait4<A> for A {}
+//~^ ERROR E0277
+trait Trait5<A, B> {}
+impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
+//~^ ERROR E0277
+trait Trait6<A, B> {}
+impl<X: ?Sized, Y> Trait6<X, Y> for X {}
+//~^ ERROR E0277
+trait Trait7<A, B> {}
+impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
+//~^ ERROR E0277
+trait Trait8<A, B> {}
+impl<X, Y: ?Sized> Trait8<X, Y> for X {}
+//~^ ERROR E0277
+
+fn main() {}
diff --git a/src/test/ui/trait-bounds/unsized-bound.stderr b/src/test/ui/trait-bounds/unsized-bound.stderr
new file mode 100644
index 0000000..0c758c9
--- /dev/null
+++ b/src/test/ui/trait-bounds/unsized-bound.stderr
@@ -0,0 +1,273 @@
+error[E0277]: the size for values of type `B` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:2:12
+ |
+LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
+ | - ^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+ = note: required because it appears within the type `(A, B)`
+note: required by a bound in `Trait`
+ --> $DIR/unsized-bound.rs:1:13
+ |
+LL | trait Trait<A> {}
+ | ^ required by this bound in `Trait`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
+LL + impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait<A: ?Sized> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `A` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:2:30
+ |
+LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
+ | - ^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+ = note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
+LL + impl<A, B> Trait<(A, B)> for (A, B) where B: ?Sized, {}
+ |
+
+error[E0277]: the size for values of type `C` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:5:31
+ |
+LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+ | - ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+ = note: required because it appears within the type `(A, B, C)`
+note: required by a bound in `Trait`
+ --> $DIR/unsized-bound.rs:1:13
+ |
+LL | trait Trait<A> {}
+ | ^ required by this bound in `Trait`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+LL + impl<A, B: ?Sized, C> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait<A: ?Sized> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `A` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:5:52
+ |
+LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+ | - ^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+ = note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+LL + impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) {}
+ |
+
+error[E0277]: the size for values of type `B` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:5:52
+ |
+LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+ | - ^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+ = note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+LL + impl<A, B, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+ |
+
+error[E0277]: the size for values of type `B` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:10:28
+ |
+LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+ | - ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+ = note: required because it appears within the type `(A, B)`
+note: required by a bound in `Trait2`
+ --> $DIR/unsized-bound.rs:9:14
+ |
+LL | trait Trait2<A> {}
+ | ^ required by this bound in `Trait2`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+LL + impl<A: ?Sized, B> Trait2<(A, B)> for (A, B) {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait2<A: ?Sized> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `A` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:10:47
+ |
+LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+ | - ^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+ = note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+LL + impl<A, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+ |
+
+error[E0277]: the size for values of type `A` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:14:9
+ |
+LL | impl<A> Trait3<A> for A where A: ?Sized {}
+ | - ^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+note: required by a bound in `Trait3`
+ --> $DIR/unsized-bound.rs:13:14
+ |
+LL | trait Trait3<A> {}
+ | ^ required by this bound in `Trait3`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A> Trait3<A> for A where A: ?Sized {}
+LL + impl<A> Trait3<A> for A {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait3<A: ?Sized> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `A` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:17:17
+ |
+LL | impl<A: ?Sized> Trait4<A> for A {}
+ | - ^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+note: required by a bound in `Trait4`
+ --> $DIR/unsized-bound.rs:16:14
+ |
+LL | trait Trait4<A> {}
+ | ^ required by this bound in `Trait4`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<A: ?Sized> Trait4<A> for A {}
+LL + impl<A> Trait4<A> for A {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait4<A: ?Sized> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `X` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:20:12
+ |
+LL | impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
+ | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+note: required by a bound in `Trait5`
+ --> $DIR/unsized-bound.rs:19:14
+ |
+LL | trait Trait5<A, B> {}
+ | ^ required by this bound in `Trait5`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
+LL + impl<X, Y> Trait5<X, Y> for X {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait5<A: ?Sized, B> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `X` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:23:20
+ |
+LL | impl<X: ?Sized, Y> Trait6<X, Y> for X {}
+ | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+note: required by a bound in `Trait6`
+ --> $DIR/unsized-bound.rs:22:14
+ |
+LL | trait Trait6<A, B> {}
+ | ^ required by this bound in `Trait6`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X: ?Sized, Y> Trait6<X, Y> for X {}
+LL + impl<X, Y> Trait6<X, Y> for X {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait6<A: ?Sized, B> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `Y` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:26:12
+ |
+LL | impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
+ | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+note: required by a bound in `Trait7`
+ --> $DIR/unsized-bound.rs:25:17
+ |
+LL | trait Trait7<A, B> {}
+ | ^ required by this bound in `Trait7`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
+LL + impl<X, Y> Trait7<X, Y> for X {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait7<A, B: ?Sized> {}
+ | ++++++++
+
+error[E0277]: the size for values of type `Y` cannot be known at compilation time
+ --> $DIR/unsized-bound.rs:29:20
+ |
+LL | impl<X, Y: ?Sized> Trait8<X, Y> for X {}
+ | - ^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | this type parameter needs to be `std::marker::Sized`
+ |
+note: required by a bound in `Trait8`
+ --> $DIR/unsized-bound.rs:28:17
+ |
+LL | trait Trait8<A, B> {}
+ | ^ required by this bound in `Trait8`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X, Y: ?Sized> Trait8<X, Y> for X {}
+LL + impl<X, Y> Trait8<X, Y> for X {}
+ |
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Trait8<A, B: ?Sized> {}
+ | ++++++++
+
+error: aborting due to 13 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/trait-impl-bound-suggestions.stderr b/src/test/ui/trait-impl-bound-suggestions.stderr
index 110ca79..3867967 100644
--- a/src/test/ui/trait-impl-bound-suggestions.stderr
+++ b/src/test/ui/trait-impl-bound-suggestions.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `X: Copy` is not satisfied
--> $DIR/trait-impl-bound-suggestions.rs:14:52
|
-LL | struct ConstrainedStruct<X: Copy> {
- | ---- required by this bound in `ConstrainedStruct`
-...
LL | fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> {
| ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `X`
|
+note: required by a bound in `ConstrainedStruct`
+ --> $DIR/trait-impl-bound-suggestions.rs:8:29
+ |
+LL | struct ConstrainedStruct<X: Copy> {
+ | ^^^^ required by this bound in `ConstrainedStruct`
help: consider further restricting type parameter `X`
|
LL | trait InsufficientlyConstrainedGeneric<X=()> where X: std::marker::Copy {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/traits/alias/ambiguous.stderr b/src/test/ui/traits/alias/ambiguous.stderr
index 649ce72..0fe1a79 100644
--- a/src/test/ui/traits/alias/ambiguous.stderr
+++ b/src/test/ui/traits/alias/ambiguous.stderr
@@ -17,11 +17,11 @@
help: disambiguate the associated function for candidate #1
|
LL | A::foo(&t);
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(&t);
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/traits/alias/cross-crate.stderr b/src/test/ui/traits/alias/cross-crate.stderr
index 3b8fee8..3c3b6e5 100644
--- a/src/test/ui/traits/alias/cross-crate.stderr
+++ b/src/test/ui/traits/alias/cross-crate.stderr
@@ -1,24 +1,28 @@
error[E0277]: `Rc<u32>` cannot be sent between threads safely
--> $DIR/cross-crate.rs:14:17
|
-LL | fn use_alias<T: SendSync>() {}
- | -------- required by this bound in `use_alias`
-...
LL | use_alias::<Rc<u32>>();
| ^^^^^^^ `Rc<u32>` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Rc<u32>`
+note: required by a bound in `use_alias`
+ --> $DIR/cross-crate.rs:10:17
+ |
+LL | fn use_alias<T: SendSync>() {}
+ | ^^^^^^^^ required by this bound in `use_alias`
error[E0277]: `Rc<u32>` cannot be shared between threads safely
--> $DIR/cross-crate.rs:14:17
|
-LL | fn use_alias<T: SendSync>() {}
- | -------- required by this bound in `use_alias`
-...
LL | use_alias::<Rc<u32>>();
| ^^^^^^^ `Rc<u32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Rc<u32>`
+note: required by a bound in `use_alias`
+ --> $DIR/cross-crate.rs:10:17
+ |
+LL | fn use_alias<T: SendSync>() {}
+ | ^^^^^^^^ required by this bound in `use_alias`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/alias/issue-83613.rs b/src/test/ui/traits/alias/issue-83613.rs
index 146920a..0013d5d 100644
--- a/src/test/ui/traits/alias/issue-83613.rs
+++ b/src/test/ui/traits/alias/issue-83613.rs
@@ -1,4 +1,4 @@
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
trait OpaqueTrait {}
impl<T> OpaqueTrait for T {}
type OpaqueType = impl OpaqueTrait;
diff --git a/src/test/ui/traits/alias/wf.stderr b/src/test/ui/traits/alias/wf.stderr
index b07145f..7172008 100644
--- a/src/test/ui/traits/alias/wf.stderr
+++ b/src/test/ui/traits/alias/wf.stderr
@@ -1,15 +1,18 @@
error[E0277]: the trait bound `T: Foo` is not satisfied
--> $DIR/wf.rs:5:14
|
-LL | trait A<T: Foo> {}
- | --- required by this bound in `A`
LL | trait B<T> = A<T>;
| ^^^^ the trait `Foo` is not implemented for `T`
|
+note: required by a bound in `A`
+ --> $DIR/wf.rs:4:12
+ |
+LL | trait A<T: Foo> {}
+ | ^^^ required by this bound in `A`
help: consider restricting type parameter `T`
|
LL | trait B<T: Foo> = A<T>;
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
index 7cf872e..38b2e5a 100644
--- a/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
+++ b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
@@ -3,7 +3,7 @@
|
LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: String {
| ^^^^^^ not a trait
- |
+ |
::: $SRC_DIR/alloc/src/string.rs:LL:COL
|
LL | pub trait ToString {
@@ -12,18 +12,18 @@
help: constrain the associated type to `String`
|
LL | struct Foo<T> where T: Bar, T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:9:54
|
LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String {
| ^^^^^^ not a trait
- |
+ |
::: $SRC_DIR/alloc/src/string.rs:LL:COL
|
LL | pub trait ToString {
@@ -32,18 +32,18 @@
help: constrain the associated type to `String`
|
LL | struct Qux<'a, T> where T: Bar, &'a T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:13:45
|
LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: String {
| ^^^^^^ not a trait
- |
+ |
::: $SRC_DIR/alloc/src/string.rs:LL:COL
|
LL | pub trait ToString {
@@ -52,18 +52,18 @@
help: constrain the associated type to `String`
|
LL | fn foo<T: Bar>(_: T) where T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:16:57
|
LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String {
| ^^^^^^ not a trait
- |
+ |
::: $SRC_DIR/alloc/src/string.rs:LL:COL
|
LL | pub trait ToString {
@@ -72,11 +72,11 @@
help: constrain the associated type to `String`
|
LL | fn qux<'a, T: Bar>(_: &'a T) where &'a T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr
index 170ed6e..6333b4e 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/check-trait-object-bounds-1.rs:12:5
|
-LL | fn f<T: X + ?Sized>() {
- | - required by this bound in `f`
-...
LL | f::<dyn X<Y = str>>();
| ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `f`
+ --> $DIR/check-trait-object-bounds-1.rs:7:9
+ |
+LL | fn f<T: X + ?Sized>() {
+ | ^ required by this bound in `f`
error: aborting due to previous error
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr
index 04e2348..46e8ce7 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr
@@ -1,13 +1,15 @@
error[E0277]: expected a `FnOnce<(&i32,)>` closure, found `i32`
--> $DIR/check-trait-object-bounds-2.rs:13:5
|
-LL | fn f<T: for<'r> X<'r> + ?Sized>() {
- | ------------- required by this bound in `f`
-...
LL | f::<dyn for<'x> X<'x, F = i32>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32`
|
= help: the trait `for<'r> FnOnce<(&'r i32,)>` is not implemented for `i32`
+note: required by a bound in `f`
+ --> $DIR/check-trait-object-bounds-2.rs:8:9
+ |
+LL | fn f<T: for<'r> X<'r> + ?Sized>() {
+ | ^^^^^^^^^^^^^ required by this bound in `f`
error: aborting due to previous error
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr
index fc9f31c..9afae9a 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/check-trait-object-bounds-4.rs:15:5
|
-LL | fn f<T: X + ?Sized>() {
- | - required by this bound in `f`
-...
LL | f::<dyn X<Y = str>>();
| ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
+ |
+note: required by a bound in `f`
+ --> $DIR/check-trait-object-bounds-4.rs:10:9
+ |
+LL | fn f<T: X + ?Sized>() {
+ | ^ required by this bound in `f`
error: aborting due to previous error
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr
index bd2b789..c97408f 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr
@@ -1,11 +1,14 @@
error[E0271]: type mismatch resolving `<i32 as Is>::T == i64`
--> $DIR/check-trait-object-bounds-5.rs:23:5
|
-LL | fn is_obj<T: ?Sized + Obj>(_: &T) {}
- | --- required by this bound in `is_obj`
-...
LL | is_obj(x)
| ^^^^^^ expected `i64`, found `i32`
+ |
+note: required by a bound in `is_obj`
+ --> $DIR/check-trait-object-bounds-5.rs:20:23
+ |
+LL | fn is_obj<T: ?Sized + Obj>(_: &T) {}
+ | ^^^ required by this bound in `is_obj`
error: aborting due to previous error
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr
index ea1fdaf..8935644 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr
@@ -1,11 +1,14 @@
error[E0271]: type mismatch resolving `<i32 as Is>::T == i64`
--> $DIR/check-trait-object-bounds-6.rs:20:5
|
-LL | fn is_obj<T: ?Sized + Obj>(_: &T) {}
- | --- required by this bound in `is_obj`
-...
LL | is_obj(x)
| ^^^^^^ expected `i64`, found `i32`
+ |
+note: required by a bound in `is_obj`
+ --> $DIR/check-trait-object-bounds-6.rs:17:23
+ |
+LL | fn is_obj<T: ?Sized + Obj>(_: &T) {}
+ | ^^^ required by this bound in `is_obj`
error: aborting due to previous error
diff --git a/src/test/ui/traits/bad-method-typaram-kind.stderr b/src/test/ui/traits/bad-method-typaram-kind.stderr
index fd3999a..1e9d151 100644
--- a/src/test/ui/traits/bad-method-typaram-kind.stderr
+++ b/src/test/ui/traits/bad-method-typaram-kind.stderr
@@ -7,7 +7,7 @@
help: consider further restricting this bound
|
LL | fn foo<T:'static + std::marker::Send>() {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/traits/bad-sized.stderr b/src/test/ui/traits/bad-sized.stderr
index 5a9d428..1322b66 100644
--- a/src/test/ui/traits/bad-sized.stderr
+++ b/src/test/ui/traits/bad-sized.stderr
@@ -14,13 +14,13 @@
|
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- |
-LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
- | - required by this bound in `Vec`
|
= help: the trait `Sized` is not implemented for `dyn Trait`
+note: required by a bound in `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ |
+LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
+ | ^ required by this bound in `Vec`
error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
--> $DIR/bad-sized.rs:4:37
@@ -40,13 +40,13 @@
|
LL | let x: Vec<dyn Trait + Sized> = Vec::new();
| ^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- |
-LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
- | - required by this bound in `Vec`
|
= help: the trait `Sized` is not implemented for `dyn Trait`
+note: required by a bound in `Vec`
+ --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ |
+LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
+ | ^ required by this bound in `Vec`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/traits/bound/not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr
index e65b898..0bbf1bf 100644
--- a/src/test/ui/traits/bound/not-on-bare-trait.stderr
+++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr
@@ -6,7 +6,7 @@
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time
--> $DIR/not-on-bare-trait.rs:7:8
@@ -19,7 +19,7 @@
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(_x: &Foo + Send) {
- | ^
+ | +
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/traits/bound/not-on-struct.stderr b/src/test/ui/traits/bound/not-on-struct.stderr
index 951e974..407a4f0 100644
--- a/src/test/ui/traits/bound/not-on-struct.stderr
+++ b/src/test/ui/traits/bound/not-on-struct.stderr
@@ -45,8 +45,9 @@
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn a() -> A {
- | --
+LL - fn a() -> A + 'static {
+LL + fn a() -> A {
+ |
error[E0404]: expected trait, found enum `Result`
--> $DIR/not-on-struct.rs:16:34
@@ -63,8 +64,9 @@
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
- | --
+LL - fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
+LL + fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
+ |
error[E0404]: expected trait, found struct `A`
--> $DIR/not-on-struct.rs:19:21
@@ -81,8 +83,9 @@
| ...because of this bound
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn c() -> A {
- | --
+LL - fn c() -> 'static + A {
+LL + fn c() -> A {
+ |
error[E0404]: expected trait, found enum `Result`
--> $DIR/not-on-struct.rs:22:39
@@ -99,8 +102,9 @@
| ...because of this bound
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
- | --
+LL - fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
+LL + fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
+ |
error[E0404]: expected trait, found struct `A`
--> $DIR/not-on-struct.rs:25:21
@@ -117,8 +121,9 @@
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn e() -> A {
- | ---
+LL - fn e() -> 'static + A + 'static {
+LL + fn e() -> A {
+ |
error[E0404]: expected trait, found enum `Result`
--> $DIR/not-on-struct.rs:29:39
@@ -135,8 +140,9 @@
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
- | -- --
+LL - fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
+LL + fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
+ |
error[E0404]: expected trait, found struct `Traitor`
--> $DIR/not-on-struct.rs:35:11
@@ -155,12 +161,13 @@
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn g() -> Traitor {
- | --
+LL - fn g() -> Traitor + 'static {
+LL + fn g() -> Traitor {
+ |
help: a trait with a similar name exists
|
LL | fn g() -> Trait + 'static {
- | ^^^^^
+ | ~~~~~
error: aborting due to 11 previous errors
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-in-fns.stderr b/src/test/ui/traits/bound/on-structs-and-enums-in-fns.stderr
index 346b690..61237a6 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-in-fns.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-in-fns.stderr
@@ -1,20 +1,26 @@
error[E0277]: the trait bound `u32: Trait` is not satisfied
--> $DIR/on-structs-and-enums-in-fns.rs:13:15
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | fn explode(x: Foo<u32>) {}
| ^^^^^^^^ the trait `Trait` is not implemented for `u32`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums-in-fns.rs:3:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `f32: Trait` is not satisfied
--> $DIR/on-structs-and-enums-in-fns.rs:16:14
|
-LL | enum Bar<T:Trait> {
- | ----- required by this bound in `Bar`
-...
LL | fn kaboom(y: Bar<f32>) {}
| ^^^^^^^^ the trait `Trait` is not implemented for `f32`
+ |
+note: required by a bound in `Bar`
+ --> $DIR/on-structs-and-enums-in-fns.rs:7:12
+ |
+LL | enum Bar<T:Trait> {
+ | ^^^^^ required by this bound in `Bar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-in-impls.stderr b/src/test/ui/traits/bound/on-structs-and-enums-in-impls.stderr
index 47bab6c..8a43742 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-in-impls.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-in-impls.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `u16: Trait` is not satisfied
--> $DIR/on-structs-and-enums-in-impls.rs:20:6
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | impl PolyTrait<Foo<u16>> for Struct {
| ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u16`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums-in-impls.rs:3:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr
index 7480d24..cd33e18 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `usize: Trait` is not satisfied
--> $DIR/on-structs-and-enums-locals.rs:15:14
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | let baz: Foo<usize> = loop { };
| ^^^^^^^^^^ the trait `Trait` is not implemented for `usize`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums-locals.rs:5:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `{integer}: Trait` is not satisfied
--> $DIR/on-structs-and-enums-locals.rs:10:15
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-static.stderr b/src/test/ui/traits/bound/on-structs-and-enums-static.stderr
index 2cf8a62..fda734e 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-static.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-static.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `usize: Trait` is not satisfied
--> $DIR/on-structs-and-enums-static.rs:9:11
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | static X: Foo<usize> = Foo {
| ^^^^^^^^^^ the trait `Trait` is not implemented for `usize`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums-static.rs:5:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr
index 0adb20d..5064b60 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr
@@ -3,22 +3,24 @@
|
LL | fn explode(x: Foo<usize>) {}
| ^^^^^^^^^^ the trait `Trait` is not implemented for `usize`
- |
- ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:5:18
+ |
+note: required by a bound in `Foo`
+ --> $DIR/auxiliary/on_structs_and_enums_xc.rs:5:18
|
LL | pub struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
+ | ^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `f32: Trait` is not satisfied
--> $DIR/on-structs-and-enums-xc.rs:10:14
|
LL | fn kaboom(y: Bar<f32>) {}
| ^^^^^^^^ the trait `Trait` is not implemented for `f32`
- |
- ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16
+ |
+note: required by a bound in `Bar`
+ --> $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16
|
LL | pub enum Bar<T:Trait> {
- | ----- required by this bound in `Bar`
+ | ^^^^^ required by this bound in `Bar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr
index ada2445..0f25c88 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr
@@ -3,11 +3,12 @@
|
LL | let bar: Bar<f64> = return;
| ^^^^^^^^ the trait `Trait` is not implemented for `f64`
- |
- ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16
+ |
+note: required by a bound in `Bar`
+ --> $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16
|
LL | pub enum Bar<T:Trait> {
- | ----- required by this bound in `Bar`
+ | ^^^^^ required by this bound in `Bar`
error[E0277]: the trait bound `{integer}: Trait` is not satisfied
--> $DIR/on-structs-and-enums-xc1.rs:8:15
diff --git a/src/test/ui/traits/bound/on-structs-and-enums.stderr b/src/test/ui/traits/bound/on-structs-and-enums.stderr
index 0c69e7b..fe05b86 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums.stderr
@@ -1,80 +1,98 @@
error[E0277]: the trait bound `T: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:13:9
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | impl<T> Foo<T> {
| ^^^^^^ the trait `Trait` is not implemented for `T`
|
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums.rs:3:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
help: consider restricting type parameter `T`
|
LL | impl<T: Trait> Foo<T> {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `isize: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:19:8
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | a: Foo<isize>,
| ^^^^^^^^^^ the trait `Trait` is not implemented for `isize`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums.rs:3:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `usize: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:23:10
|
-LL | enum Bar<T:Trait> {
- | ----- required by this bound in `Bar`
-...
LL | Quux(Bar<usize>),
| ^^^^^^^^^^ the trait `Trait` is not implemented for `usize`
+ |
+note: required by a bound in `Bar`
+ --> $DIR/on-structs-and-enums.rs:7:12
+ |
+LL | enum Bar<T:Trait> {
+ | ^^^^^ required by this bound in `Bar`
error[E0277]: the trait bound `U: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:27:8
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | b: Foo<U>,
| ^^^^^^ the trait `Trait` is not implemented for `U`
|
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums.rs:3:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
help: consider restricting type parameter `U`
|
LL | struct Badness<U: Trait> {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `V: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:31:21
|
-LL | enum Bar<T:Trait> {
- | ----- required by this bound in `Bar`
-...
LL | EvenMoreBadness(Bar<V>),
| ^^^^^^ the trait `Trait` is not implemented for `V`
|
+note: required by a bound in `Bar`
+ --> $DIR/on-structs-and-enums.rs:7:12
+ |
+LL | enum Bar<T:Trait> {
+ | ^^^^^ required by this bound in `Bar`
help: consider restricting type parameter `V`
|
LL | enum MoreBadness<V: Trait> {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `i32: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:35:5
|
-LL | struct Foo<T:Trait> {
- | ----- required by this bound in `Foo`
-...
LL | Foo<i32>,
| ^^^^^^^^ the trait `Trait` is not implemented for `i32`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/on-structs-and-enums.rs:3:14
+ |
+LL | struct Foo<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `u8: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:39:29
|
-LL | enum Bar<T:Trait> {
- | ----- required by this bound in `Bar`
-...
LL | DictionaryLike { field: Bar<u8> },
| ^^^^^^^ the trait `Trait` is not implemented for `u8`
+ |
+note: required by a bound in `Bar`
+ --> $DIR/on-structs-and-enums.rs:7:12
+ |
+LL | enum Bar<T:Trait> {
+ | ^^^^^ required by this bound in `Bar`
error: aborting due to 7 previous errors
diff --git a/src/test/ui/traits/bound/same-crate-name.stderr b/src/test/ui/traits/bound/same-crate-name.stderr
index c48f2f0..15f5fe1 100644
--- a/src/test/ui/traits/bound/same-crate-name.stderr
+++ b/src/test/ui/traits/bound/same-crate-name.stderr
@@ -3,11 +3,6 @@
|
LL | a::try_foo(foo);
| ^^^ the trait `main::a::Bar` is not implemented for `Foo`
- |
- ::: $DIR/auxiliary/crate_a1.rs:3:24
- |
-LL | pub fn try_foo(x: impl Bar) {}
- | --- required by this bound in `try_foo`
|
help: trait impl with same name found
--> $DIR/auxiliary/crate_a2.rs:5:1
@@ -15,28 +10,29 @@
LL | impl Bar for Foo {}
| ^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `crate_a2` are being used?
+note: required by a bound in `try_foo`
+ --> $DIR/auxiliary/crate_a1.rs:3:24
+ |
+LL | pub fn try_foo(x: impl Bar) {}
+ | ^^^ required by this bound in `try_foo`
error[E0277]: the trait bound `DoesNotImplementTrait: main::a::Bar` is not satisfied
--> $DIR/same-crate-name.rs:38:20
|
LL | a::try_foo(implements_no_traits);
| ^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `DoesNotImplementTrait`
- |
- ::: $DIR/auxiliary/crate_a1.rs:3:24
+ |
+note: required by a bound in `try_foo`
+ --> $DIR/auxiliary/crate_a1.rs:3:24
|
LL | pub fn try_foo(x: impl Bar) {}
- | --- required by this bound in `try_foo`
+ | ^^^ required by this bound in `try_foo`
error[E0277]: the trait bound `ImplementsWrongTraitConditionally<isize>: main::a::Bar` is not satisfied
--> $DIR/same-crate-name.rs:45:20
|
LL | a::try_foo(other_variant_implements_mismatched_trait);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsWrongTraitConditionally<isize>`
- |
- ::: $DIR/auxiliary/crate_a1.rs:3:24
- |
-LL | pub fn try_foo(x: impl Bar) {}
- | --- required by this bound in `try_foo`
|
help: trait impl with same name found
--> $DIR/auxiliary/crate_a2.rs:13:1
@@ -44,20 +40,25 @@
LL | impl Bar for ImplementsWrongTraitConditionally<isize> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `crate_a2` are being used?
+note: required by a bound in `try_foo`
+ --> $DIR/auxiliary/crate_a1.rs:3:24
+ |
+LL | pub fn try_foo(x: impl Bar) {}
+ | ^^^ required by this bound in `try_foo`
error[E0277]: the trait bound `ImplementsTraitForUsize<isize>: main::a::Bar` is not satisfied
--> $DIR/same-crate-name.rs:51:20
|
LL | a::try_foo(other_variant_implements_correct_trait);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsTraitForUsize<isize>`
- |
- ::: $DIR/auxiliary/crate_a1.rs:3:24
- |
-LL | pub fn try_foo(x: impl Bar) {}
- | --- required by this bound in `try_foo`
|
= help: the following implementations were found:
<ImplementsTraitForUsize<usize> as main::a::Bar>
+note: required by a bound in `try_foo`
+ --> $DIR/auxiliary/crate_a1.rs:3:24
+ |
+LL | pub fn try_foo(x: impl Bar) {}
+ | ^^^ required by this bound in `try_foo`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/traits/cycle-cache-err-60010.rs b/src/test/ui/traits/cycle-cache-err-60010.rs
index 98bfcb8..94e7183 100644
--- a/src/test/ui/traits/cycle-cache-err-60010.rs
+++ b/src/test/ui/traits/cycle-cache-err-60010.rs
@@ -25,6 +25,7 @@
}
struct SalsaStorage {
_parse: <ParseQuery as Query<RootDatabase>>::Data,
+ //~^ ERROR overflow
}
impl Database for RootDatabase {
@@ -67,7 +68,6 @@
// we used to fail to report an error here because we got the
// caching wrong.
SourceDatabase::parse(db);
- //~^ ERROR overflow
22
}
diff --git a/src/test/ui/traits/cycle-cache-err-60010.stderr b/src/test/ui/traits/cycle-cache-err-60010.stderr
index 5658996..9452e11 100644
--- a/src/test/ui/traits/cycle-cache-err-60010.stderr
+++ b/src/test/ui/traits/cycle-cache-err-60010.stderr
@@ -1,8 +1,8 @@
error[E0275]: overflow evaluating the requirement `SalsaStorage: RefUnwindSafe`
- --> $DIR/cycle-cache-err-60010.rs:69:5
+ --> $DIR/cycle-cache-err-60010.rs:27:13
|
-LL | SourceDatabase::parse(db);
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | _parse: <ParseQuery as Query<RootDatabase>>::Data,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: required because it appears within the type `*const SalsaStorage`
= note: required because it appears within the type `Unique<SalsaStorage>`
@@ -18,15 +18,15 @@
LL | struct RootDatabase {
| ^^^^^^^^^^^^
note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase`
- --> $DIR/cycle-cache-err-60010.rs:43:9
+ --> $DIR/cycle-cache-err-60010.rs:44:9
|
LL | impl<T> SourceDatabase for T
| ^^^^^^^^^^^^^^ ^
-note: required by `SourceDatabase::parse`
- --> $DIR/cycle-cache-err-60010.rs:14:5
+note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
+ --> $DIR/cycle-cache-err-60010.rs:37:10
|
-LL | fn parse(&self) {
- | ^^^^^^^^^^^^^^^
+LL | impl<DB> Query<DB> for ParseQuery
+ | ^^^^^^^^^ ^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/traits/impl-bounds-checking.stderr b/src/test/ui/traits/impl-bounds-checking.stderr
index 8698ed6..b01bacd 100644
--- a/src/test/ui/traits/impl-bounds-checking.stderr
+++ b/src/test/ui/traits/impl-bounds-checking.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `isize: Clone2` is not satisfied
--> $DIR/impl-bounds-checking.rs:10:6
|
-LL | trait Getter<T: Clone2> {
- | ------ required by this bound in `Getter`
-...
LL | impl Getter<isize> for isize {
| ^^^^^^^^^^^^^ the trait `Clone2` is not implemented for `isize`
+ |
+note: required by a bound in `Getter`
+ --> $DIR/impl-bounds-checking.rs:6:17
+ |
+LL | trait Getter<T: Clone2> {
+ | ^^^^^^ required by this bound in `Getter`
error: aborting due to previous error
diff --git a/src/test/ui/traits/inductive-overflow/lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs
index b75da1b..8be42fc 100644
--- a/src/test/ui/traits/inductive-overflow/lifetime.rs
+++ b/src/test/ui/traits/inductive-overflow/lifetime.rs
@@ -15,17 +15,17 @@
struct C<'a>(&'a ());
struct X<T: Y>(T::P);
-impl<T: NotAuto> NotAuto for Box<T> {}
-impl<T: Y> NotAuto for X<T> where T::P: NotAuto {} //~ NOTE: required
+impl<T: NotAuto> NotAuto for Box<T> {} //~ NOTE: required
+impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
impl<'a> NotAuto for C<'a> {}
fn is_send<S: NotAuto>() {}
//~^ NOTE: required
-
+//~| NOTE: required
fn main() {
// Should only be a few notes.
is_send::<X<C<'static>>>();
//~^ ERROR overflow evaluating
- //~| 2 redundant requirements hidden
+ //~| 3 redundant requirements hidden
//~| required because of
}
diff --git a/src/test/ui/traits/inductive-overflow/lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr
index cc91393..2ffcdb0 100644
--- a/src/test/ui/traits/inductive-overflow/lifetime.stderr
+++ b/src/test/ui/traits/inductive-overflow/lifetime.stderr
@@ -1,19 +1,21 @@
-error[E0275]: overflow evaluating the requirement `Box<X<C<'_>>>: NotAuto`
+error[E0275]: overflow evaluating the requirement `X<C<'_>>: NotAuto`
--> $DIR/lifetime.rs:27:5
|
-LL | fn is_send<S: NotAuto>() {}
- | ------- required by this bound in `is_send`
-...
LL | is_send::<X<C<'static>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: required because of the requirements on the impl of `NotAuto` for `X<C<'_>>`
- --> $DIR/lifetime.rs:19:12
+note: required because of the requirements on the impl of `NotAuto` for `Box<X<C<'_>>>`
+ --> $DIR/lifetime.rs:18:18
|
-LL | impl<T: Y> NotAuto for X<T> where T::P: NotAuto {}
- | ^^^^^^^ ^^^^
- = note: 2 redundant requirements hidden
+LL | impl<T: NotAuto> NotAuto for Box<T> {}
+ | ^^^^^^^ ^^^^^^
+ = note: 3 redundant requirements hidden
= note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
+note: required by a bound in `is_send`
+ --> $DIR/lifetime.rs:22:15
+ |
+LL | fn is_send<S: NotAuto>() {}
+ | ^^^^^^^ required by this bound in `is_send`
error: aborting due to previous error
diff --git a/src/test/ui/traits/inductive-overflow/simultaneous.stderr b/src/test/ui/traits/inductive-overflow/simultaneous.stderr
index 94a255f..230c263 100644
--- a/src/test/ui/traits/inductive-overflow/simultaneous.stderr
+++ b/src/test/ui/traits/inductive-overflow/simultaneous.stderr
@@ -1,9 +1,6 @@
-error[E0275]: overflow evaluating the requirement `{integer}: Tweedledee`
+error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum`
--> $DIR/simultaneous.rs:18:5
|
-LL | fn is_ee<T: Combo>(t: T) {
- | ----- required by this bound in `is_ee`
-...
LL | is_ee(4);
| ^^^^^
|
@@ -12,6 +9,11 @@
|
LL | impl<T: Tweedledee + Tweedledum> Combo for T {}
| ^^^^^ ^
+note: required by a bound in `is_ee`
+ --> $DIR/simultaneous.rs:13:13
+ |
+LL | fn is_ee<T: Combo>(t: T) {
+ | ^^^^^ required by this bound in `is_ee`
error: aborting due to previous error
diff --git a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
index 6a0f739..5206b57 100644
--- a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
+++ b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
@@ -9,13 +9,15 @@
error[E0277]: the trait bound `NoClone: Copy` is not satisfied
--> $DIR/supertrait-auto-trait.rs:16:23
|
-LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
- | ----- required by this bound in `copy`
-...
LL | let (a, b) = copy(NoClone);
| ^^^^^^^ the trait `Copy` is not implemented for `NoClone`
|
= note: required because of the requirements on the impl of `Magic` for `NoClone`
+note: required by a bound in `copy`
+ --> $DIR/supertrait-auto-trait.rs:10:12
+ |
+LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
+ | ^^^^^ required by this bound in `copy`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/inductive-overflow/supertrait.stderr b/src/test/ui/traits/inductive-overflow/supertrait.stderr
index 5ed1c2c..95325a5 100644
--- a/src/test/ui/traits/inductive-overflow/supertrait.stderr
+++ b/src/test/ui/traits/inductive-overflow/supertrait.stderr
@@ -1,9 +1,6 @@
error[E0275]: overflow evaluating the requirement `NoClone: Magic`
--> $DIR/supertrait.rs:13:18
|
-LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
- | ----- required by this bound in `copy`
-...
LL | let (a, b) = copy(NoClone);
| ^^^^
|
@@ -12,6 +9,11 @@
|
LL | impl<T: Magic> Magic for T {}
| ^^^^^ ^
+note: required by a bound in `copy`
+ --> $DIR/supertrait.rs:7:12
+ |
+LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
+ | ^^^^^ required by this bound in `copy`
error: aborting due to previous error
diff --git a/src/test/ui/traits/inductive-overflow/two-traits.stderr b/src/test/ui/traits/inductive-overflow/two-traits.stderr
index 508a12d..28610c9 100644
--- a/src/test/ui/traits/inductive-overflow/two-traits.stderr
+++ b/src/test/ui/traits/inductive-overflow/two-traits.stderr
@@ -1,25 +1,30 @@
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/two-traits.rs:11:5
|
-LL | type X: Trait;
- | ----- required by this bound in `Magic::X`
-...
LL | type X = Self;
| ^^^^^^^^^^^^^^ `T` cannot be shared between threads safely
|
+note: required by a bound in `Magic::X`
+ --> $DIR/two-traits.rs:8:13
+ |
+LL | type X: Trait;
+ | ^^^^^ required by this bound in `Magic::X`
help: consider further restricting this bound
|
LL | impl<T: Magic + std::marker::Sync> Magic for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0275]: overflow evaluating the requirement `*mut (): Magic`
--> $DIR/two-traits.rs:20:5
|
-LL | fn wizard<T: Magic>() { check::<<T as Magic>::X>(); }
- | ----- required by this bound in `wizard`
-...
LL | wizard::<*mut ()>();
| ^^^^^^^^^^^^^^^^^
+ |
+note: required by a bound in `wizard`
+ --> $DIR/two-traits.rs:17:14
+ |
+LL | fn wizard<T: Magic>() { check::<<T as Magic>::X>(); }
+ | ^^^^^ required by this bound in `wizard`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
index bc7b863..fa8799b 100644
--- a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
+++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
@@ -13,7 +13,7 @@
help: consider further restricting this bound
|
LL | fn with_trait<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool {
- | ^^^^^^^^^^^^^^^^
+ | ++++++++++++++++
error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied
--> $DIR/repeated-supertrait-ambig.rs:34:5
@@ -41,7 +41,7 @@
help: consider further restricting this bound
|
LL | fn with_ufcs2<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool {
- | ^^^^^^^^^^^^^^^^
+ | ++++++++++++++++
error[E0277]: the trait bound `i64: CompareTo<i32>` is not satisfied
--> $DIR/repeated-supertrait-ambig.rs:42:23
diff --git a/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr b/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr
index 4807a09..cb1128f 100644
--- a/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr
+++ b/src/test/ui/traits/issue-65284-suggest-generic-trait-bound.stderr
@@ -8,7 +8,7 @@
help: the following trait defines an item `foo`, perhaps you need to restrict type parameter `T` with it:
|
LL | fn do_stuff<T: Foo + Bar>(t : T) {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/traits/issue-65673.stderr b/src/test/ui/traits/issue-65673.stderr
index 64cc0ba..fba24d6 100644
--- a/src/test/ui/traits/issue-65673.stderr
+++ b/src/test/ui/traits/issue-65673.stderr
@@ -1,13 +1,15 @@
error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time
--> $DIR/issue-65673.rs:9:5
|
-LL | type Ctx;
- | --------- required by this bound in `WithType::Ctx`
-...
LL | type Ctx = dyn Alias<T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `(dyn Trait + 'static)`
+note: required by a bound in `WithType::Ctx`
+ --> $DIR/issue-65673.rs:4:5
+ |
+LL | type Ctx;
+ | ^^^^^^^^^ required by this bound in `WithType::Ctx`
error: aborting due to previous error
diff --git a/src/test/ui/traits/issue-72410.stderr b/src/test/ui/traits/issue-72410.stderr
index c91d1db..c7beb83 100644
--- a/src/test/ui/traits/issue-72410.stderr
+++ b/src/test/ui/traits/issue-72410.stderr
@@ -14,11 +14,11 @@
help: consider turning `map` into a method by giving it a `&self` argument
|
LL | fn map(&self)
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `map` so it does not apply to trait objects
|
LL | where for<'a> &'a mut [dyn Bar]:, Self: Sized ;
- | ^^^^^^^^^^^^^
+ | +++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/traits/issue-78372.stderr b/src/test/ui/traits/issue-78372.stderr
index e63740c..0150ff4 100644
--- a/src/test/ui/traits/issue-78372.stderr
+++ b/src/test/ui/traits/issue-78372.stderr
@@ -20,11 +20,11 @@
help: a type parameter with a similar name exists
|
LL | impl<T> DispatchFromDyn<Smaht<T, MISC>> for T {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<T, U> DispatchFromDyn<Smaht<U, MISC>> for T {}
- | ^^^
+ | +++
error[E0412]: cannot find type `MISC` in this scope
--> $DIR/issue-78372.rs:3:34
diff --git a/src/test/ui/traits/issue-85735.rs b/src/test/ui/traits/issue-85735.rs
new file mode 100644
index 0000000..16e874e
--- /dev/null
+++ b/src/test/ui/traits/issue-85735.rs
@@ -0,0 +1,13 @@
+// Regression test for the invalid suggestion in #85735 (the
+// underlying issue #21974 still exists here).
+
+trait Foo {}
+impl<'a, 'b, T> Foo for T
+where
+ T: FnMut(&'a ()),
+ //~^ ERROR: type annotations needed [E0283]
+ T: FnMut(&'b ()),
+{
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/issue-85735.stderr b/src/test/ui/traits/issue-85735.stderr
new file mode 100644
index 0000000..1f81fa7
--- /dev/null
+++ b/src/test/ui/traits/issue-85735.stderr
@@ -0,0 +1,20 @@
+error[E0283]: type annotations needed
+ --> $DIR/issue-85735.rs:7:8
+ |
+LL | T: FnMut(&'a ()),
+ | ^^^^^^^^^^^^^ cannot infer type for type parameter `T`
+ |
+ = note: cannot satisfy `T: FnMut<(&'a (),)>`
+note: required by a bound in `FnMut`
+ --> $SRC_DIR/core/src/ops/function.rs:LL:COL
+ |
+LL | / pub trait FnMut<Args>: FnOnce<Args> {
+LL | | /// Performs the call operation.
+LL | | #[unstable(feature = "fn_traits", issue = "29625")]
+LL | | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
+LL | | }
+ | |_^ required by this bound in `FnMut`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/traits/multidispatch-bad.stderr b/src/test/ui/traits/multidispatch-bad.stderr
index 8d4813c..ccdace1 100644
--- a/src/test/ui/traits/multidispatch-bad.stderr
+++ b/src/test/ui/traits/multidispatch-bad.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `i32` to `u32`
|
LL | test(22i32, 44u32);
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/traits/mutual-recursion-issue-75860.stderr b/src/test/ui/traits/mutual-recursion-issue-75860.stderr
index cf867ef..d2ac3a8 100644
--- a/src/test/ui/traits/mutual-recursion-issue-75860.stderr
+++ b/src/test/ui/traits/mutual-recursion-issue-75860.stderr
@@ -3,13 +3,13 @@
|
LL | iso(left, right)
| ^^^
- |
- ::: $SRC_DIR/core/src/option.rs:LL:COL
- |
-LL | pub enum Option<T> {
- | - required by this bound in `Option`
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`mutual_recursion_issue_75860`)
+note: required by a bound in `Option`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub enum Option<T> {
+ | ^ required by this bound in `Option`
error: aborting due to previous error
diff --git a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr
index cad298c..ad95e06 100644
--- a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr
+++ b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr
@@ -14,43 +14,46 @@
error[E0277]: `dummy::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:23:5
|
-LL | struct Outer<T: Send>(T);
- | ---- required by this bound in `Outer`
-...
LL | Outer(TestType);
| ^^^^^^^^^^^^^^^ `dummy::TestType` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `dummy::TestType`
+note: required by a bound in `Outer`
+ --> $DIR/negated-auto-traits-error.rs:10:17
+ |
+LL | struct Outer<T: Send>(T);
+ | ^^^^ required by this bound in `Outer`
error[E0277]: `dummy1b::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:32:13
|
-LL | fn is_send<T: Send>(_: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(TestType);
| ^^^^^^^^ `dummy1b::TestType` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `dummy1b::TestType`
+note: required by a bound in `is_send`
+ --> $DIR/negated-auto-traits-error.rs:16:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
error[E0277]: `dummy1c::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:40:13
|
-LL | fn is_send<T: Send>(_: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send((8, TestType));
| ^^^^^^^^^^^^^ `dummy1c::TestType` cannot be sent between threads safely
|
= help: within `({integer}, dummy1c::TestType)`, the trait `Send` is not implemented for `dummy1c::TestType`
= note: required because it appears within the type `({integer}, dummy1c::TestType)`
+note: required by a bound in `is_send`
+ --> $DIR/negated-auto-traits-error.rs:16:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
error[E0277]: `dummy2::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:48:13
|
-LL | fn is_send<T: Send>(_: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(Box::new(TestType));
| ^^^^^^^^^^^^^^^^^^
| |
@@ -60,13 +63,15 @@
= note: the trait bound `dummy2::TestType: Send` is not satisfied
= note: required because of the requirements on the impl of `Send` for `Unique<dummy2::TestType>`
= note: required because it appears within the type `Box<dummy2::TestType>`
+note: required by a bound in `is_send`
+ --> $DIR/negated-auto-traits-error.rs:16:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
error[E0277]: `dummy3::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:56:13
|
-LL | fn is_send<T: Send>(_: T) {}
- | ---- required by this bound in `is_send`
-...
LL | is_send(Box::new(Outer2(TestType)));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `dummy3::TestType` cannot be sent between threads safely
|
@@ -78,13 +83,15 @@
| ^^^^^^
= note: required because of the requirements on the impl of `Send` for `Unique<Outer2<dummy3::TestType>>`
= note: required because it appears within the type `Box<Outer2<dummy3::TestType>>`
+note: required by a bound in `is_send`
+ --> $DIR/negated-auto-traits-error.rs:16:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
error[E0277]: `main::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:66:13
|
-LL | fn is_sync<T: Sync>(_: T) {}
- | ---- required by this bound in `is_sync`
-...
LL | is_sync(Outer2(TestType));
| ^^^^^^^^^^^^^^^^
| |
@@ -97,6 +104,11 @@
|
LL | unsafe impl<T: Send> Sync for Outer2<T> {}
| ^^^^ ^^^^^^^^^
+note: required by a bound in `is_sync`
+ --> $DIR/negated-auto-traits-error.rs:17:15
+ |
+LL | fn is_sync<T: Sync>(_: T) {}
+ | ^^^^ required by this bound in `is_sync`
error: aborting due to 7 previous errors
diff --git a/src/test/ui/traits/object/safety.stderr b/src/test/ui/traits/object/safety.stderr
index 6784689..cf534d9 100644
--- a/src/test/ui/traits/object/safety.stderr
+++ b/src/test/ui/traits/object/safety.stderr
@@ -16,11 +16,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0038]: the trait `Tr` cannot be made into an object
--> $DIR/safety.rs:15:12
@@ -38,11 +38,11 @@
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/object/vs-lifetime.stderr b/src/test/ui/traits/object/vs-lifetime.stderr
index 40f5fcb..2244652 100644
--- a/src/test/ui/traits/object/vs-lifetime.stderr
+++ b/src/test/ui/traits/object/vs-lifetime.stderr
@@ -32,7 +32,7 @@
help: add missing generic argument
|
LL | let _: S<'static, 'static, T>;
- | ^^^
+ | +++
error[E0224]: at least one trait is required for an object type
--> $DIR/vs-lifetime.rs:14:14
diff --git a/src/test/ui/traits/reservation-impl/non-lattice-ok.rs b/src/test/ui/traits/reservation-impl/non-lattice-ok.rs
index b894577..a710512 100644
--- a/src/test/ui/traits/reservation-impl/non-lattice-ok.rs
+++ b/src/test/ui/traits/reservation-impl/non-lattice-ok.rs
@@ -5,7 +5,7 @@
// Why did we ever want to do this?
//
-// We want to eventually add a `impl<T> From<!> for T` impl. That impl conflicts
+// We want to eventually add an `impl<T> From<!> for T` impl. That impl conflicts
// with existing impls - at least the `impl<T> From<T> for T` impl. There are
// 2 ways we thought of for dealing with that conflict:
//
@@ -23,7 +23,7 @@
// actually cause any ambiguity.
//
// Now it turned out lattice specialization doesn't work it, because an
-// `impl<T> From<T> for Smaht<T>` would require a `impl From<!> for Smaht<!>`,
+// `impl<T> From<T> for Smaht<T>` would require an `impl From<!> for Smaht<!>`,
// breaking backwards-compatibility in a fairly painful way. So if we want to
// go with a known approach, we should go with a "marker trait overlap"-style
// approach.
diff --git a/src/test/ui/traits/resolution-in-overloaded-op.stderr b/src/test/ui/traits/resolution-in-overloaded-op.stderr
index 6a641ed..049fffe 100644
--- a/src/test/ui/traits/resolution-in-overloaded-op.stderr
+++ b/src/test/ui/traits/resolution-in-overloaded-op.stderr
@@ -9,7 +9,7 @@
help: consider further restricting this bound
|
LL | fn foo<T: MyMul<f64, f64> + std::ops::Mul<Output = f64>>(a: &T, b: f64) -> f64 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/issue-39029.stderr b/src/test/ui/traits/suggest-deferences/issue-39029.stderr
index 1005231..10eeec2 100644
--- a/src/test/ui/traits/suggest-deferences/issue-39029.stderr
+++ b/src/test/ui/traits/suggest-deferences/issue-39029.stderr
@@ -6,13 +6,13 @@
| |
| the trait `ToSocketAddrs` is not implemented for `NoToSocketAddrs`
| help: consider adding dereference here: `&*bad`
- |
- ::: $SRC_DIR/std/src/net/tcp.rs:LL:COL
- |
-LL | pub fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<TcpListener> {
- | ------------- required by this bound in `TcpListener::bind`
|
= note: required because of the requirements on the impl of `ToSocketAddrs` for `&NoToSocketAddrs`
+note: required by a bound in `TcpListener::bind`
+ --> $SRC_DIR/std/src/net/tcp.rs:LL:COL
+ |
+LL | pub fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<TcpListener> {
+ | ^^^^^^^^^^^^^ required by this bound in `TcpListener::bind`
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/issue-62530.stderr b/src/test/ui/traits/suggest-deferences/issue-62530.stderr
index 4f1165b..750c8a8 100644
--- a/src/test/ui/traits/suggest-deferences/issue-62530.stderr
+++ b/src/test/ui/traits/suggest-deferences/issue-62530.stderr
@@ -1,14 +1,17 @@
error[E0277]: the trait bound `&String: SomeTrait` is not satisfied
--> $DIR/issue-62530.rs:13:26
|
-LL | fn takes_type_parameter<T>(_x: T) where T: SomeTrait {}
- | --------- required by this bound in `takes_type_parameter`
-...
LL | takes_type_parameter(&string); // Error
| ^^^^^^^
| |
| the trait `SomeTrait` is not implemented for `&String`
| help: consider adding dereference here: `&*string`
+ |
+note: required by a bound in `takes_type_parameter`
+ --> $DIR/issue-62530.rs:4:44
+ |
+LL | fn takes_type_parameter<T>(_x: T) where T: SomeTrait {}
+ | ^^^^^^^^^ required by this bound in `takes_type_parameter`
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/multiple-0.stderr b/src/test/ui/traits/suggest-deferences/multiple-0.stderr
index f76c73c..6fcf878 100644
--- a/src/test/ui/traits/suggest-deferences/multiple-0.stderr
+++ b/src/test/ui/traits/suggest-deferences/multiple-0.stderr
@@ -1,14 +1,17 @@
error[E0277]: the trait bound `&Baz: Happy` is not satisfied
--> $DIR/multiple-0.rs:34:9
|
-LL | fn foo<T>(_: T) where T: Happy {}
- | ----- required by this bound in `foo`
-...
LL | foo(&baz);
| ^^^^
| |
| the trait `Happy` is not implemented for `&Baz`
| help: consider adding dereference here: `&***baz`
+ |
+note: required by a bound in `foo`
+ --> $DIR/multiple-0.rs:30:26
+ |
+LL | fn foo<T>(_: T) where T: Happy {}
+ | ^^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/multiple-1.stderr b/src/test/ui/traits/suggest-deferences/multiple-1.stderr
index f98cc54..268f375 100644
--- a/src/test/ui/traits/suggest-deferences/multiple-1.stderr
+++ b/src/test/ui/traits/suggest-deferences/multiple-1.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `&mut Baz: Happy` is not satisfied
--> $DIR/multiple-1.rs:52:9
|
-LL | fn foo<T>(_: T) where T: Happy {}
- | ----- required by this bound in `foo`
-...
LL | foo(&mut baz);
| ^^^^^^^^ the trait `Happy` is not implemented for `&mut Baz`
+ |
+note: required by a bound in `foo`
+ --> $DIR/multiple-1.rs:45:26
+ |
+LL | fn foo<T>(_: T) where T: Happy {}
+ | ^^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr
index f15e7e3..d955cb0 100644
--- a/src/test/ui/traits/suggest-where-clause.stderr
+++ b/src/test/ui/traits/suggest-where-clause.stderr
@@ -6,11 +6,17 @@
LL | // suggest a where-clause, if needed
LL | mem::size_of::<U>();
| ^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
+ | ^ required by this bound in `std::mem::size_of`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn check<T: Iterator, U: ?Sized>() {
+LL + fn check<T: Iterator, U>() {
+ |
error[E0277]: the size for values of type `U` cannot be known at compilation time
--> $DIR/suggest-where-clause.rs:10:5
@@ -20,17 +26,22 @@
...
LL | mem::size_of::<Misc<U>>();
| ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
-LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
|
note: required because it appears within the type `Misc<U>`
--> $DIR/suggest-where-clause.rs:3:8
|
LL | struct Misc<T:?Sized>(T);
| ^^^^
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+LL | pub const fn size_of<T>() -> usize {
+ | ^ required by this bound in `std::mem::size_of`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn check<T: Iterator, U: ?Sized>() {
+LL + fn check<T: Iterator, U>() {
+ |
error[E0277]: the trait bound `u64: From<T>` is not satisfied
--> $DIR/suggest-where-clause.rs:15:5
@@ -46,7 +57,7 @@
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfied
--> $DIR/suggest-where-clause.rs:18:5
@@ -62,7 +73,7 @@
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied
--> $DIR/suggest-where-clause.rs:23:5
@@ -81,26 +92,26 @@
|
LL | mem::size_of::<[T]>();
| ^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
-LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
|
= help: the trait `Sized` is not implemented for `[T]`
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+LL | pub const fn size_of<T>() -> usize {
+ | ^ required by this bound in `std::mem::size_of`
error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
--> $DIR/suggest-where-clause.rs:31:5
|
LL | mem::size_of::<[&U]>();
| ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
- |
-LL | pub const fn size_of<T>() -> usize {
- | - required by this bound in `std::mem::size_of`
|
= help: the trait `Sized` is not implemented for `[&U]`
+note: required by a bound in `std::mem::size_of`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+LL | pub const fn size_of<T>() -> usize {
+ | ^ required by this bound in `std::mem::size_of`
error: aborting due to 7 previous errors
diff --git a/src/test/ui/traits/trait-upcasting/basic.rs b/src/test/ui/traits/trait-upcasting/basic.rs
new file mode 100644
index 0000000..484a222
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/basic.rs
@@ -0,0 +1,87 @@
+// run-pass
+
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
+ fn a(&self) -> i32 {
+ 10
+ }
+
+ fn z(&self) -> i32 {
+ 11
+ }
+
+ fn y(&self) -> i32 {
+ 12
+ }
+}
+
+trait Bar: Foo {
+ fn b(&self) -> i32 {
+ 20
+ }
+
+ fn w(&self) -> i32 {
+ 21
+ }
+}
+
+trait Baz: Bar {
+ fn c(&self) -> i32 {
+ 30
+ }
+}
+
+impl Foo for i32 {
+ fn a(&self) -> i32 {
+ 100
+ }
+}
+
+impl Bar for i32 {
+ fn b(&self) -> i32 {
+ 200
+ }
+}
+
+impl Baz for i32 {
+ fn c(&self) -> i32 {
+ 300
+ }
+}
+
+fn main() {
+ let baz: &dyn Baz = &1;
+ let _: &dyn std::fmt::Debug = baz;
+ assert_eq!(*baz, 1);
+ assert_eq!(baz.a(), 100);
+ assert_eq!(baz.b(), 200);
+ assert_eq!(baz.c(), 300);
+ assert_eq!(baz.z(), 11);
+ assert_eq!(baz.y(), 12);
+ assert_eq!(baz.w(), 21);
+
+ let bar: &dyn Bar = baz;
+ let _: &dyn std::fmt::Debug = bar;
+ assert_eq!(*bar, 1);
+ assert_eq!(bar.a(), 100);
+ assert_eq!(bar.b(), 200);
+ assert_eq!(bar.z(), 11);
+ assert_eq!(bar.y(), 12);
+ assert_eq!(bar.w(), 21);
+
+ let foo: &dyn Foo = baz;
+ let _: &dyn std::fmt::Debug = foo;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+
+ let foo: &dyn Foo = bar;
+ let _: &dyn std::fmt::Debug = foo;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+}
diff --git a/src/test/ui/traits/trait-upcasting/correct-supertrait-substitution.rs b/src/test/ui/traits/trait-upcasting/correct-supertrait-substitution.rs
new file mode 100644
index 0000000..8d0a9ef
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/correct-supertrait-substitution.rs
@@ -0,0 +1,39 @@
+// run-pass
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo<T: Default + ToString>: Bar<i32> + Bar<T> {}
+trait Bar<T: Default + ToString> {
+ fn bar(&self) -> String {
+ T::default().to_string()
+ }
+}
+
+struct S1;
+
+impl Bar<i32> for S1 {}
+impl Foo<i32> for S1 {}
+
+struct S2;
+impl Bar<i32> for S2 {}
+impl Bar<bool> for S2 {}
+impl Foo<bool> for S2 {}
+
+fn test1(x: &dyn Foo<i32>) {
+ let s = x as &dyn Bar<i32>;
+ assert_eq!("0", &s.bar().to_string());
+}
+
+fn test2(x: &dyn Foo<bool>) {
+ let p = x as &dyn Bar<i32>;
+ assert_eq!("0", &p.bar().to_string());
+ let q = x as &dyn Bar<bool>;
+ assert_eq!("false", &q.bar().to_string());
+}
+
+fn main() {
+ let s1 = S1;
+ test1(&s1);
+ let s2 = S2;
+ test2(&s2);
+}
diff --git a/src/test/ui/traits/trait-upcasting/cyclic-trait-resolution.rs b/src/test/ui/traits/trait-upcasting/cyclic-trait-resolution.rs
new file mode 100644
index 0000000..511e415
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/cyclic-trait-resolution.rs
@@ -0,0 +1,13 @@
+trait A: B + A {}
+//~^ ERROR cycle detected when computing the super predicates of `A` [E0391]
+
+trait B {}
+
+impl A for () {}
+
+impl B for () {}
+
+fn main() {
+ let a: Box<dyn A> = Box::new(());
+ let _b: Box<dyn B> = a;
+}
diff --git a/src/test/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr b/src/test/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
new file mode 100644
index 0000000..ac00572
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/cyclic-trait-resolution.stderr
@@ -0,0 +1,21 @@
+error[E0391]: cycle detected when computing the super predicates of `A`
+ --> $DIR/cyclic-trait-resolution.rs:1:1
+ |
+LL | trait A: B + A {}
+ | ^^^^^^^^^^^^^^
+ |
+note: ...which requires computing the super traits of `A`...
+ --> $DIR/cyclic-trait-resolution.rs:1:14
+ |
+LL | trait A: B + A {}
+ | ^
+ = note: ...which again requires computing the super predicates of `A`, completing the cycle
+note: cycle used when collecting item types in top-level module
+ --> $DIR/cyclic-trait-resolution.rs:1:1
+ |
+LL | trait A: B + A {}
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/traits/trait-upcasting/diamond.rs b/src/test/ui/traits/trait-upcasting/diamond.rs
new file mode 100644
index 0000000..e4e23c1
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/diamond.rs
@@ -0,0 +1,115 @@
+// run-pass
+
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
+ fn a(&self) -> i32 {
+ 10
+ }
+
+ fn z(&self) -> i32 {
+ 11
+ }
+
+ fn y(&self) -> i32 {
+ 12
+ }
+}
+
+trait Bar1: Foo {
+ fn b(&self) -> i32 {
+ 20
+ }
+
+ fn w(&self) -> i32 {
+ 21
+ }
+}
+
+trait Bar2: Foo {
+ fn c(&self) -> i32 {
+ 30
+ }
+
+ fn v(&self) -> i32 {
+ 31
+ }
+}
+
+trait Baz: Bar1 + Bar2 {
+ fn d(&self) -> i32 {
+ 40
+ }
+}
+
+impl Foo for i32 {
+ fn a(&self) -> i32 {
+ 100
+ }
+}
+
+impl Bar1 for i32 {
+ fn b(&self) -> i32 {
+ 200
+ }
+}
+
+impl Bar2 for i32 {
+ fn c(&self) -> i32 {
+ 300
+ }
+}
+
+impl Baz for i32 {
+ fn d(&self) -> i32 {
+ 400
+ }
+}
+
+fn main() {
+ let baz: &dyn Baz = &1;
+ let _: &dyn std::fmt::Debug = baz;
+ assert_eq!(*baz, 1);
+ assert_eq!(baz.a(), 100);
+ assert_eq!(baz.b(), 200);
+ assert_eq!(baz.c(), 300);
+ assert_eq!(baz.d(), 400);
+ assert_eq!(baz.z(), 11);
+ assert_eq!(baz.y(), 12);
+ assert_eq!(baz.w(), 21);
+ assert_eq!(baz.v(), 31);
+
+ let bar1: &dyn Bar1 = baz;
+ let _: &dyn std::fmt::Debug = bar1;
+ assert_eq!(*bar1, 1);
+ assert_eq!(bar1.a(), 100);
+ assert_eq!(bar1.b(), 200);
+ assert_eq!(bar1.z(), 11);
+ assert_eq!(bar1.y(), 12);
+ assert_eq!(bar1.w(), 21);
+
+ let bar2: &dyn Bar2 = baz;
+ let _: &dyn std::fmt::Debug = bar2;
+ assert_eq!(*bar2, 1);
+ assert_eq!(bar2.a(), 100);
+ assert_eq!(bar2.c(), 300);
+ assert_eq!(bar2.z(), 11);
+ assert_eq!(bar2.y(), 12);
+ assert_eq!(bar2.v(), 31);
+
+ let foo: &dyn Foo = baz;
+ let _: &dyn std::fmt::Debug = foo;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+
+ let foo: &dyn Foo = bar1;
+ let _: &dyn std::fmt::Debug = foo;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+
+ let foo: &dyn Foo = bar2;
+ let _: &dyn std::fmt::Debug = foo;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+}
diff --git a/src/test/ui/traits/trait-upcasting/invalid-upcast.rs b/src/test/ui/traits/trait-upcasting/invalid-upcast.rs
new file mode 100644
index 0000000..2402245
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/invalid-upcast.rs
@@ -0,0 +1,87 @@
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo {
+ fn a(&self) -> i32 {
+ 10
+ }
+
+ fn z(&self) -> i32 {
+ 11
+ }
+
+ fn y(&self) -> i32 {
+ 12
+ }
+}
+
+trait Bar {
+ fn b(&self) -> i32 {
+ 20
+ }
+
+ fn w(&self) -> i32 {
+ 21
+ }
+}
+
+trait Baz {
+ fn c(&self) -> i32 {
+ 30
+ }
+}
+
+impl Foo for i32 {
+ fn a(&self) -> i32 {
+ 100
+ }
+}
+
+impl Bar for i32 {
+ fn b(&self) -> i32 {
+ 200
+ }
+}
+
+impl Baz for i32 {
+ fn c(&self) -> i32 {
+ 300
+ }
+}
+
+fn main() {
+ let baz: &dyn Baz = &1;
+ let _: &dyn std::fmt::Debug = baz;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Send = baz;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Sync = baz;
+ //~^ ERROR mismatched types [E0308]
+
+ let bar: &dyn Bar = baz;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn std::fmt::Debug = bar;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Send = bar;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Sync = bar;
+ //~^ ERROR mismatched types [E0308]
+
+ let foo: &dyn Foo = baz;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn std::fmt::Debug = foo;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Send = foo;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Sync = foo;
+ //~^ ERROR mismatched types [E0308]
+
+ let foo: &dyn Foo = bar;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn std::fmt::Debug = foo;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Send = foo;
+ //~^ ERROR mismatched types [E0308]
+ let _: &dyn Sync = foo;
+ //~^ ERROR mismatched types [E0308]
+}
diff --git a/src/test/ui/traits/trait-upcasting/invalid-upcast.stderr b/src/test/ui/traits/trait-upcasting/invalid-upcast.stderr
new file mode 100644
index 0000000..b4530ed
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/invalid-upcast.stderr
@@ -0,0 +1,168 @@
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:54:35
+ |
+LL | let _: &dyn std::fmt::Debug = baz;
+ | -------------------- ^^^ expected trait `Debug`, found trait `Baz`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Debug`
+ found reference `&dyn Baz`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:56:24
+ |
+LL | let _: &dyn Send = baz;
+ | --------- ^^^ expected trait `Send`, found trait `Baz`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Send`
+ found reference `&dyn Baz`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:58:24
+ |
+LL | let _: &dyn Sync = baz;
+ | --------- ^^^ expected trait `Sync`, found trait `Baz`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Sync`
+ found reference `&dyn Baz`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:61:25
+ |
+LL | let bar: &dyn Bar = baz;
+ | -------- ^^^ expected trait `Bar`, found trait `Baz`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Bar`
+ found reference `&dyn Baz`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:63:35
+ |
+LL | let _: &dyn std::fmt::Debug = bar;
+ | -------------------- ^^^ expected trait `Debug`, found trait `Bar`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Debug`
+ found reference `&dyn Bar`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:65:24
+ |
+LL | let _: &dyn Send = bar;
+ | --------- ^^^ expected trait `Send`, found trait `Bar`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Send`
+ found reference `&dyn Bar`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:67:24
+ |
+LL | let _: &dyn Sync = bar;
+ | --------- ^^^ expected trait `Sync`, found trait `Bar`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Sync`
+ found reference `&dyn Bar`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:70:25
+ |
+LL | let foo: &dyn Foo = baz;
+ | -------- ^^^ expected trait `Foo`, found trait `Baz`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Foo`
+ found reference `&dyn Baz`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:72:35
+ |
+LL | let _: &dyn std::fmt::Debug = foo;
+ | -------------------- ^^^ expected trait `Debug`, found trait `Foo`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Debug`
+ found reference `&dyn Foo`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:74:24
+ |
+LL | let _: &dyn Send = foo;
+ | --------- ^^^ expected trait `Send`, found trait `Foo`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Send`
+ found reference `&dyn Foo`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:76:24
+ |
+LL | let _: &dyn Sync = foo;
+ | --------- ^^^ expected trait `Sync`, found trait `Foo`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Sync`
+ found reference `&dyn Foo`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:79:25
+ |
+LL | let foo: &dyn Foo = bar;
+ | -------- ^^^ expected trait `Foo`, found trait `Bar`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Foo`
+ found reference `&dyn Bar`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:81:35
+ |
+LL | let _: &dyn std::fmt::Debug = foo;
+ | -------------------- ^^^ expected trait `Debug`, found trait `Foo`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Debug`
+ found reference `&dyn Foo`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:83:24
+ |
+LL | let _: &dyn Send = foo;
+ | --------- ^^^ expected trait `Send`, found trait `Foo`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Send`
+ found reference `&dyn Foo`
+
+error[E0308]: mismatched types
+ --> $DIR/invalid-upcast.rs:85:24
+ |
+LL | let _: &dyn Sync = foo;
+ | --------- ^^^ expected trait `Sync`, found trait `Foo`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Sync`
+ found reference `&dyn Foo`
+
+error: aborting due to 15 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/traits/trait-upcasting/issue-11515-upcast-fn_mut-fn.rs b/src/test/ui/traits/trait-upcasting/issue-11515-upcast-fn_mut-fn.rs
new file mode 100644
index 0000000..277d9ea
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/issue-11515-upcast-fn_mut-fn.rs
@@ -0,0 +1,13 @@
+// run-pass
+#![feature(box_syntax, trait_upcasting)]
+#![allow(incomplete_features)]
+
+struct Test {
+ func: Box<dyn FnMut() + 'static>,
+}
+
+fn main() {
+ let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
+ let mut test = box Test { func: closure };
+ (test.func)();
+}
diff --git a/src/test/ui/traits/trait-upcasting/lifetime.rs b/src/test/ui/traits/trait-upcasting/lifetime.rs
new file mode 100644
index 0000000..052f090
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/lifetime.rs
@@ -0,0 +1,96 @@
+// run-pass
+// ignore-compare-mode-nll
+
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
+ fn a(&self) -> i32 {
+ 10
+ }
+
+ fn z(&self) -> i32 {
+ 11
+ }
+
+ fn y(&self) -> i32 {
+ 12
+ }
+}
+
+trait Bar: Foo {
+ fn b(&self) -> i32 {
+ 20
+ }
+
+ fn w(&self) -> i32 {
+ 21
+ }
+}
+
+trait Baz: Bar {
+ fn c(&self) -> i32 {
+ 30
+ }
+}
+
+impl Foo for i32 {
+ fn a(&self) -> i32 {
+ 100
+ }
+}
+
+impl Bar for i32 {
+ fn b(&self) -> i32 {
+ 200
+ }
+}
+
+impl Baz for i32 {
+ fn c(&self) -> i32 {
+ 300
+ }
+}
+
+// Note: upcast lifetime means a shorter lifetime.
+fn upcast_baz<'a: 'b, 'b, T>(v: Box<dyn Baz + 'a>, _l: &'b T) -> Box<dyn Baz + 'b> {
+ v
+}
+fn upcast_bar<'a: 'b, 'b, T>(v: Box<dyn Bar + 'a>, _l: &'b T) -> Box<dyn Bar + 'b> {
+ v
+}
+fn upcast_foo<'a: 'b, 'b, T>(v: Box<dyn Foo + 'a>, _l: &'b T) -> Box<dyn Foo + 'b> {
+ v
+}
+
+fn main() {
+ let v = Box::new(1);
+ let l = &(); // dummy lifetime (shorter than `baz`)
+
+ let baz: Box<dyn Baz> = v.clone();
+ let u = upcast_baz(baz, &l);
+ assert_eq!(*u, 1);
+ assert_eq!(u.a(), 100);
+ assert_eq!(u.b(), 200);
+ assert_eq!(u.c(), 300);
+
+ let baz: Box<dyn Baz> = v.clone();
+ let bar: Box<dyn Bar> = baz;
+ let u = upcast_bar(bar, &l);
+ assert_eq!(*u, 1);
+ assert_eq!(u.a(), 100);
+ assert_eq!(u.b(), 200);
+
+ let baz: Box<dyn Baz> = v.clone();
+ let foo: Box<dyn Foo> = baz;
+ let u = upcast_foo(foo, &l);
+ assert_eq!(*u, 1);
+ assert_eq!(u.a(), 100);
+
+ let baz: Box<dyn Baz> = v.clone();
+ let bar: Box<dyn Bar> = baz;
+ let foo: Box<dyn Foo> = bar;
+ let u = upcast_foo(foo, &l);
+ assert_eq!(*u, 1);
+ assert_eq!(u.a(), 100);
+}
diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs b/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs
new file mode 100644
index 0000000..6986ad6
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs
@@ -0,0 +1,22 @@
+// check-fail
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Bar<T> {
+ fn bar(&self, _: T) {}
+}
+
+trait Foo : Bar<i32> + Bar<u32> {
+ fn foo(&self, _: ()) {}
+}
+
+struct S;
+
+impl Bar<i32> for S {}
+impl Bar<u32> for S {}
+impl Foo for S {}
+
+fn main() {
+ let s: &dyn Foo = &S;
+ let t: &dyn Bar<_> = s; //~ ERROR mismatched types
+}
diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr b/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr
new file mode 100644
index 0000000..e9670ad
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/multiple-occurence-ambiguousity.rs:21:26
+ |
+LL | let t: &dyn Bar<_> = s;
+ | ----------- ^ expected trait `Bar`, found trait `Foo`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn Bar<_>`
+ found reference `&dyn Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/traits/trait-upcasting/replace-vptr.rs b/src/test/ui/traits/trait-upcasting/replace-vptr.rs
new file mode 100644
index 0000000..1164e43
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/replace-vptr.rs
@@ -0,0 +1,49 @@
+// run-pass
+
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait A {
+ fn foo_a(&self);
+}
+
+trait B {
+ fn foo_b(&self);
+}
+
+trait C: A + B {
+ fn foo_c(&self);
+}
+
+struct S(i32);
+
+impl A for S {
+ fn foo_a(&self) {
+ unreachable!();
+ }
+}
+
+impl B for S {
+ fn foo_b(&self) {
+ assert_eq!(42, self.0);
+ }
+}
+
+impl C for S {
+ fn foo_c(&self) {
+ unreachable!();
+ }
+}
+
+fn invoke_inner(b: &dyn B) {
+ b.foo_b();
+}
+
+fn invoke_outer(c: &dyn C) {
+ invoke_inner(c);
+}
+
+fn main() {
+ let s = S(42);
+ invoke_outer(&s);
+}
diff --git a/src/test/ui/traits/trait-upcasting/struct.rs b/src/test/ui/traits/trait-upcasting/struct.rs
new file mode 100644
index 0000000..0f3cb28
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/struct.rs
@@ -0,0 +1,174 @@
+// run-pass
+
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+use std::rc::Rc;
+use std::sync::Arc;
+
+trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
+ fn a(&self) -> i32 {
+ 10
+ }
+
+ fn z(&self) -> i32 {
+ 11
+ }
+
+ fn y(&self) -> i32 {
+ 12
+ }
+}
+
+trait Bar: Foo {
+ fn b(&self) -> i32 {
+ 20
+ }
+
+ fn w(&self) -> i32 {
+ 21
+ }
+}
+
+trait Baz: Bar {
+ fn c(&self) -> i32 {
+ 30
+ }
+}
+
+impl Foo for i32 {
+ fn a(&self) -> i32 {
+ 100
+ }
+}
+
+impl Bar for i32 {
+ fn b(&self) -> i32 {
+ 200
+ }
+}
+
+impl Baz for i32 {
+ fn c(&self) -> i32 {
+ 300
+ }
+}
+
+fn test_box() {
+ let v = Box::new(1);
+
+ let baz: Box<dyn Baz> = v.clone();
+ assert_eq!(*baz, 1);
+ assert_eq!(baz.a(), 100);
+ assert_eq!(baz.b(), 200);
+ assert_eq!(baz.c(), 300);
+ assert_eq!(baz.z(), 11);
+ assert_eq!(baz.y(), 12);
+ assert_eq!(baz.w(), 21);
+
+ let baz: Box<dyn Baz> = v.clone();
+ let bar: Box<dyn Bar> = baz;
+ assert_eq!(*bar, 1);
+ assert_eq!(bar.a(), 100);
+ assert_eq!(bar.b(), 200);
+ assert_eq!(bar.z(), 11);
+ assert_eq!(bar.y(), 12);
+ assert_eq!(bar.w(), 21);
+
+ let baz: Box<dyn Baz> = v.clone();
+ let foo: Box<dyn Foo> = baz;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+
+ let baz: Box<dyn Baz> = v.clone();
+ let bar: Box<dyn Bar> = baz;
+ let foo: Box<dyn Foo> = bar;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+}
+
+fn test_rc() {
+ let v = Rc::new(1);
+
+ let baz: Rc<dyn Baz> = v.clone();
+ assert_eq!(*baz, 1);
+ assert_eq!(baz.a(), 100);
+ assert_eq!(baz.b(), 200);
+ assert_eq!(baz.c(), 300);
+ assert_eq!(baz.z(), 11);
+ assert_eq!(baz.y(), 12);
+ assert_eq!(baz.w(), 21);
+
+ let baz: Rc<dyn Baz> = v.clone();
+ let bar: Rc<dyn Bar> = baz;
+ assert_eq!(*bar, 1);
+ assert_eq!(bar.a(), 100);
+ assert_eq!(bar.b(), 200);
+ assert_eq!(bar.z(), 11);
+ assert_eq!(bar.y(), 12);
+ assert_eq!(bar.w(), 21);
+
+ let baz: Rc<dyn Baz> = v.clone();
+ let foo: Rc<dyn Foo> = baz;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+
+ let baz: Rc<dyn Baz> = v.clone();
+ let bar: Rc<dyn Bar> = baz;
+ let foo: Rc<dyn Foo> = bar;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+}
+
+fn test_arc() {
+ let v = Arc::new(1);
+
+ let baz: Arc<dyn Baz> = v.clone();
+ assert_eq!(*baz, 1);
+ assert_eq!(baz.a(), 100);
+ assert_eq!(baz.b(), 200);
+ assert_eq!(baz.c(), 300);
+ assert_eq!(baz.z(), 11);
+ assert_eq!(baz.y(), 12);
+ assert_eq!(baz.w(), 21);
+
+ let baz: Arc<dyn Baz> = v.clone();
+ let bar: Arc<dyn Bar> = baz;
+ assert_eq!(*bar, 1);
+ assert_eq!(bar.a(), 100);
+ assert_eq!(bar.b(), 200);
+ assert_eq!(bar.z(), 11);
+ assert_eq!(bar.y(), 12);
+ assert_eq!(bar.w(), 21);
+
+ let baz: Arc<dyn Baz> = v.clone();
+ let foo: Arc<dyn Foo> = baz;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+
+ let baz: Arc<dyn Baz> = v.clone();
+ let bar: Arc<dyn Bar> = baz;
+ let foo: Arc<dyn Foo> = bar;
+ assert_eq!(*foo, 1);
+ assert_eq!(foo.a(), 100);
+ assert_eq!(foo.z(), 11);
+ assert_eq!(foo.y(), 12);
+}
+
+fn main() {
+ test_box();
+ test_rc();
+ test_arc();
+}
diff --git a/src/test/ui/traits/trait-upcasting/subtrait-method.rs b/src/test/ui/traits/trait-upcasting/subtrait-method.rs
new file mode 100644
index 0000000..3508e15
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/subtrait-method.rs
@@ -0,0 +1,70 @@
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo: PartialEq<i32> + std::fmt::Debug + Send + Sync {
+ fn a(&self) -> i32 {
+ 10
+ }
+
+ fn z(&self) -> i32 {
+ 11
+ }
+
+ fn y(&self) -> i32 {
+ 12
+ }
+}
+
+trait Bar: Foo {
+ fn b(&self) -> i32 {
+ 20
+ }
+
+ fn w(&self) -> i32 {
+ 21
+ }
+}
+
+trait Baz: Bar {
+ fn c(&self) -> i32 {
+ 30
+ }
+}
+
+impl Foo for i32 {
+ fn a(&self) -> i32 {
+ 100
+ }
+}
+
+impl Bar for i32 {
+ fn b(&self) -> i32 {
+ 200
+ }
+}
+
+impl Baz for i32 {
+ fn c(&self) -> i32 {
+ 300
+ }
+}
+
+fn main() {
+ let baz: &dyn Baz = &1;
+
+ let bar: &dyn Bar = baz;
+ bar.c();
+ //~^ ERROR no method named `c` found for reference `&dyn Bar` in the current scope [E0599]
+
+ let foo: &dyn Foo = baz;
+ foo.b();
+ //~^ ERROR no method named `b` found for reference `&dyn Foo` in the current scope [E0599]
+ foo.c();
+ //~^ ERROR no method named `c` found for reference `&dyn Foo` in the current scope [E0599]
+
+ let foo: &dyn Foo = bar;
+ foo.b();
+ //~^ ERROR no method named `b` found for reference `&dyn Foo` in the current scope [E0599]
+ foo.c();
+ //~^ ERROR no method named `c` found for reference `&dyn Foo` in the current scope [E0599]
+}
diff --git a/src/test/ui/traits/trait-upcasting/subtrait-method.stderr b/src/test/ui/traits/trait-upcasting/subtrait-method.stderr
new file mode 100644
index 0000000..8c69011
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/subtrait-method.stderr
@@ -0,0 +1,68 @@
+error[E0599]: no method named `c` found for reference `&dyn Bar` in the current scope
+ --> $DIR/subtrait-method.rs:56:9
+ |
+LL | bar.c();
+ | ^ help: there is an associated function with a similar name: `a`
+ |
+ = help: items from traits can only be used if the trait is implemented and in scope
+note: `Baz` defines an item `c`, perhaps you need to implement it
+ --> $DIR/subtrait-method.rs:28:1
+ |
+LL | trait Baz: Bar {
+ | ^^^^^^^^^^^^^^
+
+error[E0599]: no method named `b` found for reference `&dyn Foo` in the current scope
+ --> $DIR/subtrait-method.rs:60:9
+ |
+LL | foo.b();
+ | ^ help: there is an associated function with a similar name: `a`
+ |
+ = help: items from traits can only be used if the trait is implemented and in scope
+note: `Bar` defines an item `b`, perhaps you need to implement it
+ --> $DIR/subtrait-method.rs:18:1
+ |
+LL | trait Bar: Foo {
+ | ^^^^^^^^^^^^^^
+
+error[E0599]: no method named `c` found for reference `&dyn Foo` in the current scope
+ --> $DIR/subtrait-method.rs:62:9
+ |
+LL | foo.c();
+ | ^ help: there is an associated function with a similar name: `a`
+ |
+ = help: items from traits can only be used if the trait is implemented and in scope
+note: `Baz` defines an item `c`, perhaps you need to implement it
+ --> $DIR/subtrait-method.rs:28:1
+ |
+LL | trait Baz: Bar {
+ | ^^^^^^^^^^^^^^
+
+error[E0599]: no method named `b` found for reference `&dyn Foo` in the current scope
+ --> $DIR/subtrait-method.rs:66:9
+ |
+LL | foo.b();
+ | ^ help: there is an associated function with a similar name: `a`
+ |
+ = help: items from traits can only be used if the trait is implemented and in scope
+note: `Bar` defines an item `b`, perhaps you need to implement it
+ --> $DIR/subtrait-method.rs:18:1
+ |
+LL | trait Bar: Foo {
+ | ^^^^^^^^^^^^^^
+
+error[E0599]: no method named `c` found for reference `&dyn Foo` in the current scope
+ --> $DIR/subtrait-method.rs:68:9
+ |
+LL | foo.c();
+ | ^ help: there is an associated function with a similar name: `a`
+ |
+ = help: items from traits can only be used if the trait is implemented and in scope
+note: `Baz` defines an item `c`, perhaps you need to implement it
+ --> $DIR/subtrait-method.rs:28:1
+ |
+LL | trait Baz: Bar {
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-1.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-1.rs
new file mode 100644
index 0000000..79ddedd
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-1.rs
@@ -0,0 +1,27 @@
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo: Bar<i32> + Bar<u32> {}
+trait Bar<T> {
+ fn bar(&self) -> Option<T> {
+ None
+ }
+}
+
+fn test_specific(x: &dyn Foo) {
+ let _ = x as &dyn Bar<i32>; // OK
+ let _ = x as &dyn Bar<u32>; // OK
+}
+
+fn test_unknown_version(x: &dyn Foo) {
+ let _ = x as &dyn Bar<_>; // Ambiguous
+ //~^ ERROR non-primitive cast
+ //~^^ ERROR the trait bound `&dyn Foo: Bar<_>` is not satisfied
+}
+
+fn test_infer_version(x: &dyn Foo) {
+ let a = x as &dyn Bar<_>; // OK
+ let _: Option<u32> = a.bar();
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr
new file mode 100644
index 0000000..44f32e0
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-1.stderr
@@ -0,0 +1,23 @@
+error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<_>`
+ --> $DIR/type-checking-test-1.rs:17:13
+ |
+LL | let _ = x as &dyn Bar<_>; // Ambiguous
+ | ^^^^^^^^^^^^^^^^ invalid cast
+ |
+help: consider borrowing the value
+ |
+LL | let _ = &x as &dyn Bar<_>; // Ambiguous
+ | +
+
+error[E0277]: the trait bound `&dyn Foo: Bar<_>` is not satisfied
+ --> $DIR/type-checking-test-1.rs:17:13
+ |
+LL | let _ = x as &dyn Bar<_>; // Ambiguous
+ | ^ the trait `Bar<_>` is not implemented for `&dyn Foo`
+ |
+ = note: required for the cast to the object type `dyn Bar<_>`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0277, E0605.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-2.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-2.rs
new file mode 100644
index 0000000..32754c5
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-2.rs
@@ -0,0 +1,32 @@
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo<T>: Bar<i32> + Bar<T> {}
+trait Bar<T> {
+ fn bar(&self) -> Option<T> {
+ None
+ }
+}
+
+fn test_specific(x: &dyn Foo<i32>) {
+ let _ = x as &dyn Bar<i32>; // OK
+}
+
+fn test_specific2(x: &dyn Foo<u32>) {
+ let _ = x as &dyn Bar<i32>; // OK
+}
+
+fn test_specific3(x: &dyn Foo<i32>) {
+ let _ = x as &dyn Bar<u32>; // Error
+ //~^ ERROR non-primitive cast
+ //~^^ ERROR the trait bound `&dyn Foo<i32>: Bar<u32>` is not satisfied
+}
+
+fn test_infer_arg(x: &dyn Foo<u32>) {
+ let a = x as &dyn Bar<_>; // Ambiguous
+ //~^ ERROR non-primitive cast
+ //~^^ ERROR the trait bound `&dyn Foo<u32>: Bar<_>` is not satisfied
+ let _ = a.bar();
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr
new file mode 100644
index 0000000..4ae4c85
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-2.stderr
@@ -0,0 +1,42 @@
+error[E0605]: non-primitive cast: `&dyn Foo<i32>` as `&dyn Bar<u32>`
+ --> $DIR/type-checking-test-2.rs:20:13
+ |
+LL | let _ = x as &dyn Bar<u32>; // Error
+ | ^^^^^^^^^^^^^^^^^^ invalid cast
+ |
+help: consider borrowing the value
+ |
+LL | let _ = &x as &dyn Bar<u32>; // Error
+ | +
+
+error[E0277]: the trait bound `&dyn Foo<i32>: Bar<u32>` is not satisfied
+ --> $DIR/type-checking-test-2.rs:20:13
+ |
+LL | let _ = x as &dyn Bar<u32>; // Error
+ | ^ the trait `Bar<u32>` is not implemented for `&dyn Foo<i32>`
+ |
+ = note: required for the cast to the object type `dyn Bar<u32>`
+
+error[E0605]: non-primitive cast: `&dyn Foo<u32>` as `&dyn Bar<_>`
+ --> $DIR/type-checking-test-2.rs:26:13
+ |
+LL | let a = x as &dyn Bar<_>; // Ambiguous
+ | ^^^^^^^^^^^^^^^^ invalid cast
+ |
+help: consider borrowing the value
+ |
+LL | let a = &x as &dyn Bar<_>; // Ambiguous
+ | +
+
+error[E0277]: the trait bound `&dyn Foo<u32>: Bar<_>` is not satisfied
+ --> $DIR/type-checking-test-2.rs:26:13
+ |
+LL | let a = x as &dyn Bar<_>; // Ambiguous
+ | ^ the trait `Bar<_>` is not implemented for `&dyn Foo<u32>`
+ |
+ = note: required for the cast to the object type `dyn Bar<_>`
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0277, E0605.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.polonius.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-3.polonius.stderr
new file mode 100644
index 0000000..e48ba70
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-3.polonius.stderr
@@ -0,0 +1,22 @@
+error: lifetime may not live long enough
+ --> $DIR/type-checking-test-3.rs:13:13
+ |
+LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ | -- lifetime `'a` defined here
+LL | let _ = x as &dyn Bar<'a>; // Error
+ | ^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
+ |
+ = help: consider replacing `'a` with `'static`
+
+error: lifetime may not live long enough
+ --> $DIR/type-checking-test-3.rs:18:13
+ |
+LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) {
+ | -- lifetime `'a` defined here
+LL | let _ = x as &dyn Bar<'static>; // Error
+ | ^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
+ |
+ = help: consider replacing `'a` with `'static`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs
new file mode 100644
index 0000000..49c24e4
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-3.rs
@@ -0,0 +1,22 @@
+// ignore-compare-mode-nll
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo<'a>: Bar<'a> {}
+trait Bar<'a> {}
+
+fn test_correct(x: &dyn Foo<'static>) {
+ let _ = x as &dyn Bar<'static>;
+}
+
+fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ let _ = x as &dyn Bar<'a>; // Error
+ //~^ ERROR mismatched types
+}
+
+fn test_wrong2<'a>(x: &dyn Foo<'a>) {
+ let _ = x as &dyn Bar<'static>; // Error
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr
new file mode 100644
index 0000000..593ee0a
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-3.stderr
@@ -0,0 +1,33 @@
+error[E0308]: mismatched types
+ --> $DIR/type-checking-test-3.rs:13:13
+ |
+LL | let _ = x as &dyn Bar<'a>; // Error
+ | ^ lifetime mismatch
+ |
+ = note: expected trait object `dyn Bar<'a>`
+ found trait object `dyn Bar<'static>`
+note: the lifetime `'a` as defined on the function body at 12:16...
+ --> $DIR/type-checking-test-3.rs:12:16
+ |
+LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ | ^^
+ = note: ...does not necessarily outlive the static lifetime
+
+error[E0308]: mismatched types
+ --> $DIR/type-checking-test-3.rs:18:13
+ |
+LL | let _ = x as &dyn Bar<'static>; // Error
+ | ^ lifetime mismatch
+ |
+ = note: expected trait object `dyn Bar<'static>`
+ found trait object `dyn Bar<'a>`
+note: the lifetime `'a` as defined on the function body at 17:16...
+ --> $DIR/type-checking-test-3.rs:17:16
+ |
+LL | fn test_wrong2<'a>(x: &dyn Foo<'a>) {
+ | ^^
+ = note: ...does not necessarily outlive the static lifetime
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.polonius.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-4.polonius.stderr
new file mode 100644
index 0000000..a3411f4
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.polonius.stderr
@@ -0,0 +1,33 @@
+error: lifetime may not live long enough
+ --> $DIR/type-checking-test-4.rs:17:13
+ |
+LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ | -- lifetime `'a` defined here
+LL | let _ = x as &dyn Bar<'static, 'a>; // Error
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
+ |
+ = help: consider replacing `'a` with `'static`
+
+error: lifetime may not live long enough
+ --> $DIR/type-checking-test-4.rs:22:13
+ |
+LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ | -- lifetime `'a` defined here
+LL | let _ = x as &dyn Bar<'a, 'static>; // Error
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
+ |
+ = help: consider replacing `'a` with `'static`
+
+error: lifetime may not live long enough
+ --> $DIR/type-checking-test-4.rs:29:5
+ |
+LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
+ | -- lifetime `'a` defined here
+...
+LL | y.get_b() // ERROR
+ | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
+ |
+ = help: consider replacing `'a` with `'static`
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs b/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs
new file mode 100644
index 0000000..9b27fd4
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.rs
@@ -0,0 +1,32 @@
+// ignore-compare-mode-nll
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo<'a>: Bar<'a, 'a> {}
+trait Bar<'a, 'b> {
+ fn get_b(&self) -> Option<&'a u32> {
+ None
+ }
+}
+
+fn test_correct(x: &dyn Foo<'static>) {
+ let _ = x as &dyn Bar<'static, 'static>;
+}
+
+fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ let _ = x as &dyn Bar<'static, 'a>; // Error
+ //~^ ERROR mismatched types
+}
+
+fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ let _ = x as &dyn Bar<'a, 'static>; // Error
+ //~^ ERROR mismatched types
+}
+
+fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
+ let y = x as &dyn Bar<'_, '_>;
+ //~^ ERROR `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
+ y.get_b() // ERROR
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr
new file mode 100644
index 0000000..811e524
--- /dev/null
+++ b/src/test/ui/traits/trait-upcasting/type-checking-test-4.stderr
@@ -0,0 +1,47 @@
+error[E0308]: mismatched types
+ --> $DIR/type-checking-test-4.rs:17:13
+ |
+LL | let _ = x as &dyn Bar<'static, 'a>; // Error
+ | ^ lifetime mismatch
+ |
+ = note: expected trait object `dyn Bar<'static, 'a>`
+ found trait object `dyn Bar<'static, 'static>`
+note: the lifetime `'a` as defined on the function body at 16:16...
+ --> $DIR/type-checking-test-4.rs:16:16
+ |
+LL | fn test_wrong1<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ | ^^
+ = note: ...does not necessarily outlive the static lifetime
+
+error[E0308]: mismatched types
+ --> $DIR/type-checking-test-4.rs:22:13
+ |
+LL | let _ = x as &dyn Bar<'a, 'static>; // Error
+ | ^ lifetime mismatch
+ |
+ = note: expected trait object `dyn Bar<'a, 'static>`
+ found trait object `dyn Bar<'static, 'static>`
+note: the lifetime `'a` as defined on the function body at 21:16...
+ --> $DIR/type-checking-test-4.rs:21:16
+ |
+LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
+ | ^^
+ = note: ...does not necessarily outlive the static lifetime
+
+error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
+ --> $DIR/type-checking-test-4.rs:27:27
+ |
+LL | fn test_wrong3<'a>(x: &dyn Foo<'a>) -> Option<&'static u32> {
+ | ------------ this data with lifetime `'a`...
+LL | let y = x as &dyn Bar<'_, '_>;
+ | - ^^
+ | |
+ | ...is captured here...
+LL |
+LL | y.get_b() // ERROR
+ | --------- ...and is required to live as long as `'static` here
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0308, E0759.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/traits/vtable/vtable-diamond.rs b/src/test/ui/traits/vtable/vtable-diamond.rs
new file mode 100644
index 0000000..f64ae95
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-diamond.rs
@@ -0,0 +1,39 @@
+// build-fail
+#![feature(rustc_attrs)]
+
+#[rustc_dump_vtable]
+trait A {
+ fn foo_a(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait B: A {
+ fn foo_b(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait C: A {
+ //~^ error Vtable
+ fn foo_c(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait D: B + C {
+ //~^ error Vtable
+ fn foo_d(&self) {}
+}
+
+struct S;
+
+impl A for S {}
+impl B for S {}
+impl C for S {}
+impl D for S {}
+
+fn foo(d: &dyn D) {
+ d.foo_d();
+}
+
+fn main() {
+ foo(&S);
+}
diff --git a/src/test/ui/traits/vtable/vtable-diamond.stderr b/src/test/ui/traits/vtable/vtable-diamond.stderr
new file mode 100644
index 0000000..92a7f29
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-diamond.stderr
@@ -0,0 +1,35 @@
+error: Vtable entries for `<S as D>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as A>::foo_a),
+ Method(<S as B>::foo_b),
+ Method(<S as C>::foo_c),
+ TraitVPtr(<S as C>),
+ Method(<S as D>::foo_d),
+]
+ --> $DIR/vtable-diamond.rs:21:1
+ |
+LL | / trait D: B + C {
+LL | |
+LL | | fn foo_d(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as C>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as A>::foo_a),
+ Method(<S as C>::foo_c),
+]
+ --> $DIR/vtable-diamond.rs:15:1
+ |
+LL | / trait C: A {
+LL | |
+LL | | fn foo_c(&self) {}
+LL | | }
+ | |_^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/traits/vtable/vtable-multi-level.rs b/src/test/ui/traits/vtable/vtable-multi-level.rs
new file mode 100644
index 0000000..33112b4
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-multi-level.rs
@@ -0,0 +1,122 @@
+// build-fail
+#![feature(rustc_attrs)]
+
+// O --> G --> C --> A
+// \ \ \-> B
+// | |-> F --> D
+// | \-> E
+// |-> N --> J --> H
+// \ \-> I
+// |-> M --> K
+// \-> L
+
+#[rustc_dump_vtable]
+trait A {
+ fn foo_a(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait B {
+ //~^ error Vtable
+ fn foo_b(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait C: A + B {
+ fn foo_c(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait D {
+ //~^ error Vtable
+ fn foo_d(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait E {
+ //~^ error Vtable
+ fn foo_e(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait F: D + E {
+ //~^ error Vtable
+ fn foo_f(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait G: C + F {
+ fn foo_g(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait H {
+ //~^ error Vtable
+ fn foo_h(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait I {
+ //~^ error Vtable
+ fn foo_i(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait J: H + I {
+ //~^ error Vtable
+ fn foo_j(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait K {
+ //~^ error Vtable
+ fn foo_k(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait L {
+ //~^ error Vtable
+ fn foo_l(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait M: K + L {
+ //~^ error Vtable
+ fn foo_m(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait N: J + M {
+ //~^ error Vtable
+ fn foo_n(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait O: G + N {
+ //~^ error Vtable
+ fn foo_o(&self) {}
+}
+
+struct S;
+
+impl A for S {}
+impl B for S {}
+impl C for S {}
+impl D for S {}
+impl E for S {}
+impl F for S {}
+impl G for S {}
+impl H for S {}
+impl I for S {}
+impl J for S {}
+impl K for S {}
+impl L for S {}
+impl M for S {}
+impl N for S {}
+impl O for S {}
+
+fn foo(_: &dyn O) {}
+
+fn main() {
+ foo(&S);
+}
diff --git a/src/test/ui/traits/vtable/vtable-multi-level.stderr b/src/test/ui/traits/vtable/vtable-multi-level.stderr
new file mode 100644
index 0000000..7700db9
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-multi-level.stderr
@@ -0,0 +1,214 @@
+error: Vtable entries for `<S as O>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as A>::foo_a),
+ Method(<S as B>::foo_b),
+ TraitVPtr(<S as B>),
+ Method(<S as C>::foo_c),
+ Method(<S as D>::foo_d),
+ TraitVPtr(<S as D>),
+ Method(<S as E>::foo_e),
+ TraitVPtr(<S as E>),
+ Method(<S as F>::foo_f),
+ TraitVPtr(<S as F>),
+ Method(<S as G>::foo_g),
+ Method(<S as H>::foo_h),
+ TraitVPtr(<S as H>),
+ Method(<S as I>::foo_i),
+ TraitVPtr(<S as I>),
+ Method(<S as J>::foo_j),
+ TraitVPtr(<S as J>),
+ Method(<S as K>::foo_k),
+ TraitVPtr(<S as K>),
+ Method(<S as L>::foo_l),
+ TraitVPtr(<S as L>),
+ Method(<S as M>::foo_m),
+ TraitVPtr(<S as M>),
+ Method(<S as N>::foo_n),
+ TraitVPtr(<S as N>),
+ Method(<S as O>::foo_o),
+]
+ --> $DIR/vtable-multi-level.rs:95:1
+ |
+LL | / trait O: G + N {
+LL | |
+LL | | fn foo_o(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as B>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as B>::foo_b),
+]
+ --> $DIR/vtable-multi-level.rs:19:1
+ |
+LL | / trait B {
+LL | |
+LL | | fn foo_b(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as D>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as D>::foo_d),
+]
+ --> $DIR/vtable-multi-level.rs:30:1
+ |
+LL | / trait D {
+LL | |
+LL | | fn foo_d(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as E>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as E>::foo_e),
+]
+ --> $DIR/vtable-multi-level.rs:36:1
+ |
+LL | / trait E {
+LL | |
+LL | | fn foo_e(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as F>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as D>::foo_d),
+ Method(<S as E>::foo_e),
+ TraitVPtr(<S as E>),
+ Method(<S as F>::foo_f),
+]
+ --> $DIR/vtable-multi-level.rs:42:1
+ |
+LL | / trait F: D + E {
+LL | |
+LL | | fn foo_f(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as H>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as H>::foo_h),
+]
+ --> $DIR/vtable-multi-level.rs:53:1
+ |
+LL | / trait H {
+LL | |
+LL | | fn foo_h(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as I>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as I>::foo_i),
+]
+ --> $DIR/vtable-multi-level.rs:59:1
+ |
+LL | / trait I {
+LL | |
+LL | | fn foo_i(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as J>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as H>::foo_h),
+ Method(<S as I>::foo_i),
+ TraitVPtr(<S as I>),
+ Method(<S as J>::foo_j),
+]
+ --> $DIR/vtable-multi-level.rs:65:1
+ |
+LL | / trait J: H + I {
+LL | |
+LL | | fn foo_j(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as K>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as K>::foo_k),
+]
+ --> $DIR/vtable-multi-level.rs:71:1
+ |
+LL | / trait K {
+LL | |
+LL | | fn foo_k(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as L>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as L>::foo_l),
+]
+ --> $DIR/vtable-multi-level.rs:77:1
+ |
+LL | / trait L {
+LL | |
+LL | | fn foo_l(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as M>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as K>::foo_k),
+ Method(<S as L>::foo_l),
+ TraitVPtr(<S as L>),
+ Method(<S as M>::foo_m),
+]
+ --> $DIR/vtable-multi-level.rs:83:1
+ |
+LL | / trait M: K + L {
+LL | |
+LL | | fn foo_m(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as N>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as H>::foo_h),
+ Method(<S as I>::foo_i),
+ TraitVPtr(<S as I>),
+ Method(<S as J>::foo_j),
+ Method(<S as K>::foo_k),
+ TraitVPtr(<S as K>),
+ Method(<S as L>::foo_l),
+ TraitVPtr(<S as L>),
+ Method(<S as M>::foo_m),
+ TraitVPtr(<S as M>),
+ Method(<S as N>::foo_n),
+]
+ --> $DIR/vtable-multi-level.rs:89:1
+ |
+LL | / trait N: J + M {
+LL | |
+LL | | fn foo_n(&self) {}
+LL | | }
+ | |_^
+
+error: aborting due to 12 previous errors
+
diff --git a/src/test/ui/traits/vtable/vtable-multiple.rs b/src/test/ui/traits/vtable/vtable-multiple.rs
new file mode 100644
index 0000000..cb0d0b7
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-multiple.rs
@@ -0,0 +1,31 @@
+// build-fail
+#![feature(rustc_attrs)]
+
+#[rustc_dump_vtable]
+trait A {
+ fn foo_a(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait B {
+ //~^ error Vtable
+ fn foo_b(&self) {}
+}
+
+#[rustc_dump_vtable]
+trait C: A + B {
+ //~^ error Vtable
+ fn foo_c(&self) {}
+}
+
+struct S;
+
+impl A for S {}
+impl B for S {}
+impl C for S {}
+
+fn foo(c: &dyn C) {}
+
+fn main() {
+ foo(&S);
+}
diff --git a/src/test/ui/traits/vtable/vtable-multiple.stderr b/src/test/ui/traits/vtable/vtable-multiple.stderr
new file mode 100644
index 0000000..f51b083
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-multiple.stderr
@@ -0,0 +1,33 @@
+error: Vtable entries for `<S as C>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as A>::foo_a),
+ Method(<S as B>::foo_b),
+ TraitVPtr(<S as B>),
+ Method(<S as C>::foo_c),
+]
+ --> $DIR/vtable-multiple.rs:16:1
+ |
+LL | / trait C: A + B {
+LL | |
+LL | | fn foo_c(&self) {}
+LL | | }
+ | |_^
+
+error: Vtable entries for `<S as B>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as B>::foo_b),
+]
+ --> $DIR/vtable-multiple.rs:10:1
+ |
+LL | / trait B {
+LL | |
+LL | | fn foo_b(&self) {}
+LL | | }
+ | |_^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/traits/vtable/vtable-vacant.rs b/src/test/ui/traits/vtable/vtable-vacant.rs
new file mode 100644
index 0000000..ebea941
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-vacant.rs
@@ -0,0 +1,28 @@
+// build-fail
+#![feature(rustc_attrs)]
+
+// B --> A
+
+#[rustc_dump_vtable]
+trait A {
+ fn foo_a1(&self) {}
+ fn foo_a2(&self) where Self: Sized {}
+}
+
+#[rustc_dump_vtable]
+trait B: A {
+ //~^ error Vtable
+ fn foo_b1(&self) {}
+ fn foo_b2() where Self: Sized {}
+}
+
+struct S;
+
+impl A for S {}
+impl B for S {}
+
+fn foo(_: &dyn B) {}
+
+fn main() {
+ foo(&S);
+}
diff --git a/src/test/ui/traits/vtable/vtable-vacant.stderr b/src/test/ui/traits/vtable/vtable-vacant.stderr
new file mode 100644
index 0000000..768cca5
--- /dev/null
+++ b/src/test/ui/traits/vtable/vtable-vacant.stderr
@@ -0,0 +1,20 @@
+error: Vtable entries for `<S as B>`: [
+ MetadataDropInPlace,
+ MetadataSize,
+ MetadataAlign,
+ Method(<S as A>::foo_a1),
+ Vacant,
+ Method(<S as B>::foo_b1),
+ Vacant,
+]
+ --> $DIR/vtable-vacant.rs:13:1
+ |
+LL | / trait B: A {
+LL | |
+LL | | fn foo_b1(&self) {}
+LL | | fn foo_b2() where Self: Sized {}
+LL | | }
+ | |_^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr
index edb48b6..6508e6a 100644
--- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr
+++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr
@@ -10,7 +10,7 @@
help: you can convert an `i32` to a `u8` and panic if the converted value doesn't fit
|
LL | B::get_x().try_into().unwrap()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr
index 3824501..94c51c5 100644
--- a/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr
+++ b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr
@@ -33,8 +33,9 @@
= note: `#[warn(type_alias_bounds)]` on by default
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type Y = ();
- | --
+LL - type Y where i32: Foo = ();
+LL + type Y = ();
+ |
warning: Trait bound i32: Foo does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-inconsistent.rs:22:19
diff --git a/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr
index 41a19bf..97ef2dd 100644
--- a/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr
+++ b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr
@@ -37,9 +37,12 @@
|
LL | generic_function(5i32);
| ^^^^ the trait `Foo` is not implemented for `i32`
-...
+ |
+note: required by a bound in `generic_function`
+ --> $DIR/trivial-bounds-leak.rs:29:24
+ |
LL | fn generic_function<T: Foo>(t: T) {}
- | --- required by this bound in `generic_function`
+ | ^^^ required by this bound in `generic_function`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/try-block/try-block-in-edition2015.stderr b/src/test/ui/try-block/try-block-in-edition2015.stderr
index 0f3c14b..a00064c 100644
--- a/src/test/ui/try-block/try-block-in-edition2015.stderr
+++ b/src/test/ui/try-block/try-block-in-edition2015.stderr
@@ -17,7 +17,7 @@
help: use `!` to invoke the macro
|
LL | let try_result: Option<_> = try! {
- | ^
+ | +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/try-macro-suggestion.stderr b/src/test/ui/try-macro-suggestion.stderr
index 9d833ef..c7dde7e 100644
--- a/src/test/ui/try-macro-suggestion.stderr
+++ b/src/test/ui/try-macro-suggestion.stderr
@@ -8,7 +8,7 @@
help: you can still access the deprecated `try!()` macro using the "raw identifier" syntax
|
LL | Ok(r#try!());
- | ^^
+ | ++
error: use of deprecated `try` macro
--> $DIR/try-macro-suggestion.rs:4:8
@@ -19,12 +19,13 @@
= note: in the 2018 edition `try` is a reserved keyword, and the `try!()` macro is deprecated
help: you can use the `?` operator instead
|
-LL | Ok(Ok(())?)
- | -- ^
+LL - Ok(try!(Ok(())))
+LL + Ok(Ok(())?)
+ |
help: alternatively, you can still access the deprecated `try!()` macro using the "raw identifier" syntax
|
LL | Ok(r#try!(Ok(())))
- | ^^
+ | ++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/try-trait/try-operator-on-main.stderr b/src/test/ui/try-trait/try-operator-on-main.stderr
index dd893ca..d669124 100644
--- a/src/test/ui/try-trait/try-operator-on-main.stderr
+++ b/src/test/ui/try-trait/try-operator-on-main.stderr
@@ -58,9 +58,12 @@
|
LL | try_trait_generic::<()>();
| ^^ the trait `Try` is not implemented for `()`
-...
+ |
+note: required by a bound in `try_trait_generic`
+ --> $DIR/try-operator-on-main.rs:17:25
+ |
LL | fn try_trait_generic<T: Try>() -> T {
- | --- required by this bound in `try_trait_generic`
+ | ^^^ required by this bound in `try_trait_generic`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/try-operator-on-main.rs:19:5
diff --git a/src/test/ui/tutorial-suffix-inference-test.stderr b/src/test/ui/tutorial-suffix-inference-test.stderr
index f9974ac..ac1027f 100644
--- a/src/test/ui/tutorial-suffix-inference-test.stderr
+++ b/src/test/ui/tutorial-suffix-inference-test.stderr
@@ -16,7 +16,7 @@
help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
|
LL | identity_u16(y.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/tutorial-suffix-inference-test.rs:21:18
@@ -27,7 +27,7 @@
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
LL | identity_u16(a.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
index 1d52061..37543c1 100644
--- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
+++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
@@ -5,6 +5,12 @@
| ^^^^^^-- supplied 0 arguments
| |
| expected 1 argument
+ |
+note: tuple variant defined here
+ --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:5:5
+ |
+LL | V(u8)
+ | ^
error[E0308]: mismatched types
--> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17
diff --git a/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr b/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr
index f80abad..2e12b76 100644
--- a/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr
+++ b/src/test/ui/type-alias-enum-variants/incorrect-variant-form-through-alias-caught.stderr
@@ -30,7 +30,7 @@
help: `Alias::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | Alias::Unit;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0164]: expected tuple struct or tuple variant, found unit variant `Alias::Unit`
--> $DIR/incorrect-variant-form-through-alias-caught.rs:17:9
diff --git a/src/test/ui/type-alias-impl-trait/argument-types.rs b/src/test/ui/type-alias-impl-trait/argument-types.rs
new file mode 100644
index 0000000..8427b5b
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/argument-types.rs
@@ -0,0 +1,28 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+use std::fmt::Debug;
+
+type Foo = impl Debug;
+
+// FIXME: This should compile, but it currently doesn't
+fn foo1(mut x: Foo) {
+ x = 22_u32;
+ //~^ ERROR: mismatched types [E0308]
+}
+
+fn foo2(mut x: Foo) {
+ // no constraint on x
+}
+
+fn foo3(x: Foo) {
+ println!("{:?}", x);
+}
+
+fn foo_value() -> Foo {
+ 11_u32
+}
+
+fn main() {
+ foo3(foo_value());
+}
diff --git a/src/test/ui/type-alias-impl-trait/argument-types.stderr b/src/test/ui/type-alias-impl-trait/argument-types.stderr
new file mode 100644
index 0000000..1cbf9c9
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/argument-types.stderr
@@ -0,0 +1,15 @@
+error[E0308]: mismatched types
+ --> $DIR/argument-types.rs:10:9
+ |
+LL | type Foo = impl Debug;
+ | ---------- the expected opaque type
+...
+LL | x = 22_u32;
+ | ^^^^^^ expected opaque type, found `u32`
+ |
+ = note: expected opaque type `impl Debug`
+ found type `u32`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-const.full_tait.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-const.full_tait.stderr
deleted file mode 100644
index 7b43d1d..0000000
--- a/src/test/ui/type-alias-impl-trait/assoc-type-const.full_tait.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/assoc-type-const.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/assoc-type-const.rs:9:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 2 warnings emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-const.min_tait.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-const.min_tait.stderr
deleted file mode 100644
index d4b9132..0000000
--- a/src/test/ui/type-alias-impl-trait/assoc-type-const.min_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/assoc-type-const.rs:9:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-const.rs b/src/test/ui/type-alias-impl-trait/assoc-type-const.rs
index be065c3..0ade36d 100644
--- a/src/test/ui/type-alias-impl-trait/assoc-type-const.rs
+++ b/src/test/ui/type-alias-impl-trait/assoc-type-const.rs
@@ -2,12 +2,7 @@
// const generics in an associated opaque type
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete
+#![feature(type_alias_impl_trait)]
trait UnwrapItemsExt<'a, const C: usize> {
type Iter;
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.full_tait.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.full_tait.stderr
deleted file mode 100644
index 01263cd..0000000
--- a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.full_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/assoc-type-lifetime-unconstrained.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/assoc-type-lifetime-unconstrained.rs:20:6
- |
-LL | impl<'a, I> UnwrapItemsExt for I {
- | ^^ unconstrained lifetime parameter
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.min_tait.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.min_tait.stderr
deleted file mode 100644
index afcdab5..0000000
--- a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.min_tait.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/assoc-type-lifetime-unconstrained.rs:20:6
- |
-LL | impl<'a, I> UnwrapItemsExt for I {
- | ^^ unconstrained lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs
index 39cc75e..3f34b00 100644
--- a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs
+++ b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs
@@ -1,10 +1,7 @@
// Tests that we don't allow unconstrained lifetime parameters in impls when
// the lifetime is used in an associated opaque type.
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait UnwrapItemsExt {
type Iter;
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr
new file mode 100644
index 0000000..e594dc5
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/assoc-type-lifetime-unconstrained.rs:17:6
+ |
+LL | impl<'a, I> UnwrapItemsExt for I {
+ | ^^ unconstrained lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.full_tait.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.full_tait.stderr
deleted file mode 100644
index 31afbf1..0000000
--- a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/assoc-type-lifetime.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs
index ebbdbb6..39f785d 100644
--- a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs
+++ b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs
@@ -2,10 +2,7 @@
// lifetimes are used in an associated opaque type
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait UnwrapItemsExt<'a> {
type Iter;
diff --git a/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.full_tait.stderr
deleted file mode 100644
index 2c48d81..0000000
--- a/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/associated-type-alias-impl-trait.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs b/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs
index 8d2b182..42f07d4 100644
--- a/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs
+++ b/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// build-pass (FIXME(62277): could be check-pass?)
trait Bar {}
diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage.rs b/src/test/ui/type-alias-impl-trait/auto-trait-leakage.rs
new file mode 100644
index 0000000..a158458
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+mod m {
+ type Foo = impl std::fmt::Debug;
+
+ pub fn foo() -> Foo {
+ 22_u32
+ }
+}
+
+fn is_send<T: Send>(_: T) {}
+
+fn main() {
+ is_send(m::foo());
+}
diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage2.rs b/src/test/ui/type-alias-impl-trait/auto-trait-leakage2.rs
new file mode 100644
index 0000000..745379e
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage2.rs
@@ -0,0 +1,19 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+mod m {
+ use std::rc::Rc;
+
+ type Foo = impl std::fmt::Debug;
+
+ pub fn foo() -> Foo {
+ Rc::new(22_u32)
+ }
+}
+
+fn is_send<T: Send>(_: T) {}
+
+fn main() {
+ is_send(m::foo());
+ //~^ ERROR: `Rc<u32>` cannot be sent between threads safely [E0277]
+}
diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage2.stderr b/src/test/ui/type-alias-impl-trait/auto-trait-leakage2.stderr
new file mode 100644
index 0000000..d60be4b
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage2.stderr
@@ -0,0 +1,20 @@
+error[E0277]: `Rc<u32>` cannot be sent between threads safely
+ --> $DIR/auto-trait-leakage2.rs:17:5
+ |
+LL | type Foo = impl std::fmt::Debug;
+ | -------------------- within this `impl Debug`
+...
+LL | is_send(m::foo());
+ | ^^^^^^^ `Rc<u32>` cannot be sent between threads safely
+ |
+ = help: within `impl Debug`, the trait `Send` is not implemented for `Rc<u32>`
+ = note: required because it appears within the type `impl Debug`
+note: required by a bound in `is_send`
+ --> $DIR/auto-trait-leakage2.rs:14:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs
new file mode 100644
index 0000000..5fb7a94
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.rs
@@ -0,0 +1,21 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// FIXME This should compile, but it currently doesn't
+
+mod m {
+ type Foo = impl std::fmt::Debug;
+ //~^ ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391]
+
+ pub fn foo() -> Foo {
+ 22_u32
+ }
+
+ pub fn bar() {
+ is_send(foo());
+ }
+
+ fn is_send<T: Send>(_: T) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
new file mode 100644
index 0000000..86b3f87
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/auto-trait-leakage3.stderr
@@ -0,0 +1,22 @@
+error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
+ --> $DIR/auto-trait-leakage3.rs:7:16
+ |
+LL | type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires type-checking `m::bar`...
+ --> $DIR/auto-trait-leakage3.rs:15:9
+ |
+LL | is_send(foo());
+ | ^^^^^^^
+ = note: ...which requires evaluating trait selection obligation `impl std::fmt::Debug: std::marker::Send`...
+ = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in module `m`
+ --> $DIR/auto-trait-leakage3.rs:6:1
+ |
+LL | mod m {
+ | ^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs
index 94e1fa7..e7bca22 100644
--- a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs
+++ b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs
@@ -1,10 +1,7 @@
// Crate that exports an opaque `impl Trait` type. Used for testing cross-crate.
#![crate_type = "rlib"]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub type Foo = impl std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
index 65bc594..119f7df 100644
--- a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
+++ b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
@@ -1,10 +1,7 @@
// Crate that exports an opaque `impl Trait` type. Used for testing cross-crate.
#![crate_type = "rlib"]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub trait View {
type Tmp: Iterator<Item = u32>;
@@ -18,6 +15,6 @@
type Tmp = impl Iterator<Item = u32>;
fn test(&self) -> Self::Tmp {
- vec![1,2,3].into_iter()
+ vec![1, 2, 3].into_iter()
}
}
diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction.rs b/src/test/ui/type-alias-impl-trait/bound_reduction.rs
index b45105e..b9b50f0 100644
--- a/src/test/ui/type-alias-impl-trait/bound_reduction.rs
+++ b/src/test/ui/type-alias-impl-trait/bound_reduction.rs
@@ -1,9 +1,7 @@
// build-pass (FIXME(62277): could be check-pass?)
#![allow(warnings)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+#![feature(type_alias_impl_trait)]
fn main() {
}
diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/bound_reduction2.full_tait.stderr
deleted file mode 100644
index 164564e..0000000
--- a/src/test/ui/type-alias-impl-trait/bound_reduction2.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/bound_reduction2.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/bound_reduction2.rs:18:46
- |
-LL | fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> {
- | ^^^^^^^^^^^^^
- |
-note: used non-generic type `<T as TraitWithAssoc>::Assoc` for generic parameter
- --> $DIR/bound_reduction2.rs:12:10
- |
-LL | type Foo<V> = impl Trait<V>;
- | ^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.min_tait.stderr b/src/test/ui/type-alias-impl-trait/bound_reduction2.min_tait.stderr
deleted file mode 100644
index d3520a9..0000000
--- a/src/test/ui/type-alias-impl-trait/bound_reduction2.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/bound_reduction2.rs:18:46
- |
-LL | fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> {
- | ^^^^^^^^^^^^^
- |
-note: used non-generic type `<T as TraitWithAssoc>::Assoc` for generic parameter
- --> $DIR/bound_reduction2.rs:12:10
- |
-LL | type Foo<V> = impl Trait<V>;
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.rs b/src/test/ui/type-alias-impl-trait/bound_reduction2.rs
index b94b21e..a15074c 100644
--- a/src/test/ui/type-alias-impl-trait/bound_reduction2.rs
+++ b/src/test/ui/type-alias-impl-trait/bound_reduction2.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr b/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr
new file mode 100644
index 0000000..c9d6a43
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/bound_reduction2.rs:15:46
+ |
+LL | fn foo_desugared<T: TraitWithAssoc>(_: T) -> Foo<T::Assoc> {
+ | ^^^^^^^^^^^^^
+ |
+note: used non-generic type `<T as TraitWithAssoc>::Assoc` for generic parameter
+ --> $DIR/bound_reduction2.rs:9:10
+ |
+LL | type Foo<V> = impl Trait<V>;
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr
deleted file mode 100644
index cfb1fe9..0000000
--- a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/bounds-are-checked-2.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0277]: the trait bound `T: Clone` is not satisfied
- --> $DIR/bounds-are-checked-2.rs:9:13
- |
-LL | type X<T> = impl Clone;
- | ^^^^^^^^^^ the trait `Clone` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | type X<T: std::clone::Clone> = impl Clone;
- | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.min_tait.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.min_tait.stderr
deleted file mode 100644
index 735b96d..0000000
--- a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0277]: the trait bound `T: Clone` is not satisfied
- --> $DIR/bounds-are-checked-2.rs:9:13
- |
-LL | type X<T> = impl Clone;
- | ^^^^^^^^^^ the trait `Clone` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | type X<T: std::clone::Clone> = impl Clone;
- | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs
index fecc254..c035915 100644
--- a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs
+++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs
@@ -1,10 +1,7 @@
// Make sure that we check that impl trait types implement the traits that they
// claim to.
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type X<T> = impl Clone;
//~^ ERROR the trait bound `T: Clone` is not satisfied
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.stderr
new file mode 100644
index 0000000..5ee7c72
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.stderr
@@ -0,0 +1,14 @@
+error[E0277]: the trait bound `T: Clone` is not satisfied
+ --> $DIR/bounds-are-checked-2.rs:6:13
+ |
+LL | type X<T> = impl Clone;
+ | ^^^^^^^^^^ the trait `Clone` is not implemented for `T`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | type X<T: std::clone::Clone> = impl Clone;
+ | +++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.full_tait.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked.full_tait.stderr
deleted file mode 100644
index ca89421..0000000
--- a/src/test/ui/type-alias-impl-trait/bounds-are-checked.full_tait.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/bounds-are-checked.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: unnecessary lifetime parameter `'a`
- --> $DIR/bounds-are-checked.rs:12:6
- |
-LL | fn f<'a: 'static>(t: &'a str) -> X<'a> {
- | ^^^^^^^^^^^
- |
- = help: you can use the `'static` lifetime directly, in place of `'a`
-
-error[E0308]: mismatched types
- --> $DIR/bounds-are-checked.rs:9:14
- |
-LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
- |
- = note: expected trait `From<&'a str>`
- found trait `From<&'static str>`
-note: the lifetime `'a` as defined on the item at 9:8...
- --> $DIR/bounds-are-checked.rs:9:8
- |
-LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
- | ^^
- = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error; 2 warnings emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.min_tait.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked.min_tait.stderr
deleted file mode 100644
index 9a451cb..0000000
--- a/src/test/ui/type-alias-impl-trait/bounds-are-checked.min_tait.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-warning: unnecessary lifetime parameter `'a`
- --> $DIR/bounds-are-checked.rs:12:6
- |
-LL | fn f<'a: 'static>(t: &'a str) -> X<'a> {
- | ^^^^^^^^^^^
- |
- = help: you can use the `'static` lifetime directly, in place of `'a`
-
-error[E0308]: mismatched types
- --> $DIR/bounds-are-checked.rs:9:14
- |
-LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
- |
- = note: expected trait `From<&'a str>`
- found trait `From<&'static str>`
-note: the lifetime `'a` as defined on the item at 9:8...
- --> $DIR/bounds-are-checked.rs:9:8
- |
-LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
- | ^^
- = note: ...does not necessarily outlive the static lifetime
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs b/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs
index 5e1faaa..eecef23 100644
--- a/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs
+++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs
@@ -1,10 +1,7 @@
// Make sure that we check that impl trait types implement the traits that they
// claim to.
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type X<'a> = impl Into<&'static str> + From<&'a str>;
//~^ ERROR mismatched types
@@ -19,8 +16,7 @@
}
fn main() {
- let r =
- {
+ let r = {
let s = "abcdef".to_string();
extend_lt(&s)
};
diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr
new file mode 100644
index 0000000..d5fafe0
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr
@@ -0,0 +1,26 @@
+warning: unnecessary lifetime parameter `'a`
+ --> $DIR/bounds-are-checked.rs:9:6
+ |
+LL | fn f<'a: 'static>(t: &'a str) -> X<'a> {
+ | ^^^^^^^^^^^
+ |
+ = help: you can use the `'static` lifetime directly, in place of `'a`
+
+error[E0308]: mismatched types
+ --> $DIR/bounds-are-checked.rs:6:14
+ |
+LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
+ |
+ = note: expected trait `From<&'a str>`
+ found trait `From<&'static str>`
+note: the lifetime `'a` as defined on the item at 6:8...
+ --> $DIR/bounds-are-checked.rs:6:8
+ |
+LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
+ | ^^
+ = note: ...does not necessarily outlive the static lifetime
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/coherence.full_tait.stderr b/src/test/ui/type-alias-impl-trait/coherence.full_tait.stderr
deleted file mode 100644
index 68de0c9..0000000
--- a/src/test/ui/type-alias-impl-trait/coherence.full_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/coherence.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
- --> $DIR/coherence.rs:17:6
- |
-LL | impl<T> foreign_crate::ForeignTrait for AliasOfForeignType<T> {}
- | ^ unconstrained type parameter
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/coherence.min_tait.stderr b/src/test/ui/type-alias-impl-trait/coherence.min_tait.stderr
deleted file mode 100644
index 4da5236..0000000
--- a/src/test/ui/type-alias-impl-trait/coherence.min_tait.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
- --> $DIR/coherence.rs:17:6
- |
-LL | impl<T> foreign_crate::ForeignTrait for AliasOfForeignType<T> {}
- | ^ unconstrained type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/coherence.rs b/src/test/ui/type-alias-impl-trait/coherence.rs
index 51babb0..1c0f83d 100644
--- a/src/test/ui/type-alias-impl-trait/coherence.rs
+++ b/src/test/ui/type-alias-impl-trait/coherence.rs
@@ -1,8 +1,5 @@
// aux-build:foreign-crate.rs
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
extern crate foreign_crate;
diff --git a/src/test/ui/type-alias-impl-trait/coherence.stderr b/src/test/ui/type-alias-impl-trait/coherence.stderr
new file mode 100644
index 0000000..6ede0fa
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/coherence.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/coherence.rs:14:6
+ |
+LL | impl<T> foreign_crate::ForeignTrait for AliasOfForeignType<T> {}
+ | ^ unconstrained type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.full_tait.stderr b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.full_tait.stderr
deleted file mode 100644
index 5fc79cf..0000000
--- a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/declared_but_never_defined.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: could not find defining uses
- --> $DIR/declared_but_never_defined.rs:9:12
- |
-LL | type Bar = impl std::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.min_tait.stderr b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.min_tait.stderr
deleted file mode 100644
index b731e41..0000000
--- a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: could not find defining uses
- --> $DIR/declared_but_never_defined.rs:9:12
- |
-LL | type Bar = impl std::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs
index ac92bea..c4bf56a 100644
--- a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs
+++ b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.stderr b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.stderr
new file mode 100644
index 0000000..21c2e8a
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.stderr
@@ -0,0 +1,8 @@
+error: could not find defining uses
+ --> $DIR/declared_but_never_defined.rs:6:12
+ |
+LL | type Bar = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.full_tait.stderr b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.full_tait.stderr
deleted file mode 100644
index eeccc59..0000000
--- a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.full_tait.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/declared_but_not_defined_in_scope.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: could not find defining uses
- --> $DIR/declared_but_not_defined_in_scope.rs:10:20
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/declared_but_not_defined_in_scope.rs:14:5
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ---------------------- the expected opaque type
-...
-LL | fn bomp() -> boo::Boo {
- | -------- expected `impl Debug` because of return type
-LL | ""
- | ^^ expected opaque type, found `&str`
- |
- = note: expected opaque type `impl Debug`
- found reference `&'static str`
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.min_tait.stderr b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.min_tait.stderr
deleted file mode 100644
index 20057c3..0000000
--- a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.min_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error: could not find defining uses
- --> $DIR/declared_but_not_defined_in_scope.rs:10:20
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/declared_but_not_defined_in_scope.rs:14:5
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ---------------------- the expected opaque type
-...
-LL | fn bomp() -> boo::Boo {
- | -------- expected `impl Debug` because of return type
-LL | ""
- | ^^ expected opaque type, found `&str`
- |
- = note: expected opaque type `impl Debug`
- found reference `&'static str`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs
index 2bbae98..7ea517e 100644
--- a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs
+++ b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr
new file mode 100644
index 0000000..0b4c262
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr
@@ -0,0 +1,23 @@
+error: could not find defining uses
+ --> $DIR/declared_but_not_defined_in_scope.rs:7:20
+ |
+LL | pub type Boo = impl ::std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0308]: mismatched types
+ --> $DIR/declared_but_not_defined_in_scope.rs:11:5
+ |
+LL | pub type Boo = impl ::std::fmt::Debug;
+ | ---------------------- the expected opaque type
+...
+LL | fn bomp() -> boo::Boo {
+ | -------- expected `impl Debug` because of return type
+LL | ""
+ | ^^ expected opaque type, found `&str`
+ |
+ = note: expected opaque type `impl Debug`
+ found reference `&'static str`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/defining-use-submodule.rs b/src/test/ui/type-alias-impl-trait/defining-use-submodule.rs
new file mode 100644
index 0000000..8b51f55
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/defining-use-submodule.rs
@@ -0,0 +1,23 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// test that the type alias impl trait defining use is in a submodule
+
+fn main() {}
+
+type Foo = impl std::fmt::Display;
+type Bar = impl std::fmt::Display;
+
+mod foo {
+ pub fn foo() -> super::Foo {
+ "foo"
+ }
+
+ pub mod bar {
+ pub fn bar() -> crate::Bar {
+ 1
+ }
+ }
+}
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses.full_tait.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses.full_tait.stderr
deleted file mode 100644
index 60fa141..0000000
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/different_defining_uses.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/different_defining_uses.rs:15:1
- |
-LL | fn bar() -> Foo {
- | ^^^^^^^^^^^^^^^ expected `&'static str`, got `i32`
- |
-note: previous use here
- --> $DIR/different_defining_uses.rs:11:1
- |
-LL | fn foo() -> Foo {
- | ^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses.min_tait.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses.min_tait.stderr
deleted file mode 100644
index 904ee58..0000000
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/different_defining_uses.rs:15:1
- |
-LL | fn bar() -> Foo {
- | ^^^^^^^^^^^^^^^ expected `&'static str`, got `i32`
- |
-note: previous use here
- --> $DIR/different_defining_uses.rs:11:1
- |
-LL | fn foo() -> Foo {
- | ^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses.rs
index 542de6b..272af7a 100644
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses.rs
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
@@ -12,6 +9,7 @@
""
}
-fn bar() -> Foo { //~ ERROR concrete type differs from previous
+fn bar() -> Foo {
+ //~^ ERROR concrete type differs from previous
42i32
}
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses.stderr
new file mode 100644
index 0000000..eaa716b
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/different_defining_uses.rs:12:1
+ |
+LL | fn bar() -> Foo {
+ | ^^^^^^^^^^^^^^^ expected `&'static str`, got `i32`
+ |
+note: previous use here
+ --> $DIR/different_defining_uses.rs:8:1
+ |
+LL | fn foo() -> Foo {
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.full_tait.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.full_tait.stderr
deleted file mode 100644
index 5c5ae7e..0000000
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.full_tait.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/different_defining_uses_never_type.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/different_defining_uses_never_type.rs:15:1
- |
-LL | fn bar() -> Foo {
- | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()`
- |
-note: previous use here
- --> $DIR/different_defining_uses_never_type.rs:11:1
- |
-LL | fn foo() -> Foo {
- | ^^^^^^^^^^^^^^^
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/different_defining_uses_never_type.rs:19:1
- |
-LL | fn boo() -> Foo {
- | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()`
- |
-note: previous use here
- --> $DIR/different_defining_uses_never_type.rs:11:1
- |
-LL | fn foo() -> Foo {
- | ^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.min_tait.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.min_tait.stderr
deleted file mode 100644
index 9cf2c58..0000000
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.min_tait.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/different_defining_uses_never_type.rs:15:1
- |
-LL | fn bar() -> Foo {
- | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()`
- |
-note: previous use here
- --> $DIR/different_defining_uses_never_type.rs:11:1
- |
-LL | fn foo() -> Foo {
- | ^^^^^^^^^^^^^^^
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/different_defining_uses_never_type.rs:19:1
- |
-LL | fn boo() -> Foo {
- | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()`
- |
-note: previous use here
- --> $DIR/different_defining_uses_never_type.rs:11:1
- |
-LL | fn foo() -> Foo {
- | ^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs
index 72352a7..95cbcfec2 100644
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
@@ -12,10 +9,12 @@
""
}
-fn bar() -> Foo { //~ ERROR concrete type differs from previous
+fn bar() -> Foo {
+ //~^ ERROR concrete type differs from previous
panic!()
}
-fn boo() -> Foo { //~ ERROR concrete type differs from previous
+fn boo() -> Foo {
+ //~^ ERROR concrete type differs from previous
loop {}
}
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr
new file mode 100644
index 0000000..6274029
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr
@@ -0,0 +1,26 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/different_defining_uses_never_type.rs:12:1
+ |
+LL | fn bar() -> Foo {
+ | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()`
+ |
+note: previous use here
+ --> $DIR/different_defining_uses_never_type.rs:8:1
+ |
+LL | fn foo() -> Foo {
+ | ^^^^^^^^^^^^^^^
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/different_defining_uses_never_type.rs:17:1
+ |
+LL | fn boo() -> Foo {
+ | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()`
+ |
+note: previous use here
+ --> $DIR/different_defining_uses_never_type.rs:8:1
+ |
+LL | fn foo() -> Foo {
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.full_tait.stderr
deleted file mode 100644
index b69622b..0000000
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/different_defining_uses_never_type2.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs
index ac9884b..8549687 100644
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs
@@ -1,9 +1,6 @@
// build-pass (FIXME(62277): could be check-pass?)
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs
new file mode 100644
index 0000000..d000197
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs
@@ -0,0 +1,15 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+type OneLifetime<'a, 'b> = impl std::fmt::Debug;
+
+fn foo<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> {
+ a
+}
+
+fn bar<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> {
+ //~^ ERROR: concrete type differs from previous defining opaque type use
+ b
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr
new file mode 100644
index 0000000..9493a59
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/different_lifetimes_defining_uses.rs:10:1
+ |
+LL | fn bar<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'a u32`, got `&'b u32`
+ |
+note: previous use here
+ --> $DIR/different_lifetimes_defining_uses.rs:6:1
+ |
+LL | fn foo<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/fallback.full_tait.stderr b/src/test/ui/type-alias-impl-trait/fallback.full_tait.stderr
deleted file mode 100644
index 9641d75..0000000
--- a/src/test/ui/type-alias-impl-trait/fallback.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/fallback.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/fallback.rs b/src/test/ui/type-alias-impl-trait/fallback.rs
index 84fec75..fe1ca22 100644
--- a/src/test/ui/type-alias-impl-trait/fallback.rs
+++ b/src/test/ui/type-alias-impl-trait/fallback.rs
@@ -2,10 +2,7 @@
// inference variable being completely unconstrained.
//
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Foo = impl Copy;
diff --git a/src/test/ui/type-alias-impl-trait/field-types.rs b/src/test/ui/type-alias-impl-trait/field-types.rs
new file mode 100644
index 0000000..91494a8
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/field-types.rs
@@ -0,0 +1,20 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// FIXME This should compile, but it currently doesn't
+
+use std::fmt::Debug;
+
+type Foo = impl Debug;
+//~^ ERROR: could not find defining uses
+
+struct Bar {
+ foo: Foo,
+}
+
+fn bar() -> Bar {
+ Bar { foo: "foo" }
+ //~^ ERROR: mismatched types [E0308]
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/field-types.stderr b/src/test/ui/type-alias-impl-trait/field-types.stderr
new file mode 100644
index 0000000..18c2abb
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/field-types.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/field-types.rs:16:16
+ |
+LL | type Foo = impl Debug;
+ | ---------- the expected opaque type
+...
+LL | Bar { foo: "foo" }
+ | ^^^^^ expected opaque type, found `&str`
+ |
+ = note: expected opaque type `impl Debug`
+ found reference `&'static str`
+
+error: could not find defining uses
+ --> $DIR/field-types.rs:8:12
+ |
+LL | type Foo = impl Debug;
+ | ^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.full_tait.stderr
deleted file mode 100644
index 972e5d9..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_different_defining_uses.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_different_defining_uses.rs:14:1
- |
-LL | fn my_iter2<T>(t: T) -> MyIter<T> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `std::iter::Once<T>`, got `std::option::IntoIter<T>`
- |
-note: previous use here
- --> $DIR/generic_different_defining_uses.rs:10:1
- |
-LL | fn my_iter<T>(t: T) -> MyIter<T> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.min_tait.stderr
deleted file mode 100644
index 9116838..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_different_defining_uses.rs:14:1
- |
-LL | fn my_iter2<T>(t: T) -> MyIter<T> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `std::iter::Once<T>`, got `std::option::IntoIter<T>`
- |
-note: previous use here
- --> $DIR/generic_different_defining_uses.rs:10:1
- |
-LL | fn my_iter<T>(t: T) -> MyIter<T> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs
index 4eb603d..0753513 100644
--- a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
@@ -11,6 +8,7 @@
std::iter::once(t)
}
-fn my_iter2<T>(t: T) -> MyIter<T> { //~ ERROR concrete type differs from previous
+fn my_iter2<T>(t: T) -> MyIter<T> {
+ //~^ ERROR concrete type differs from previous
Some(t).into_iter()
}
diff --git a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.stderr b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.stderr
new file mode 100644
index 0000000..f8a0581
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_different_defining_uses.rs:11:1
+ |
+LL | fn my_iter2<T>(t: T) -> MyIter<T> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `std::iter::Once<T>`, got `std::option::IntoIter<T>`
+ |
+note: previous use here
+ --> $DIR/generic_different_defining_uses.rs:7:1
+ |
+LL | fn my_iter<T>(t: T) -> MyIter<T> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.full_tait.stderr
deleted file mode 100644
index ecf0e39..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_lifetime_param.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_lifetime_param.rs:10:26
- |
-LL | fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
- | ^^^^^^^^^^^
- |
-note: lifetime used multiple times
- --> $DIR/generic_duplicate_lifetime_param.rs:8:10
- |
-LL | type Two<'a, 'b> = impl std::fmt::Debug;
- | ^^ ^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.min_tait.stderr
deleted file mode 100644
index 1aad312..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_lifetime_param.rs:10:26
- |
-LL | fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
- | ^^^^^^^^^^^
- |
-note: lifetime used multiple times
- --> $DIR/generic_duplicate_lifetime_param.rs:8:10
- |
-LL | type Two<'a, 'b> = impl std::fmt::Debug;
- | ^^ ^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
index d838d49..31f9929 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
@@ -1,12 +1,10 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
type Two<'a, 'b> = impl std::fmt::Debug;
-fn one<'a>(t: &'a ()) -> Two<'a, 'a> { //~ ERROR non-defining opaque type use
+fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
+ //~^ ERROR non-defining opaque type use
t
}
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
new file mode 100644
index 0000000..08b26b8
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_lifetime_param.rs:7:26
+ |
+LL | fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
+ | ^^^^^^^^^^^
+ |
+note: lifetime used multiple times
+ --> $DIR/generic_duplicate_lifetime_param.rs:5:10
+ |
+LL | type Two<'a, 'b> = impl std::fmt::Debug;
+ | ^^ ^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.full_tait.stderr
deleted file mode 100644
index 805cea7..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.full_tait.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:16:30
- |
-LL | fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
- | ^^^^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use.rs:12:13
- |
-LL | type TwoTys<T, U> = impl Debug;
- | ^ ^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:21:36
- |
-LL | fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
- | ^^^^^^^^^^^^^^^^^^^^
- |
-note: lifetime used multiple times
- --> $DIR/generic_duplicate_param_use.rs:13:19
- |
-LL | type TwoLifetimes<'a, 'b> = impl Debug;
- | ^^ ^^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:26:50
- |
-LL | fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
- | ^^^^^^^^^^^^^^^
- |
-note: constant used multiple times
- --> $DIR/generic_duplicate_param_use.rs:14:22
- |
-LL | type TwoConsts<const X: usize, const Y: usize> = impl Debug;
- | ^ ^
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.min_tait.stderr
deleted file mode 100644
index 805cea7..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.min_tait.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:16:30
- |
-LL | fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
- | ^^^^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use.rs:12:13
- |
-LL | type TwoTys<T, U> = impl Debug;
- | ^ ^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:21:36
- |
-LL | fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
- | ^^^^^^^^^^^^^^^^^^^^
- |
-note: lifetime used multiple times
- --> $DIR/generic_duplicate_param_use.rs:13:19
- |
-LL | type TwoLifetimes<'a, 'b> = impl Debug;
- | ^^ ^^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:26:50
- |
-LL | fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
- | ^^^^^^^^^^^^^^^
- |
-note: constant used multiple times
- --> $DIR/generic_duplicate_param_use.rs:14:22
- |
-LL | type TwoConsts<const X: usize, const Y: usize> = impl Debug;
- | ^ ^
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
index 12ff5a2..a4e40f5 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
@@ -1,8 +1,4 @@
-#![feature(const_generics)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-#![allow(incomplete_features)]
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
@@ -14,16 +10,16 @@
type TwoConsts<const X: usize, const Y: usize> = impl Debug;
fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
-//~^ ERROR non-defining opaque type use in defining scope
+ //~^ ERROR non-defining opaque type use in defining scope
t
}
fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
-//~^ ERROR non-defining opaque type use in defining scope
+ //~^ ERROR non-defining opaque type use in defining scope
t
}
fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
-//~^ ERROR non-defining opaque type use in defining scope
+ //~^ ERROR non-defining opaque type use in defining scope
t
}
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
new file mode 100644
index 0000000..641cce2
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
@@ -0,0 +1,38 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use.rs:12:30
+ |
+LL | fn one_ty<T: Debug>(t: T) -> TwoTys<T, T> {
+ | ^^^^^^^^^^^^
+ |
+note: type used multiple times
+ --> $DIR/generic_duplicate_param_use.rs:8:13
+ |
+LL | type TwoTys<T, U> = impl Debug;
+ | ^ ^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use.rs:17:36
+ |
+LL | fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> {
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: lifetime used multiple times
+ --> $DIR/generic_duplicate_param_use.rs:9:19
+ |
+LL | type TwoLifetimes<'a, 'b> = impl Debug;
+ | ^^ ^^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use.rs:22:50
+ |
+LL | fn one_const<const N: usize>(t: *mut [u8; N]) -> TwoConsts<N, N> {
+ | ^^^^^^^^^^^^^^^
+ |
+note: constant used multiple times
+ --> $DIR/generic_duplicate_param_use.rs:10:22
+ |
+LL | type TwoConsts<const X: usize, const Y: usize> = impl Debug;
+ | ^ ^
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.full_tait.stderr
deleted file mode 100644
index ef7d4f1..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use10.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs
index c7a7ded..c17d595 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs
@@ -1,8 +1,5 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.full_tait.stderr
deleted file mode 100644
index 357d477..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use2.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use2.rs:13:27
- |
-LL | fn one<T: Debug>(t: T) -> Two<T, T> {
- | ^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use2.rs:11:10
- |
-LL | type Two<T, U> = impl Debug;
- | ^ ^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.min_tait.stderr
deleted file mode 100644
index 805ab67..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use2.rs:13:27
- |
-LL | fn one<T: Debug>(t: T) -> Two<T, T> {
- | ^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use2.rs:11:10
- |
-LL | type Two<T, U> = impl Debug;
- | ^ ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs
index ff51662..a74731d 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr
new file mode 100644
index 0000000..d87e8c5
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use2.rs:10:27
+ |
+LL | fn one<T: Debug>(t: T) -> Two<T, T> {
+ | ^^^^^^^^^
+ |
+note: type used multiple times
+ --> $DIR/generic_duplicate_param_use2.rs:8:10
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^ ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.full_tait.stderr
deleted file mode 100644
index b2004c84..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use3.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use3.rs:13:27
- |
-LL | fn one<T: Debug>(t: T) -> Two<T, T> {
- | ^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use3.rs:11:10
- |
-LL | type Two<T, U> = impl Debug;
- | ^ ^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.min_tait.stderr
deleted file mode 100644
index 43af9ec..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use3.rs:13:27
- |
-LL | fn one<T: Debug>(t: T) -> Two<T, T> {
- | ^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use3.rs:11:10
- |
-LL | type Two<T, U> = impl Debug;
- | ^ ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs
index f7d1cc1..0597b83 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr
new file mode 100644
index 0000000..711de85
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use3.rs:10:27
+ |
+LL | fn one<T: Debug>(t: T) -> Two<T, T> {
+ | ^^^^^^^^^
+ |
+note: type used multiple times
+ --> $DIR/generic_duplicate_param_use3.rs:8:10
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^ ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.full_tait.stderr
deleted file mode 100644
index f5db77a..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use4.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use4.rs:13:27
- |
-LL | fn one<T: Debug>(t: T) -> Two<T, T> {
- | ^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use4.rs:11:10
- |
-LL | type Two<T, U> = impl Debug;
- | ^ ^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.min_tait.stderr
deleted file mode 100644
index f8e2b51..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use4.rs:13:27
- |
-LL | fn one<T: Debug>(t: T) -> Two<T, T> {
- | ^^^^^^^^^
- |
-note: type used multiple times
- --> $DIR/generic_duplicate_param_use4.rs:11:10
- |
-LL | type Two<T, U> = impl Debug;
- | ^ ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs
index 26583a6..e77c949 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
@@ -11,7 +8,7 @@
type Two<T, U> = impl Debug;
fn one<T: Debug>(t: T) -> Two<T, T> {
-//~^ ERROR non-defining opaque type use in defining scope
+ //~^ ERROR non-defining opaque type use in defining scope
t
}
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.stderr
new file mode 100644
index 0000000..fcf01f5
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_duplicate_param_use4.rs:10:27
+ |
+LL | fn one<T: Debug>(t: T) -> Two<T, T> {
+ | ^^^^^^^^^
+ |
+note: type used multiple times
+ --> $DIR/generic_duplicate_param_use4.rs:8:10
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^ ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr
deleted file mode 100644
index aab64e7..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.full_tait.stderr
+++ /dev/null
@@ -1,48 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use5.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use5.rs:19:1
- |
-LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, U)`, got `(U, T)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use5.rs:15:1
- |
-LL | fn two<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `T` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use5.rs:11:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, U)`
-help: consider restricting type parameter `T`
- |
-LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error[E0277]: `U` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use5.rs:11:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, U)`
-help: consider restricting type parameter `U`
- |
-LL | type Two<T, U: std::fmt::Debug> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.min_tait.stderr
deleted file mode 100644
index 5c8c5b89..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.min_tait.stderr
+++ /dev/null
@@ -1,39 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use5.rs:19:1
- |
-LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, U)`, got `(U, T)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use5.rs:15:1
- |
-LL | fn two<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `T` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use5.rs:11:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, U)`
-help: consider restricting type parameter `T`
- |
-LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error[E0277]: `U` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use5.rs:11:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, U)`
-help: consider restricting type parameter `U`
- |
-LL | type Two<T, U: std::fmt::Debug> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs
index af473e8..dd2f202 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr
new file mode 100644
index 0000000..6cc6b35
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr
@@ -0,0 +1,39 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use5.rs:16:1
+ |
+LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, U)`, got `(U, T)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use5.rs:12:1
+ |
+LL | fn two<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: `T` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use5.rs:8:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, U)`
+help: consider restricting type parameter `T`
+ |
+LL | type Two<T: std::fmt::Debug, U> = impl Debug;
+ | +++++++++++++++++
+
+error[E0277]: `U` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use5.rs:8:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, U)`
+help: consider restricting type parameter `U`
+ |
+LL | type Two<T, U: std::fmt::Debug> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr
deleted file mode 100644
index a69e99b..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.full_tait.stderr
+++ /dev/null
@@ -1,36 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use6.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use6.rs:18:1
- |
-LL | fn three<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, T)`, got `(U, T)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use6.rs:14:1
- |
-LL | fn two<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `T` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use6.rs:11:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, T)`
-help: consider restricting type parameter `T`
- |
-LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.min_tait.stderr
deleted file mode 100644
index a377ef2..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.min_tait.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use6.rs:18:1
- |
-LL | fn three<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, T)`, got `(U, T)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use6.rs:14:1
- |
-LL | fn two<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `T` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use6.rs:11:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, T)`
-help: consider restricting type parameter `T`
- |
-LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs
index 01afb2f..d54d3cd 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr
new file mode 100644
index 0000000..e752098
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr
@@ -0,0 +1,27 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use6.rs:15:1
+ |
+LL | fn three<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, T)`, got `(U, T)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use6.rs:11:1
+ |
+LL | fn two<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: `T` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use6.rs:8:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, T)`
+help: consider restricting type parameter `T`
+ |
+LL | type Two<T: std::fmt::Debug, U> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.full_tait.stderr
deleted file mode 100644
index d80c832..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use7.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs
index 184e3a5..feebf81 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs
@@ -1,8 +1,5 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr
deleted file mode 100644
index e73ac88..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.full_tait.stderr
+++ /dev/null
@@ -1,36 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use8.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use8.rs:17:1
- |
-LL | fn three<T: Debug, U: Debug>(_: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, u32)`, got `(U, u32)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use8.rs:13:1
- |
-LL | fn two<T: Debug, U: Debug>(t: T, _: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `T` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use8.rs:10:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, u32)`
-help: consider restricting type parameter `T`
- |
-LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.min_tait.stderr
deleted file mode 100644
index d7edce7..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.min_tait.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use8.rs:17:1
- |
-LL | fn three<T: Debug, U: Debug>(_: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, u32)`, got `(U, u32)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use8.rs:13:1
- |
-LL | fn two<T: Debug, U: Debug>(t: T, _: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `T` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use8.rs:10:18
- |
-LL | type Two<T, U> = impl Debug;
- | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(T, u32)`
-help: consider restricting type parameter `T`
- |
-LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs
index ecb8b2c..4a723b6 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr
new file mode 100644
index 0000000..44bdbdc
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr
@@ -0,0 +1,27 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use8.rs:14:1
+ |
+LL | fn three<T: Debug, U: Debug>(_: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, u32)`, got `(U, u32)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use8.rs:10:1
+ |
+LL | fn two<T: Debug, U: Debug>(t: T, _: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: `T` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use8.rs:7:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, u32)`
+help: consider restricting type parameter `T`
+ |
+LL | type Two<T: std::fmt::Debug, U> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr
deleted file mode 100644
index 0b3d72d..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.full_tait.stderr
+++ /dev/null
@@ -1,60 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_duplicate_param_use9.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use9.rs:24:1
- |
-LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(A, B, <A as Foo>::Bar)`, got `(A, B, i32)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use9.rs:20:1
- |
-LL | fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, <A as Foo>::Bar)`
- --> $DIR/generic_duplicate_param_use9.rs:10:18
- |
-LL | type Two<A, B> = impl Debug;
- | ^^^^^^^^^^ within `(A, B, <A as Foo>::Bar)`, the trait `Foo` is not implemented for `A`
- |
- = note: required because it appears within the type `(A, B, <A as Foo>::Bar)`
-help: consider restricting type parameter `A`
- |
-LL | type Two<A: Foo, B> = impl Debug;
- | ^^^^^
-
-error[E0277]: `A` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use9.rs:10:18
- |
-LL | type Two<A, B> = impl Debug;
- | ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
-help: consider restricting type parameter `A`
- |
-LL | type Two<A: std::fmt::Debug, B> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error[E0277]: `B` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use9.rs:10:18
- |
-LL | type Two<A, B> = impl Debug;
- | ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
-help: consider restricting type parameter `B`
- |
-LL | type Two<A, B: std::fmt::Debug> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.min_tait.stderr
deleted file mode 100644
index fd1081d..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.min_tait.stderr
+++ /dev/null
@@ -1,51 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/generic_duplicate_param_use9.rs:24:1
- |
-LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(A, B, <A as Foo>::Bar)`, got `(A, B, i32)`
- |
-note: previous use here
- --> $DIR/generic_duplicate_param_use9.rs:20:1
- |
-LL | fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, <A as Foo>::Bar)`
- --> $DIR/generic_duplicate_param_use9.rs:10:18
- |
-LL | type Two<A, B> = impl Debug;
- | ^^^^^^^^^^ within `(A, B, <A as Foo>::Bar)`, the trait `Foo` is not implemented for `A`
- |
- = note: required because it appears within the type `(A, B, <A as Foo>::Bar)`
-help: consider restricting type parameter `A`
- |
-LL | type Two<A: Foo, B> = impl Debug;
- | ^^^^^
-
-error[E0277]: `A` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use9.rs:10:18
- |
-LL | type Two<A, B> = impl Debug;
- | ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
-help: consider restricting type parameter `A`
- |
-LL | type Two<A: std::fmt::Debug, B> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error[E0277]: `B` doesn't implement `Debug`
- --> $DIR/generic_duplicate_param_use9.rs:10:18
- |
-LL | type Two<A, B> = impl Debug;
- | ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
- = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
-help: consider restricting type parameter `B`
- |
-LL | type Two<A, B: std::fmt::Debug> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs
index 5eced6c..7470819 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr
new file mode 100644
index 0000000..a8eb53a
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr
@@ -0,0 +1,51 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use9.rs:21:1
+ |
+LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(A, B, <A as Foo>::Bar)`, got `(A, B, i32)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use9.rs:17:1
+ |
+LL | fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, <A as Foo>::Bar)`
+ --> $DIR/generic_duplicate_param_use9.rs:7:18
+ |
+LL | type Two<A, B> = impl Debug;
+ | ^^^^^^^^^^ within `(A, B, <A as Foo>::Bar)`, the trait `Foo` is not implemented for `A`
+ |
+ = note: required because it appears within the type `(A, B, <A as Foo>::Bar)`
+help: consider restricting type parameter `A`
+ |
+LL | type Two<A: Foo, B> = impl Debug;
+ | +++++
+
+error[E0277]: `A` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use9.rs:7:18
+ |
+LL | type Two<A, B> = impl Debug;
+ | ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
+help: consider restricting type parameter `A`
+ |
+LL | type Two<A: std::fmt::Debug, B> = impl Debug;
+ | +++++++++++++++++
+
+error[E0277]: `B` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use9.rs:7:18
+ |
+LL | type Two<A, B> = impl Debug;
+ | ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
+help: consider restricting type parameter `B`
+ |
+LL | type Two<A, B: std::fmt::Debug> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_lifetime_param.full_tait.stderr
deleted file mode 100644
index 3981775..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_lifetime_param.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs b/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs
index dbe7cfd..e109c38 100644
--- a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs
@@ -1,9 +1,6 @@
// build-pass (FIXME(62277): could be check-pass?)
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.full_tait.stderr
deleted file mode 100644
index 4d7eddf..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.full_tait.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_nondefining_use.rs:17:21
- |
-LL | fn concrete_ty() -> OneTy<u32> {
- | ^^^^^^^^^^
- |
-note: used non-generic type `u32` for generic parameter
- --> $DIR/generic_nondefining_use.rs:11:12
- |
-LL | type OneTy<T> = impl Debug;
- | ^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_nondefining_use.rs:22:27
- |
-LL | type OneLifetime<'a> = impl Debug;
- | -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
-...
-LL | fn concrete_lifetime() -> OneLifetime<'static> {
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_nondefining_use.rs:27:24
- |
-LL | fn concrete_const() -> OneConst<{123}> {
- | ^^^^^^^^^^^^^^^
- |
-note: used non-generic constant `{123}` for generic parameter
- --> $DIR/generic_nondefining_use.rs:13:21
- |
-LL | type OneConst<const X: usize> = impl Debug;
- | ^
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.min_tait.stderr
deleted file mode 100644
index 4d7eddf..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.min_tait.stderr
+++ /dev/null
@@ -1,35 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_nondefining_use.rs:17:21
- |
-LL | fn concrete_ty() -> OneTy<u32> {
- | ^^^^^^^^^^
- |
-note: used non-generic type `u32` for generic parameter
- --> $DIR/generic_nondefining_use.rs:11:12
- |
-LL | type OneTy<T> = impl Debug;
- | ^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_nondefining_use.rs:22:27
- |
-LL | type OneLifetime<'a> = impl Debug;
- | -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
-...
-LL | fn concrete_lifetime() -> OneLifetime<'static> {
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: non-defining opaque type use in defining scope
- --> $DIR/generic_nondefining_use.rs:27:24
- |
-LL | fn concrete_const() -> OneConst<{123}> {
- | ^^^^^^^^^^^^^^^
- |
-note: used non-generic constant `{123}` for generic parameter
- --> $DIR/generic_nondefining_use.rs:13:21
- |
-LL | type OneConst<const X: usize> = impl Debug;
- | ^
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs
index c69884d..7ee5f7b 100644
--- a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs
@@ -1,8 +1,4 @@
-#![feature(const_generics)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-#![allow(incomplete_features)]
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
@@ -15,16 +11,16 @@
// Not defining uses, because they doesn't define *all* possible generics.
fn concrete_ty() -> OneTy<u32> {
-//~^ ERROR non-defining opaque type use in defining scope
+ //~^ ERROR non-defining opaque type use in defining scope
5u32
}
fn concrete_lifetime() -> OneLifetime<'static> {
-//~^ ERROR non-defining opaque type use in defining scope
+ //~^ ERROR non-defining opaque type use in defining scope
6u32
}
-fn concrete_const() -> OneConst<{123}> {
-//~^ ERROR non-defining opaque type use in defining scope
+fn concrete_const() -> OneConst<{ 123 }> {
+ //~^ ERROR non-defining opaque type use in defining scope
7u32
}
diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr
new file mode 100644
index 0000000..5b42f10
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr
@@ -0,0 +1,35 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_nondefining_use.rs:13:21
+ |
+LL | fn concrete_ty() -> OneTy<u32> {
+ | ^^^^^^^^^^
+ |
+note: used non-generic type `u32` for generic parameter
+ --> $DIR/generic_nondefining_use.rs:7:12
+ |
+LL | type OneTy<T> = impl Debug;
+ | ^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_nondefining_use.rs:18:27
+ |
+LL | type OneLifetime<'a> = impl Debug;
+ | -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type
+...
+LL | fn concrete_lifetime() -> OneLifetime<'static> {
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: non-defining opaque type use in defining scope
+ --> $DIR/generic_nondefining_use.rs:23:24
+ |
+LL | fn concrete_const() -> OneConst<{ 123 }> {
+ | ^^^^^^^^^^^^^^^^^
+ |
+note: used non-generic constant `123_usize` for generic parameter
+ --> $DIR/generic_nondefining_use.rs:9:21
+ |
+LL | type OneConst<const X: usize> = impl Debug;
+ | ^
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_not_used.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_not_used.full_tait.stderr
deleted file mode 100644
index 819ef7b..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_not_used.full_tait.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_not_used.rs:8:33
- |
-LL | type WrongGeneric<T: 'static> = impl 'static;
- | ^^^^^^^^^^^^
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_not_used.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: type parameter `V` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/generic_not_used.rs:11:73
- |
-LL | fn wrong_generic<U: 'static, V: 'static>(_: U, v: V) -> WrongGeneric<U> {
- | _________________________________________________________________________^
-LL | |
-LL | | v
-LL | | }
- | |_^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_not_used.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_not_used.min_tait.stderr
deleted file mode 100644
index fe7f5f6..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_not_used.min_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_not_used.rs:8:33
- |
-LL | type WrongGeneric<T: 'static> = impl 'static;
- | ^^^^^^^^^^^^
-
-error: type parameter `V` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/generic_not_used.rs:11:73
- |
-LL | fn wrong_generic<U: 'static, V: 'static>(_: U, v: V) -> WrongGeneric<U> {
- | _________________________________________________________________________^
-LL | |
-LL | | v
-LL | | }
- | |_^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/generic_not_used.rs b/src/test/ui/type-alias-impl-trait/generic_not_used.rs
index 68f50b2..dd6300a 100644
--- a/src/test/ui/type-alias-impl-trait/generic_not_used.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_not_used.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
@@ -9,6 +6,6 @@
//~^ ERROR: at least one trait must be specified
fn wrong_generic<U: 'static, V: 'static>(_: U, v: V) -> WrongGeneric<U> {
-//~^ ERROR type parameter `V` is part of concrete type but not used in parameter list
+ //~^ ERROR type parameter `V` is part of concrete type but not used in parameter list
v
}
diff --git a/src/test/ui/type-alias-impl-trait/generic_not_used.stderr b/src/test/ui/type-alias-impl-trait/generic_not_used.stderr
new file mode 100644
index 0000000..8015ff7
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_not_used.stderr
@@ -0,0 +1,18 @@
+error: at least one trait must be specified
+ --> $DIR/generic_not_used.rs:5:33
+ |
+LL | type WrongGeneric<T: 'static> = impl 'static;
+ | ^^^^^^^^^^^^
+
+error: type parameter `V` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ --> $DIR/generic_not_used.rs:8:73
+ |
+LL | fn wrong_generic<U: 'static, V: 'static>(_: U, v: V) -> WrongGeneric<U> {
+ | _________________________________________________________________________^
+LL | |
+LL | | v
+LL | | }
+ | |_^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.nll.stderr
deleted file mode 100644
index 28ac61a..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.nll.stderr
+++ /dev/null
@@ -1,50 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_type_does_not_live_long_enough.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0308]: mismatched types
- --> $DIR/generic_type_does_not_live_long_enough.rs:9:18
- |
-LL | let z: i32 = x;
- | --- ^ expected `i32`, found opaque type
- | |
- | expected due to this
-...
-LL | type WrongGeneric<T> = impl 'static;
- | ------------ the found opaque type
- |
- = note: expected type `i32`
- found opaque type `impl Sized`
-
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:16:30
- |
-LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
- | ^^^^^^^^^^^^^^^
- |
- = help: consider adding an explicit lifetime bound `T: 'static`...
-
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^
- |
- = help: consider adding an explicit lifetime bound `T: 'static`...
- = note: ...so that the type `T` will meet its required lifetime bounds
-
-error: aborting due to 4 previous errors; 1 warning emitted
-
-Some errors have detailed explanations: E0308, E0310.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.stderr
deleted file mode 100644
index 90a753b..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.full_tait.stderr
+++ /dev/null
@@ -1,42 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_type_does_not_live_long_enough.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0308]: mismatched types
- --> $DIR/generic_type_does_not_live_long_enough.rs:9:18
- |
-LL | let z: i32 = x;
- | --- ^ expected `i32`, found opaque type
- | |
- | expected due to this
-...
-LL | type WrongGeneric<T> = impl 'static;
- | ------------ the found opaque type
- |
- = note: expected type `i32`
- found opaque type `impl Sized`
-
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
-...
-LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
- | - help: consider adding an explicit lifetime bound...: `T: 'static`
-
-error: aborting due to 3 previous errors; 1 warning emitted
-
-Some errors have detailed explanations: E0308, E0310.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr
deleted file mode 100644
index b8ca8e4..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.nll.stderr
+++ /dev/null
@@ -1,41 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/generic_type_does_not_live_long_enough.rs:9:18
- |
-LL | let z: i32 = x;
- | --- ^ expected `i32`, found opaque type
- | |
- | expected due to this
-...
-LL | type WrongGeneric<T> = impl 'static;
- | ------------ the found opaque type
- |
- = note: expected type `i32`
- found opaque type `impl Sized`
-
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:16:30
- |
-LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
- | ^^^^^^^^^^^^^^^
- |
- = help: consider adding an explicit lifetime bound `T: 'static`...
-
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^
- |
- = help: consider adding an explicit lifetime bound `T: 'static`...
- = note: ...so that the type `T` will meet its required lifetime bounds
-
-error: aborting due to 4 previous errors
-
-Some errors have detailed explanations: E0308, E0310.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.stderr
deleted file mode 100644
index e502822..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.min_tait.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/generic_type_does_not_live_long_enough.rs:9:18
- |
-LL | let z: i32 = x;
- | --- ^ expected `i32`, found opaque type
- | |
- | expected due to this
-...
-LL | type WrongGeneric<T> = impl 'static;
- | ------------ the found opaque type
- |
- = note: expected type `i32`
- found opaque type `impl Sized`
-
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:12:24
- |
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
-...
-LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
- | - help: consider adding an explicit lifetime bound...: `T: 'static`
-
-error: aborting due to 3 previous errors
-
-Some errors have detailed explanations: E0308, E0310.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr
new file mode 100644
index 0000000..f4e1de8
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.nll.stderr
@@ -0,0 +1,41 @@
+error: at least one trait must be specified
+ --> $DIR/generic_type_does_not_live_long_enough.rs:9:24
+ |
+LL | type WrongGeneric<T> = impl 'static;
+ | ^^^^^^^^^^^^
+
+error[E0308]: mismatched types
+ --> $DIR/generic_type_does_not_live_long_enough.rs:6:18
+ |
+LL | let z: i32 = x;
+ | --- ^ expected `i32`, found opaque type
+ | |
+ | expected due to this
+...
+LL | type WrongGeneric<T> = impl 'static;
+ | ------------ the found opaque type
+ |
+ = note: expected type `i32`
+ found opaque type `impl Sized`
+
+error[E0310]: the parameter type `T` may not live long enough
+ --> $DIR/generic_type_does_not_live_long_enough.rs:12:30
+ |
+LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
+ | ^^^^^^^^^^^^^^^
+ |
+ = help: consider adding an explicit lifetime bound `T: 'static`...
+
+error[E0310]: the parameter type `T` may not live long enough
+ --> $DIR/generic_type_does_not_live_long_enough.rs:9:24
+ |
+LL | type WrongGeneric<T> = impl 'static;
+ | ^^^^^^^^^^^^
+ |
+ = help: consider adding an explicit lifetime bound `T: 'static`...
+ = note: ...so that the type `T` will meet its required lifetime bounds
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0308, E0310.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
index 9f647d9..78d25e3 100644
--- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {
let y = 42;
@@ -10,9 +7,9 @@
}
type WrongGeneric<T> = impl 'static;
-//~^ ERROR the parameter type `T` may not live long enough
-//~| ERROR: at least one trait must be specified
+//~^ ERROR: at least one trait must be specified
fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
+ //~^ ERROR the parameter type `T` may not live long enough
t
}
diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
new file mode 100644
index 0000000..5687843
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr
@@ -0,0 +1,32 @@
+error: at least one trait must be specified
+ --> $DIR/generic_type_does_not_live_long_enough.rs:9:24
+ |
+LL | type WrongGeneric<T> = impl 'static;
+ | ^^^^^^^^^^^^
+
+error[E0308]: mismatched types
+ --> $DIR/generic_type_does_not_live_long_enough.rs:6:18
+ |
+LL | let z: i32 = x;
+ | --- ^ expected `i32`, found opaque type
+ | |
+ | expected due to this
+...
+LL | type WrongGeneric<T> = impl 'static;
+ | ------------ the found opaque type
+ |
+ = note: expected type `i32`
+ found opaque type `impl Sized`
+
+error[E0310]: the parameter type `T` may not live long enough
+ --> $DIR/generic_type_does_not_live_long_enough.rs:12:30
+ |
+LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
+ | - ^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+ | |
+ | help: consider adding an explicit lifetime bound...: `T: 'static`
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0308, E0310.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained.full_tait.stderr
deleted file mode 100644
index c4778a4..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.full_tait.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_underconstrained.rs:9:35
- |
-LL | type Underconstrained<T: Trait> = impl 'static;
- | ^^^^^^^^^^^^
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_underconstrained.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0277]: the trait bound `T: Trait` is not satisfied
- --> $DIR/generic_underconstrained.rs:13:31
- |
-LL | type Underconstrained<T: Trait> = impl 'static;
- | ----- required by this bound in `Underconstrained`
-...
-LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
- | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
- | ^^^^^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained.min_tait.stderr
deleted file mode 100644
index 6c1d6de..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.min_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_underconstrained.rs:9:35
- |
-LL | type Underconstrained<T: Trait> = impl 'static;
- | ^^^^^^^^^^^^
-
-error[E0277]: the trait bound `T: Trait` is not satisfied
- --> $DIR/generic_underconstrained.rs:13:31
- |
-LL | type Underconstrained<T: Trait> = impl 'static;
- | ----- required by this bound in `Underconstrained`
-...
-LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
- | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
- | ^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs
index f4c4a1b..d87a25a 100644
--- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs
@@ -1,13 +1,9 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
trait Trait {}
-type Underconstrained<T: Trait> = impl 'static;
-//~^ ERROR: at least one trait must be specified
+type Underconstrained<T: Trait> = impl Send;
// no `Trait` bound
fn underconstrain<T>(_: T) -> Underconstrained<T> {
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr
new file mode 100644
index 0000000..c732883
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr
@@ -0,0 +1,19 @@
+error[E0277]: the trait bound `T: Trait` is not satisfied
+ --> $DIR/generic_underconstrained.rs:9:31
+ |
+LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
+ | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
+ |
+note: required by a bound in `Underconstrained`
+ --> $DIR/generic_underconstrained.rs:6:26
+ |
+LL | type Underconstrained<T: Trait> = impl Send;
+ | ^^^^^ required by this bound in `Underconstrained`
+help: consider restricting type parameter `T`
+ |
+LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
+ | +++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr
deleted file mode 100644
index 7ab73d2..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.full_tait.stderr
+++ /dev/null
@@ -1,52 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_underconstrained2.rs:8:45
- |
-LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
- | ^^^^^^^^^^^^
-
-error: at least one trait must be specified
- --> $DIR/generic_underconstrained2.rs:17:46
- |
-LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
- | ^^^^^^^^^^^^
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/generic_underconstrained2.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0277]: `U` doesn't implement `Debug`
- --> $DIR/generic_underconstrained2.rs:12:33
- |
-LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
- | --------------- required by this bound in `Underconstrained`
-...
-LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
- | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
-help: consider restricting type parameter `U`
- |
-LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
- | ^^^^^^^^^^^^^^^^^
-
-error[E0277]: `V` doesn't implement `Debug`
- --> $DIR/generic_underconstrained2.rs:21:43
- |
-LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
- | --------------- required by this bound in `Underconstrained2`
-...
-LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
- | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
-help: consider restricting type parameter `V`
- |
-LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.min_tait.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.min_tait.stderr
deleted file mode 100644
index a4f5f4b..0000000
--- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.min_tait.stderr
+++ /dev/null
@@ -1,43 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/generic_underconstrained2.rs:8:45
- |
-LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
- | ^^^^^^^^^^^^
-
-error: at least one trait must be specified
- --> $DIR/generic_underconstrained2.rs:17:46
- |
-LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
- | ^^^^^^^^^^^^
-
-error[E0277]: `U` doesn't implement `Debug`
- --> $DIR/generic_underconstrained2.rs:12:33
- |
-LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
- | --------------- required by this bound in `Underconstrained`
-...
-LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
- | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
-help: consider restricting type parameter `U`
- |
-LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
- | ^^^^^^^^^^^^^^^^^
-
-error[E0277]: `V` doesn't implement `Debug`
- --> $DIR/generic_underconstrained2.rs:21:43
- |
-LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
- | --------------- required by this bound in `Underconstrained2`
-...
-LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
- | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
- |
-help: consider restricting type parameter `V`
- |
-LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs
index b3fb074..8adc0bf 100644
--- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs
@@ -1,12 +1,8 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
-type Underconstrained<T: std::fmt::Debug> = impl 'static;
-//~^ ERROR: at least one trait must be specified
+type Underconstrained<T: std::fmt::Debug> = impl Send;
// not a defining use, because it doesn't define *all* possible generics
fn underconstrained<U>(_: U) -> Underconstrained<U> {
@@ -14,8 +10,7 @@
5u32
}
-type Underconstrained2<T: std::fmt::Debug> = impl 'static;
-//~^ ERROR: at least one trait must be specified
+type Underconstrained2<T: std::fmt::Debug> = impl Send;
// not a defining use, because it doesn't define *all* possible generics
fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr
new file mode 100644
index 0000000..d77d978
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr
@@ -0,0 +1,35 @@
+error[E0277]: `U` doesn't implement `Debug`
+ --> $DIR/generic_underconstrained2.rs:8:33
+ |
+LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
+ | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+note: required by a bound in `Underconstrained`
+ --> $DIR/generic_underconstrained2.rs:5:26
+ |
+LL | type Underconstrained<T: std::fmt::Debug> = impl Send;
+ | ^^^^^^^^^^^^^^^ required by this bound in `Underconstrained`
+help: consider restricting type parameter `U`
+ |
+LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
+ | +++++++++++++++++
+
+error[E0277]: `V` doesn't implement `Debug`
+ --> $DIR/generic_underconstrained2.rs:16:43
+ |
+LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
+ | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+note: required by a bound in `Underconstrained2`
+ --> $DIR/generic_underconstrained2.rs:13:27
+ |
+LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
+ | ^^^^^^^^^^^^^^^ required by this bound in `Underconstrained2`
+help: consider restricting type parameter `V`
+ |
+LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
+ | +++++++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.full_tait.stderr b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.full_tait.stderr
deleted file mode 100644
index bdd8813..0000000
--- a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.full_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/impl-with-unconstrained-param.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
- --> $DIR/impl-with-unconstrained-param.rs:14:6
- |
-LL | impl<T> X for () {
- | ^ unconstrained type parameter
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.min_tait.stderr b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.min_tait.stderr
deleted file mode 100644
index eb59766..0000000
--- a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.min_tait.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
- --> $DIR/impl-with-unconstrained-param.rs:14:6
- |
-LL | impl<T> X for () {
- | ^ unconstrained type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs
index 1aefa24..851c2f6 100644
--- a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs
+++ b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs
@@ -1,10 +1,7 @@
// Ensure that we don't ICE if associated type impl trait is used in an impl
// with an unconstrained type parameter.
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait X {
type I;
diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr
new file mode 100644
index 0000000..8cf8fb1
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/impl-with-unconstrained-param.rs:11:6
+ |
+LL | impl<T> X for () {
+ | ^ unconstrained type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr
deleted file mode 100644
index 6d1a59a..0000000
--- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/incoherent-assoc-imp-trait.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`
- --> $DIR/incoherent-assoc-imp-trait.rs:13:1
- |
-LL | impl<F> FnOnce<()> for &F {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: conflicting implementation in crate `core`:
- - impl<A, F> FnOnce<A> for &F
- where F: Fn<A>, F: ?Sized;
-
-error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`)
- --> $DIR/incoherent-assoc-imp-trait.rs:13:6
- |
-LL | impl<F> FnOnce<()> for &F {
- | ^ type parameter `F` must be used as the type parameter for some local type
- |
- = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
- = note: only traits defined in the current crate can be implemented for a type parameter
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-Some errors have detailed explanations: E0119, E0210.
-For more information about an error, try `rustc --explain E0119`.
diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr
deleted file mode 100644
index 5c02b60..0000000
--- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`
- --> $DIR/incoherent-assoc-imp-trait.rs:13:1
- |
-LL | impl<F> FnOnce<()> for &F {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: conflicting implementation in crate `core`:
- - impl<A, F> FnOnce<A> for &F
- where F: Fn<A>, F: ?Sized;
-
-error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`)
- --> $DIR/incoherent-assoc-imp-trait.rs:13:6
- |
-LL | impl<F> FnOnce<()> for &F {
- | ^ type parameter `F` must be used as the type parameter for some local type
- |
- = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
- = note: only traits defined in the current crate can be implemented for a type parameter
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0119, E0210.
-For more information about an error, try `rustc --explain E0119`.
diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs
index b52b9c1..c46c471 100644
--- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs
+++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs
@@ -1,10 +1,7 @@
// Regression test for issue 67856
#![feature(unboxed_closures)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![feature(fn_traits)]
trait MyTrait {}
diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.stderr
new file mode 100644
index 0000000..e1e2591
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.stderr
@@ -0,0 +1,23 @@
+error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`
+ --> $DIR/incoherent-assoc-imp-trait.rs:10:1
+ |
+LL | impl<F> FnOnce<()> for &F {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: conflicting implementation in crate `core`:
+ - impl<A, F> FnOnce<A> for &F
+ where F: Fn<A>, F: ?Sized;
+
+error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`)
+ --> $DIR/incoherent-assoc-imp-trait.rs:10:6
+ |
+LL | impl<F> FnOnce<()> for &F {
+ | ^ type parameter `F` must be used as the type parameter for some local type
+ |
+ = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
+ = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0119, E0210.
+For more information about an error, try `rustc --explain E0119`.
diff --git a/src/test/ui/type-alias-impl-trait/incomplete-inference.rs b/src/test/ui/type-alias-impl-trait/incomplete-inference.rs
new file mode 100644
index 0000000..955d128
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/incomplete-inference.rs
@@ -0,0 +1,15 @@
+#![feature(type_alias_impl_trait)]
+
+type Foo = impl Sized;
+
+fn bar() -> Foo {
+ None
+ //~^ ERROR: type annotations needed [E0282]
+}
+
+fn baz() -> Foo {
+ //~^ ERROR: concrete type differs from previous defining opaque type use
+ Some(())
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/incomplete-inference.stderr b/src/test/ui/type-alias-impl-trait/incomplete-inference.stderr
new file mode 100644
index 0000000..53cdf9e
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/incomplete-inference.stderr
@@ -0,0 +1,21 @@
+error[E0282]: type annotations needed
+ --> $DIR/incomplete-inference.rs:6:5
+ |
+LL | None
+ | ^^^^ cannot infer type for type parameter `T` declared on the enum `Option`
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/incomplete-inference.rs:10:1
+ |
+LL | fn baz() -> Foo {
+ | ^^^^^^^^^^^^^^^ expected `[type error]`, got `Option<()>`
+ |
+note: previous use here
+ --> $DIR/incomplete-inference.rs:5:1
+ |
+LL | fn bar() -> Foo {
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/type-alias-impl-trait/inference-cycle.rs b/src/test/ui/type-alias-impl-trait/inference-cycle.rs
new file mode 100644
index 0000000..c781e20
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/inference-cycle.rs
@@ -0,0 +1,26 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+mod m {
+ type Foo = impl std::fmt::Debug;
+ //~^ ERROR: cycle detected when computing type of `m::Foo::{opaque#0}` [E0391]
+
+ // Cycle: error today, but it'd be nice if it eventually worked
+
+ pub fn foo() -> Foo {
+ is_send(bar())
+ }
+
+ pub fn bar() {
+ is_send(foo()); // Today: error
+ }
+
+ fn baz() {
+ let f: Foo = 22_u32;
+ //~^ ERROR: mismatched types [E0308]
+ }
+
+ fn is_send<T: Send>(_: T) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/inference-cycle.stderr b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr
new file mode 100644
index 0000000..4c5921c
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/inference-cycle.stderr
@@ -0,0 +1,37 @@
+error[E0391]: cycle detected when computing type of `m::Foo::{opaque#0}`
+ --> $DIR/inference-cycle.rs:5:16
+ |
+LL | type Foo = impl std::fmt::Debug;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires type-checking `m::bar`...
+ --> $DIR/inference-cycle.rs:15:9
+ |
+LL | is_send(foo()); // Today: error
+ | ^^^^^^^
+ = note: ...which requires evaluating trait selection obligation `impl std::fmt::Debug: std::marker::Send`...
+ = note: ...which again requires computing type of `m::Foo::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in module `m`
+ --> $DIR/inference-cycle.rs:4:1
+ |
+LL | mod m {
+ | ^^^^^
+
+error[E0308]: mismatched types
+ --> $DIR/inference-cycle.rs:19:22
+ |
+LL | type Foo = impl std::fmt::Debug;
+ | -------------------- the expected opaque type
+...
+LL | let f: Foo = 22_u32;
+ | --- ^^^^^^ expected opaque type, found `u32`
+ | |
+ | expected due to this
+ |
+ = note: expected opaque type `impl Debug`
+ found type `u32`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0308, E0391.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.full_tait.stderr
deleted file mode 100644
index 4effd87..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-52843-closure-constrain.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/issue-52843-closure-constrain.rs:13:16
- |
-LL | let null = || -> Opaque { 0 };
- | ^^^^^^^^^^^^^^^^^^ expected `String`, got `i32`
- |
-note: previous use here
- --> $DIR/issue-52843-closure-constrain.rs:12:5
- |
-LL | fn _unused() -> Opaque { String::new() }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.min_tait.stderr
deleted file mode 100644
index c2cb482..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.min_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/issue-52843-closure-constrain.rs:13:22
- |
-LL | let null = || -> Opaque { 0 };
- | ^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-
-error: concrete type differs from previous defining opaque type use
- --> $DIR/issue-52843-closure-constrain.rs:13:16
- |
-LL | let null = || -> Opaque { 0 };
- | ^^^^^^^^^^^^^^^^^^ expected `String`, got `[type error]`
- |
-note: previous use here
- --> $DIR/issue-52843-closure-constrain.rs:12:5
- |
-LL | fn _unused() -> Opaque { String::new() }
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs
index 01f8741..50eeff0 100644
--- a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs
@@ -1,16 +1,13 @@
// Checks to ensure that we properly detect when a closure constrains an opaque type
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
fn main() {
type Opaque = impl Debug;
fn _unused() -> Opaque { String::new() }
- let null = || -> Opaque { 0 }; //[min_tait]~ ERROR: not permitted here
+ let null = || -> Opaque { 0 };
//~^ ERROR: concrete type differs from previous defining opaque type use
println!("{:?}", null());
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.stderr b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.stderr
new file mode 100644
index 0000000..d82050e
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/issue-52843-closure-constrain.rs:10:16
+ |
+LL | let null = || -> Opaque { 0 };
+ | ^^^^^^^^^^^^^^^^^^ expected `String`, got `i32`
+ |
+note: previous use here
+ --> $DIR/issue-52843-closure-constrain.rs:9:5
+ |
+LL | fn _unused() -> Opaque { String::new() }
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr
deleted file mode 100644
index 35ac099..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-52843.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-52843.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0277]: the trait bound `T: Default` is not satisfied
- --> $DIR/issue-52843.rs:6:15
- |
-LL | type Foo<T> = impl Default;
- | ^^^^^^^^^^^^ the trait `Default` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | type Foo<T: std::default::Default> = impl Default;
- | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843.min_tait.stderr
deleted file mode 100644
index 9fb760f..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-52843.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0277]: the trait bound `T: Default` is not satisfied
- --> $DIR/issue-52843.rs:6:15
- |
-LL | type Foo<T> = impl Default;
- | ^^^^^^^^^^^^ the trait `Default` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | type Foo<T: std::default::Default> = impl Default;
- | ^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.rs b/src/test/ui/type-alias-impl-trait/issue-52843.rs
index 14f9db6..b24959d 100644
--- a/src/test/ui/type-alias-impl-trait/issue-52843.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-52843.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Foo<T> = impl Default;
//~^ ERROR: the trait bound `T: Default` is not satisfied
diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.stderr b/src/test/ui/type-alias-impl-trait/issue-52843.stderr
new file mode 100644
index 0000000..2463ed9
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-52843.stderr
@@ -0,0 +1,14 @@
+error[E0277]: the trait bound `T: Default` is not satisfied
+ --> $DIR/issue-52843.rs:3:15
+ |
+LL | type Foo<T> = impl Default;
+ | ^^^^^^^^^^^^ the trait `Default` is not implemented for `T`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | type Foo<T: std::default::Default> = impl Default;
+ | +++++++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-53096.full_tait.stderr
deleted file mode 100644
index a8dd6a9..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-53096.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-53096.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-53096.rs:14:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-53096.min_tait.stderr
deleted file mode 100644
index 4210d0c..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-53096.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-53096.rs:14:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.rs b/src/test/ui/type-alias-impl-trait/issue-53096.rs
index 7bb0066..792bd16 100644
--- a/src/test/ui/type-alias-impl-trait/issue-53096.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-53096.rs
@@ -1,8 +1,5 @@
#![feature(const_impl_trait, const_fn_fn_ptr_basics, rustc_attrs)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Foo = impl Fn() -> usize;
const fn bar() -> Foo {
diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.stderr b/src/test/ui/type-alias-impl-trait/issue-53096.stderr
new file mode 100644
index 0000000..0af3a75
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-53096.stderr
@@ -0,0 +1,8 @@
+error: fatal error triggered by #[rustc_error]
+ --> $DIR/issue-53096.rs:11:1
+ |
+LL | fn main() {}
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-53598.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-53598.full_tait.stderr
deleted file mode 100644
index ee4b7ee..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-53598.full_tait.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-53598.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-53598.rs:23:42
- |
-LL | fn foo<T: Debug>(_: T) -> Self::Item {
- | __________________________________________^
-LL | |
-LL | | S::<T>(Default::default())
-LL | | }
- | |_____^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-53598.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-53598.min_tait.stderr
deleted file mode 100644
index 728721b..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-53598.min_tait.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-53598.rs:23:42
- |
-LL | fn foo<T: Debug>(_: T) -> Self::Item {
- | __________________________________________^
-LL | |
-LL | | S::<T>(Default::default())
-LL | | }
- | |_____^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-53598.rs b/src/test/ui/type-alias-impl-trait/issue-53598.rs
index 38067a7..37b330b 100644
--- a/src/test/ui/type-alias-impl-trait/issue-53598.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-53598.rs
@@ -1,8 +1,5 @@
// ignore-compare-mode-chalk
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
@@ -21,7 +18,7 @@
type Item = impl Debug;
fn foo<T: Debug>(_: T) -> Self::Item {
- //~^ Error type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ //~^ Error type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
S::<T>(Default::default())
}
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-53598.stderr b/src/test/ui/type-alias-impl-trait/issue-53598.stderr
new file mode 100644
index 0000000..4c8144a
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-53598.stderr
@@ -0,0 +1,12 @@
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ --> $DIR/issue-53598.rs:20:42
+ |
+LL | fn foo<T: Debug>(_: T) -> Self::Item {
+ | __________________________________________^
+LL | |
+LL | | S::<T>(Default::default())
+LL | | }
+ | |_____^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.full_tait.stderr
deleted file mode 100644
index b23fed5..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-53678-generator-and-const-fn.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-53678-generator-and-const-fn.rs:22:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.min_tait.stderr
deleted file mode 100644
index fabba21..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-53678-generator-and-const-fn.rs:22:1
- |
-LL | fn main() {}
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs
index a8215c4..1761182 100644
--- a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs
@@ -1,8 +1,5 @@
#![feature(const_impl_trait, generators, generator_trait, rustc_attrs)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::ops::Generator;
diff --git a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr
new file mode 100644
index 0000000..eb1c960
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr
@@ -0,0 +1,8 @@
+error: fatal error triggered by #[rustc_error]
+ --> $DIR/issue-53678-generator-and-const-fn.rs:19:1
+ |
+LL | fn main() {}
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.full_tait.stderr
deleted file mode 100644
index 9877821..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-55099-lifetime-inference.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs
index 2c24e9d..af0780a 100644
--- a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs
@@ -3,18 +3,13 @@
// Tests that we don't incorrectly consider a lifetime to part
// of the concrete type
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
-trait Future {
-}
+trait Future {}
struct AndThen<F>(F);
-impl<F> Future for AndThen<F> {
-}
+impl<F> Future for AndThen<F> {}
struct Foo<'a> {
x: &'a mut (),
diff --git a/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.full_tait.stderr
deleted file mode 100644
index d31c232..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-57188-associate-impl-capture.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs b/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
index 645a4c5..3a7a5da 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs
@@ -2,10 +2,7 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
struct Baz<'a> {
source: &'a str,
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.nll.stderr
deleted file mode 100644
index e2b8b19..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.nll.stderr
+++ /dev/null
@@ -1,47 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-57611-trait-alias.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: higher-ranked subtype error
- --> $DIR/issue-57611-trait-alias.rs:24:9
- |
-LL | |x| x
- | ^^^^^
-
-error: higher-ranked subtype error
- --> $DIR/issue-57611-trait-alias.rs:24:9
- |
-LL | |x| x
- | ^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/issue-57611-trait-alias.rs:20:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
- |
- = note: expected type `for<'r> Fn<(&'r X,)>`
- found type `Fn<(&'static X,)>`
-note: this closure does not fulfill the lifetime requirements
- --> $DIR/issue-57611-trait-alias.rs:24:9
- |
-LL | |x| x
- | ^^^^^
-
-error: implementation of `FnOnce` is not general enough
- --> $DIR/issue-57611-trait-alias.rs:20:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
- |
- = note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`...
- = note: ...but it actually implements `FnOnce<(&'static X,)>`
-
-error: aborting due to 4 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.stderr
deleted file mode 100644
index 61e8da9..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.full_tait.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-57611-trait-alias.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: implementation of `FnOnce` is not general enough
- --> $DIR/issue-57611-trait-alias.rs:20:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
- |
- = note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`...
- = note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr
deleted file mode 100644
index 3a4d1d9..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.nll.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error: higher-ranked subtype error
- --> $DIR/issue-57611-trait-alias.rs:24:9
- |
-LL | |x| x
- | ^^^^^
-
-error: higher-ranked subtype error
- --> $DIR/issue-57611-trait-alias.rs:24:9
- |
-LL | |x| x
- | ^^^^^
-
-error[E0308]: mismatched types
- --> $DIR/issue-57611-trait-alias.rs:20:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
- |
- = note: expected type `for<'r> Fn<(&'r X,)>`
- found type `Fn<(&'static X,)>`
-note: this closure does not fulfill the lifetime requirements
- --> $DIR/issue-57611-trait-alias.rs:24:9
- |
-LL | |x| x
- | ^^^^^
-
-error: implementation of `FnOnce` is not general enough
- --> $DIR/issue-57611-trait-alias.rs:20:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
- |
- = note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`...
- = note: ...but it actually implements `FnOnce<(&'static X,)>`
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.stderr
deleted file mode 100644
index f65e91e..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.min_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: implementation of `FnOnce` is not general enough
- --> $DIR/issue-57611-trait-alias.rs:20:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
- |
- = note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`...
- = note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr
new file mode 100644
index 0000000..8c9cb74
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.nll.stderr
@@ -0,0 +1,14 @@
+error: higher-ranked subtype error
+ --> $DIR/issue-57611-trait-alias.rs:21:9
+ |
+LL | |x| x
+ | ^^^^^
+
+error: higher-ranked subtype error
+ --> $DIR/issue-57611-trait-alias.rs:21:9
+ |
+LL | |x| x
+ | ^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
index 508ecdd..625e46b 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs
@@ -3,10 +3,7 @@
// FIXME: This should compile, but it currently doesn't
#![feature(trait_alias)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Foo {
type Bar: Baz<Self, Self>;
@@ -18,9 +15,9 @@
impl Foo for X {
type Bar = impl Baz<Self, Self>;
- //~^ ERROR implementation of `FnOnce` is not general enough
fn bar(&self) -> Self::Bar {
+ //~^ ERROR implementation of `FnOnce` is not general enough
|x| x
}
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr
new file mode 100644
index 0000000..54d2371
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr
@@ -0,0 +1,11 @@
+error: implementation of `FnOnce` is not general enough
+ --> $DIR/issue-57611-trait-alias.rs:19:22
+ |
+LL | fn bar(&self) -> Self::Bar {
+ | ^^^^^^^^^ implementation of `FnOnce` is not general enough
+ |
+ = note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-57700.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-57700.full_tait.stderr
deleted file mode 100644
index 4336532..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57700.full_tait.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-57700.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-57700.rs:19:58
- |
-LL | fn foo(self: impl Deref<Target = Self>) -> Self::Bar {
- | __________________________________________________________^
-LL | |
-LL | | self
-LL | | }
- | |_____^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-57700.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-57700.min_tait.stderr
deleted file mode 100644
index 47ab31c..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57700.min_tait.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error: type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-57700.rs:19:58
- |
-LL | fn foo(self: impl Deref<Target = Self>) -> Self::Bar {
- | __________________________________________________________^
-LL | |
-LL | | self
-LL | | }
- | |_____^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-57700.rs b/src/test/ui/type-alias-impl-trait/issue-57700.rs
index 476a188..f1db4d3 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57700.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-57700.rs
@@ -1,9 +1,6 @@
// ignore-compare-mode-chalk
#![feature(arbitrary_self_types)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::ops::Deref;
@@ -17,7 +14,7 @@
type Bar = impl Foo;
fn foo(self: impl Deref<Target = Self>) -> Self::Bar {
- //~^ Error type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ //~^ Error type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias
self
}
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-57700.stderr b/src/test/ui/type-alias-impl-trait/issue-57700.stderr
new file mode 100644
index 0000000..c701e3e
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-57700.stderr
@@ -0,0 +1,12 @@
+error: type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ --> $DIR/issue-57700.rs:16:58
+ |
+LL | fn foo(self: impl Deref<Target = Self>) -> Self::Bar {
+ | __________________________________________________________^
+LL | |
+LL | | self
+LL | | }
+ | |_____^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.full_tait.stderr
deleted file mode 100644
index b35361c..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-57807-associated-type.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs b/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs
index 0a02114..fcab2c7 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs
@@ -2,10 +2,7 @@
// that we properly unify associated types within
// a type alias impl trait
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Bar {
type A;
diff --git a/src/test/ui/type-alias-impl-trait/issue-58887.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-58887.full_tait.stderr
deleted file mode 100644
index f0fd5f2..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-58887.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-58887.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-58887.rs b/src/test/ui/type-alias-impl-trait/issue-58887.rs
index f0803a6..96ac786 100644
--- a/src/test/ui/type-alias-impl-trait/issue-58887.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-58887.rs
@@ -1,9 +1,6 @@
// run-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait UnwrapItemsExt {
type Iter;
diff --git a/src/test/ui/type-alias-impl-trait/issue-58951.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-58951.full_tait.stderr
deleted file mode 100644
index 164b888..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-58951.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-58951.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-58951.rs b/src/test/ui/type-alias-impl-trait/issue-58951.rs
index 3b1ea0d..7303cba 100644
--- a/src/test/ui/type-alias-impl-trait/issue-58951.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-58951.rs
@@ -1,13 +1,12 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type A = impl Iterator;
-fn def_a() -> A { 0..1 }
+fn def_a() -> A {
+ 0..1
+}
pub fn use_a() {
def_a().map(|x| x);
diff --git a/src/test/ui/type-alias-impl-trait/issue-60371.rs b/src/test/ui/type-alias-impl-trait/issue-60371.rs
index cee5e5a..37a2f28 100644
--- a/src/test/ui/type-alias-impl-trait/issue-60371.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-60371.rs
@@ -8,10 +8,9 @@
impl Bug for &() {
type Item = impl Bug; //~ ERROR `impl Trait` in type aliases is unstable
- //~^ ERROR the trait bound `(): Bug` is not satisfied
const FUN: fn() -> Self::Item = || ();
- //~^ ERROR type alias impl trait is not permitted here
+ //~^ ERROR the trait bound `(): Bug` is not satisfied
}
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-60371.stderr b/src/test/ui/type-alias-impl-trait/issue-60371.stderr
index a9df746..1710e07 100644
--- a/src/test/ui/type-alias-impl-trait/issue-60371.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-60371.stderr
@@ -5,27 +5,18 @@
| ^^^^^^^^
|
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/issue-60371.rs:13:40
- |
-LL | const FUN: fn() -> Self::Item = || ();
- | ^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0277]: the trait bound `(): Bug` is not satisfied
- --> $DIR/issue-60371.rs:10:17
+ --> $DIR/issue-60371.rs:12:40
|
-LL | type Item = impl Bug;
- | ^^^^^^^^ the trait `Bug` is not implemented for `()`
+LL | const FUN: fn() -> Self::Item = || ();
+ | ^ the trait `Bug` is not implemented for `()`
|
= help: the following implementations were found:
<&() as Bug>
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-60407.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-60407.full_tait.stderr
deleted file mode 100644
index 9d3f366..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-60407.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-60407.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-60407.rs:11:1
- |
-LL | fn main() {
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-60407.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-60407.min_tait.stderr
deleted file mode 100644
index 1a3ceaf..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-60407.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-60407.rs:11:1
- |
-LL | fn main() {
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-60407.rs b/src/test/ui/type-alias-impl-trait/issue-60407.rs
index 3c6b873..b833429 100644
--- a/src/test/ui/type-alias-impl-trait/issue-60407.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-60407.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait, rustc_attrs)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait, rustc_attrs)]
type Debuggable = impl core::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/issue-60407.stderr b/src/test/ui/type-alias-impl-trait/issue-60407.stderr
new file mode 100644
index 0000000..fecee27
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-60407.stderr
@@ -0,0 +1,8 @@
+error: fatal error triggered by #[rustc_error]
+ --> $DIR/issue-60407.rs:8:1
+ |
+LL | fn main() {
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-60564.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-60564.full_tait.stderr
deleted file mode 100644
index 72b6b06..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-60564.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-60564.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/issue-60564.rs:22:34
- |
-LL | fn iter_bits(self, n: u8) -> Self::BitsIter {
- | ^^^^^^^^^^^^^^
- |
-note: used non-generic type `u8` for generic parameter
- --> $DIR/issue-60564.rs:11:25
- |
-LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
- | ^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-60564.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-60564.min_tait.stderr
deleted file mode 100644
index 72668c8..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-60564.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/issue-60564.rs:22:34
- |
-LL | fn iter_bits(self, n: u8) -> Self::BitsIter {
- | ^^^^^^^^^^^^^^
- |
-note: used non-generic type `u8` for generic parameter
- --> $DIR/issue-60564.rs:11:25
- |
-LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-60564.rs b/src/test/ui/type-alias-impl-trait/issue-60564.rs
index 10fbbd2..78def0d 100644
--- a/src/test/ui/type-alias-impl-trait/issue-60564.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-60564.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait IterBits {
type BitsIter: Iterator<Item = u8>;
diff --git a/src/test/ui/type-alias-impl-trait/issue-60564.stderr b/src/test/ui/type-alias-impl-trait/issue-60564.stderr
new file mode 100644
index 0000000..66fa862
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-60564.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/issue-60564.rs:19:34
+ |
+LL | fn iter_bits(self, n: u8) -> Self::BitsIter {
+ | ^^^^^^^^^^^^^^
+ |
+note: used non-generic type `u8` for generic parameter
+ --> $DIR/issue-60564.rs:8:25
+ |
+LL | type IterBitsIter<T, E, I> = impl std::iter::Iterator<Item = I>;
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.full_tait.stderr
deleted file mode 100644
index 1fc38d2..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-62000-associate-impl-trait-lifetimes.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs b/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs
index 4d9ca47..36779a0 100644
--- a/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs
@@ -2,10 +2,7 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait MyTrait {
type AssocType: Send;
diff --git a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.full_tait.stderr
deleted file mode 100644
index 1c6759e..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-63263-closure-return.rs:9:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs b/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs
index 3b8f6af..7414611 100644
--- a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs
@@ -4,8 +4,7 @@
// check-pass
-#![feature(min_type_alias_impl_trait, type_alias_impl_trait)]
-//~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub type Closure = impl FnOnce();
diff --git a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.stderr b/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.stderr
deleted file mode 100644
index e1f4ecd3..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-63263-closure-return.rs:7:39
- |
-LL | #![feature(min_type_alias_impl_trait, type_alias_impl_trait)]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.full_tait.stderr
deleted file mode 100644
index 53a0016..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-63279.full_tait.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-63279.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:11:5: 11:28] as FnOnce<()>>::Output == ()`
- --> $DIR/issue-63279.rs:8:16
- |
-LL | type Closure = impl FnOnce();
- | ^^^^^^^^^^^^^ expected `()`, found opaque type
- |
- = note: expected unit type `()`
- found opaque type `impl FnOnce<()>`
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.min_tait.stderr
deleted file mode 100644
index be386ab..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-63279.min_tait.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/issue-63279.rs:11:11
- |
-LL | || -> Closure { || () }
- | ^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:11:5: 11:28] as FnOnce<()>>::Output == ()`
- --> $DIR/issue-63279.rs:8:16
- |
-LL | type Closure = impl FnOnce();
- | ^^^^^^^^^^^^^ expected `()`, found opaque type
- |
- = note: expected unit type `()`
- found opaque type `impl FnOnce<()>`
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0271, E0658.
-For more information about an error, try `rustc --explain E0271`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.rs b/src/test/ui/type-alias-impl-trait/issue-63279.rs
index 0867156..875cce4 100644
--- a/src/test/ui/type-alias-impl-trait/issue-63279.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-63279.rs
@@ -1,14 +1,11 @@
// compile-flags: -Zsave-analysis
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
-type Closure = impl FnOnce(); //~ ERROR: type mismatch resolving
+type Closure = impl FnOnce();
fn c() -> Closure {
- || -> Closure { || () } //[min_tait]~ ERROR: not permitted here
+ || -> Closure { || () } //~ ERROR: mismatched types
}
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.stderr
new file mode 100644
index 0000000..5fde8c2
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-63279.stderr
@@ -0,0 +1,17 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-63279.rs:8:5
+ |
+LL | type Closure = impl FnOnce();
+ | ------------- the found opaque type
+...
+LL | || -> Closure { || () }
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
+ |
+ = note: expected type `[closure@$DIR/issue-63279.rs:8:21: 8:26]`
+ found closure `[closure@$DIR/issue-63279.rs:8:5: 8:28]`
+ = note: no two closures, even if identical, have the same type
+ = help: consider boxing your closure and/or using it as a trait object
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-63355.rs b/src/test/ui/type-alias-impl-trait/issue-63355.rs
index 8762d18..ff4fd5d 100644
--- a/src/test/ui/type-alias-impl-trait/issue-63355.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-63355.rs
@@ -1,4 +1,4 @@
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]
@@ -28,7 +28,7 @@
}
}
-// FIXME(#86731): The below is illegal use of `min_type_alias_impl_trait`
+// FIXME(#86731): The below is illegal use of `type_alias_impl_trait`
// but the compiler doesn't report it, we should fix it.
pub type FooImpl = impl Foo;
pub type BarImpl = impl Bar<Foo = FooImpl>;
diff --git a/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.full_tait.stderr
deleted file mode 100644
index fc8d814..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-63677-type-alias-coherence.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs b/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs
index 62d11ad..28f4a85 100644
--- a/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs
@@ -2,10 +2,7 @@
// Regression test for issue #63677 - ensure that
// coherence checking can properly handle 'impl trait'
// in type aliases
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub trait Trait {}
pub struct S1<T>(T);
diff --git a/src/test/ui/type-alias-impl-trait/issue-65384.rs b/src/test/ui/type-alias-impl-trait/issue-65384.rs
index 63666c4..273928c 100644
--- a/src/test/ui/type-alias-impl-trait/issue-65384.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-65384.rs
@@ -1,4 +1,4 @@
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]
diff --git a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.full_tait.stderr
deleted file mode 100644
index ee26789..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:18:1
- |
-LL | fn main() {
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.min_tait.stderr
deleted file mode 100644
index 5b6c4b5..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.min_tait.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:20:13
- |
-LL | take(|| {});
- | ^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:22:13
- |
-LL | take(|| {});
- | ^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
index d37be64..72c2282 100644
--- a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs
@@ -1,9 +1,7 @@
// compile-flags: -Zsave-analysis
+// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait, rustc_attrs)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait, rustc_attrs)]
type T = impl Sized;
// The concrete type referred by impl-trait-type-alias(`T`) is guaranteed
@@ -14,11 +12,7 @@
fn take(_: fn() -> T) {}
-#[rustc_error]
fn main() {
- //[full_tait]~^ ERROR fatal error triggered by #[rustc_error]
take(|| {});
- //[min_tait]~^ ERROR not permitted here
take(|| {});
- //[min_tait]~^ ERROR not permitted here
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-65918.rs b/src/test/ui/type-alias-impl-trait/issue-65918.rs
index ab05e4b..af6d501 100644
--- a/src/test/ui/type-alias-impl-trait/issue-65918.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-65918.rs
@@ -2,10 +2,7 @@
// build-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::marker::PhantomData;
diff --git a/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.full_tait.stderr
deleted file mode 100644
index 2fc4657..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-66580-closure-coherence.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs b/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs
index 7b3ddc7..d97270c 100644
--- a/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs
@@ -2,10 +2,7 @@
// Ensures that we don't try to determine whether a closure
// is foreign when it's the underlying type of an opaque type
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Closure = impl FnOnce();
@@ -13,7 +10,9 @@
|| {}
}
-struct Wrap<T> { f: T }
+struct Wrap<T> {
+ f: T,
+}
impl Wrap<Closure> {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.full_tait.stderr
deleted file mode 100644
index 81e27da..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-67844-nested-opaque.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs b/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs
index b9e29a0..cd21932 100644
--- a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs
@@ -3,12 +3,11 @@
// Ensures that we properly handle nested TAIT occurrences
// with generic parameters
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
-trait WithAssoc { type AssocType; }
+trait WithAssoc {
+ type AssocType;
+}
trait WithParam<A> {}
@@ -23,7 +22,6 @@
type AssocType = MyParam;
}
-
fn my_fun<A>() -> Return<A> {
MyStruct
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.full_tait.stderr
deleted file mode 100644
index 8b1ad19..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-68368-non-defining-use.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/issue-68368-non-defining-use.rs:11:15
- |
-LL | fn f<'a>() -> Alias<'a, ()> {}
- | ^^^^^^^^^^^^^
- |
-note: used non-generic type `()` for generic parameter
- --> $DIR/issue-68368-non-defining-use.rs:10:16
- |
-LL | type Alias<'a, U> = impl Trait<U>;
- | ^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.min_tait.stderr
deleted file mode 100644
index 01ae457..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/issue-68368-non-defining-use.rs:11:15
- |
-LL | fn f<'a>() -> Alias<'a, ()> {}
- | ^^^^^^^^^^^^^
- |
-note: used non-generic type `()` for generic parameter
- --> $DIR/issue-68368-non-defining-use.rs:10:16
- |
-LL | type Alias<'a, U> = impl Trait<U>;
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs
index 9246507..3b6decb 100644
--- a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs
@@ -2,10 +2,7 @@
// Ensures that we don't ICE when emitting an error
// for a non-defining use when lifetimes are involved
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Trait<T> {}
type Alias<'a, U> = impl Trait<U>;
fn f<'a>() -> Alias<'a, ()> {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr
new file mode 100644
index 0000000..c2fa54f
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/issue-68368-non-defining-use.rs:8:15
+ |
+LL | fn f<'a>() -> Alias<'a, ()> {}
+ | ^^^^^^^^^^^^^
+ |
+note: used non-generic type `()` for generic parameter
+ --> $DIR/issue-68368-non-defining-use.rs:7:16
+ |
+LL | type Alias<'a, U> = impl Trait<U>;
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.full_tait.stderr
deleted file mode 100644
index 7f120af2..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.full_tait.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:20:65
- |
-LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
- | - ^^ undeclared lifetime
- | |
- | help: consider introducing lifetime `'a` here: `'a,`
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0261`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.min_tait.stderr
deleted file mode 100644
index e1fc94c..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.min_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:20:65
- |
-LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
- | - ^^ undeclared lifetime
- | |
- | help: consider introducing lifetime `'a` here: `'a,`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0261`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs
index 61161d4..6732902 100644
--- a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs
@@ -1,9 +1,6 @@
// Regression test for #69136
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait SomeTrait {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr
new file mode 100644
index 0000000..fe45e39
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr
@@ -0,0 +1,11 @@
+error[E0261]: use of undeclared lifetime name `'a`
+ --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:17:65
+ |
+LL | type Return<A> = impl WithAssoc<A, AssocType = impl SomeTrait + 'a>;
+ | - ^^ undeclared lifetime
+ | |
+ | help: consider introducing lifetime `'a` here: `'a,`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.full_tait.stderr
deleted file mode 100644
index 61e2e20..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-69136-inner-lifetime-resolve-ok.rs:7:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs
index 01df967..a6916ed 100644
--- a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs
@@ -2,10 +2,7 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait SomeTrait {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-69323.full.stderr b/src/test/ui/type-alias-impl-trait/issue-69323.full.stderr
deleted file mode 100644
index 71cc6f6..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-69323.full.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-69323.rs:5:27
- |
-LL | #![cfg_attr(full, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-69323.rs b/src/test/ui/type-alias-impl-trait/issue-69323.rs
index 824558c..a9bd6da 100644
--- a/src/test/ui/type-alias-impl-trait/issue-69323.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-69323.rs
@@ -1,9 +1,6 @@
// check-pass
-// revisions: min full
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full, feature(type_alias_impl_trait))]
-//[full]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::iter::{once, Chain};
diff --git a/src/test/ui/type-alias-impl-trait/issue-70121.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-70121.full_tait.stderr
deleted file mode 100644
index 9fe2e2c..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-70121.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-70121.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-70121.rs b/src/test/ui/type-alias-impl-trait/issue-70121.rs
index 150eca4..dff0d89 100644
--- a/src/test/ui/type-alias-impl-trait/issue-70121.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-70121.rs
@@ -1,9 +1,6 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub type Successors<'a> = impl Iterator<Item = &'a ()>;
diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-74244.full_tait.stderr
deleted file mode 100644
index e7729e4..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-74244.full_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-74244.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74244.rs:12:6
- |
-LL | impl<T> Allocator for DefaultAllocator {
- | ^ unconstrained type parameter
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-74244.min_tait.stderr
deleted file mode 100644
index 6ee8c58..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-74244.min_tait.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74244.rs:12:6
- |
-LL | impl<T> Allocator for DefaultAllocator {
- | ^ unconstrained type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.rs b/src/test/ui/type-alias-impl-trait/issue-74244.rs
index 890eb23..bb4104b 100644
--- a/src/test/ui/type-alias-impl-trait/issue-74244.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-74244.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Allocator {
type Buffer;
diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.stderr b/src/test/ui/type-alias-impl-trait/issue-74244.stderr
new file mode 100644
index 0000000..ff6bacd
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-74244.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/issue-74244.rs:9:6
+ |
+LL | impl<T> Allocator for DefaultAllocator {
+ | ^ unconstrained type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-74280.rs b/src/test/ui/type-alias-impl-trait/issue-74280.rs
new file mode 100644
index 0000000..ad641ea
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-74280.rs
@@ -0,0 +1,12 @@
+// Regression test for #74280.
+
+#![feature(type_alias_impl_trait)]
+
+type Test = impl Copy;
+
+fn test() -> Test {
+ let y = || -> Test { () };
+ 7 //~ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-74280.stderr b/src/test/ui/type-alias-impl-trait/issue-74280.stderr
new file mode 100644
index 0000000..f6b369d
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-74280.stderr
@@ -0,0 +1,9 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-74280.rs:9:5
+ |
+LL | 7
+ | ^ expected `()`, found integer
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-74761-2.rs b/src/test/ui/type-alias-impl-trait/issue-74761-2.rs
index 4b0f2af..4345b5d 100644
--- a/src/test/ui/type-alias-impl-trait/issue-74761-2.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-74761-2.rs
@@ -1,6 +1,5 @@
#![feature(member_constraints)]
#![feature(type_alias_impl_trait)]
-//~^ WARN incomplete
pub trait A {
type B;
@@ -10,8 +9,6 @@
//~^ ERROR the lifetime parameter `'a` is not constrained
//~| ERROR the lifetime parameter `'b` is not constrained
type B = impl core::fmt::Debug;
- //~^ ERROR is unstable
-
fn f(&self) -> Self::B {}
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr b/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr
index 4506a6e..7a32145 100644
--- a/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr
@@ -1,34 +1,15 @@
-error[E0658]: `impl Trait` in type aliases is unstable
- --> $DIR/issue-74761-2.rs:12:14
- |
-LL | type B = impl core::fmt::Debug;
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-74761-2.rs:2:12
- |
-LL | #![feature(type_alias_impl_trait)]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74761-2.rs:9:6
+ --> $DIR/issue-74761-2.rs:8:6
|
LL | impl<'a, 'b> A for () {
| ^^ unconstrained lifetime parameter
error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74761-2.rs:9:10
+ --> $DIR/issue-74761-2.rs:8:10
|
LL | impl<'a, 'b> A for () {
| ^^ unconstrained lifetime parameter
-error: aborting due to 3 previous errors; 1 warning emitted
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0207, E0658.
-For more information about an error, try `rustc --explain E0207`.
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-74761.full_tait.stderr
deleted file mode 100644
index 05b63a0..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-74761.full_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-74761.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74761.rs:10:6
- |
-LL | impl<'a, 'b> A for () {
- | ^^ unconstrained lifetime parameter
-
-error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74761.rs:10:10
- |
-LL | impl<'a, 'b> A for () {
- | ^^ unconstrained lifetime parameter
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-74761.min_tait.stderr
deleted file mode 100644
index ad111e2..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-74761.min_tait.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74761.rs:10:6
- |
-LL | impl<'a, 'b> A for () {
- | ^^ unconstrained lifetime parameter
-
-error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-74761.rs:10:10
- |
-LL | impl<'a, 'b> A for () {
- | ^^ unconstrained lifetime parameter
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.rs b/src/test/ui/type-alias-impl-trait/issue-74761.rs
index bbc67ec..d26ca5c 100644
--- a/src/test/ui/type-alias-impl-trait/issue-74761.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-74761.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub trait A {
type B;
diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.stderr b/src/test/ui/type-alias-impl-trait/issue-74761.stderr
new file mode 100644
index 0000000..1d016fe
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-74761.stderr
@@ -0,0 +1,15 @@
+error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/issue-74761.rs:7:6
+ |
+LL | impl<'a, 'b> A for () {
+ | ^^ unconstrained lifetime parameter
+
+error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/issue-74761.rs:7:10
+ |
+LL | impl<'a, 'b> A for () {
+ | ^^ unconstrained lifetime parameter
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.full_tait.stderr
deleted file mode 100644
index 8fb4a3b..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-76202-trait-impl-for-tait.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: cannot implement trait on type alias impl trait
- --> $DIR/issue-76202-trait-impl-for-tait.rs:19:1
- |
-LL | impl Test for F {
- | ^^^^^^^^^^^^^^^
- |
-note: type alias impl trait defined here
- --> $DIR/issue-76202-trait-impl-for-tait.rs:12:10
- |
-LL | type F = impl Dummy;
- | ^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.min_tait.stderr
deleted file mode 100644
index 3754553..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: cannot implement trait on type alias impl trait
- --> $DIR/issue-76202-trait-impl-for-tait.rs:19:1
- |
-LL | impl Test for F {
- | ^^^^^^^^^^^^^^^
- |
-note: type alias impl trait defined here
- --> $DIR/issue-76202-trait-impl-for-tait.rs:12:10
- |
-LL | type F = impl Dummy;
- | ^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
index 276c770..fb56cc5 100644
--- a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs
@@ -1,10 +1,7 @@
// Regression test for issue #76202
// Tests that we don't ICE when we have a trait impl on a TAIT.
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Dummy {}
impl Dummy for () {}
@@ -16,7 +13,8 @@
fn test(self);
}
-impl Test for F { //~ ERROR cannot implement trait
+impl Test for F {
+ //~^ ERROR cannot implement trait
fn test(self) {}
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.stderr b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.stderr
new file mode 100644
index 0000000..8689ee5
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.stderr
@@ -0,0 +1,14 @@
+error: cannot implement trait on type alias impl trait
+ --> $DIR/issue-76202-trait-impl-for-tait.rs:16:1
+ |
+LL | impl Test for F {
+ | ^^^^^^^^^^^^^^^
+ |
+note: type alias impl trait defined here
+ --> $DIR/issue-76202-trait-impl-for-tait.rs:9:10
+ |
+LL | type F = impl Dummy;
+ | ^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/issue-77179.rs b/src/test/ui/type-alias-impl-trait/issue-77179.rs
new file mode 100644
index 0000000..31c45a2
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-77179.rs
@@ -0,0 +1,14 @@
+// Regression test for #77179.
+
+#![feature(type_alias_impl_trait)]
+
+type Pointer<T> = impl std::ops::Deref<Target=T>;
+
+fn test() -> Pointer<_> {
+ //~^ ERROR: the type placeholder `_` is not allowed within types
+ Box::new(1)
+}
+
+fn main() {
+ test();
+}
diff --git a/src/test/ui/type-alias-impl-trait/issue-77179.stderr b/src/test/ui/type-alias-impl-trait/issue-77179.stderr
new file mode 100644
index 0000000..593aeea
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-77179.stderr
@@ -0,0 +1,12 @@
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/issue-77179.rs:7:22
+ |
+LL | fn test() -> Pointer<_> {
+ | --------^-
+ | | |
+ | | not allowed in type signatures
+ | help: replace with the correct return type: `Box<i32>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-78450.rs b/src/test/ui/type-alias-impl-trait/issue-78450.rs
index 640f929..fccbfb7 100644
--- a/src/test/ui/type-alias-impl-trait/issue-78450.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-78450.rs
@@ -1,8 +1,6 @@
// check-pass
-#![feature(min_type_alias_impl_trait)]
#![feature(type_alias_impl_trait)]
-//~^ WARNING: the feature `type_alias_impl_trait` is incomplete
pub trait AssociatedImpl {
type ImplTrait;
diff --git a/src/test/ui/type-alias-impl-trait/issue-78450.stderr b/src/test/ui/type-alias-impl-trait/issue-78450.stderr
deleted file mode 100644
index efccf62..0000000
--- a/src/test/ui/type-alias-impl-trait/issue-78450.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-78450.rs:4:12
- |
-LL | #![feature(type_alias_impl_trait)]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs
index ecad910..f412b2d 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs
@@ -1,5 +1,5 @@
// check-pass
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
type X<A: ToString + Clone, B: ToString + Clone> = impl ToString;
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs
index 67351e2..da845e8 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs
@@ -2,12 +2,12 @@
// This test used to cause unsoundness, since one of the two possible
// resolutions was chosen at random instead of erroring due to conflicts.
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
type X<A, B> = impl Into<&'static A>;
-//~^ ERROR the trait bound `&'static B: From<&A>` is not satisfied
fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
+ //~^ ERROR the trait bound `&'static B: From<&A>` is not satisfied
(a, a)
}
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
index 731c6e27..4df2f52 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
@@ -1,14 +1,14 @@
error[E0277]: the trait bound `&'static B: From<&A>` is not satisfied
- --> $DIR/multiple-def-uses-in-one-fn.rs:7:16
+ --> $DIR/multiple-def-uses-in-one-fn.rs:9:45
|
-LL | type X<A, B> = impl Into<&'static A>;
- | ^^^^^^^^^^^^^^^^^^^^^ the trait `From<&A>` is not implemented for `&'static B`
+LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
+ | ^^^^^^^^^^^^^^^^^^ the trait `From<&A>` is not implemented for `&'static B`
|
= note: required because of the requirements on the impl of `Into<&'static B>` for `&A`
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) where &'static B: From<&A> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs
index 1175601..06e1990 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs
@@ -2,7 +2,7 @@
// This test used to cause unsoundness, since one of the two possible
// resolutions was chosen at random instead of erroring due to conflicts.
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
type X<A: ToString + Clone, B: ToString + Clone> = impl ToString;
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs
index 5f25365..bcd9aef 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs
@@ -2,7 +2,7 @@
// This test used to cause unsoundness, since one of the two possible
// resolutions was chosen at random instead of erroring due to conflicts.
-#![feature(min_type_alias_impl_trait)]
+#![feature(type_alias_impl_trait)]
type X<A: ToString + Clone, B: ToString + Clone> = impl ToString;
diff --git a/src/test/ui/type-alias-impl-trait/nested-tait-inference.rs b/src/test/ui/type-alias-impl-trait/nested-tait-inference.rs
new file mode 100644
index 0000000..efb88da
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/nested-tait-inference.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+use std::fmt::Debug;
+
+type FooX = impl Debug;
+
+trait Foo<A> { }
+
+impl Foo<()> for () { }
+
+fn foo() -> impl Foo<FooX> {
+ ()
+}
+
+fn main() { }
diff --git a/src/test/ui/type-alias-impl-trait/nested-tait-inference2.rs b/src/test/ui/type-alias-impl-trait/nested-tait-inference2.rs
new file mode 100644
index 0000000..9b26a65
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/nested-tait-inference2.rs
@@ -0,0 +1,19 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+use std::fmt::Debug;
+
+type FooX = impl Debug;
+//~^ ERROR: could not find defining uses
+
+trait Foo<A> {}
+
+impl Foo<()> for () {}
+impl Foo<u32> for () {}
+
+fn foo() -> impl Foo<FooX> {
+ //~^ ERROR: the trait bound `(): Foo<impl Debug>` is not satisfied [E0277]
+ ()
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr b/src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr
new file mode 100644
index 0000000..7e24ee6
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr
@@ -0,0 +1,19 @@
+error[E0277]: the trait bound `(): Foo<impl Debug>` is not satisfied
+ --> $DIR/nested-tait-inference2.rs:14:13
+ |
+LL | fn foo() -> impl Foo<FooX> {
+ | ^^^^^^^^^^^^^^ the trait `Foo<impl Debug>` is not implemented for `()`
+ |
+ = help: the following implementations were found:
+ <() as Foo<()>>
+ <() as Foo<u32>>
+
+error: could not find defining uses
+ --> $DIR/nested-tait-inference2.rs:6:13
+ |
+LL | type FooX = impl Debug;
+ | ^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.full_tait.stderr
deleted file mode 100644
index 5e4307b..0000000
--- a/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/nested_type_alias_impl_trait.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs b/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs
index f03563d..6282264 100644
--- a/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs
+++ b/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs
@@ -1,21 +1,18 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// build-pass (FIXME(62277): could be check-pass?)
mod my_mod {
- use std::fmt::Debug;
+ use std::fmt::Debug;
- pub type Foo = impl Debug;
- pub type Foot = impl Debug;
+ pub type Foo = impl Debug;
+ pub type Foot = impl Debug;
- pub fn get_foo() -> Foo {
- 5i32
- }
+ pub fn get_foo() -> Foo {
+ 5i32
+ }
- pub fn get_foot() -> Foot {
- get_foo()
- }
+ pub fn get_foot() -> Foot {
+ get_foo()
+ }
}
fn main() {
diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.full_tait.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.full_tait.stderr
deleted file mode 100644
index 45c9546..0000000
--- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.full_tait.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/never_reveal_concrete_type.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0308]: mismatched types
- --> $DIR/never_reveal_concrete_type.rs:16:27
- |
-LL | type NoReveal = impl std::fmt::Debug;
- | -------------------- the found opaque type
-...
-LL | let _: &'static str = x;
- | ------------ ^ expected `&str`, found opaque type
- | |
- | expected due to this
- |
- = note: expected reference `&'static str`
- found opaque type `impl Debug`
-
-error[E0605]: non-primitive cast: `impl Debug` as `&'static str`
- --> $DIR/never_reveal_concrete_type.rs:17:13
- |
-LL | let _ = x as &'static str;
- | ^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-Some errors have detailed explanations: E0308, E0605.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.min_tait.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.min_tait.stderr
deleted file mode 100644
index 530f887..0000000
--- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.min_tait.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/never_reveal_concrete_type.rs:16:27
- |
-LL | type NoReveal = impl std::fmt::Debug;
- | -------------------- the found opaque type
-...
-LL | let _: &'static str = x;
- | ------------ ^ expected `&str`, found opaque type
- | |
- | expected due to this
- |
- = note: expected reference `&'static str`
- found opaque type `impl Debug`
-
-error[E0605]: non-primitive cast: `impl Debug` as `&'static str`
- --> $DIR/never_reveal_concrete_type.rs:17:13
- |
-LL | let _ = x as &'static str;
- | ^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0308, E0605.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs
index c555b9c..8787c02 100644
--- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs
+++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr
new file mode 100644
index 0000000..b438f84
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr
@@ -0,0 +1,24 @@
+error[E0308]: mismatched types
+ --> $DIR/never_reveal_concrete_type.rs:13:27
+ |
+LL | type NoReveal = impl std::fmt::Debug;
+ | -------------------- the found opaque type
+...
+LL | let _: &'static str = x;
+ | ------------ ^ expected `&str`, found opaque type
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&'static str`
+ found opaque type `impl Debug`
+
+error[E0605]: non-primitive cast: `impl Debug` as `&'static str`
+ --> $DIR/never_reveal_concrete_type.rs:14:13
+ |
+LL | let _ = x as &'static str;
+ | ^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0308, E0605.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.full_tait.stderr b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.full_tait.stderr
deleted file mode 100644
index faddecb..0000000
--- a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/no_inferrable_concrete_type.rs:6:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: could not find defining uses
- --> $DIR/no_inferrable_concrete_type.rs:9:12
- |
-LL | type Foo = impl Copy;
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.min_tait.stderr b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.min_tait.stderr
deleted file mode 100644
index 3194bd7..0000000
--- a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: could not find defining uses
- --> $DIR/no_inferrable_concrete_type.rs:9:12
- |
-LL | type Foo = impl Copy;
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs
index 409eec7..1197c7b 100644
--- a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs
+++ b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs
@@ -1,10 +1,7 @@
// Issue 52985: user code provides no use case that allows a type alias `impl Trait`
// We now emit a 'could not find defining uses' error
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Foo = impl Copy; //~ could not find defining uses
diff --git a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.stderr
new file mode 100644
index 0000000..61025e8
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.stderr
@@ -0,0 +1,8 @@
+error: could not find defining uses
+ --> $DIR/no_inferrable_concrete_type.rs:6:12
+ |
+LL | type Foo = impl Copy;
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.full_tait.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.full_tait.stderr
deleted file mode 100644
index 8699b21..0000000
--- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.full_tait.stderr
+++ /dev/null
@@ -1,40 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/no_revealing_outside_defining_module.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0308]: mismatched types
- --> $DIR/no_revealing_outside_defining_module.rs:18:19
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ---------------------- the found opaque type
-...
-LL | let _: &str = bomp();
- | ---- ^^^^^^ expected `&str`, found opaque type
- | |
- | expected due to this
- |
- = note: expected reference `&str`
- found opaque type `impl Debug`
-
-error[E0308]: mismatched types
- --> $DIR/no_revealing_outside_defining_module.rs:22:5
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ---------------------- the expected opaque type
-...
-LL | fn bomp() -> boo::Boo {
- | -------- expected `impl Debug` because of return type
-LL | ""
- | ^^ expected opaque type, found `&str`
- |
- = note: expected opaque type `impl Debug`
- found reference `&'static str`
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.min_tait.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.min_tait.stderr
deleted file mode 100644
index faaab43..0000000
--- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.min_tait.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/no_revealing_outside_defining_module.rs:18:19
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ---------------------- the found opaque type
-...
-LL | let _: &str = bomp();
- | ---- ^^^^^^ expected `&str`, found opaque type
- | |
- | expected due to this
- |
- = note: expected reference `&str`
- found opaque type `impl Debug`
-
-error[E0308]: mismatched types
- --> $DIR/no_revealing_outside_defining_module.rs:22:5
- |
-LL | pub type Boo = impl ::std::fmt::Debug;
- | ---------------------- the expected opaque type
-...
-LL | fn bomp() -> boo::Boo {
- | -------- expected `impl Debug` because of return type
-LL | ""
- | ^^ expected opaque type, found `&str`
- |
- = note: expected opaque type `impl Debug`
- found reference `&'static str`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs
index 566c311..61153b1 100644
--- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs
+++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr
new file mode 100644
index 0000000..67752ac
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr
@@ -0,0 +1,31 @@
+error[E0308]: mismatched types
+ --> $DIR/no_revealing_outside_defining_module.rs:15:19
+ |
+LL | pub type Boo = impl ::std::fmt::Debug;
+ | ---------------------- the found opaque type
+...
+LL | let _: &str = bomp();
+ | ---- ^^^^^^ expected `&str`, found opaque type
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&str`
+ found opaque type `impl Debug`
+
+error[E0308]: mismatched types
+ --> $DIR/no_revealing_outside_defining_module.rs:19:5
+ |
+LL | pub type Boo = impl ::std::fmt::Debug;
+ | ---------------------- the expected opaque type
+...
+LL | fn bomp() -> boo::Boo {
+ | -------- expected `impl Debug` because of return type
+LL | ""
+ | ^^ expected opaque type, found `&str`
+ |
+ = note: expected opaque type `impl Debug`
+ found reference `&'static str`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.full_tait.stderr b/src/test/ui/type-alias-impl-trait/not_a_defining_use.full_tait.stderr
deleted file mode 100644
index 76e3500..0000000
--- a/src/test/ui/type-alias-impl-trait/not_a_defining_use.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/not_a_defining_use.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: non-defining opaque type use in defining scope
- --> $DIR/not_a_defining_use.rs:12:27
- |
-LL | fn two<T: Debug>(t: T) -> Two<T, u32> {
- | ^^^^^^^^^^^
- |
-note: used non-generic type `u32` for generic parameter
- --> $DIR/not_a_defining_use.rs:10:13
- |
-LL | type Two<T, U> = impl Debug;
- | ^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.min_tait.stderr b/src/test/ui/type-alias-impl-trait/not_a_defining_use.min_tait.stderr
deleted file mode 100644
index f5dbfec..0000000
--- a/src/test/ui/type-alias-impl-trait/not_a_defining_use.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: non-defining opaque type use in defining scope
- --> $DIR/not_a_defining_use.rs:12:27
- |
-LL | fn two<T: Debug>(t: T) -> Two<T, u32> {
- | ^^^^^^^^^^^
- |
-note: used non-generic type `u32` for generic parameter
- --> $DIR/not_a_defining_use.rs:10:13
- |
-LL | type Two<T, U> = impl Debug;
- | ^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs b/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs
index e58f33f..f29b980 100644
--- a/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs
+++ b/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::fmt::Debug;
diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr
new file mode 100644
index 0000000..2fa236b
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr
@@ -0,0 +1,14 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/not_a_defining_use.rs:9:27
+ |
+LL | fn two<T: Debug>(t: T) -> Two<T, u32> {
+ | ^^^^^^^^^^^
+ |
+note: used non-generic type `u32` for generic parameter
+ --> $DIR/not_a_defining_use.rs:7:13
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.full_tait.stderr b/src/test/ui/type-alias-impl-trait/not_well_formed.full_tait.stderr
deleted file mode 100644
index 38f086e..0000000
--- a/src/test/ui/type-alias-impl-trait/not_well_formed.full_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/not_well_formed.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0220]: associated type `Assoc` not found for `V`
- --> $DIR/not_well_formed.rs:13:29
- |
-LL | type Foo<V> = impl Trait<V::Assoc>;
- | ^^^^^ associated type `Assoc` not found
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0220`.
diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.min_tait.stderr b/src/test/ui/type-alias-impl-trait/not_well_formed.min_tait.stderr
deleted file mode 100644
index 3bac38c..0000000
--- a/src/test/ui/type-alias-impl-trait/not_well_formed.min_tait.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0220]: associated type `Assoc` not found for `V`
- --> $DIR/not_well_formed.rs:13:29
- |
-LL | type Foo<V> = impl Trait<V::Assoc>;
- | ^^^^^ associated type `Assoc` not found
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0220`.
diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.rs b/src/test/ui/type-alias-impl-trait/not_well_formed.rs
index 6d511c5..fbb7a4d 100644
--- a/src/test/ui/type-alias-impl-trait/not_well_formed.rs
+++ b/src/test/ui/type-alias-impl-trait/not_well_formed.rs
@@ -1,10 +1,6 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
-fn main() {
-}
+fn main() {}
trait TraitWithAssoc {
type Assoc;
diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.stderr b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
new file mode 100644
index 0000000..91c1d03
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
@@ -0,0 +1,9 @@
+error[E0220]: associated type `Assoc` not found for `V`
+ --> $DIR/not_well_formed.rs:9:29
+ |
+LL | type Foo<V> = impl Trait<V::Assoc>;
+ | ^^^^^ associated type `Assoc` not found
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0220`.
diff --git a/src/test/ui/type-alias-impl-trait/static-const-types.rs b/src/test/ui/type-alias-impl-trait/static-const-types.rs
new file mode 100644
index 0000000..f630d27
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/static-const-types.rs
@@ -0,0 +1,16 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// FIXME: This should compile, but it currently doesn't
+
+use std::fmt::Debug;
+
+type Foo = impl Debug;
+//~^ ERROR: could not find defining uses
+
+static FOO1: Foo = 22_u32;
+//~^ ERROR: mismatched types [E0308]
+const FOO2: Foo = 22_u32;
+//~^ ERROR: mismatched types [E0308]
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/static-const-types.stderr b/src/test/ui/type-alias-impl-trait/static-const-types.stderr
new file mode 100644
index 0000000..72083d0
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/static-const-types.stderr
@@ -0,0 +1,33 @@
+error[E0308]: mismatched types
+ --> $DIR/static-const-types.rs:11:20
+ |
+LL | type Foo = impl Debug;
+ | ---------- the expected opaque type
+...
+LL | static FOO1: Foo = 22_u32;
+ | ^^^^^^ expected opaque type, found `u32`
+ |
+ = note: expected opaque type `impl Debug`
+ found type `u32`
+
+error[E0308]: mismatched types
+ --> $DIR/static-const-types.rs:13:19
+ |
+LL | type Foo = impl Debug;
+ | ---------- the expected opaque type
+...
+LL | const FOO2: Foo = 22_u32;
+ | ^^^^^^ expected opaque type, found `u32`
+ |
+ = note: expected opaque type `impl Debug`
+ found type `u32`
+
+error: could not find defining uses
+ --> $DIR/static-const-types.rs:8:12
+ |
+LL | type Foo = impl Debug;
+ | ^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.full_tait.stderr b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.full_tait.stderr
deleted file mode 100644
index d5a4fa5..0000000
--- a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/structural-match-no-leak.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `impl Send` cannot be used in patterns
- --> $DIR/structural-match-no-leak.rs:18:9
- |
-LL | LEAK_FREE => (),
- | ^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.min_tait.stderr b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.min_tait.stderr
deleted file mode 100644
index b7caf8e..0000000
--- a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: `impl Send` cannot be used in patterns
- --> $DIR/structural-match-no-leak.rs:18:9
- |
-LL | LEAK_FREE => (),
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs
index e2b10e7..51a7b64 100644
--- a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs
+++ b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs
@@ -1,8 +1,5 @@
#![feature(const_impl_trait)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Bar = impl Send;
diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr
new file mode 100644
index 0000000..7e41b37
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr
@@ -0,0 +1,8 @@
+error: `impl Send` cannot be used in patterns
+ --> $DIR/structural-match-no-leak.rs:15:9
+ |
+LL | LEAK_FREE => (),
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/structural-match.full_tait.stderr b/src/test/ui/type-alias-impl-trait/structural-match.full_tait.stderr
deleted file mode 100644
index d394c99..0000000
--- a/src/test/ui/type-alias-impl-trait/structural-match.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/structural-match.rs:4:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: `impl Send` cannot be used in patterns
- --> $DIR/structural-match.rs:19:9
- |
-LL | VALUE => (),
- | ^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/structural-match.min_tait.stderr b/src/test/ui/type-alias-impl-trait/structural-match.min_tait.stderr
deleted file mode 100644
index f63b1fb..0000000
--- a/src/test/ui/type-alias-impl-trait/structural-match.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: `impl Send` cannot be used in patterns
- --> $DIR/structural-match.rs:19:9
- |
-LL | VALUE => (),
- | ^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/structural-match.rs b/src/test/ui/type-alias-impl-trait/structural-match.rs
index aed9334..73558d3 100644
--- a/src/test/ui/type-alias-impl-trait/structural-match.rs
+++ b/src/test/ui/type-alias-impl-trait/structural-match.rs
@@ -1,8 +1,5 @@
#![feature(const_impl_trait)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Foo = impl Send;
diff --git a/src/test/ui/type-alias-impl-trait/structural-match.stderr b/src/test/ui/type-alias-impl-trait/structural-match.stderr
new file mode 100644
index 0000000..b43f214
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/structural-match.stderr
@@ -0,0 +1,8 @@
+error: `impl Send` cannot be used in patterns
+ --> $DIR/structural-match.rs:16:9
+ |
+LL | VALUE => (),
+ | ^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-assoc-dyn.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-assoc-dyn.rs
new file mode 100644
index 0000000..f6a8302
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-assoc-dyn.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+type Foo = Box<dyn Iterator<Item = impl Send>>;
+
+fn make_foo() -> Foo {
+ Box::new(vec![1, 2, 3].into_iter())
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-assoc-impl-trait.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-assoc-impl-trait.rs
new file mode 100644
index 0000000..fddecfc
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-assoc-impl-trait.rs
@@ -0,0 +1,19 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+type Foo = impl Iterator<Item = impl Send>;
+
+fn make_foo() -> Foo {
+ vec![1, 2].into_iter()
+}
+
+type Bar = impl Send;
+type Baz = impl Iterator<Item = Bar>;
+
+fn make_baz() -> Baz {
+ vec!["1", "2"].into_iter()
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.full_tait.stderr
deleted file mode 100644
index 6f81775..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.full_tait.stderr
+++ /dev/null
@@ -1,30 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-const.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0308]: mismatched types
- --> $DIR/type-alias-impl-trait-const.rs:13:19
- |
-LL | pub type Foo = impl Debug;
- | ---------- the expected opaque type
-...
-LL | const _FOO: Foo = 5;
- | ^ expected opaque type, found integer
- |
- = note: expected opaque type `impl Debug`
- found type `{integer}`
-
-error: could not find defining uses
- --> $DIR/type-alias-impl-trait-const.rs:10:16
- |
-LL | pub type Foo = impl Debug;
- | ^^^^^^^^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.min_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.min_tait.stderr
deleted file mode 100644
index ce98318..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.min_tait.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/type-alias-impl-trait-const.rs:13:19
- |
-LL | pub type Foo = impl Debug;
- | ---------- the expected opaque type
-...
-LL | const _FOO: Foo = 5;
- | ^ expected opaque type, found integer
- |
- = note: expected opaque type `impl Debug`
- found type `{integer}`
-
-error: could not find defining uses
- --> $DIR/type-alias-impl-trait-const.rs:10:16
- |
-LL | pub type Foo = impl Debug;
- | ^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs
index 751512c..1a81138 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// Ensures that `const` items can constrain an opaque `impl Trait`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.stderr
new file mode 100644
index 0000000..e2567e8
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/type-alias-impl-trait-const.rs:10:19
+ |
+LL | pub type Foo = impl Debug;
+ | ---------- the expected opaque type
+...
+LL | const _FOO: Foo = 5;
+ | ^ expected opaque type, found integer
+ |
+ = note: expected opaque type `impl Debug`
+ found type `{integer}`
+
+error: could not find defining uses
+ --> $DIR/type-alias-impl-trait-const.rs:7:16
+ |
+LL | pub type Foo = impl Debug;
+ | ^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs
new file mode 100644
index 0000000..299bdf5
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.rs
@@ -0,0 +1,13 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// FIXME: this is ruled out for now but should work
+
+type Foo = fn() -> impl Send;
+//~^ ERROR: `impl Trait` not allowed outside of function and method return types
+
+fn make_foo() -> Foo {
+ || 15
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.stderr
new file mode 100644
index 0000000..1c5d57d
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fn-type.stderr
@@ -0,0 +1,9 @@
+error[E0562]: `impl Trait` not allowed outside of function and method return types
+ --> $DIR/type-alias-impl-trait-fn-type.rs:6:20
+ |
+LL | type Foo = fn() -> impl Send;
+ | ^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0562`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.full_tait.stderr
deleted file mode 100644
index fb88c20..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-fns.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs
index a6b0022..07c891f 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs
@@ -1,9 +1,6 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// Regression test for issue #61863
@@ -11,20 +8,19 @@
#[derive(Debug)]
pub struct MyStruct {
- v: u64
+ v: u64,
}
impl MyTrait for MyStruct {}
pub fn bla() -> TE {
- return MyStruct {v:1}
+ return MyStruct { v: 1 };
}
pub fn bla2() -> TE {
bla()
}
-
type TE = impl MyTrait;
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.full_tait.stderr
deleted file mode 100644
index cbecd0b..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-sized.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs
index b062739..c5e8068 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs
@@ -1,20 +1,25 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type A = impl Sized;
-fn f1() -> A { 0 }
+fn f1() -> A {
+ 0
+}
type B = impl ?Sized;
-fn f2() -> &'static B { &[0] }
+fn f2() -> &'static B {
+ &[0]
+}
type C = impl ?Sized + 'static;
-fn f3() -> &'static C { &[0] }
+fn f3() -> &'static C {
+ &[0]
+}
type D = impl ?Sized;
-fn f4() -> &'static D { &1 }
+fn f4() -> &'static D {
+ &1
+}
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-struct.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-struct.rs
new file mode 100644
index 0000000..1a40640
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-struct.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+type Foo = Vec<impl Send>;
+
+fn make_foo() -> Foo {
+ vec![true, false]
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.full_tait.stderr
deleted file mode 100644
index 1a35186..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-tuple.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs
index ad2c11d..1f2d0e4 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs
@@ -1,29 +1,25 @@
// check-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
#![allow(dead_code)]
pub trait MyTrait {}
impl MyTrait for bool {}
+type Foo = impl MyTrait;
+
struct Blah {
my_foo: Foo,
- my_u8: u8
+ my_u8: u8,
}
impl Blah {
fn new() -> Blah {
- Blah {
- my_foo: make_foo(),
- my_u8: 12
- }
+ Blah { my_foo: make_foo(), my_u8: 12 }
}
- fn into_inner(self) -> (Foo, u8) {
- (self.my_foo, self.my_u8)
+ fn into_inner(self) -> (Foo, u8, Foo) {
+ (self.my_foo, self.my_u8, make_foo())
}
}
@@ -31,6 +27,4 @@
true
}
-type Foo = impl MyTrait;
-
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.full_tait.stderr
deleted file mode 100644
index b16d9c2..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.full_tait.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-unconstrained-lifetime.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/type-alias-impl-trait-unconstrained-lifetime.rs:13:6
- |
-LL | impl<'a, I: Iterator<Item = i32>> Trait for (i32, I) {
- | ^^ unconstrained lifetime parameter
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.min_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.min_tait.stderr
deleted file mode 100644
index 7d4abb0..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.min_tait.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/type-alias-impl-trait-unconstrained-lifetime.rs:13:6
- |
-LL | impl<'a, I: Iterator<Item = i32>> Trait for (i32, I) {
- | ^^ unconstrained lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs
index 97294e8..efbf4f1 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs
@@ -1,9 +1,6 @@
// regression test for #74018
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
trait Trait {
type Associated;
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr
new file mode 100644
index 0000000..8cdce2f
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr
@@ -0,0 +1,9 @@
+error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
+ --> $DIR/type-alias-impl-trait-unconstrained-lifetime.rs:10:6
+ |
+LL | impl<'a, I: Iterator<Item = i32>> Trait for (i32, I) {
+ | ^^ unconstrained lifetime parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0207`.
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.full_tait.stderr
deleted file mode 100644
index e3fd076..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-with-cycle-error.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: could not find defining uses
- --> $DIR/type-alias-impl-trait-with-cycle-error.rs:6:12
- |
-LL | type Foo = impl Fn() -> Foo;
- | ^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.min_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.min_tait.stderr
deleted file mode 100644
index 5567795..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: could not find defining uses
- --> $DIR/type-alias-impl-trait-with-cycle-error.rs:6:12
- |
-LL | type Foo = impl Fn() -> Foo;
- | ^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs
index dba0d2c..c009952 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Foo = impl Fn() -> Foo;
//~^ ERROR: could not find defining uses
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.stderr
new file mode 100644
index 0000000..726f4ea
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.stderr
@@ -0,0 +1,8 @@
+error: could not find defining uses
+ --> $DIR/type-alias-impl-trait-with-cycle-error.rs:3:12
+ |
+LL | type Foo = impl Fn() -> Foo;
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.full_tait.stderr
deleted file mode 100644
index eccf08b..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.full_tait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-with-cycle-error2.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: could not find defining uses
- --> $DIR/type-alias-impl-trait-with-cycle-error2.rs:10:12
- |
-LL | type Foo = impl Bar<Foo, Item = Foo>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.min_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.min_tait.stderr
deleted file mode 100644
index 44d279c..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.min_tait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: could not find defining uses
- --> $DIR/type-alias-impl-trait-with-cycle-error2.rs:10:12
- |
-LL | type Foo = impl Bar<Foo, Item = Foo>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs
index f204403..f3898bc 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
pub trait Bar<T> {
type Item;
@@ -14,6 +11,4 @@
x
}
-fn main() {
-
-}
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.stderr
new file mode 100644
index 0000000..3947cc4
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.stderr
@@ -0,0 +1,8 @@
+error: could not find defining uses
+ --> $DIR/type-alias-impl-trait-with-cycle-error2.rs:7:12
+ |
+LL | type Foo = impl Bar<Foo, Item = Foo>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.full_tait.stderr
deleted file mode 100644
index 6ada4b2..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/type-alias-impl-trait-with-no-traits.rs:6:12
- |
-LL | type Foo = impl 'static;
- | ^^^^^^^^^^^^
-
-error: at least one trait must be specified
- --> $DIR/type-alias-impl-trait-with-no-traits.rs:13:13
- |
-LL | fn bar() -> impl 'static {
- | ^^^^^^^^^^^^
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait-with-no-traits.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.min_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.min_tait.stderr
deleted file mode 100644
index 5fd8aac..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/type-alias-impl-trait-with-no-traits.rs:6:12
- |
-LL | type Foo = impl 'static;
- | ^^^^^^^^^^^^
-
-error: at least one trait must be specified
- --> $DIR/type-alias-impl-trait-with-no-traits.rs:13:13
- |
-LL | fn bar() -> impl 'static {
- | ^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs
index 7efc790..8ca279e 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs
@@ -1,7 +1,4 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
type Foo = impl 'static;
//~^ ERROR: at least one trait must be specified
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.stderr
new file mode 100644
index 0000000..3f7acd3
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.stderr
@@ -0,0 +1,14 @@
+error: at least one trait must be specified
+ --> $DIR/type-alias-impl-trait-with-no-traits.rs:3:12
+ |
+LL | type Foo = impl 'static;
+ | ^^^^^^^^^^^^
+
+error: at least one trait must be specified
+ --> $DIR/type-alias-impl-trait-with-no-traits.rs:10:13
+ |
+LL | fn bar() -> impl 'static {
+ | ^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.full_tait.stderr
deleted file mode 100644
index 8c0f775..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-impl-trait.rs:8:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs
index 6176595..d2c8c1f 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs
@@ -3,10 +3,7 @@
#![allow(dead_code)]
#![allow(unused_assignments)]
#![allow(unused_variables)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
fn main() {
assert_eq!(foo().to_string(), "foo");
@@ -14,7 +11,6 @@
assert_eq!(bar2().to_string(), "bar2");
let mut x = bar1();
x = bar2();
- assert_eq!(boo::boo().to_string(), "boo");
assert_eq!(my_iter(42u8).collect::<Vec<u8>>(), vec![42u8]);
}
@@ -36,15 +32,6 @@
"bar2"
}
-// definition in submodule
-type Boo = impl std::fmt::Display;
-
-mod boo {
- pub fn boo() -> super::Boo {
- "boo"
- }
-}
-
type MyIter<T> = impl Iterator<Item = T>;
fn my_iter<T>(t: T) -> MyIter<T> {
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.full_tait.stderr
deleted file mode 100644
index ed4fe41..0000000
--- a/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.full_tait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/type-alias-nested-impl-trait.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs b/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs
index 3023bf0..fd95480 100644
--- a/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs
+++ b/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs
@@ -1,9 +1,6 @@
// run-pass
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
use std::iter::{once, Chain};
diff --git a/src/test/ui/type-alias-impl-trait/type_of_a_let.rs b/src/test/ui/type-alias-impl-trait/type_of_a_let.rs
new file mode 100644
index 0000000..7f8e612
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type_of_a_let.rs
@@ -0,0 +1,29 @@
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// FIXME This should compile, but it currently doesn't
+
+use std::fmt::Debug;
+
+type Foo = impl Debug;
+//~^ ERROR: could not find defining uses
+
+fn foo1() -> u32 {
+ let x: Foo = 22_u32;
+ //~^ ERROR: mismatched types [E0308]
+ x
+ //~^ ERROR: mismatched types [E0308]
+}
+
+fn foo2() -> u32 {
+ let x: Foo = 22_u32;
+ //~^ ERROR: mismatched types [E0308]
+ let y: Foo = x;
+ same_type((x, y));
+ y
+ //~^ ERROR: mismatched types [E0308]
+}
+
+fn same_type<T>(x: (T, T)) {}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type_of_a_let.stderr b/src/test/ui/type-alias-impl-trait/type_of_a_let.stderr
new file mode 100644
index 0000000..cac8d68
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/type_of_a_let.stderr
@@ -0,0 +1,67 @@
+error[E0308]: mismatched types
+ --> $DIR/type_of_a_let.rs:12:18
+ |
+LL | type Foo = impl Debug;
+ | ---------- the expected opaque type
+...
+LL | let x: Foo = 22_u32;
+ | --- ^^^^^^ expected opaque type, found `u32`
+ | |
+ | expected due to this
+ |
+ = note: expected opaque type `impl Debug`
+ found type `u32`
+
+error[E0308]: mismatched types
+ --> $DIR/type_of_a_let.rs:14:5
+ |
+LL | type Foo = impl Debug;
+ | ---------- the found opaque type
+...
+LL | fn foo1() -> u32 {
+ | --- expected `u32` because of return type
+...
+LL | x
+ | ^ expected `u32`, found opaque type
+ |
+ = note: expected type `u32`
+ found opaque type `impl Debug`
+
+error[E0308]: mismatched types
+ --> $DIR/type_of_a_let.rs:19:18
+ |
+LL | type Foo = impl Debug;
+ | ---------- the expected opaque type
+...
+LL | let x: Foo = 22_u32;
+ | --- ^^^^^^ expected opaque type, found `u32`
+ | |
+ | expected due to this
+ |
+ = note: expected opaque type `impl Debug`
+ found type `u32`
+
+error[E0308]: mismatched types
+ --> $DIR/type_of_a_let.rs:23:5
+ |
+LL | type Foo = impl Debug;
+ | ---------- the found opaque type
+...
+LL | fn foo2() -> u32 {
+ | --- expected `u32` because of return type
+...
+LL | y
+ | ^ expected `u32`, found opaque type
+ |
+ = note: expected type `u32`
+ found opaque type `impl Debug`
+
+error: could not find defining uses
+ --> $DIR/type_of_a_let.rs:8:12
+ |
+LL | type Foo = impl Debug;
+ | ^^^^^^^^^^
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/unused_generic_param.full_tait.stderr b/src/test/ui/type-alias-impl-trait/unused_generic_param.full_tait.stderr
deleted file mode 100644
index b70f36b..0000000
--- a/src/test/ui/type-alias-impl-trait/unused_generic_param.full_tait.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/unused_generic_param.rs:9:28
- |
-LL | type PartiallyDefined<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-error: at least one trait must be specified
- --> $DIR/unused_generic_param.rs:16:29
- |
-LL | type PartiallyDefined2<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/unused_generic_param.rs:3:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
diff --git a/src/test/ui/type-alias-impl-trait/unused_generic_param.min_tait.stderr b/src/test/ui/type-alias-impl-trait/unused_generic_param.min_tait.stderr
deleted file mode 100644
index 561025c..0000000
--- a/src/test/ui/type-alias-impl-trait/unused_generic_param.min_tait.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error: at least one trait must be specified
- --> $DIR/unused_generic_param.rs:9:28
- |
-LL | type PartiallyDefined<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-error: at least one trait must be specified
- --> $DIR/unused_generic_param.rs:16:29
- |
-LL | type PartiallyDefined2<T> = impl 'static;
- | ^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/type-alias-impl-trait/unused_generic_param.rs b/src/test/ui/type-alias-impl-trait/unused_generic_param.rs
index 59c7646..ad5e491 100644
--- a/src/test/ui/type-alias-impl-trait/unused_generic_param.rs
+++ b/src/test/ui/type-alias-impl-trait/unused_generic_param.rs
@@ -1,20 +1,17 @@
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+// check-pass
-fn main() {
-}
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
-type PartiallyDefined<T> = impl 'static;
-//~^ ERROR: at least one trait must be specified
+fn main() {}
+
+type PartiallyDefined<T> = impl Sized;
fn partially_defined<T: std::fmt::Debug>(_: T) -> PartiallyDefined<T> {
4u32
}
-type PartiallyDefined2<T> = impl 'static;
-//~^ ERROR: at least one trait must be specified
+type PartiallyDefined2<T> = impl Sized;
fn partially_defined2<T: std::fmt::Debug>(_: T) -> PartiallyDefined2<T> {
4u32
diff --git a/src/test/ui/type-alias-impl-trait/weird-return-types.rs b/src/test/ui/type-alias-impl-trait/weird-return-types.rs
new file mode 100644
index 0000000..faad5ee
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/weird-return-types.rs
@@ -0,0 +1,16 @@
+// edition:2018
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+use std::future::Future;
+use std::fmt::Debug;
+
+type Foo = impl Debug;
+
+fn f() -> impl Future<Output = Foo> {
+ async move { 22_u32 }
+}
+
+fn main() {}
diff --git a/src/test/ui/type-inference/or_else-multiple-type-params.stderr b/src/test/ui/type-inference/or_else-multiple-type-params.stderr
index 047728d..12a98e4 100644
--- a/src/test/ui/type-inference/or_else-multiple-type-params.stderr
+++ b/src/test/ui/type-inference/or_else-multiple-type-params.stderr
@@ -7,7 +7,7 @@
help: consider specifying the type arguments in the method call
|
LL | .or_else::<F, O>(|err| {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
diff --git a/src/test/ui/type-inference/sort_by_key.stderr b/src/test/ui/type-inference/sort_by_key.stderr
index 0b6630e..78b7386 100644
--- a/src/test/ui/type-inference/sort_by_key.stderr
+++ b/src/test/ui/type-inference/sort_by_key.stderr
@@ -7,7 +7,7 @@
help: consider specifying the type argument in the method call
|
LL | lst.sort_by_key(|&(v, _)| v.iter().sum::<S>());
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/type/ascription/issue-34255-1.stderr b/src/test/ui/type/ascription/issue-34255-1.stderr
index 00449af..43f0fbb 100644
--- a/src/test/ui/type/ascription/issue-34255-1.stderr
+++ b/src/test/ui/type/ascription/issue-34255-1.stderr
@@ -3,6 +3,16 @@
|
LL | input_cells: Vec::new()
| ^^^^^^^^^^^ a field by this name exists in `Self`
+ |
+help: you might have meant to write a `struct` literal
+ |
+LL ~ pub fn new() -> Self { SomeStruct {
+LL | input_cells: Vec::new()
+LL |
+LL |
+LL |
+LL ~ }}
+ |
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-34255-1.rs:7:27
@@ -24,7 +34,7 @@
help: add missing generic argument
|
LL | input_cells: Vec<T>::new()
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr
index c1c7665..db215d2 100644
--- a/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr
+++ b/src/test/ui/type/issue-67690-type-alias-bound-diagnostic-crash.stderr
@@ -7,8 +7,9 @@
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | pub type T<P> = P;
- | --
+LL - pub type T<P: Send + Send + Send> = P;
+LL + pub type T<P> = P;
+ |
warning: 1 warning emitted
diff --git a/src/test/ui/type/type-alias-bounds.stderr b/src/test/ui/type/type-alias-bounds.stderr
index d4188b5..dc44ded 100644
--- a/src/test/ui/type/type-alias-bounds.stderr
+++ b/src/test/ui/type/type-alias-bounds.stderr
@@ -7,8 +7,9 @@
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type SVec<T> = Vec<T>;
- | --
+LL - type SVec<T: Send + Send> = Vec<T>;
+LL + type SVec<T> = Vec<T>;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:10:21
@@ -18,8 +19,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type S2Vec<T> = Vec<T>;
- | --
+LL - type S2Vec<T> where T: Send = Vec<T>;
+LL + type S2Vec<T> = Vec<T>;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:12:19
@@ -29,8 +31,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type VVec<'b, 'a> = (&'b u32, Vec<&'a i32>);
- | --
+LL - type VVec<'b, 'a: 'b + 'b> = (&'b u32, Vec<&'a i32>);
+LL + type VVec<'b, 'a> = (&'b u32, Vec<&'a i32>);
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:14:18
@@ -40,8 +43,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type WVec<'b, T> = (&'b u32, Vec<T>);
- | --
+LL - type WVec<'b, T: 'b + 'b> = (&'b u32, Vec<T>);
+LL + type WVec<'b, T> = (&'b u32, Vec<T>);
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:16:25
@@ -51,8 +55,9 @@
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type W2Vec<'b, T> = (&'b u32, Vec<T>);
- | --
+LL - type W2Vec<'b, T> where T: 'b, T: 'b = (&'b u32, Vec<T>);
+LL + type W2Vec<'b, T> = (&'b u32, Vec<T>);
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:47:12
@@ -67,8 +72,9 @@
| ^^^^^^^^
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type T1<U> = U::Assoc;
- | --
+LL - type T1<U: Bound> = U::Assoc;
+LL + type T1<U> = U::Assoc;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:48:18
@@ -83,8 +89,9 @@
| ^^^^^^^^
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type T2<U> = U::Assoc;
- | --
+LL - type T2<U> where U: Bound = U::Assoc;
+LL + type T2<U> = U::Assoc;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:56:12
@@ -94,8 +101,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type T5<U> = <U as Bound>::Assoc;
- | --
+LL - type T5<U: Bound> = <U as Bound>::Assoc;
+LL + type T5<U> = <U as Bound>::Assoc;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:57:12
@@ -105,8 +113,9 @@
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type T6<U> = ::std::vec::Vec<U>;
- | --
+LL - type T6<U: Bound> = ::std::vec::Vec<U>;
+LL + type T6<U> = ::std::vec::Vec<U>;
+ |
warning: 9 warnings emitted
diff --git a/src/test/ui/type/type-annotation-needed.rs b/src/test/ui/type/type-annotation-needed.rs
index 553318e..9994860 100644
--- a/src/test/ui/type/type-annotation-needed.rs
+++ b/src/test/ui/type/type-annotation-needed.rs
@@ -1,6 +1,6 @@
fn foo<T: Into<String>>(x: i32) {}
//~^ NOTE required by
-
+//~| NOTE required by
fn main() {
foo(42);
//~^ ERROR type annotations needed
diff --git a/src/test/ui/type/type-annotation-needed.stderr b/src/test/ui/type/type-annotation-needed.stderr
index 97817a1..20cae3e 100644
--- a/src/test/ui/type/type-annotation-needed.stderr
+++ b/src/test/ui/type/type-annotation-needed.stderr
@@ -1,17 +1,19 @@
error[E0283]: type annotations needed
--> $DIR/type-annotation-needed.rs:5:5
|
-LL | fn foo<T: Into<String>>(x: i32) {}
- | ------------ required by this bound in `foo`
-...
LL | foo(42);
| ^^^ cannot infer type for type parameter `T` declared on the function `foo`
|
= note: cannot satisfy `_: Into<String>`
+note: required by a bound in `foo`
+ --> $DIR/type-annotation-needed.rs:1:11
+ |
+LL | fn foo<T: Into<String>>(x: i32) {}
+ | ^^^^^^^^^^^^ required by this bound in `foo`
help: consider specifying the type argument in the function call
|
LL | foo::<T>(42);
- | ^^^^^
+ | +++++
error: aborting due to previous error
diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr
index adf3fa2..f8dbd66 100644
--- a/src/test/ui/type/type-check-defaults.stderr
+++ b/src/test/ui/type/type-check-defaults.stderr
@@ -1,23 +1,28 @@
error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
--> $DIR/type-check-defaults.rs:6:19
|
-LL | struct Foo<T, U: FromIterator<T>>(T, U);
- | --------------- required by this bound in `Foo`
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
| ^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `FromIterator<i32>` is not implemented for `i32`
+note: required by a bound in `Foo`
+ --> $DIR/type-check-defaults.rs:5:18
+ |
+LL | struct Foo<T, U: FromIterator<T>>(T, U);
+ | ^^^^^^^^^^^^^^^ required by this bound in `Foo`
error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
--> $DIR/type-check-defaults.rs:8:27
|
-LL | struct Foo<T, U: FromIterator<T>>(T, U);
- | --------------- required by this bound in `Foo`
-...
LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
| ^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `FromIterator<i32>` is not implemented for `i32`
+note: required by a bound in `Foo`
+ --> $DIR/type-check-defaults.rs:5:18
+ |
+LL | struct Foo<T, U: FromIterator<T>>(T, U);
+ | ^^^^^^^^^^^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/type-check-defaults.rs:11:17
@@ -58,15 +63,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/type-check-defaults.rs:21:25
|
-LL | trait Super<T: Copy> { }
- | ---- required by this bound in `Super`
LL | trait Base<T = String>: Super<T> { }
| ^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `Super`
+ --> $DIR/type-check-defaults.rs:20:16
+ |
+LL | trait Super<T: Copy> { }
+ | ^^^^ required by this bound in `Super`
help: consider further restricting type parameter `T`
|
LL | trait Base<T = String>: Super<T> where T: std::marker::Copy { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++
error[E0277]: cannot add `u8` to `i32`
--> $DIR/type-check-defaults.rs:24:66
diff --git a/src/test/ui/type/type-check/assignment-expected-bool.stderr b/src/test/ui/type/type-check/assignment-expected-bool.stderr
index d1c13a3..862ac65 100644
--- a/src/test/ui/type/type-check/assignment-expected-bool.stderr
+++ b/src/test/ui/type/type-check/assignment-expected-bool.stderr
@@ -7,7 +7,7 @@
help: you might have meant to compare for equality
|
LL | let _: bool = 0 == 0;
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:9:14
@@ -18,7 +18,7 @@
help: you might have meant to compare for equality
|
LL | 0 => 0 == 0,
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:10:14
@@ -29,7 +29,7 @@
help: you might have meant to compare for equality
|
LL | _ => 0 == 0,
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:14:17
@@ -40,7 +40,7 @@
help: you might have meant to compare for equality
|
LL | true => 0 == 0,
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:18:8
@@ -51,11 +51,11 @@
help: you might have meant to use pattern matching
|
LL | if let 0 = 0 {}
- | ^^^
+ | +++
help: you might have meant to compare for equality
|
LL | if 0 == 0 {}
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:20:24
@@ -66,7 +66,7 @@
help: you might have meant to compare for equality
|
LL | let _: bool = if { 0 == 0 } {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:21:9
@@ -77,7 +77,7 @@
help: you might have meant to compare for equality
|
LL | 0 == 0
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:23:9
@@ -88,7 +88,7 @@
help: you might have meant to compare for equality
|
LL | 0 == 0
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:26:13
@@ -99,7 +99,7 @@
help: you might have meant to compare for equality
|
LL | let _ = (0 == 0)
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:27:14
@@ -110,7 +110,7 @@
help: you might have meant to compare for equality
|
LL | && { 0 == 0 }
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:28:12
@@ -121,7 +121,7 @@
help: you might have meant to compare for equality
|
LL | || (0 == 0);
- | ^^
+ | ~~
error[E0070]: invalid left-hand side of assignment
--> $DIR/assignment-expected-bool.rs:31:22
diff --git a/src/test/ui/type/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr
index f5306a1..710be9d 100644
--- a/src/test/ui/type/type-check/assignment-in-if.stderr
+++ b/src/test/ui/type/type-check/assignment-in-if.stderr
@@ -7,7 +7,7 @@
help: you might have meant to compare for equality
|
LL | if x == x {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:20:8
@@ -18,7 +18,7 @@
help: you might have meant to compare for equality
|
LL | if (x == x) {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:25:8
@@ -29,7 +29,7 @@
help: you might have meant to compare for equality
|
LL | if y == (Foo { foo: x }) {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:30:8
@@ -40,11 +40,11 @@
help: you might have meant to use pattern matching
|
LL | if let 3 = x {
- | ^^^
+ | +++
help: you might have meant to compare for equality
|
LL | if 3 == x {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:36:13
@@ -55,7 +55,7 @@
help: you might have meant to compare for equality
|
LL | x == 4
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:38:13
@@ -66,7 +66,7 @@
help: you might have meant to compare for equality
|
LL | x == 5
- | ^^
+ | ~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/type/type-check/issue-40294.stderr b/src/test/ui/type/type-check/issue-40294.stderr
index ea7771a..9ca07ea 100644
--- a/src/test/ui/type/type-check/issue-40294.stderr
+++ b/src/test/ui/type/type-check/issue-40294.stderr
@@ -1,13 +1,15 @@
error[E0283]: type annotations needed
--> $DIR/issue-40294.rs:6:19
|
-LL | trait Foo: Sized {
- | ---------------- required by this bound in `Foo`
-...
LL | where &'a T : Foo,
| ^^^ cannot infer type for reference `&'a T`
|
= note: cannot satisfy `&'a T: Foo`
+note: required by a bound in `Foo`
+ --> $DIR/issue-40294.rs:1:1
+ |
+LL | trait Foo: Sized {
+ | ^^^^^^^^^^^^^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/type/type-check/issue-41314.stderr b/src/test/ui/type/type-check/issue-41314.stderr
index c3d41ae..4a9bf61 100644
--- a/src/test/ui/type/type-check/issue-41314.stderr
+++ b/src/test/ui/type/type-check/issue-41314.stderr
@@ -7,7 +7,7 @@
help: use the tuple variant pattern syntax instead
|
LL | X::Y(number) => {}
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/type/type-check/missing_trait_impl.stderr b/src/test/ui/type/type-check/missing_trait_impl.stderr
index 30df126..45f2e84 100644
--- a/src/test/ui/type/type-check/missing_trait_impl.stderr
+++ b/src/test/ui/type/type-check/missing_trait_impl.stderr
@@ -9,7 +9,7 @@
help: consider restricting type parameter `T`
|
LL | fn foo<T: std::ops::Add<Output = T>>(x: T, y: T) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++
error[E0368]: binary assignment operation `+=` cannot be applied to type `T`
--> $DIR/missing_trait_impl.rs:9:5
@@ -22,7 +22,7 @@
help: consider restricting type parameter `T`
|
LL | fn bar<T: std::ops::AddAssign>(x: T) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/type/type-params-in-different-spaces-2.stderr b/src/test/ui/type/type-params-in-different-spaces-2.stderr
index a6b4152..368adb4 100644
--- a/src/test/ui/type/type-params-in-different-spaces-2.stderr
+++ b/src/test/ui/type/type-params-in-different-spaces-2.stderr
@@ -12,7 +12,7 @@
help: consider further restricting `Self`
|
LL | fn test<U>(u: U) -> Self where Self: Tr<U> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: the trait bound `Self: Tr<U>` is not satisfied
--> $DIR/type-params-in-different-spaces-2.rs:16:9
@@ -28,7 +28,7 @@
help: consider further restricting `Self`
|
LL | fn test<U>(u: U) -> Self where Self: Tr<U> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/type/type-recursive.stderr b/src/test/ui/type/type-recursive.stderr
index d6d32cc..5a94a0f 100644
--- a/src/test/ui/type/type-recursive.stderr
+++ b/src/test/ui/type/type-recursive.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T1` representable
|
LL | foolish: Box<T1>
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/type_length_limit.polonius.stderr b/src/test/ui/type_length_limit.polonius.stderr
new file mode 100644
index 0000000..82d066b
--- /dev/null
+++ b/src/test/ui/type_length_limit.polonius.stderr
@@ -0,0 +1,11 @@
+error: reached the type-length limit while instantiating `std::mem::drop::<Option<((((...,....., ...), ..., ...), ..., ...)>>`
+ --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
+ |
+LL | pub fn drop<T>(_x: T) {}
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit.polonius/type_length_limit.long-type.txt'
+ = help: consider adding a `#![type_length_limit="8"]` attribute to your crate
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/typeck/conversion-methods.stderr b/src/test/ui/typeck/conversion-methods.stderr
index 4f47e1f..091502b 100644
--- a/src/test/ui/typeck/conversion-methods.stderr
+++ b/src/test/ui/typeck/conversion-methods.stderr
@@ -2,44 +2,43 @@
--> $DIR/conversion-methods.rs:5:41
|
LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—";
- | ------ ^^^^^^^^^^^^^^^^^^^^^
+ | ------ ^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
| | |
| | expected struct `String`, found `&str`
- | | help: try using a conversion method: `"'Tis a fond Ambush—".to_string()`
| expected due to this
error[E0308]: mismatched types
--> $DIR/conversion-methods.rs:6:40
|
LL | let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
- | ------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_path_buf()`
| | |
| | expected struct `PathBuf`, found `&Path`
- | | help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()`
| expected due to this
error[E0308]: mismatched types
--> $DIR/conversion-methods.rs:9:40
|
LL | let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
- | ------ ^
+ | ------ ^- help: try using a conversion method: `.to_string()`
| | |
| | expected struct `String`, found integer
- | | help: try using a conversion method: `2.to_string()`
| expected due to this
error[E0308]: mismatched types
--> $DIR/conversion-methods.rs:12:47
|
LL | let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3];
- | ---------- ^^^^^^^^^^
- | | |
- | | expected struct `Vec`, found `&[{integer}; 3]`
- | | help: try using a conversion method: `(&[1, 2, 3]).to_vec()`
+ | ---------- ^^^^^^^^^^ expected struct `Vec`, found `&[{integer}; 3]`
+ | |
| expected due to this
|
= note: expected struct `Vec<usize>`
found reference `&[{integer}; 3]`
+help: try using a conversion method
+ |
+LL | let _prove_piercing_earnest: Vec<usize> = (&[1, 2, 3]).to_vec();
+ | + ++++++++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/typeck/issue-75883.stderr b/src/test/ui/typeck/issue-75883.stderr
index a722c4b..5e42c81 100644
--- a/src/test/ui/typeck/issue-75883.stderr
+++ b/src/test/ui/typeck/issue-75883.stderr
@@ -14,7 +14,7 @@
help: add missing generic argument
|
LL | pub fn run() -> Result<_, E> {
- | ^^^
+ | +++
error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/issue-75883.rs:15:35
@@ -32,7 +32,7 @@
help: add missing generic argument
|
LL | pub fn interact(&mut self) -> Result<_, E> {
- | ^^^
+ | +++
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/issue-75883.rs:15:42
diff --git a/src/test/ui/typeck/issue-79040.rs b/src/test/ui/typeck/issue-79040.rs
index af2a9c1..9416125 100644
--- a/src/test/ui/typeck/issue-79040.rs
+++ b/src/test/ui/typeck/issue-79040.rs
@@ -1,5 +1,5 @@
fn main() {
const FOO = "hello" + 1; //~ ERROR cannot add `{integer}` to `&str`
- //~^ ERROR cannot add `{integer}` to `&str`
+ //~^ missing type for `const` item
println!("{}", FOO);
}
diff --git a/src/test/ui/typeck/issue-79040.stderr b/src/test/ui/typeck/issue-79040.stderr
index 32049e5..aec2e1e 100644
--- a/src/test/ui/typeck/issue-79040.stderr
+++ b/src/test/ui/typeck/issue-79040.stderr
@@ -6,13 +6,11 @@
| |
| &str
-error[E0369]: cannot add `{integer}` to `&str`
- --> $DIR/issue-79040.rs:2:25
+error: missing type for `const` item
+ --> $DIR/issue-79040.rs:2:11
|
LL | const FOO = "hello" + 1;
- | ------- ^ - {integer}
- | |
- | &str
+ | ^^^ help: provide a type for the item: `FOO: <type>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/typeck/issue-81943.stderr b/src/test/ui/typeck/issue-81943.stderr
index 7a18465..041ff10 100644
--- a/src/test/ui/typeck/issue-81943.stderr
+++ b/src/test/ui/typeck/issue-81943.stderr
@@ -18,11 +18,11 @@
help: consider using a semicolon here
|
LL | f(|x| match x { tmp => { g(tmp); } });
- | ^
+ | +
help: consider using a semicolon here
|
LL | f(|x| match x { tmp => { g(tmp) } };);
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/issue-81943.rs:10:38
@@ -40,11 +40,11 @@
help: consider using a semicolon here
|
LL | ($e:expr) => { match $e { x => { g(x); } } }
- | ^
+ | +
help: consider using a semicolon here
|
LL | ($e:expr) => { match $e { x => { g(x) } }; }
- | ^
+ | +
error: aborting due to 3 previous errors
diff --git a/src/test/ui/typeck/issue-83693.rs b/src/test/ui/typeck/issue-83693.rs
new file mode 100644
index 0000000..a425582
--- /dev/null
+++ b/src/test/ui/typeck/issue-83693.rs
@@ -0,0 +1,19 @@
+// Regression test for the ICE described in #83693.
+
+#![feature(fn_traits)]
+#![crate_type="lib"]
+
+impl F {
+//~^ ERROR: cannot find type `F` in this scope [E0412]
+ fn call() {
+ <Self as Fn(&TestResult)>::call
+ //~^ ERROR: cannot find type `TestResult` in this scope [E0412]
+ //~| associated type bindings are not allowed here [E0229]
+ }
+}
+
+fn call() {
+ <x as Fn(&usize)>::call
+ //~^ ERROR: cannot find type `x` in this scope [E0412]
+ //~| ERROR: associated type bindings are not allowed here [E0229]
+}
diff --git a/src/test/ui/typeck/issue-83693.stderr b/src/test/ui/typeck/issue-83693.stderr
new file mode 100644
index 0000000..0d8bbf1
--- /dev/null
+++ b/src/test/ui/typeck/issue-83693.stderr
@@ -0,0 +1,39 @@
+error[E0412]: cannot find type `F` in this scope
+ --> $DIR/issue-83693.rs:6:6
+ |
+LL | impl F {
+ | ^ help: a trait with a similar name exists: `Fn`
+ |
+ ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
+ |
+LL | pub trait Fn<Args>: FnMut<Args> {
+ | ------------------------------- similarly named trait `Fn` defined here
+
+error[E0412]: cannot find type `TestResult` in this scope
+ --> $DIR/issue-83693.rs:9:22
+ |
+LL | <Self as Fn(&TestResult)>::call
+ | ^^^^^^^^^^ not found in this scope
+
+error[E0412]: cannot find type `x` in this scope
+ --> $DIR/issue-83693.rs:16:6
+ |
+LL | <x as Fn(&usize)>::call
+ | ^ not found in this scope
+
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-83693.rs:9:18
+ |
+LL | <Self as Fn(&TestResult)>::call
+ | ^^^^^^^^^^^^^^^ associated type not allowed here
+
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-83693.rs:16:11
+ |
+LL | <x as Fn(&usize)>::call
+ | ^^^^^^^^^^ associated type not allowed here
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0229, E0412.
+For more information about an error, try `rustc --explain E0229`.
diff --git a/src/test/ui/typeck/issue-84768.rs b/src/test/ui/typeck/issue-84768.rs
new file mode 100644
index 0000000..ffa9282
--- /dev/null
+++ b/src/test/ui/typeck/issue-84768.rs
@@ -0,0 +1,10 @@
+// Regression test for the ICE described in #84768.
+
+#![feature(fn_traits)]
+#![crate_type="lib"]
+
+fn transform_mut<F>(f: F) where F: for<'b> FnOnce(&'b mut u8) {
+ <F as FnOnce(&mut u8)>::call_once(f, 1)
+ //~^ ERROR: associated type bindings are not allowed here [E0229]
+ //~| ERROR: mismatched types [E0308]
+}
diff --git a/src/test/ui/typeck/issue-84768.stderr b/src/test/ui/typeck/issue-84768.stderr
new file mode 100644
index 0000000..0a79d53
--- /dev/null
+++ b/src/test/ui/typeck/issue-84768.stderr
@@ -0,0 +1,19 @@
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-84768.rs:7:11
+ |
+LL | <F as FnOnce(&mut u8)>::call_once(f, 1)
+ | ^^^^^^^^^^^^^^^ associated type not allowed here
+
+error[E0308]: mismatched types
+ --> $DIR/issue-84768.rs:7:42
+ |
+LL | <F as FnOnce(&mut u8)>::call_once(f, 1)
+ | ^ expected tuple, found integer
+ |
+ = note: expected tuple `(&mut u8,)`
+ found type `{integer}`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0229, E0308.
+For more information about an error, try `rustc --explain E0229`.
diff --git a/src/test/ui/typeck/issue-84831.stderr b/src/test/ui/typeck/issue-84831.stderr
index e3cce10..461ccb1 100644
--- a/src/test/ui/typeck/issue-84831.stderr
+++ b/src/test/ui/typeck/issue-84831.stderr
@@ -7,7 +7,7 @@
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | std::<{ _ as _ }>;
- | ^ ^
+ | + +
error[E0423]: expected value, found crate `std`
--> $DIR/issue-84831.rs:2:5
diff --git a/src/test/ui/typeck/issue-87872-missing-inaccessible-field-literal.rs b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-literal.rs
new file mode 100644
index 0000000..3176144
--- /dev/null
+++ b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-literal.rs
@@ -0,0 +1,11 @@
+pub mod foo {
+ pub struct Foo {
+ pub you_can_use_this_field: bool,
+ you_cant_use_this_field: bool,
+ }
+}
+
+fn main() {
+ foo::Foo {};
+ //~^ ERROR cannot construct `Foo` with struct literal syntax due to inaccessible fields
+}
diff --git a/src/test/ui/typeck/issue-87872-missing-inaccessible-field-literal.stderr b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-literal.stderr
new file mode 100644
index 0000000..81b73c0
--- /dev/null
+++ b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-literal.stderr
@@ -0,0 +1,8 @@
+error: cannot construct `Foo` with struct literal syntax due to inaccessible fields
+ --> $DIR/issue-87872-missing-inaccessible-field-literal.rs:9:5
+ |
+LL | foo::Foo {};
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/typeck/issue-87872-missing-inaccessible-field-pattern.rs b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-pattern.rs
new file mode 100644
index 0000000..d28e175
--- /dev/null
+++ b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-pattern.rs
@@ -0,0 +1,11 @@
+#![allow(dead_code, unused_variables)]
+
+pub mod foo {
+ #[derive(Default)]
+ pub struct Foo { pub visible: bool, invisible: bool, }
+}
+
+fn main() {
+ let foo::Foo {} = foo::Foo::default();
+ //~^ ERROR pattern does not mention field `visible` and inaccessible fields
+}
diff --git a/src/test/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr
new file mode 100644
index 0000000..dc30975
--- /dev/null
+++ b/src/test/ui/typeck/issue-87872-missing-inaccessible-field-pattern.stderr
@@ -0,0 +1,18 @@
+error[E0027]: pattern does not mention field `visible` and inaccessible fields
+ --> $DIR/issue-87872-missing-inaccessible-field-pattern.rs:9:9
+ |
+LL | let foo::Foo {} = foo::Foo::default();
+ | ^^^^^^^^^^^ missing field `visible` and inaccessible fields
+ |
+help: include the missing field in the pattern and ignore the inaccessible fields
+ |
+LL | let foo::Foo { visible, .. } = foo::Foo::default();
+ | ~~~~~~~~~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | let foo::Foo { .. } = foo::Foo::default();
+ | ~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0027`.
diff --git a/src/test/ui/typeck/issue-87935-unsized-box-expr.rs b/src/test/ui/typeck/issue-87935-unsized-box-expr.rs
new file mode 100644
index 0000000..cd2a820
--- /dev/null
+++ b/src/test/ui/typeck/issue-87935-unsized-box-expr.rs
@@ -0,0 +1,10 @@
+#![feature(box_syntax)]
+// Box expression needs to be movable, and hence has to be of a Sized type.
+fn main() {
+ let _x: Box<[u32]> = box { loop {} };
+ //~^ ERROR: the size for values of type `[u32]` cannot be known at compilation time
+
+ // Check that a deduced size does not cause issues.
+ let _y: Box<[u32]> = box [];
+ let _z: Box<[u32; 0]> = box { loop {} };
+}
diff --git a/src/test/ui/typeck/issue-87935-unsized-box-expr.stderr b/src/test/ui/typeck/issue-87935-unsized-box-expr.stderr
new file mode 100644
index 0000000..9ff8223
--- /dev/null
+++ b/src/test/ui/typeck/issue-87935-unsized-box-expr.stderr
@@ -0,0 +1,12 @@
+error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
+ --> $DIR/issue-87935-unsized-box-expr.rs:4:30
+ |
+LL | let _x: Box<[u32]> = box { loop {} };
+ | ^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `[u32]`
+ = note: the type of a box expression must have a statically known size
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/typeck/struct-enum-wrong-args.stderr b/src/test/ui/typeck/struct-enum-wrong-args.stderr
index d77ef73..6e99fee 100644
--- a/src/test/ui/typeck/struct-enum-wrong-args.stderr
+++ b/src/test/ui/typeck/struct-enum-wrong-args.stderr
@@ -29,6 +29,12 @@
| ^^^^^^^-- supplied 0 arguments
| |
| expected 1 argument
+ |
+note: tuple struct defined here
+ --> $DIR/struct-enum-wrong-args.rs:2:8
+ |
+LL | struct Wrapper(i32);
+ | ^^^^^^^
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:10:13
@@ -37,6 +43,12 @@
| ^^^^^^^ - - supplied 2 arguments
| |
| expected 1 argument
+ |
+note: tuple struct defined here
+ --> $DIR/struct-enum-wrong-args.rs:2:8
+ |
+LL | struct Wrapper(i32);
+ | ^^^^^^^
error[E0061]: this struct takes 2 arguments but 0 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:11:13
@@ -45,6 +57,12 @@
| ^^^^^^^^^^^^^-- supplied 0 arguments
| |
| expected 2 arguments
+ |
+note: tuple struct defined here
+ --> $DIR/struct-enum-wrong-args.rs:3:8
+ |
+LL | struct DoubleWrapper(i32, i32);
+ | ^^^^^^^^^^^^^
error[E0061]: this struct takes 2 arguments but 1 argument was supplied
--> $DIR/struct-enum-wrong-args.rs:12:13
@@ -53,6 +71,12 @@
| ^^^^^^^^^^^^^ - supplied 1 argument
| |
| expected 2 arguments
+ |
+note: tuple struct defined here
+ --> $DIR/struct-enum-wrong-args.rs:3:8
+ |
+LL | struct DoubleWrapper(i32, i32);
+ | ^^^^^^^^^^^^^
error[E0061]: this struct takes 2 arguments but 3 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:13:13
@@ -61,6 +85,12 @@
| ^^^^^^^^^^^^^ - - - supplied 3 arguments
| |
| expected 2 arguments
+ |
+note: tuple struct defined here
+ --> $DIR/struct-enum-wrong-args.rs:3:8
+ |
+LL | struct DoubleWrapper(i32, i32);
+ | ^^^^^^^^^^^^^
error: aborting due to 8 previous errors
diff --git a/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr b/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr
index 17ad017..7aefa06 100644
--- a/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr
+++ b/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr
@@ -3,15 +3,17 @@
|
LL | is_send::<T::AssocType>();
| ^^^^^^^^^^^^^^^^^^^^^^^ `<T as Trait>::AssocType` cannot be sent between threads safely
-...
-LL | fn is_send<T:Send>() {
- | ---- required by this bound in `is_send`
|
= help: the trait `Send` is not implemented for `<T as Trait>::AssocType`
+note: required by a bound in `is_send`
+ --> $DIR/typeck-default-trait-impl-assoc-type.rs:14:14
+ |
+LL | fn is_send<T:Send>() {
+ | ^^^^ required by this bound in `is_send`
help: consider further restricting the associated type
|
LL | fn bar<T:Trait+Send>() where <T as Trait>::AssocType: Send {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr
index e164bb0..2ce3299 100644
--- a/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr
+++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr
@@ -1,13 +1,15 @@
error[E0277]: `MyNotSendable` cannot be sent between threads safely
--> $DIR/typeck-default-trait-impl-negation-send.rs:19:15
|
-LL | fn is_send<T: Send>() {}
- | ---- required by this bound in `is_send`
-...
LL | is_send::<MyNotSendable>();
| ^^^^^^^^^^^^^ `MyNotSendable` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `MyNotSendable`
+note: required by a bound in `is_send`
+ --> $DIR/typeck-default-trait-impl-negation-send.rs:15:15
+ |
+LL | fn is_send<T: Send>() {}
+ | ^^^^ required by this bound in `is_send`
error: aborting due to previous error
diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr
index a9b49ee..6bb5e1f 100644
--- a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr
+++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr
@@ -1,20 +1,19 @@
error[E0277]: `MyNotSync` cannot be shared between threads safely
--> $DIR/typeck-default-trait-impl-negation-sync.rs:33:15
|
-LL | fn is_sync<T: Sync>() {}
- | ---- required by this bound in `is_sync`
-...
LL | is_sync::<MyNotSync>();
| ^^^^^^^^^ `MyNotSync` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `MyNotSync`
+note: required by a bound in `is_sync`
+ --> $DIR/typeck-default-trait-impl-negation-sync.rs:29:15
+ |
+LL | fn is_sync<T: Sync>() {}
+ | ^^^^ required by this bound in `is_sync`
error[E0277]: `UnsafeCell<u8>` cannot be shared between threads safely
--> $DIR/typeck-default-trait-impl-negation-sync.rs:36:5
|
-LL | fn is_sync<T: Sync>() {}
- | ---- required by this bound in `is_sync`
-...
LL | is_sync::<MyTypeWUnsafe>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<u8>` cannot be shared between threads safely
|
@@ -24,13 +23,15 @@
|
LL | struct MyTypeWUnsafe {
| ^^^^^^^^^^^^^
+note: required by a bound in `is_sync`
+ --> $DIR/typeck-default-trait-impl-negation-sync.rs:29:15
+ |
+LL | fn is_sync<T: Sync>() {}
+ | ^^^^ required by this bound in `is_sync`
error[E0277]: `Managed` cannot be shared between threads safely
--> $DIR/typeck-default-trait-impl-negation-sync.rs:39:5
|
-LL | fn is_sync<T: Sync>() {}
- | ---- required by this bound in `is_sync`
-...
LL | is_sync::<MyTypeManaged>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ `Managed` cannot be shared between threads safely
|
@@ -40,6 +41,11 @@
|
LL | struct MyTypeManaged {
| ^^^^^^^^^^^^^
+note: required by a bound in `is_sync`
+ --> $DIR/typeck-default-trait-impl-negation-sync.rs:29:15
+ |
+LL | fn is_sync<T: Sync>() {}
+ | ^^^^ required by this bound in `is_sync`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr b/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr
index 7398b48..887a1dd 100644
--- a/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr
+++ b/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr
@@ -3,14 +3,16 @@
|
LL | is_send::<T>()
| ^ `T` cannot be sent between threads safely
-...
-LL | fn is_send<T:Send>() {
- | ---- required by this bound in `is_send`
|
+note: required by a bound in `is_send`
+ --> $DIR/typeck-default-trait-impl-send-param.rs:8:14
+ |
+LL | fn is_send<T:Send>() {
+ | ^^^^ required by this bound in `is_send`
help: consider restricting type parameter `T`
|
LL | fn foo<T: std::marker::Send>() {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/typeck/typeck-unsafe-always-share.stderr b/src/test/ui/typeck/typeck-unsafe-always-share.stderr
index 91585e7..c0f388b 100644
--- a/src/test/ui/typeck/typeck-unsafe-always-share.stderr
+++ b/src/test/ui/typeck/typeck-unsafe-always-share.stderr
@@ -1,31 +1,32 @@
error[E0277]: `UnsafeCell<MySync<{integer}>>` cannot be shared between threads safely
--> $DIR/typeck-unsafe-always-share.rs:19:10
|
-LL | fn test<T: Sync>(s: T) {}
- | ---- required by this bound in `test`
-...
LL | test(us);
| ^^ `UnsafeCell<MySync<{integer}>>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `UnsafeCell<MySync<{integer}>>`
+note: required by a bound in `test`
+ --> $DIR/typeck-unsafe-always-share.rs:15:12
+ |
+LL | fn test<T: Sync>(s: T) {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `UnsafeCell<NoSync>` cannot be shared between threads safely
--> $DIR/typeck-unsafe-always-share.rs:23:10
|
-LL | fn test<T: Sync>(s: T) {}
- | ---- required by this bound in `test`
-...
LL | test(uns);
| ^^^ `UnsafeCell<NoSync>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `UnsafeCell<NoSync>`
+note: required by a bound in `test`
+ --> $DIR/typeck-unsafe-always-share.rs:15:12
+ |
+LL | fn test<T: Sync>(s: T) {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `UnsafeCell<NoSync>` cannot be shared between threads safely
--> $DIR/typeck-unsafe-always-share.rs:27:5
|
-LL | fn test<T: Sync>(s: T) {}
- | ---- required by this bound in `test`
-...
LL | test(ms);
| ^^^^ `UnsafeCell<NoSync>` cannot be shared between threads safely
|
@@ -35,17 +36,24 @@
|
LL | struct MySync<T> {
| ^^^^^^
+note: required by a bound in `test`
+ --> $DIR/typeck-unsafe-always-share.rs:15:12
+ |
+LL | fn test<T: Sync>(s: T) {}
+ | ^^^^ required by this bound in `test`
error[E0277]: `NoSync` cannot be shared between threads safely
--> $DIR/typeck-unsafe-always-share.rs:30:10
|
-LL | fn test<T: Sync>(s: T) {}
- | ---- required by this bound in `test`
-...
LL | test(NoSync);
| ^^^^^^ `NoSync` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `NoSync`
+note: required by a bound in `test`
+ --> $DIR/typeck-unsafe-always-share.rs:15:12
+ |
+LL | fn test<T: Sync>(s: T) {}
+ | ^^^^ required by this bound in `test`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr
deleted file mode 100644
index b6aea95..0000000
--- a/src/test/ui/typeck/typeck_type_placeholder_item.full_tait.stderr
+++ /dev/null
@@ -1,647 +0,0 @@
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:157:18
- |
-LL | struct BadStruct<_>(_);
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:160:16
- |
-LL | trait BadTrait<_> {}
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:170:19
- |
-LL | struct BadStruct1<_, _>(_);
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:170:22
- |
-LL | struct BadStruct1<_, _>(_);
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:175:19
- |
-LL | struct BadStruct2<_, T>(_, T);
- | ^ expected identifier, found reserved identifier
-
-error: associated constant in `impl` without body
- --> $DIR/typeck_type_placeholder_item.rs:208:5
- |
-LL | const C: _;
- | ^^^^^^^^^^-
- | |
- | help: provide a definition for the constant: `= <expr>;`
-
-error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters
- --> $DIR/typeck_type_placeholder_item.rs:170:22
- |
-LL | struct BadStruct1<_, _>(_);
- | - ^ already used
- | |
- | first use of `_`
-
-warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/typeck_type_placeholder_item.rs:5:32
- |
-LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:10:14
- |
-LL | fn test() -> _ { 5 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:13:16
- |
-LL | fn test2() -> (_, _) { (5, 5) }
- | -^--^-
- | || |
- | || not allowed in type signatures
- | |not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:16:15
- |
-LL | static TEST3: _ = "test";
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `&str`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:19:15
- |
-LL | static TEST4: _ = 145;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:22:15
- |
-LL | static TEST5: (_, _) = (1, 2);
- | ^^^^^^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:25:13
- |
-LL | fn test6(_: _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test6<T>(_: T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:28:18
- |
-LL | fn test6_b<T>(_: _, _: T) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test6_b<T, U>(_: U, _: T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:31:30
- |
-LL | fn test6_c<T, K, L, A, B>(_: _, _: (T, K, L, A, B)) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test6_c<T, K, L, A, B, U>(_: U, _: (T, K, L, A, B)) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:34:13
- |
-LL | fn test7(x: _) { let _x: usize = x; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test7<T>(x: T) { let _x: usize = x; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:37:22
- |
-LL | fn test8(_f: fn() -> _) { }
- | ^
- | |
- | not allowed in type signatures
- | help: use type parameters instead: `T`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:37:22
- |
-LL | fn test8(_f: fn() -> _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test8<T>(_f: fn() -> T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:51:26
- |
-LL | fn test11(x: &usize) -> &_ {
- | -^
- | ||
- | |not allowed in type signatures
- | help: replace with the correct return type: `&'static &'static usize`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:56:52
- |
-LL | unsafe fn test12(x: *const usize) -> *const *const _ {
- | --------------^
- | | |
- | | not allowed in type signatures
- | help: replace with the correct return type: `*const *const usize`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:70:8
- |
-LL | a: _,
- | ^ not allowed in type signatures
-LL |
-LL | b: (_, _),
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct Test10<T> {
-LL | a: T,
-LL |
-LL | b: (T, T),
- |
-
-error: missing type for `static` item
- --> $DIR/typeck_type_placeholder_item.rs:76:12
- |
-LL | static A = 42;
- | ^ help: provide a type for the static variable: `A: i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:78:15
- |
-LL | static B: _ = 42;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:80:15
- |
-LL | static C: Option<_> = Some(42);
- | ^^^^^^^^^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:82:21
- |
-LL | fn fn_test() -> _ { 5 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:85:23
- |
-LL | fn fn_test2() -> (_, _) { (5, 5) }
- | -^--^-
- | || |
- | || not allowed in type signatures
- | |not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:88:22
- |
-LL | static FN_TEST3: _ = "test";
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `&str`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:91:22
- |
-LL | static FN_TEST4: _ = 145;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:94:22
- |
-LL | static FN_TEST5: (_, _) = (1, 2);
- | ^^^^^^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:97:20
- |
-LL | fn fn_test6(_: _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test6<T>(_: T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:100:20
- |
-LL | fn fn_test7(x: _) { let _x: usize = x; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:103:29
- |
-LL | fn fn_test8(_f: fn() -> _) { }
- | ^
- | |
- | not allowed in type signatures
- | help: use type parameters instead: `T`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:103:29
- |
-LL | fn fn_test8(_f: fn() -> _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test8<T>(_f: fn() -> T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:126:12
- |
-LL | a: _,
- | ^ not allowed in type signatures
-LL |
-LL | b: (_, _),
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct FnTest10<T> {
-LL | a: T,
-LL |
-LL | b: (T, T),
- |
-
-error[E0282]: type annotations needed
- --> $DIR/typeck_type_placeholder_item.rs:131:18
- |
-LL | fn fn_test11(_: _) -> (_, _) { panic!() }
- | ^ cannot infer type
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:131:28
- |
-LL | fn fn_test11(_: _) -> (_, _) { panic!() }
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:135:30
- |
-LL | fn fn_test12(x: i32) -> (_, _) { (x, x) }
- | -^--^-
- | || |
- | || not allowed in type signatures
- | |not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:138:33
- |
-LL | fn fn_test13(x: _) -> (i32, _) { (x, x) }
- | ------^-
- | | |
- | | not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:157:21
- |
-LL | struct BadStruct<_>(_);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct BadStruct<T>(T);
- | ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for implementations
- --> $DIR/typeck_type_placeholder_item.rs:162:15
- |
-LL | impl BadTrait<_> for BadStruct<_> {}
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | impl<T> BadTrait<T> for BadStruct<T> {}
- | ^^^ ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
- --> $DIR/typeck_type_placeholder_item.rs:165:34
- |
-LL | fn impl_trait() -> impl BadTrait<_> {
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:170:25
- |
-LL | struct BadStruct1<_, _>(_);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct BadStruct1<T, _>(T);
- | ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:175:25
- |
-LL | struct BadStruct2<_, T>(_, T);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct BadStruct2<U, T>(U, T);
- | ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for type aliases
- --> $DIR/typeck_type_placeholder_item.rs:179:14
- |
-LL | type X = Box<_>;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
- --> $DIR/typeck_type_placeholder_item.rs:185:21
- |
-LL | type Y = impl Trait<_>;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:219:31
- |
-LL | fn value() -> Option<&'static _> {
- | ----------------^-
- | | |
- | | not allowed in type signatures
- | help: replace with the correct return type: `Option<&'static u8>`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:224:10
- |
-LL | const _: Option<_> = map(value);
- | ^^^^^^^^^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `Option<u8>`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:143:31
- |
-LL | fn method_test1(&self, x: _);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn method_test1<T>(&self, x: T);
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:145:31
- |
-LL | fn method_test2(&self, x: _) -> _;
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn method_test2<T>(&self, x: T) -> T;
- | ^^^ ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:147:31
- |
-LL | fn method_test3(&self) -> _;
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn method_test3<T>(&self) -> T;
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:149:26
- |
-LL | fn assoc_fn_test1(x: _);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn assoc_fn_test1<T>(x: T);
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:151:26
- |
-LL | fn assoc_fn_test2(x: _) -> _;
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn assoc_fn_test2<T>(x: T) -> T;
- | ^^^ ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:153:28
- |
-LL | fn assoc_fn_test3() -> _;
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn assoc_fn_test3<T>() -> T;
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:193:14
- |
-LL | type B = _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:195:14
- |
-LL | const C: _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:197:14
- |
-LL | const D: _ = 42;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:200:26
- |
-LL | type F: std::ops::Fn(_);
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:44:24
- |
-LL | fn test9(&self) -> _ { () }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `()`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:47:27
- |
-LL | fn test10(&self, _x : _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test10<T>(&self, _x : T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:62:24
- |
-LL | fn clone(&self) -> _ { Test9 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `Test9`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:65:37
- |
-LL | fn clone_from(&mut self, other: _) { *self = Test9; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:110:31
- |
-LL | fn fn_test9(&self) -> _ { () }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `()`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:113:34
- |
-LL | fn fn_test10(&self, _x : _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test10<T>(&self, _x : T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:118:28
- |
-LL | fn clone(&self) -> _ { FnTest9 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `FnTest9`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:121:41
- |
-LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:204:14
- |
-LL | type A = _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:206:14
- |
-LL | type B = _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:208:14
- |
-LL | const C: _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:211:14
- |
-LL | const D: _ = 42;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error: aborting due to 69 previous errors; 1 warning emitted
-
-Some errors have detailed explanations: E0121, E0282, E0403.
-For more information about an error, try `rustc --explain E0121`.
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr
deleted file mode 100644
index 88cc3bf..0000000
--- a/src/test/ui/typeck/typeck_type_placeholder_item.min_tait.stderr
+++ /dev/null
@@ -1,638 +0,0 @@
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:157:18
- |
-LL | struct BadStruct<_>(_);
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:160:16
- |
-LL | trait BadTrait<_> {}
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:170:19
- |
-LL | struct BadStruct1<_, _>(_);
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:170:22
- |
-LL | struct BadStruct1<_, _>(_);
- | ^ expected identifier, found reserved identifier
-
-error: expected identifier, found reserved identifier `_`
- --> $DIR/typeck_type_placeholder_item.rs:175:19
- |
-LL | struct BadStruct2<_, T>(_, T);
- | ^ expected identifier, found reserved identifier
-
-error: associated constant in `impl` without body
- --> $DIR/typeck_type_placeholder_item.rs:208:5
- |
-LL | const C: _;
- | ^^^^^^^^^^-
- | |
- | help: provide a definition for the constant: `= <expr>;`
-
-error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters
- --> $DIR/typeck_type_placeholder_item.rs:170:22
- |
-LL | struct BadStruct1<_, _>(_);
- | - ^ already used
- | |
- | first use of `_`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:10:14
- |
-LL | fn test() -> _ { 5 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:13:16
- |
-LL | fn test2() -> (_, _) { (5, 5) }
- | -^--^-
- | || |
- | || not allowed in type signatures
- | |not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:16:15
- |
-LL | static TEST3: _ = "test";
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `&str`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:19:15
- |
-LL | static TEST4: _ = 145;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:22:15
- |
-LL | static TEST5: (_, _) = (1, 2);
- | ^^^^^^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:25:13
- |
-LL | fn test6(_: _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test6<T>(_: T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:28:18
- |
-LL | fn test6_b<T>(_: _, _: T) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test6_b<T, U>(_: U, _: T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:31:30
- |
-LL | fn test6_c<T, K, L, A, B>(_: _, _: (T, K, L, A, B)) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test6_c<T, K, L, A, B, U>(_: U, _: (T, K, L, A, B)) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:34:13
- |
-LL | fn test7(x: _) { let _x: usize = x; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test7<T>(x: T) { let _x: usize = x; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:37:22
- |
-LL | fn test8(_f: fn() -> _) { }
- | ^
- | |
- | not allowed in type signatures
- | help: use type parameters instead: `T`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:37:22
- |
-LL | fn test8(_f: fn() -> _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test8<T>(_f: fn() -> T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:51:26
- |
-LL | fn test11(x: &usize) -> &_ {
- | -^
- | ||
- | |not allowed in type signatures
- | help: replace with the correct return type: `&'static &'static usize`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:56:52
- |
-LL | unsafe fn test12(x: *const usize) -> *const *const _ {
- | --------------^
- | | |
- | | not allowed in type signatures
- | help: replace with the correct return type: `*const *const usize`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:70:8
- |
-LL | a: _,
- | ^ not allowed in type signatures
-LL |
-LL | b: (_, _),
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct Test10<T> {
-LL | a: T,
-LL |
-LL | b: (T, T),
- |
-
-error: missing type for `static` item
- --> $DIR/typeck_type_placeholder_item.rs:76:12
- |
-LL | static A = 42;
- | ^ help: provide a type for the static variable: `A: i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:78:15
- |
-LL | static B: _ = 42;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:80:15
- |
-LL | static C: Option<_> = Some(42);
- | ^^^^^^^^^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:82:21
- |
-LL | fn fn_test() -> _ { 5 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:85:23
- |
-LL | fn fn_test2() -> (_, _) { (5, 5) }
- | -^--^-
- | || |
- | || not allowed in type signatures
- | |not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:88:22
- |
-LL | static FN_TEST3: _ = "test";
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `&str`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:91:22
- |
-LL | static FN_TEST4: _ = 145;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
- --> $DIR/typeck_type_placeholder_item.rs:94:22
- |
-LL | static FN_TEST5: (_, _) = (1, 2);
- | ^^^^^^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:97:20
- |
-LL | fn fn_test6(_: _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test6<T>(_: T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:100:20
- |
-LL | fn fn_test7(x: _) { let _x: usize = x; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:103:29
- |
-LL | fn fn_test8(_f: fn() -> _) { }
- | ^
- | |
- | not allowed in type signatures
- | help: use type parameters instead: `T`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:103:29
- |
-LL | fn fn_test8(_f: fn() -> _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test8<T>(_f: fn() -> T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:126:12
- |
-LL | a: _,
- | ^ not allowed in type signatures
-LL |
-LL | b: (_, _),
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct FnTest10<T> {
-LL | a: T,
-LL |
-LL | b: (T, T),
- |
-
-error[E0282]: type annotations needed
- --> $DIR/typeck_type_placeholder_item.rs:131:18
- |
-LL | fn fn_test11(_: _) -> (_, _) { panic!() }
- | ^ cannot infer type
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:131:28
- |
-LL | fn fn_test11(_: _) -> (_, _) { panic!() }
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:135:30
- |
-LL | fn fn_test12(x: i32) -> (_, _) { (x, x) }
- | -^--^-
- | || |
- | || not allowed in type signatures
- | |not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:138:33
- |
-LL | fn fn_test13(x: _) -> (i32, _) { (x, x) }
- | ------^-
- | | |
- | | not allowed in type signatures
- | help: replace with the correct return type: `(i32, i32)`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:157:21
- |
-LL | struct BadStruct<_>(_);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct BadStruct<T>(T);
- | ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for implementations
- --> $DIR/typeck_type_placeholder_item.rs:162:15
- |
-LL | impl BadTrait<_> for BadStruct<_> {}
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | impl<T> BadTrait<T> for BadStruct<T> {}
- | ^^^ ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
- --> $DIR/typeck_type_placeholder_item.rs:165:34
- |
-LL | fn impl_trait() -> impl BadTrait<_> {
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:170:25
- |
-LL | struct BadStruct1<_, _>(_);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct BadStruct1<T, _>(T);
- | ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
- --> $DIR/typeck_type_placeholder_item.rs:175:25
- |
-LL | struct BadStruct2<_, T>(_, T);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | struct BadStruct2<U, T>(U, T);
- | ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for type aliases
- --> $DIR/typeck_type_placeholder_item.rs:179:14
- |
-LL | type X = Box<_>;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
- --> $DIR/typeck_type_placeholder_item.rs:185:21
- |
-LL | type Y = impl Trait<_>;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:219:31
- |
-LL | fn value() -> Option<&'static _> {
- | ----------------^-
- | | |
- | | not allowed in type signatures
- | help: replace with the correct return type: `Option<&'static u8>`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:224:10
- |
-LL | const _: Option<_> = map(value);
- | ^^^^^^^^^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `Option<u8>`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:143:31
- |
-LL | fn method_test1(&self, x: _);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn method_test1<T>(&self, x: T);
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:145:31
- |
-LL | fn method_test2(&self, x: _) -> _;
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn method_test2<T>(&self, x: T) -> T;
- | ^^^ ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:147:31
- |
-LL | fn method_test3(&self) -> _;
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn method_test3<T>(&self) -> T;
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:149:26
- |
-LL | fn assoc_fn_test1(x: _);
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn assoc_fn_test1<T>(x: T);
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:151:26
- |
-LL | fn assoc_fn_test2(x: _) -> _;
- | ^ ^ not allowed in type signatures
- | |
- | not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn assoc_fn_test2<T>(x: T) -> T;
- | ^^^ ^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:153:28
- |
-LL | fn assoc_fn_test3() -> _;
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn assoc_fn_test3<T>() -> T;
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:193:14
- |
-LL | type B = _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:195:14
- |
-LL | const C: _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:197:14
- |
-LL | const D: _ = 42;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:200:26
- |
-LL | type F: std::ops::Fn(_);
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:44:24
- |
-LL | fn test9(&self) -> _ { () }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `()`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:47:27
- |
-LL | fn test10(&self, _x : _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn test10<T>(&self, _x : T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:62:24
- |
-LL | fn clone(&self) -> _ { Test9 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `Test9`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:65:37
- |
-LL | fn clone_from(&mut self, other: _) { *self = Test9; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:110:31
- |
-LL | fn fn_test9(&self) -> _ { () }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `()`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:113:34
- |
-LL | fn fn_test10(&self, _x : _) { }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn fn_test10<T>(&self, _x : T) { }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
- --> $DIR/typeck_type_placeholder_item.rs:118:28
- |
-LL | fn clone(&self) -> _ { FnTest9 }
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct return type: `FnTest9`
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
- --> $DIR/typeck_type_placeholder_item.rs:121:41
- |
-LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
- | ^ not allowed in type signatures
- |
-help: use type parameters instead
- |
-LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
- | ^^^ ^
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:204:14
- |
-LL | type A = _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
- --> $DIR/typeck_type_placeholder_item.rs:206:14
- |
-LL | type B = _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:208:14
- |
-LL | const C: _;
- | ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/typeck_type_placeholder_item.rs:211:14
- |
-LL | const D: _ = 42;
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `i32`
-
-error: aborting due to 69 previous errors
-
-Some errors have detailed explanations: E0121, E0282, E0403.
-For more information about an error, try `rustc --explain E0121`.
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.rs b/src/test/ui/typeck/typeck_type_placeholder_item.rs
index 55f5d44..a3b7554 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_item.rs
+++ b/src/test/ui/typeck/typeck_type_placeholder_item.rs
@@ -1,9 +1,6 @@
// Needed for `type Y = impl Trait<_>` and `type B = _;`
#![feature(associated_type_defaults)]
-// revisions: min_tait full_tait
-#![feature(min_type_alias_impl_trait)]
-#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
-//[full_tait]~^ WARN incomplete
+#![feature(type_alias_impl_trait)]
// This test checks that it is not possible to enable global type
// inference by using the `_` type placeholder.
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.stderr
new file mode 100644
index 0000000..e1f66af
--- /dev/null
+++ b/src/test/ui/typeck/typeck_type_placeholder_item.stderr
@@ -0,0 +1,638 @@
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:154:18
+ |
+LL | struct BadStruct<_>(_);
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:157:16
+ |
+LL | trait BadTrait<_> {}
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:167:19
+ |
+LL | struct BadStruct1<_, _>(_);
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:167:22
+ |
+LL | struct BadStruct1<_, _>(_);
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:172:19
+ |
+LL | struct BadStruct2<_, T>(_, T);
+ | ^ expected identifier, found reserved identifier
+
+error: associated constant in `impl` without body
+ --> $DIR/typeck_type_placeholder_item.rs:205:5
+ |
+LL | const C: _;
+ | ^^^^^^^^^^-
+ | |
+ | help: provide a definition for the constant: `= <expr>;`
+
+error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters
+ --> $DIR/typeck_type_placeholder_item.rs:167:22
+ |
+LL | struct BadStruct1<_, _>(_);
+ | - ^ already used
+ | |
+ | first use of `_`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:7:14
+ |
+LL | fn test() -> _ { 5 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:10:16
+ |
+LL | fn test2() -> (_, _) { (5, 5) }
+ | -^--^-
+ | || |
+ | || not allowed in type signatures
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:13:15
+ |
+LL | static TEST3: _ = "test";
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `&str`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:16:15
+ |
+LL | static TEST4: _ = 145;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:19:15
+ |
+LL | static TEST5: (_, _) = (1, 2);
+ | ^^^^^^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:22:13
+ |
+LL | fn test6(_: _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test6<T>(_: T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:25:18
+ |
+LL | fn test6_b<T>(_: _, _: T) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test6_b<T, U>(_: U, _: T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:28:30
+ |
+LL | fn test6_c<T, K, L, A, B>(_: _, _: (T, K, L, A, B)) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test6_c<T, K, L, A, B, U>(_: U, _: (T, K, L, A, B)) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:31:13
+ |
+LL | fn test7(x: _) { let _x: usize = x; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test7<T>(x: T) { let _x: usize = x; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:34:22
+ |
+LL | fn test8(_f: fn() -> _) { }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: use type parameters instead: `T`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:34:22
+ |
+LL | fn test8(_f: fn() -> _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test8<T>(_f: fn() -> T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:48:26
+ |
+LL | fn test11(x: &usize) -> &_ {
+ | -^
+ | ||
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `&'static &'static usize`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:53:52
+ |
+LL | unsafe fn test12(x: *const usize) -> *const *const _ {
+ | --------------^
+ | | |
+ | | not allowed in type signatures
+ | help: replace with the correct return type: `*const *const usize`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:67:8
+ |
+LL | a: _,
+ | ^ not allowed in type signatures
+LL |
+LL | b: (_, _),
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL ~ struct Test10<T> {
+LL ~ a: T,
+LL |
+LL ~ b: (T, T),
+ |
+
+error: missing type for `static` item
+ --> $DIR/typeck_type_placeholder_item.rs:73:12
+ |
+LL | static A = 42;
+ | ^ help: provide a type for the static variable: `A: i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:75:15
+ |
+LL | static B: _ = 42;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:77:15
+ |
+LL | static C: Option<_> = Some(42);
+ | ^^^^^^^^^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:79:21
+ |
+LL | fn fn_test() -> _ { 5 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:82:23
+ |
+LL | fn fn_test2() -> (_, _) { (5, 5) }
+ | -^--^-
+ | || |
+ | || not allowed in type signatures
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:85:22
+ |
+LL | static FN_TEST3: _ = "test";
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `&str`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:88:22
+ |
+LL | static FN_TEST4: _ = 145;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:91:22
+ |
+LL | static FN_TEST5: (_, _) = (1, 2);
+ | ^^^^^^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:94:20
+ |
+LL | fn fn_test6(_: _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test6<T>(_: T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:97:20
+ |
+LL | fn fn_test7(x: _) { let _x: usize = x; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:100:29
+ |
+LL | fn fn_test8(_f: fn() -> _) { }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: use type parameters instead: `T`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:100:29
+ |
+LL | fn fn_test8(_f: fn() -> _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test8<T>(_f: fn() -> T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:123:12
+ |
+LL | a: _,
+ | ^ not allowed in type signatures
+LL |
+LL | b: (_, _),
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL ~ struct FnTest10<T> {
+LL ~ a: T,
+LL |
+LL ~ b: (T, T),
+ |
+
+error[E0282]: type annotations needed
+ --> $DIR/typeck_type_placeholder_item.rs:128:18
+ |
+LL | fn fn_test11(_: _) -> (_, _) { panic!() }
+ | ^ cannot infer type
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:128:28
+ |
+LL | fn fn_test11(_: _) -> (_, _) { panic!() }
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:132:30
+ |
+LL | fn fn_test12(x: i32) -> (_, _) { (x, x) }
+ | -^--^-
+ | || |
+ | || not allowed in type signatures
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:135:33
+ |
+LL | fn fn_test13(x: _) -> (i32, _) { (x, x) }
+ | ------^-
+ | | |
+ | | not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:154:21
+ |
+LL | struct BadStruct<_>(_);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | struct BadStruct<T>(T);
+ | ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for implementations
+ --> $DIR/typeck_type_placeholder_item.rs:159:15
+ |
+LL | impl BadTrait<_> for BadStruct<_> {}
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | impl<T> BadTrait<T> for BadStruct<T> {}
+ | +++ ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
+ --> $DIR/typeck_type_placeholder_item.rs:162:34
+ |
+LL | fn impl_trait() -> impl BadTrait<_> {
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:167:25
+ |
+LL | struct BadStruct1<_, _>(_);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | struct BadStruct1<T, _>(T);
+ | ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:172:25
+ |
+LL | struct BadStruct2<_, T>(_, T);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | struct BadStruct2<U, T>(U, T);
+ | ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for type aliases
+ --> $DIR/typeck_type_placeholder_item.rs:176:14
+ |
+LL | type X = Box<_>;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
+ --> $DIR/typeck_type_placeholder_item.rs:182:21
+ |
+LL | type Y = impl Trait<_>;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:216:31
+ |
+LL | fn value() -> Option<&'static _> {
+ | ----------------^-
+ | | |
+ | | not allowed in type signatures
+ | help: replace with the correct return type: `Option<&'static u8>`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:221:10
+ |
+LL | const _: Option<_> = map(value);
+ | ^^^^^^^^^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `Option<u8>`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:140:31
+ |
+LL | fn method_test1(&self, x: _);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn method_test1<T>(&self, x: T);
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:142:31
+ |
+LL | fn method_test2(&self, x: _) -> _;
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn method_test2<T>(&self, x: T) -> T;
+ | +++ ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:144:31
+ |
+LL | fn method_test3(&self) -> _;
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn method_test3<T>(&self) -> T;
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:146:26
+ |
+LL | fn assoc_fn_test1(x: _);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn assoc_fn_test1<T>(x: T);
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:148:26
+ |
+LL | fn assoc_fn_test2(x: _) -> _;
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn assoc_fn_test2<T>(x: T) -> T;
+ | +++ ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:150:28
+ |
+LL | fn assoc_fn_test3() -> _;
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn assoc_fn_test3<T>() -> T;
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:190:14
+ |
+LL | type B = _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:192:14
+ |
+LL | const C: _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:194:14
+ |
+LL | const D: _ = 42;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:197:26
+ |
+LL | type F: std::ops::Fn(_);
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:41:24
+ |
+LL | fn test9(&self) -> _ { () }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `()`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:44:27
+ |
+LL | fn test10(&self, _x : _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test10<T>(&self, _x : T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:59:24
+ |
+LL | fn clone(&self) -> _ { Test9 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `Test9`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:62:37
+ |
+LL | fn clone_from(&mut self, other: _) { *self = Test9; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:107:31
+ |
+LL | fn fn_test9(&self) -> _ { () }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `()`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:110:34
+ |
+LL | fn fn_test10(&self, _x : _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test10<T>(&self, _x : T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:115:28
+ |
+LL | fn clone(&self) -> _ { FnTest9 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `FnTest9`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:118:41
+ |
+LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:201:14
+ |
+LL | type A = _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:203:14
+ |
+LL | type B = _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:205:14
+ |
+LL | const C: _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:208:14
+ |
+LL | const D: _ = 42;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error: aborting due to 69 previous errors
+
+Some errors have detailed explanations: E0121, E0282, E0403.
+For more information about an error, try `rustc --explain E0121`.
diff --git a/src/test/ui/typeof/type_mismatch.stderr b/src/test/ui/typeof/type_mismatch.stderr
index 12fd7c9..5c58e29 100644
--- a/src/test/ui/typeof/type_mismatch.stderr
+++ b/src/test/ui/typeof/type_mismatch.stderr
@@ -15,7 +15,7 @@
help: change the type of the numeric literal from `i8` to `u8`
|
LL | let b: typeof(a) = 1u8;
- | ^^^
+ | ~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr b/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr
index 37aa4d9..a832964 100644
--- a/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr
+++ b/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr
@@ -12,7 +12,7 @@
help: add missing generic argument
|
LL | <String as IntoCow<B>>::into_cow("foo".to_string());
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0107]: missing generics for trait `IntoCow`
--> $DIR/ufcs-qpath-missing-params.rs:17:16
@@ -28,7 +28,7 @@
help: add missing generic argument
|
LL | <String as IntoCow<B>>::into_cow::<str>("foo".to_string());
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/ufcs-qpath-missing-params.rs:17:26
diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
index e30e4f5..8dc0246 100644
--- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
+++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
@@ -20,7 +20,7 @@
help: change the type of the numeric literal from `u32` to `i32`
|
LL | <i32 as Add<i32>>::add(1i32, 2);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/ufcs-qpath-self-mismatch.rs:8:31
@@ -31,7 +31,7 @@
help: change the type of the numeric literal from `u32` to `i32`
|
LL | <i32 as Add<i32>>::add(1, 2i32);
- | ^^^^
+ | ~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/unboxed-closures/issue-30906.nll.stderr b/src/test/ui/unboxed-closures/issue-30906.nll.stderr
index 2db392e..147a209 100644
--- a/src/test/ui/unboxed-closures/issue-30906.nll.stderr
+++ b/src/test/ui/unboxed-closures/issue-30906.nll.stderr
@@ -1,8 +1,11 @@
-error: higher-ranked subtype error
+error: implementation of `FnOnce` is not general enough
--> $DIR/issue-30906.rs:18:5
|
LL | test(Compose(f, |_| {}));
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
+ |
+ = note: `fn(&'2 str) -> T` must implement `FnOnce<(&'1 str,)>`, for any lifetime `'1`...
+ = note: ...but it actually implements `FnOnce<(&'2 str,)>`, for some specific lifetime `'2`
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/issue-53448.stderr b/src/test/ui/unboxed-closures/issue-53448.stderr
index 29273a5..8f9d918 100644
--- a/src/test/ui/unboxed-closures/issue-53448.stderr
+++ b/src/test/ui/unboxed-closures/issue-53448.stderr
@@ -9,11 +9,11 @@
help: consider further restricting the associated type
|
LL | fn main() where <() as Lt<'_>>::T: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | let f: &mut dyn FnMut<(_,), Output = ()> = &mut |_: &<() as Lt<'_>>::T| {};
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr
index 908d854..09d3eec 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output = ()>: Eq<dyn Foo<(isize,), Output = ()>>` is not satisfied
--> $DIR/unboxed-closure-sugar-default.rs:21:5
|
-LL | fn eq<A: ?Sized,B: ?Sized>() where A : Eq<B> { }
- | ----- required by this bound in `eq`
-...
LL | eq::<dyn Foo<(isize,), isize, Output=()>, dyn Foo(isize)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq<dyn Foo<(isize,), Output = ()>>` is not implemented for `dyn Foo<(isize,), isize, Output = ()>`
+ |
+note: required by a bound in `eq`
+ --> $DIR/unboxed-closure-sugar-default.rs:14:40
+ |
+LL | fn eq<A: ?Sized,B: ?Sized>() where A : Eq<B> { }
+ | ^^^^^ required by this bound in `eq`
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr
index 8ce7e82..a1cbf84 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr
@@ -1,12 +1,15 @@
error[E0277]: the trait bound `dyn Foo<(char,), Output = ()>: Eq<dyn Foo<(), Output = ()>>` is not satisfied
--> $DIR/unboxed-closure-sugar-equiv.rs:43:5
|
-LL | fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
- | ----- required by this bound in `eq`
-...
LL | / eq::< dyn Foo<(),Output=()>,
LL | | dyn Foo(char) >();
| |_______________________________________________________________________^ the trait `Eq<dyn Foo<(), Output = ()>>` is not implemented for `dyn Foo<(char,), Output = ()>`
+ |
+note: required by a bound in `eq`
+ --> $DIR/unboxed-closure-sugar-equiv.rs:16:28
+ |
+LL | fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
+ | ^^^^^ required by this bound in `eq`
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr
index 1719a99..64d14d0 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr
@@ -7,7 +7,7 @@
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
help: consider introducing a named lifetime parameter
|
-LL | fn main<'a>() {
+LL ~ fn main<'a>() {
LL | eq::< dyn for<'a> Foo<(&'a isize,), Output=&'a isize>,
LL | dyn Foo(&isize) -> &isize >();
LL | eq::< dyn for<'a> Foo<(&'a isize,), Output=(&'a isize, &'a isize)>,
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.stderr
index 90bef7b..29ea573 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.stderr
@@ -18,7 +18,7 @@
help: add missing generic argument
|
LL | let x: Box<Bar(A)> = panic!();
- | ^
+ | +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.stderr
index 931675a..427ba34 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.stderr
@@ -18,7 +18,7 @@
help: add missing generic argument
|
LL | fn foo(b: Box<Bar(A)>) {
- | ^
+ | +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr
index df35634..f30bf40 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr
@@ -1,13 +1,15 @@
error[E0277]: expected a `Fn<(isize,)>` closure, found `S`
--> $DIR/unboxed-closures-fnmut-as-fn.rs:28:21
|
-LL | fn call_it<F:Fn(isize)->isize>(f: &F, x: isize) -> isize {
- | ---------------- required by this bound in `call_it`
-...
LL | let x = call_it(&S, 22);
| ^^ expected an `Fn<(isize,)>` closure, found `S`
|
= help: the trait `Fn<(isize,)>` is not implemented for `S`
+note: required by a bound in `call_it`
+ --> $DIR/unboxed-closures-fnmut-as-fn.rs:23:14
+ |
+LL | fn call_it<F:Fn(isize)->isize>(f: &F, x: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^ required by this bound in `call_it`
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
index 482b3ace..67bf4be 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
@@ -7,7 +7,7 @@
help: change the type of the numeric literal from `usize` to `isize`
|
LL | let z = f(1_isize, 2);
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
index d1f433e..6b21b92 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
@@ -1,35 +1,41 @@
error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21
|
-LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
- | ------------------- required by this bound in `call_it`
-...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+note: required by a bound in `call_it`
+ --> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15
+ |
+LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25
|
-LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
- | ---------------------- required by this bound in `call_it_mut`
-...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+note: required by a bound in `call_it_mut`
+ --> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19
+ |
+LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26
|
-LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
- | ----------------------- required by this bound in `call_it_once`
-...
LL | let z = call_it_once(square, 22);
| ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+note: required by a bound in `call_it_once`
+ --> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20
+ |
+LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_once`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
index 05b532e..936cb27 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
@@ -1,35 +1,41 @@
error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:20:21
|
-LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
- | ------------------- required by this bound in `call_it`
-...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+note: required by a bound in `call_it`
+ --> $DIR/unboxed-closures-wrong-abi.rs:9:15
+ |
+LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:25:25
|
-LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
- | ---------------------- required by this bound in `call_it_mut`
-...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+note: required by a bound in `call_it_mut`
+ --> $DIR/unboxed-closures-wrong-abi.rs:12:19
+ |
+LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:30:26
|
-LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
- | ----------------------- required by this bound in `call_it_once`
-...
LL | let z = call_it_once(square, 22);
| ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
|
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+note: required by a bound in `call_it_once`
+ --> $DIR/unboxed-closures-wrong-abi.rs:15:20
+ |
+LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_once`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
index 3b88b35..f9f1182 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
@@ -1,35 +1,41 @@
error[E0277]: expected a `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:21:21
|
-LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
- | ------------------- required by this bound in `call_it`
-...
LL | let x = call_it(&square, 22);
| ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+note: required by a bound in `call_it`
+ --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:10:15
+ |
+LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
error[E0277]: expected a `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:26:25
|
-LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
- | ---------------------- required by this bound in `call_it_mut`
-...
LL | let y = call_it_mut(&mut square, 22);
| ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+note: required by a bound in `call_it_mut`
+ --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:19
+ |
+LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:31:26
|
-LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
- | ----------------------- required by this bound in `call_it_once`
-...
LL | let z = call_it_once(square, 22);
| ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}`
|
= help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+note: required by a bound in `call_it_once`
+ --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:16:20
+ |
+LL | fn call_it_once<F: FnOnce(&isize) -> isize>(_: F, _: isize) -> isize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_once`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr
index 2c59583..b865278 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore-in-struct.stderr
@@ -6,8 +6,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: Box<dyn Debug + 'a>,
+LL ~ struct Foo<'a> {
+LL ~ x: Box<dyn Debug + 'a>,
|
error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
index dd80486..de3a6bb 100644
--- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
+++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr
@@ -10,7 +10,7 @@
help: to declare that the trait object captures data from argument `items`, you can add an explicit `'_` lifetime bound
|
LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T> + '_> {
- | ^^^^
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/underscore-lifetime/in-fn-return-illegal.stderr b/src/test/ui/underscore-lifetime/in-fn-return-illegal.stderr
index 8d2c82e..6a104e8 100644
--- a/src/test/ui/underscore-lifetime/in-fn-return-illegal.stderr
+++ b/src/test/ui/underscore-lifetime/in-fn-return-illegal.stderr
@@ -8,7 +8,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn foo<'a>(x: &'a u32, y: &'a u32) -> &'a u32 { loop { } }
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^
+ | ++++ ++ ++ ~~
error: aborting due to previous error
diff --git a/src/test/ui/underscore-lifetime/in-struct.stderr b/src/test/ui/underscore-lifetime/in-struct.stderr
index 4275cc2..84183f6 100644
--- a/src/test/ui/underscore-lifetime/in-struct.stderr
+++ b/src/test/ui/underscore-lifetime/in-struct.stderr
@@ -6,8 +6,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: &'a u32,
+LL ~ struct Foo<'a> {
+LL ~ x: &'a u32,
|
error[E0106]: missing lifetime specifier
@@ -18,8 +18,8 @@
|
help: consider introducing a named lifetime parameter
|
-LL | enum Bar<'a> {
-LL | Variant(&'a u32),
+LL ~ enum Bar<'a> {
+LL ~ Variant(&'a u32),
|
error: aborting due to 2 previous errors
diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
index 594cdd2..22bf1fd 100644
--- a/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
+++ b/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr
@@ -19,7 +19,7 @@
help: consider using the `'a` lifetime
|
LL | struct Baz<'a>(&'a &'a u8);
- | ^^
+ | ~~
error[E0106]: missing lifetime specifier
--> $DIR/underscore-lifetime-binders.rs:10:33
@@ -31,7 +31,7 @@
help: consider using the `'static` lifetime
|
LL | fn meh() -> Box<dyn for<'_> Meh<'static>>
- | ^^^^^^^
+ | ~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/underscore-lifetime-binders.rs:16:35
@@ -43,7 +43,7 @@
help: consider introducing a named lifetime parameter
|
LL | fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y }
- | ^^^^ ^^^^^^ ^^^^^^ ^^
+ | ++++ ~~ ~~ ~~
error: aborting due to 5 previous errors
diff --git a/src/test/ui/uninhabited/uninhabited-irrefutable.stderr b/src/test/ui/uninhabited/uninhabited-irrefutable.stderr
index e1ff38f..3cb9955 100644
--- a/src/test/ui/uninhabited/uninhabited-irrefutable.stderr
+++ b/src/test/ui/uninhabited/uninhabited-irrefutable.stderr
@@ -19,7 +19,7 @@
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Foo::D(_y) = x { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr
index 4f2f9e0..b92ceb4 100644
--- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr
+++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr
@@ -3,7 +3,7 @@
|
LL | let _ = match x {
| ^ pattern `Err(_)` not covered
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
@@ -57,7 +57,7 @@
|
LL | let _ = match x {
| ^ pattern `Err(_)` not covered
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
@@ -71,7 +71,7 @@
|
LL | let Ok(x) = x;
| ^^^^^ pattern `Err(_)` not covered
- |
+ |
::: $SRC_DIR/core/src/result.rs:LL:COL
|
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
diff --git a/src/test/ui/union/union-const-eval.rs b/src/test/ui/union/union-const-eval.rs
index 0b6788b..32ee4a7 100644
--- a/src/test/ui/union/union-const-eval.rs
+++ b/src/test/ui/union/union-const-eval.rs
@@ -1,9 +1,7 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
// revisions: mirunsafeck thirunsafeck
// [thirunsafeck]compile-flags: -Z thir-unsafeck
-#![feature(const_fn_union)]
-
union U {
a: usize,
b: usize,
diff --git a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr
index 41e828c..b52117c 100644
--- a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr
+++ b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr
@@ -1,16 +1,3 @@
-error[E0277]: the trait bound `U1: Copy` is not satisfied
- --> $DIR/union-derive-clone.rs:6:10
- |
-LL | #[derive(Clone)]
- | ^^^^^ the trait `Copy` is not implemented for `U1`
- |
- ::: $SRC_DIR/core/src/clone.rs:LL:COL
- |
-LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
- | ---- required by this bound in `AssertParamIsCopy`
- |
- = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
-
error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
--> $DIR/union-derive-clone.rs:38:15
|
@@ -30,6 +17,19 @@
`CloneNoCopy: Copy`
which is required by `U5<CloneNoCopy>: Clone`
+error[E0277]: the trait bound `U1: Copy` is not satisfied
+ --> $DIR/union-derive-clone.rs:6:10
+ |
+LL | #[derive(Clone)]
+ | ^^^^^ the trait `Copy` is not implemented for `U1`
+ |
+note: required by a bound in `AssertParamIsCopy`
+ --> $SRC_DIR/core/src/clone.rs:LL:COL
+ |
+LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
+ | ^^^^ required by this bound in `AssertParamIsCopy`
+ = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0599.
diff --git a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr
index 41e828c..b52117c 100644
--- a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr
+++ b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr
@@ -1,16 +1,3 @@
-error[E0277]: the trait bound `U1: Copy` is not satisfied
- --> $DIR/union-derive-clone.rs:6:10
- |
-LL | #[derive(Clone)]
- | ^^^^^ the trait `Copy` is not implemented for `U1`
- |
- ::: $SRC_DIR/core/src/clone.rs:LL:COL
- |
-LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
- | ---- required by this bound in `AssertParamIsCopy`
- |
- = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
-
error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied
--> $DIR/union-derive-clone.rs:38:15
|
@@ -30,6 +17,19 @@
`CloneNoCopy: Copy`
which is required by `U5<CloneNoCopy>: Clone`
+error[E0277]: the trait bound `U1: Copy` is not satisfied
+ --> $DIR/union-derive-clone.rs:6:10
+ |
+LL | #[derive(Clone)]
+ | ^^^^^ the trait `Copy` is not implemented for `U1`
+ |
+note: required by a bound in `AssertParamIsCopy`
+ --> $SRC_DIR/core/src/clone.rs:LL:COL
+ |
+LL | pub struct AssertParamIsCopy<T: Copy + ?Sized> {
+ | ^^^^ required by this bound in `AssertParamIsCopy`
+ = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
+
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0599.
diff --git a/src/test/ui/union/union-derive-eq.mirunsafeck.stderr b/src/test/ui/union/union-derive-eq.mirunsafeck.stderr
index c2fd854..ff4dfcd 100644
--- a/src/test/ui/union/union-derive-eq.mirunsafeck.stderr
+++ b/src/test/ui/union/union-derive-eq.mirunsafeck.stderr
@@ -6,12 +6,12 @@
LL | union U2 {
LL | a: PartialEqNotEq,
| ^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `PartialEqNotEq`
- |
- ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub struct AssertParamIsEq<T: Eq + ?Sized> {
- | -- required by this bound in `AssertParamIsEq`
- |
+ | ^^ required by this bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/union/union-derive-eq.thirunsafeck.stderr b/src/test/ui/union/union-derive-eq.thirunsafeck.stderr
index c2fd854..ff4dfcd 100644
--- a/src/test/ui/union/union-derive-eq.thirunsafeck.stderr
+++ b/src/test/ui/union/union-derive-eq.thirunsafeck.stderr
@@ -6,12 +6,12 @@
LL | union U2 {
LL | a: PartialEqNotEq,
| ^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `PartialEqNotEq`
- |
- ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
|
LL | pub struct AssertParamIsEq<T: Eq + ?Sized> {
- | -- required by this bound in `AssertParamIsEq`
- |
+ | ^^ required by this bound in `AssertParamIsEq`
= note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/union/union-drop.rs b/src/test/ui/union/union-drop.rs
index 9edf582..c3d7d41 100644
--- a/src/test/ui/union/union-drop.rs
+++ b/src/test/ui/union/union-drop.rs
@@ -1,4 +1,7 @@
// run-pass
+// revisions: mirunsafeck thirunsafeck
+// [thirunsafeck]compile-flags: -Z thir-unsafeck
+
#![allow(dead_code)]
#![allow(unused_variables)]
diff --git a/src/test/ui/union/union-drop.thirunsafeck.stderr b/src/test/ui/union/union-drop.thirunsafeck.stderr
deleted file mode 100644
index 9766ae4..0000000
--- a/src/test/ui/union/union-drop.thirunsafeck.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-warning: unnecessary `unsafe` block
- --> $DIR/union-drop.rs:27:9
- |
-LL | unsafe { CHECK += 1; }
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: `#[warn(unused_unsafe)]` on by default
-
-warning: unnecessary `unsafe` block
- --> $DIR/union-drop.rs:33:9
- |
-LL | unsafe { CHECK += 1; }
- | ^^^^^^ unnecessary `unsafe` block
-
-warning: unnecessary `unsafe` block
- --> $DIR/union-drop.rs:40:5
- |
-LL | unsafe {
- | ^^^^^^ unnecessary `unsafe` block
-
-warning: 3 warnings emitted
-
diff --git a/src/test/ui/union/union-fields-2.mirunsafeck.stderr b/src/test/ui/union/union-fields-2.mirunsafeck.stderr
index 867bf75..90ad164 100644
--- a/src/test/ui/union/union-fields-2.mirunsafeck.stderr
+++ b/src/test/ui/union/union-fields-2.mirunsafeck.stderr
@@ -1,10 +1,10 @@
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:10:13
|
LL | let u = U {};
| ^
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:12:13
|
LL | let u = U { a: 0, b: 1 };
@@ -18,13 +18,13 @@
|
= note: available fields are: `a`, `b`
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:13:13
|
LL | let u = U { a: 0, b: 1, c: 2 };
| ^
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:15:13
|
LL | let u = U { ..u };
@@ -80,5 +80,5 @@
error: aborting due to 13 previous errors
-Some errors have detailed explanations: E0026, E0436, E0560.
+Some errors have detailed explanations: E0026, E0436, E0560, E0784.
For more information about an error, try `rustc --explain E0026`.
diff --git a/src/test/ui/union/union-fields-2.thirunsafeck.stderr b/src/test/ui/union/union-fields-2.thirunsafeck.stderr
index 867bf75..90ad164 100644
--- a/src/test/ui/union/union-fields-2.thirunsafeck.stderr
+++ b/src/test/ui/union/union-fields-2.thirunsafeck.stderr
@@ -1,10 +1,10 @@
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:10:13
|
LL | let u = U {};
| ^
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:12:13
|
LL | let u = U { a: 0, b: 1 };
@@ -18,13 +18,13 @@
|
= note: available fields are: `a`, `b`
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:13:13
|
LL | let u = U { a: 0, b: 1, c: 2 };
| ^
-error: union expressions should have exactly one field
+error[E0784]: union expressions should have exactly one field
--> $DIR/union-fields-2.rs:15:13
|
LL | let u = U { ..u };
@@ -80,5 +80,5 @@
error: aborting due to 13 previous errors
-Some errors have detailed explanations: E0026, E0436, E0560.
+Some errors have detailed explanations: E0026, E0436, E0560, E0784.
For more information about an error, try `rustc --explain E0026`.
diff --git a/src/test/ui/union/union-nonrepresentable.stderr b/src/test/ui/union/union-nonrepresentable.stderr
index c54d04d..7da7c87 100644
--- a/src/test/ui/union/union-nonrepresentable.stderr
+++ b/src/test/ui/union/union-nonrepresentable.stderr
@@ -10,7 +10,7 @@
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `U` representable
|
LL | b: Box<U>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/union/union-nonzero.rs b/src/test/ui/union/union-nonzero.rs
index d29e7a9..3f4f7ea 100644
--- a/src/test/ui/union/union-nonzero.rs
+++ b/src/test/ui/union/union-nonzero.rs
@@ -13,7 +13,7 @@
// optimizations to types containing unions even if they're theoretically possible. (discussion:
// https://github.com/rust-lang/rust/issues/36394)
//
-// Notably this nails down part of the behavior that `MaybeUninit` assumes: that a
+// Notably this nails down part of the behavior that `MaybeUninit` assumes: that an
// `Option<MaybeUninit<&u8>>` does not take advantage of non-zero optimization, and thus is a safe
// construct.
diff --git a/src/test/ui/union/union-sized-field.stderr b/src/test/ui/union/union-sized-field.stderr
index b916bbe..0f66f6c 100644
--- a/src/test/ui/union/union-sized-field.stderr
+++ b/src/test/ui/union/union-sized-field.stderr
@@ -8,14 +8,19 @@
|
= note: no field of a union may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - union Foo<T: ?Sized> {
+LL + union Foo<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:9:12
@@ -27,14 +32,19 @@
|
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - struct Foo2<T: ?Sized> {
+LL + struct Foo2<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:15:11
@@ -46,14 +56,19 @@
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - enum Foo3<T: ?Sized> {
+LL + enum Foo3<T> {
+ |
help: borrowed types always have a statically known size
|
LL | Value(&T),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | Value(Box<T>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to 3 previous errors
diff --git a/src/test/ui/union/union-suggest-field.mirunsafeck.stderr b/src/test/ui/union/union-suggest-field.mirunsafeck.stderr
index 26fc25b..58b1f5c 100644
--- a/src/test/ui/union/union-suggest-field.mirunsafeck.stderr
+++ b/src/test/ui/union/union-suggest-field.mirunsafeck.stderr
@@ -19,7 +19,7 @@
help: use parentheses to call the method
|
LL | let y = u.calculate();
- | ^^
+ | ++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/union/union-suggest-field.thirunsafeck.stderr b/src/test/ui/union/union-suggest-field.thirunsafeck.stderr
index 26fc25b..58b1f5c 100644
--- a/src/test/ui/union/union-suggest-field.thirunsafeck.stderr
+++ b/src/test/ui/union/union-suggest-field.thirunsafeck.stderr
@@ -19,7 +19,7 @@
help: use parentheses to call the method
|
LL | let y = u.calculate();
- | ^^
+ | ++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/union/union-unsafe.mir.stderr b/src/test/ui/union/union-unsafe.mir.stderr
index 84a7eb2..318b00d 100644
--- a/src/test/ui/union/union-unsafe.mir.stderr
+++ b/src/test/ui/union/union-unsafe.mir.stderr
@@ -55,10 +55,10 @@
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/union-unsafe.rs:65:20
+ --> $DIR/union-unsafe.rs:65:12
|
LL | if let U1 { a: 12 } = u1 {}
- | ^^ access to union field
+ | ^^^^^^^^^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
diff --git a/src/test/ui/union/union-unsafe.rs b/src/test/ui/union/union-unsafe.rs
index e841490..3cb3a18 100644
--- a/src/test/ui/union/union-unsafe.rs
+++ b/src/test/ui/union/union-unsafe.rs
@@ -36,8 +36,8 @@
fn assign_noncopy_union_field(mut u: URefCell) {
// FIXME(thir-unsafeck)
- u.a = (RefCell::new(0), 1); //[mir]~ ERROR assignment to union field that might need dropping
- u.a.0 = RefCell::new(0); //[mir]~ ERROR assignment to union field that might need dropping
+ u.a = (RefCell::new(0), 1); //~ ERROR assignment to union field that might need dropping
+ u.a.0 = RefCell::new(0); //~ ERROR assignment to union field that might need dropping
u.a.1 = 1; // OK
}
diff --git a/src/test/ui/union/union-unsafe.thir.stderr b/src/test/ui/union/union-unsafe.thir.stderr
index 51f1987..a8c3886 100644
--- a/src/test/ui/union/union-unsafe.thir.stderr
+++ b/src/test/ui/union/union-unsafe.thir.stderr
@@ -6,6 +6,22 @@
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
+ --> $DIR/union-unsafe.rs:39:5
+ |
+LL | u.a = (RefCell::new(0), 1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
+ |
+ = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
+
+error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
+ --> $DIR/union-unsafe.rs:40:5
+ |
+LL | u.a.0 = RefCell::new(0);
+ | ^^^^^^^^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
+ |
+ = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
+
error[E0133]: access to union field is unsafe and requires unsafe function or block
--> $DIR/union-unsafe.rs:47:6
|
@@ -39,10 +55,10 @@
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
error[E0133]: access to union field is unsafe and requires unsafe function or block
- --> $DIR/union-unsafe.rs:65:20
+ --> $DIR/union-unsafe.rs:65:8
|
LL | if let U1 { a: 12 } = u1 {}
- | ^^ access to union field
+ | ^^^^^^^^^^^^^^^^^^^^^ access to union field
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
@@ -70,6 +86,6 @@
|
= note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
-error: aborting due to 9 previous errors
+error: aborting due to 11 previous errors
For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/union/union-unsized.mirunsafeck.stderr b/src/test/ui/union/union-unsized.mirunsafeck.stderr
index 86a13c1..36e782a 100644
--- a/src/test/ui/union/union-unsized.mirunsafeck.stderr
+++ b/src/test/ui/union/union-unsized.mirunsafeck.stderr
@@ -10,11 +10,11 @@
help: borrowed types always have a statically known size
|
LL | a: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | a: Box<str>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/union-unsized.rs:15:8
@@ -28,11 +28,11 @@
help: borrowed types always have a statically known size
|
LL | b: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | b: Box<str>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/union/union-unsized.thirunsafeck.stderr b/src/test/ui/union/union-unsized.thirunsafeck.stderr
index 86a13c1..36e782a 100644
--- a/src/test/ui/union/union-unsized.thirunsafeck.stderr
+++ b/src/test/ui/union/union-unsized.thirunsafeck.stderr
@@ -10,11 +10,11 @@
help: borrowed types always have a statically known size
|
LL | a: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | a: Box<str>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/union-unsized.rs:15:8
@@ -28,11 +28,11 @@
help: borrowed types always have a statically known size
|
LL | b: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | b: Box<str>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr
index 6a355dd..5c40787 100644
--- a/src/test/ui/unique-object-noncopyable.stderr
+++ b/src/test/ui/unique-object-noncopyable.stderr
@@ -9,7 +9,7 @@
...
LL | let _z = y.clone();
| ^^^^^ method cannot be called on `Box<dyn Foo>` due to unsatisfied trait bounds
- |
+ |
::: $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | / pub struct Box<
diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr
index a4421bc..8e0804e 100644
--- a/src/test/ui/unique-pinned-nocopy.stderr
+++ b/src/test/ui/unique-pinned-nocopy.stderr
@@ -6,7 +6,7 @@
...
LL | let _j = i.clone();
| ^^^^^ method cannot be called on `Box<R>` due to unsatisfied trait bounds
- |
+ |
::: $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | / pub struct Box<
diff --git a/src/test/ui/unnamed_fields/restrict_anonymous.rs b/src/test/ui/unnamed_fields/restrict_anonymous.rs
deleted file mode 100644
index 99637d1..0000000
--- a/src/test/ui/unnamed_fields/restrict_anonymous.rs
+++ /dev/null
@@ -1,52 +0,0 @@
-#![allow(incomplete_features)]
-#![feature(unnamed_fields)]
-
-fn f() -> struct { field: u8 } {} //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
-//~^ ERROR anonymous structs are unimplemented
-
-fn f2(a: struct { field: u8 } ) {} //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
-//~^ ERROR anonymous structs are unimplemented
-
-union G {
- field: struct { field: u8 } //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
- //~^ ERROR anonymous structs are unimplemented
-}
-//~| ERROR unions may not contain fields that need dropping [E0740]
-
-struct H { _: u8 } // Should error after hir checks
-
-struct I(struct { field: u8 }, u8); //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
-//~^ ERROR anonymous structs are unimplemented
-
-enum J {
- K(struct { field: u8 }), //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
- //~^ ERROR anonymous structs are unimplemented
- L {
- _ : struct { field: u8 } //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
- //~^ ERROR anonymous fields are not allowed outside of structs or unions
- //~| ERROR anonymous structs are unimplemented
- },
- M {
- _ : u8 //~ ERROR anonymous fields are not allowed outside of structs or unions
- }
-}
-
-static M: union { field: u8 } = 0; //~ ERROR anonymous unions are not allowed outside of unnamed struct or union fields
-//~^ ERROR anonymous unions are unimplemented
-
-type N = union { field: u8 }; //~ ERROR anonymous unions are not allowed outside of unnamed struct or union fields
-//~^ ERROR anonymous unions are unimplemented
-
-fn main() {
- const O: struct { field: u8 } = 0; //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
- //~^ ERROR anonymous structs are unimplemented
-
- let p: [struct { field: u8 }; 1]; //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
- //~^ ERROR anonymous structs are unimplemented
-
- let q: (struct { field: u8 }, u8); //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
- //~^ ERROR anonymous structs are unimplemented
-
- let cl = || -> struct { field: u8 } {}; //~ ERROR anonymous structs are not allowed outside of unnamed struct or union fields
- //~^ ERROR anonymous structs are unimplemented
-}
diff --git a/src/test/ui/unnamed_fields/restrict_anonymous.stderr b/src/test/ui/unnamed_fields/restrict_anonymous.stderr
deleted file mode 100644
index efcf544..0000000
--- a/src/test/ui/unnamed_fields/restrict_anonymous.stderr
+++ /dev/null
@@ -1,175 +0,0 @@
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:4:11
- |
-LL | fn f() -> struct { field: u8 } {}
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:7:10
- |
-LL | fn f2(a: struct { field: u8 } ) {}
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:11:12
- |
-LL | field: struct { field: u8 }
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:18:10
- |
-LL | struct I(struct { field: u8 }, u8);
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:22:7
- |
-LL | K(struct { field: u8 }),
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous fields are not allowed outside of structs or unions
- --> $DIR/restrict_anonymous.rs:25:9
- |
-LL | _ : struct { field: u8 }
- | -^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | anonymous field declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:25:13
- |
-LL | _ : struct { field: u8 }
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous fields are not allowed outside of structs or unions
- --> $DIR/restrict_anonymous.rs:30:9
- |
-LL | _ : u8
- | -^^^^^
- | |
- | anonymous field declared here
-
-error: anonymous unions are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:34:11
- |
-LL | static M: union { field: u8 } = 0;
- | ^^^^^^^^^^^^^^^^^^^ anonymous union declared here
-
-error: anonymous unions are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:37:10
- |
-LL | type N = union { field: u8 };
- | ^^^^^^^^^^^^^^^^^^^ anonymous union declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:41:14
- |
-LL | const O: struct { field: u8 } = 0;
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:44:13
- |
-LL | let p: [struct { field: u8 }; 1];
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:47:13
- |
-LL | let q: (struct { field: u8 }, u8);
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are not allowed outside of unnamed struct or union fields
- --> $DIR/restrict_anonymous.rs:50:20
- |
-LL | let cl = || -> struct { field: u8 } {};
- | ^^^^^^^^^^^^^^^^^^^^ anonymous struct declared here
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:4:11
- |
-LL | fn f() -> struct { field: u8 } {}
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:7:10
- |
-LL | fn f2(a: struct { field: u8 } ) {}
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:11:12
- |
-LL | field: struct { field: u8 }
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:18:10
- |
-LL | struct I(struct { field: u8 }, u8);
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:22:7
- |
-LL | K(struct { field: u8 }),
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:25:13
- |
-LL | _ : struct { field: u8 }
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous unions are unimplemented
- --> $DIR/restrict_anonymous.rs:34:11
- |
-LL | static M: union { field: u8 } = 0;
- | ^^^^^^^^^^^^^^^^^^^
-
-error: anonymous unions are unimplemented
- --> $DIR/restrict_anonymous.rs:37:10
- |
-LL | type N = union { field: u8 };
- | ^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:44:13
- |
-LL | let p: [struct { field: u8 }; 1];
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:47:13
- |
-LL | let q: (struct { field: u8 }, u8);
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:50:20
- |
-LL | let cl = || -> struct { field: u8 } {};
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: anonymous structs are unimplemented
- --> $DIR/restrict_anonymous.rs:41:14
- |
-LL | const O: struct { field: u8 } = 0;
- | ^^^^^^^^^^^^^^^^^^^^
-
-error[E0740]: unions may not contain fields that need dropping
- --> $DIR/restrict_anonymous.rs:11:5
- |
-LL | field: struct { field: u8 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: `std::mem::ManuallyDrop` can be used to wrap the type
- --> $DIR/restrict_anonymous.rs:11:5
- |
-LL | field: struct { field: u8 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 27 previous errors
-
-For more information about this error, try `rustc --explain E0740`.
diff --git a/src/test/ui/unop-move-semantics.stderr b/src/test/ui/unop-move-semantics.stderr
index c20d3dd..95a0f4f 100644
--- a/src/test/ui/unop-move-semantics.stderr
+++ b/src/test/ui/unop-move-semantics.stderr
@@ -17,7 +17,7 @@
help: consider further restricting this bound
|
LL | fn move_then_borrow<T: Not<Output=T> + Clone + Copy>(x: T) {
- | ^^^^^^
+ | ++++++
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/unop-move-semantics.rs:15:6
diff --git a/src/test/ui/unsafe/inline_asm.mir.stderr b/src/test/ui/unsafe/inline_asm.mir.stderr
index daacd23..5d9828b 100644
--- a/src/test/ui/unsafe/inline_asm.mir.stderr
+++ b/src/test/ui/unsafe/inline_asm.mir.stderr
@@ -1,5 +1,5 @@
error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
- --> $DIR/inline_asm.rs:8:5
+ --> $DIR/inline_asm.rs:10:5
|
LL | asm!("nop");
| ^^^^^^^^^^^^ use of inline assembly
@@ -7,7 +7,7 @@
= note: inline assembly is entirely unchecked and can cause undefined behavior
error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
- --> $DIR/inline_asm.rs:9:5
+ --> $DIR/inline_asm.rs:11:5
|
LL | llvm_asm!("nop");
| ^^^^^^^^^^^^^^^^^ use of inline assembly
diff --git a/src/test/ui/unsafe/inline_asm.rs b/src/test/ui/unsafe/inline_asm.rs
index d002d0e..8e1325b 100644
--- a/src/test/ui/unsafe/inline_asm.rs
+++ b/src/test/ui/unsafe/inline_asm.rs
@@ -1,8 +1,10 @@
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
+// needs-asm-support
#![feature(llvm_asm)]
#![feature(asm)]
+#![allow(deprecated)] // llvm_asm!
fn main() {
asm!("nop"); //~ ERROR use of inline assembly is unsafe and requires unsafe function or block
diff --git a/src/test/ui/unsafe/inline_asm.thir.stderr b/src/test/ui/unsafe/inline_asm.thir.stderr
index daacd23..5d9828b 100644
--- a/src/test/ui/unsafe/inline_asm.thir.stderr
+++ b/src/test/ui/unsafe/inline_asm.thir.stderr
@@ -1,5 +1,5 @@
error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
- --> $DIR/inline_asm.rs:8:5
+ --> $DIR/inline_asm.rs:10:5
|
LL | asm!("nop");
| ^^^^^^^^^^^^ use of inline assembly
@@ -7,7 +7,7 @@
= note: inline assembly is entirely unchecked and can cause undefined behavior
error[E0133]: use of inline assembly is unsafe and requires unsafe function or block
- --> $DIR/inline_asm.rs:9:5
+ --> $DIR/inline_asm.rs:11:5
|
LL | llvm_asm!("nop");
| ^^^^^^^^^^^^^^^^^ use of inline assembly
diff --git a/src/test/ui/unsafe/issue-87414-query-cycle.rs b/src/test/ui/unsafe/issue-87414-query-cycle.rs
new file mode 100644
index 0000000..99e40ba
--- /dev/null
+++ b/src/test/ui/unsafe/issue-87414-query-cycle.rs
@@ -0,0 +1,15 @@
+// Regression test for #87414.
+
+// check-pass
+// compile-flags: -Zthir-unsafeck
+
+fn bad<T>() -> Box<dyn Iterator<Item = [(); { |x: u32| { x }; 4 }]>> { todo!() }
+
+fn foo() -> [(); { |x: u32| { x }; 4 }] { todo!() }
+fn bar() { let _: [(); { |x: u32| { x }; 4 }]; }
+
+// This one should not cause any errors either:
+unsafe fn unsf() {}
+fn bad2<T>() -> Box<dyn Iterator<Item = [(); { unsafe { || { unsf() } }; 4 }]>> { todo!() }
+
+fn main() {}
diff --git a/src/test/ui/unsafe/union-assignop.mirunsafeck.stderr b/src/test/ui/unsafe/union-assignop.mirunsafeck.stderr
new file mode 100644
index 0000000..cd338ac
--- /dev/null
+++ b/src/test/ui/unsafe/union-assignop.mirunsafeck.stderr
@@ -0,0 +1,59 @@
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:20:5
+ |
+LL | foo.a += 5;
+ | ^^^^^^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:21:5
+ |
+LL | foo.b += Dropping;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:22:5
+ |
+LL | foo.b = Dropping;
+ | ^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
+ |
+ = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:23:5
+ |
+LL | foo.a;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:25:5
+ |
+LL | foo.b;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:27:13
+ |
+LL | foo.b = foo.b;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:27:5
+ |
+LL | foo.b = foo.b;
+ | ^^^^^^^^^^^^^ assignment to union field that might need dropping
+ |
+ = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/unsafe/union-assignop.rs b/src/test/ui/unsafe/union-assignop.rs
new file mode 100644
index 0000000..c4be20a
--- /dev/null
+++ b/src/test/ui/unsafe/union-assignop.rs
@@ -0,0 +1,30 @@
+// revisions: mirunsafeck thirunsafeck
+// [thirunsafeck]compile-flags: -Z thir-unsafeck
+
+#![feature(untagged_unions)]
+
+use std::ops::AddAssign;
+
+struct Dropping;
+impl AddAssign for Dropping {
+ fn add_assign(&mut self, _: Self) {}
+}
+
+union Foo {
+ a: u8, // non-dropping
+ b: Dropping, // treated as dropping
+}
+
+fn main() {
+ let mut foo = Foo { a: 42 };
+ foo.a += 5; //~ ERROR access to union field is unsafe
+ foo.b += Dropping; //~ ERROR access to union field is unsafe
+ foo.b = Dropping; //~ ERROR assignment to union field that might need dropping is unsafe
+ foo.a; //~ ERROR access to union field is unsafe
+ let foo = Foo { a: 42 };
+ foo.b; //~ ERROR access to union field is unsafe
+ let mut foo = Foo { a: 42 };
+ foo.b = foo.b;
+ //~^ ERROR access to union field is unsafe
+ //~| ERROR assignment to union field that might need dropping
+}
diff --git a/src/test/ui/unsafe/union-assignop.thirunsafeck.stderr b/src/test/ui/unsafe/union-assignop.thirunsafeck.stderr
new file mode 100644
index 0000000..71de421
--- /dev/null
+++ b/src/test/ui/unsafe/union-assignop.thirunsafeck.stderr
@@ -0,0 +1,59 @@
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:20:5
+ |
+LL | foo.a += 5;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:21:5
+ |
+LL | foo.b += Dropping;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:22:5
+ |
+LL | foo.b = Dropping;
+ | ^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
+ |
+ = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:23:5
+ |
+LL | foo.a;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:25:5
+ |
+LL | foo.b;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:27:5
+ |
+LL | foo.b = foo.b;
+ | ^^^^^^^^^^^^^ assignment to union field that might need dropping
+ |
+ = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
+
+error[E0133]: access to union field is unsafe and requires unsafe function or block
+ --> $DIR/union-assignop.rs:27:13
+ |
+LL | foo.b = foo.b;
+ | ^^^^^ access to union field
+ |
+ = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.mir.stderr b/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.mir.stderr
index 29bd84c..62199e5 100644
--- a/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.mir.stderr
+++ b/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.mir.stderr
@@ -10,5 +10,11 @@
LL | #![deny(unused_unsafe)]
| ^^^^^^^^^^^^^
-error: aborting due to previous error
+error: unnecessary `unsafe` block
+ --> $DIR/unsafe-around-compiler-generated-unsafe.rs:13:5
+ |
+LL | unsafe { println!("foo"); }
+ | ^^^^^^ unnecessary `unsafe` block
+
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs b/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs
index e9c7efb..c1a3276 100644
--- a/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs
+++ b/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs
@@ -8,4 +8,7 @@
let _ = async {
unsafe { async {}.await; } //~ ERROR unnecessary `unsafe`
};
+
+ // `format_args!` expands with a compiler-generated unsafe block
+ unsafe { println!("foo"); } //~ ERROR unnecessary `unsafe`
}
diff --git a/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.thir.stderr b/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.thir.stderr
index 29bd84c..62199e5 100644
--- a/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.thir.stderr
+++ b/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.thir.stderr
@@ -10,5 +10,11 @@
LL | #![deny(unused_unsafe)]
| ^^^^^^^^^^^^^
-error: aborting due to previous error
+error: unnecessary `unsafe` block
+ --> $DIR/unsafe-around-compiler-generated-unsafe.rs:13:5
+ |
+LL | unsafe { println!("foo"); }
+ | ^^^^^^ unnecessary `unsafe` block
+
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/unsized/issue-75707.stderr b/src/test/ui/unsized/issue-75707.stderr
index 6e557a2..7d0a2cb 100644
--- a/src/test/ui/unsized/issue-75707.stderr
+++ b/src/test/ui/unsized/issue-75707.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `MyCall: Callback` is not satisfied
--> $DIR/issue-75707.rs:15:5
|
-LL | fn f<P: Processing + ?Sized>() {
- | ---------- required by this bound in `f`
-...
LL | f::<dyn Processing<Call = MyCall>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
+ |
+note: required by a bound in `f`
+ --> $DIR/issue-75707.rs:9:9
+ |
+LL | fn f<P: Processing + ?Sized>() {
+ | ^^^^^^^^^^ required by this bound in `f`
error: aborting due to previous error
diff --git a/src/test/ui/unsized/param-mentioned-by-different-field.rs b/src/test/ui/unsized/param-mentioned-by-different-field.rs
new file mode 100644
index 0000000..cda94b3
--- /dev/null
+++ b/src/test/ui/unsized/param-mentioned-by-different-field.rs
@@ -0,0 +1,10 @@
+// We must not allow this with our current setup as `T`
+// is mentioned both in the tail of `Foo` and by another
+// field.
+struct Foo<T: ?Sized>(Box<T>, T);
+
+fn main() {
+ let x: Foo<[u8; 1]> = Foo(Box::new([2]), [3]);
+ let y: &Foo<[u8]> = &x; //~ ERROR mismatched types
+ assert_eq!(y.0.len(), 1);
+}
diff --git a/src/test/ui/unsized/param-mentioned-by-different-field.stderr b/src/test/ui/unsized/param-mentioned-by-different-field.stderr
new file mode 100644
index 0000000..d18fa64
--- /dev/null
+++ b/src/test/ui/unsized/param-mentioned-by-different-field.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/param-mentioned-by-different-field.rs:8:25
+ |
+LL | let y: &Foo<[u8]> = &x;
+ | ---------- ^^ expected slice `[u8]`, found array `[u8; 1]`
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&Foo<[u8]>`
+ found reference `&Foo<[u8; 1]>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/unsized/unsized-bare-typaram.stderr b/src/test/ui/unsized/unsized-bare-typaram.stderr
index 19978ae..531e9b4 100644
--- a/src/test/ui/unsized/unsized-bare-typaram.stderr
+++ b/src/test/ui/unsized/unsized-bare-typaram.stderr
@@ -1,12 +1,21 @@
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/unsized-bare-typaram.rs:2:29
|
-LL | fn bar<T: Sized>() { }
- | - required by this bound in `bar`
LL | fn foo<T: ?Sized>() { bar::<T>() }
| - ^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
+ |
+note: required by a bound in `bar`
+ --> $DIR/unsized-bare-typaram.rs:1:8
+ |
+LL | fn bar<T: Sized>() { }
+ | ^ required by this bound in `bar`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn foo<T: ?Sized>() { bar::<T>() }
+LL + fn foo<T>() { bar::<T>() }
+ |
error: aborting due to previous error
diff --git a/src/test/ui/unsized/unsized-enum.stderr b/src/test/ui/unsized/unsized-enum.stderr
index 601db7d..980dee8 100644
--- a/src/test/ui/unsized/unsized-enum.stderr
+++ b/src/test/ui/unsized/unsized-enum.stderr
@@ -1,14 +1,16 @@
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/unsized-enum.rs:6:36
|
-LL | enum Foo<U> { FooSome(U), FooNone }
- | - required by this bound in `Foo`
-LL | fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
+note: required by a bound in `Foo`
+ --> $DIR/unsized-enum.rs:4:10
+ |
+LL | enum Foo<U> { FooSome(U), FooNone }
+ | ^ required by this bound in `Foo`
help: you could relax the implicit `Sized` bound on `U` if it were used through indirection like `&U` or `Box<U>`
--> $DIR/unsized-enum.rs:4:10
|
@@ -16,6 +18,11 @@
| ^ - ...if indirection were used here: `Box<U>`
| |
| this could be changed to `U: ?Sized`...
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
+LL + fn foo2<T>() { not_sized::<Foo<T>>() }
+ |
error: aborting due to previous error
diff --git a/src/test/ui/unsized/unsized-enum2.stderr b/src/test/ui/unsized/unsized-enum2.stderr
index 1b6c858..3985f73f 100644
--- a/src/test/ui/unsized/unsized-enum2.stderr
+++ b/src/test/ui/unsized/unsized-enum2.stderr
@@ -9,14 +9,19 @@
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+ |
help: borrowed types always have a statically known size
|
LL | VA(&W),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VA(Box<W>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:25:11
@@ -29,14 +34,19 @@
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W: ?Sized, X, Y: ?Sized, Z: ?Sized> {
+ |
help: borrowed types always have a statically known size
|
LL | VB{x: &X},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VB{x: Box<X>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `Y` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:27:15
@@ -49,14 +59,19 @@
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W: ?Sized, X: ?Sized, Y, Z: ?Sized> {
+ |
help: borrowed types always have a statically known size
|
LL | VC(isize, &Y),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VC(isize, Box<Y>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `Z` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:29:21
@@ -69,14 +84,19 @@
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z> {
+ |
help: borrowed types always have a statically known size
|
LL | VD{u: isize, x: &Z},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VD{u: isize, x: Box<Z>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:33:8
@@ -90,11 +110,11 @@
help: borrowed types always have a statically known size
|
LL | VE(&[u8]),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VE(Box<[u8]>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:35:11
@@ -108,11 +128,11 @@
help: borrowed types always have a statically known size
|
LL | VF{x: &str},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VF{x: Box<str>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[f32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:37:15
@@ -126,11 +146,11 @@
help: borrowed types always have a statically known size
|
LL | VG(isize, &[f32]),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VG(isize, Box<[f32]>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:39:21
@@ -144,11 +164,11 @@
help: borrowed types always have a statically known size
|
LL | VH{u: isize, x: &[u32]},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VH{u: isize, x: Box<[u32]>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:53:8
@@ -162,11 +182,11 @@
help: borrowed types always have a statically known size
|
LL | VM(&dyn Foo),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VM(Box<dyn Foo>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Bar + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:55:11
@@ -180,11 +200,11 @@
help: borrowed types always have a statically known size
|
LL | VN{x: &dyn Bar},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VN{x: Box<dyn Bar>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn FooBar + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:57:15
@@ -198,11 +218,11 @@
help: borrowed types always have a statically known size
|
LL | VO(isize, &dyn FooBar),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VO(isize, Box<dyn FooBar>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn BarFoo + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:59:21
@@ -216,11 +236,11 @@
help: borrowed types always have a statically known size
|
LL | VP{u: isize, x: &dyn BarFoo},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VP{u: isize, x: Box<dyn BarFoo>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:63:8
@@ -234,11 +254,11 @@
help: borrowed types always have a statically known size
|
LL | VQ(&<&'static [i8] as Deref>::Target),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VQ(Box<<&'static [i8] as Deref>::Target>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[char]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:65:11
@@ -252,11 +272,11 @@
help: borrowed types always have a statically known size
|
LL | VR{x: &<&'static [char] as Deref>::Target},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VR{x: Box<<&'static [char] as Deref>::Target>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[f64]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:67:15
@@ -270,11 +290,11 @@
help: borrowed types always have a statically known size
|
LL | VS(isize, &<&'static [f64] as Deref>::Target),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VS(isize, Box<<&'static [f64] as Deref>::Target>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:69:21
@@ -288,11 +308,11 @@
help: borrowed types always have a statically known size
|
LL | VT{u: isize, x: &<&'static [i32] as Deref>::Target},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:43:8
@@ -311,11 +331,11 @@
help: borrowed types always have a statically known size
|
LL | VI(&Path1),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VI(Box<Path1>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:45:11
@@ -334,11 +354,11 @@
help: borrowed types always have a statically known size
|
LL | VJ{x: &Path2},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VJ{x: Box<Path2>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:47:15
@@ -357,11 +377,11 @@
help: borrowed types always have a statically known size
|
LL | VK(isize, &Path3),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VK(isize, Box<Path3>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:49:21
@@ -380,11 +400,11 @@
help: borrowed types always have a statically known size
|
LL | VL{u: isize, x: &Path4},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VL{u: isize, x: Box<Path4>},
- | ^^^^ ^
+ | ++++ +
error: aborting due to 20 previous errors
diff --git a/src/test/ui/unsized/unsized-fn-arg.fixed b/src/test/ui/unsized/unsized-fn-arg.fixed
index 2c686c6..fd9b159 100644
--- a/src/test/ui/unsized/unsized-fn-arg.fixed
+++ b/src/test/ui/unsized/unsized-fn-arg.fixed
@@ -2,5 +2,5 @@
#![crate_type="lib"]
#![allow(unused)]
-fn f<T: ?Sized>(t: &T) {}
+fn f<T>(t: &T) {}
//~^ ERROR the size for values of type `T` cannot be known at compilation time
diff --git a/src/test/ui/unsized/unsized-fn-arg.stderr b/src/test/ui/unsized/unsized-fn-arg.stderr
index 6b802dd..d81dd7f 100644
--- a/src/test/ui/unsized/unsized-fn-arg.stderr
+++ b/src/test/ui/unsized/unsized-fn-arg.stderr
@@ -7,10 +7,15 @@
| this type parameter needs to be `std::marker::Sized`
|
= help: unsized fn params are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f<T: ?Sized>(t: T) {}
+LL + fn f<T>(t: T) {}
+ |
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f<T: ?Sized>(t: &T) {}
- | ^
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr b/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr
index 9d072ed..1a3c7d7 100644
--- a/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr
+++ b/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr
@@ -1,14 +1,16 @@
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-inherent-impl-self-type.rs:7:17
|
-LL | struct S5<Y>(Y);
- | - required by this bound in `S5`
-LL |
LL | impl<X: ?Sized> S5<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
+note: required by a bound in `S5`
+ --> $DIR/unsized-inherent-impl-self-type.rs:5:11
+ |
+LL | struct S5<Y>(Y);
+ | ^ required by this bound in `S5`
help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box<Y>`
--> $DIR/unsized-inherent-impl-self-type.rs:5:11
|
@@ -16,6 +18,11 @@
| ^ - ...if indirection were used here: `Box<Y>`
| |
| this could be changed to `Y: ?Sized`...
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X: ?Sized> S5<X> {
+LL + impl<X> S5<X> {
+ |
error: aborting due to previous error
diff --git a/src/test/ui/unsized/unsized-struct.stderr b/src/test/ui/unsized/unsized-struct.stderr
index e38375b..1c70a84 100644
--- a/src/test/ui/unsized/unsized-struct.stderr
+++ b/src/test/ui/unsized/unsized-struct.stderr
@@ -1,14 +1,16 @@
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/unsized-struct.rs:6:36
|
-LL | struct Foo<T> { data: T }
- | - required by this bound in `Foo`
-LL | fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
| - ^^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
+note: required by a bound in `Foo`
+ --> $DIR/unsized-struct.rs:4:12
+ |
+LL | struct Foo<T> { data: T }
+ | ^ required by this bound in `Foo`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/unsized-struct.rs:4:12
|
@@ -16,13 +18,15 @@
| ^ - ...if indirection were used here: `Box<T>`
| |
| this could be changed to `T: ?Sized`...
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
+LL + fn foo2<T>() { not_sized::<Foo<T>>() }
+ |
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/unsized-struct.rs:13:24
|
-LL | fn is_sized<T:Sized>() { }
- | - required by this bound in `is_sized`
-...
LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
| - ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
| |
@@ -33,6 +37,16 @@
|
LL | struct Bar<T: ?Sized> { data: T }
| ^^^
+note: required by a bound in `is_sized`
+ --> $DIR/unsized-struct.rs:1:13
+ |
+LL | fn is_sized<T:Sized>() { }
+ | ^ required by this bound in `is_sized`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
+LL + fn bar2<T>() { is_sized::<Bar<T>>() }
+ |
error: aborting due to 2 previous errors
diff --git a/src/test/ui/unsized/unsized-trait-impl-self-type.stderr b/src/test/ui/unsized/unsized-trait-impl-self-type.stderr
index aef0d0c..da251d4 100644
--- a/src/test/ui/unsized/unsized-trait-impl-self-type.stderr
+++ b/src/test/ui/unsized/unsized-trait-impl-self-type.stderr
@@ -1,14 +1,16 @@
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-trait-impl-self-type.rs:10:27
|
-LL | struct S5<Y>(Y);
- | - required by this bound in `S5`
-LL |
LL | impl<X: ?Sized> T3<X> for S5<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
+note: required by a bound in `S5`
+ --> $DIR/unsized-trait-impl-self-type.rs:8:11
+ |
+LL | struct S5<Y>(Y);
+ | ^ required by this bound in `S5`
help: you could relax the implicit `Sized` bound on `Y` if it were used through indirection like `&Y` or `Box<Y>`
--> $DIR/unsized-trait-impl-self-type.rs:8:11
|
@@ -16,6 +18,11 @@
| ^ - ...if indirection were used here: `Box<Y>`
| |
| this could be changed to `Y: ?Sized`...
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X: ?Sized> T3<X> for S5<X> {
+LL + impl<X> T3<X> for S5<X> {
+ |
error: aborting due to previous error
diff --git a/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr b/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr
index f48d4ef..e914190 100644
--- a/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr
+++ b/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr
@@ -1,18 +1,25 @@
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-trait-impl-trait-arg.rs:8:17
|
-LL | trait T2<Z> {
- | - required by this bound in `T2`
-...
LL | impl<X: ?Sized> T2<X> for S4<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
+note: required by a bound in `T2`
+ --> $DIR/unsized-trait-impl-trait-arg.rs:4:10
+ |
+LL | trait T2<Z> {
+ | ^ required by this bound in `T2`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X: ?Sized> T2<X> for S4<X> {
+LL + impl<X> T2<X> for S4<X> {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait T2<Z: ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
diff --git a/src/test/ui/unsized/unsized3.stderr b/src/test/ui/unsized/unsized3.stderr
index bd36008..f7bb6c9 100644
--- a/src/test/ui/unsized/unsized3.stderr
+++ b/src/test/ui/unsized/unsized3.stderr
@@ -5,14 +5,21 @@
| - this type parameter needs to be `std::marker::Sized`
LL | f2::<X>(x);
| ^ doesn't have a size known at compile-time
-...
-LL | fn f2<X>(x: &X) {
- | - required by this bound in `f2`
|
+note: required by a bound in `f2`
+ --> $DIR/unsized3.rs:10:7
+ |
+LL | fn f2<X>(x: &X) {
+ | ^ required by this bound in `f2`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f1<X: ?Sized>(x: &X) {
+LL + fn f1<X>(x: &X) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f2<X: ?Sized>(x: &X) {
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:18:13
@@ -21,21 +28,25 @@
| - this type parameter needs to be `std::marker::Sized`
LL | f4::<X>(x);
| ^ doesn't have a size known at compile-time
-...
-LL | fn f4<X: T>(x: &X) {
- | - required by this bound in `f4`
|
+note: required by a bound in `f4`
+ --> $DIR/unsized3.rs:21:7
+ |
+LL | fn f4<X: T>(x: &X) {
+ | ^ required by this bound in `f4`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f3<X: ?Sized + T>(x: &X) {
+LL + fn f3<X: T>(x: &X) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f4<X: T + ?Sized>(x: &X) {
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:33:8
|
-LL | fn f5<Y>(x: &Y) {}
- | - required by this bound in `f5`
-...
LL | fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
| - this type parameter needs to be `std::marker::Sized`
LL | f5(x1);
@@ -46,10 +57,20 @@
|
LL | struct S<X: ?Sized> {
| ^
+note: required by a bound in `f5`
+ --> $DIR/unsized3.rs:24:7
+ |
+LL | fn f5<Y>(x: &Y) {}
+ | ^ required by this bound in `f5`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
+LL + fn f8<X>(x1: &S<X>, x2: &S<X>) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f5<Y: ?Sized>(x: &Y) {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:40:8
@@ -65,6 +86,11 @@
LL | struct S<X: ?Sized> {
| ^
= note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f9<X: ?Sized>(x1: Box<S<X>>) {
+LL + fn f9<X>(x1: Box<S<X>>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:45:9
@@ -81,13 +107,15 @@
| ^
= note: required because it appears within the type `({integer}, S<X>)`
= note: tuples must have a statically known size to be initialized
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
+LL + fn f10<X>(x1: Box<S<X>>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:45:8
|
-LL | fn f5<Y>(x: &Y) {}
- | - required by this bound in `f5`
-...
LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `std::marker::Sized`
LL | f5(&(32, *x1));
@@ -99,10 +127,20 @@
LL | struct S<X: ?Sized> {
| ^
= note: required because it appears within the type `({integer}, S<X>)`
+note: required by a bound in `f5`
+ --> $DIR/unsized3.rs:24:7
+ |
+LL | fn f5<Y>(x: &Y) {}
+ | ^ required by this bound in `f5`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
+LL + fn f10<X>(x1: Box<S<X>>) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f5<Y: ?Sized>(x: &Y) {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/unsized/unsized5.stderr b/src/test/ui/unsized/unsized5.stderr
index 0bfd456..43463ff 100644
--- a/src/test/ui/unsized/unsized5.stderr
+++ b/src/test/ui/unsized/unsized5.stderr
@@ -8,14 +8,19 @@
|
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - struct S1<X: ?Sized> {
+LL + struct S1<X> {
+ |
help: borrowed types always have a statically known size
|
LL | f1: &X,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | f1: Box<X>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized5.rs:10:8
@@ -28,14 +33,19 @@
|
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - struct S2<X: ?Sized> {
+LL + struct S2<X> {
+ |
help: borrowed types always have a statically known size
|
LL | g: &X,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | g: Box<X>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized5.rs:15:8
@@ -49,11 +59,11 @@
help: borrowed types always have a statically known size
|
LL | f: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | f: Box<str>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/unsized5.rs:20:8
@@ -67,11 +77,11 @@
help: borrowed types always have a statically known size
|
LL | f: &[u8],
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | f: Box<[u8]>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized5.rs:25:8
@@ -83,14 +93,19 @@
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - enum E<X: ?Sized> {
+LL + enum E<X> {
+ |
help: borrowed types always have a statically known size
|
LL | V1(&X, isize),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | V1(Box<X>, isize),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized5.rs:29:12
@@ -102,14 +117,19 @@
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - enum F<X: ?Sized> {
+LL + enum F<X> {
+ |
help: borrowed types always have a statically known size
|
LL | V2{f1: &X, f: isize},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | V2{f1: Box<X>, f: isize},
- | ^^^^ ^
+ | ++++ +
error: aborting due to 6 previous errors
diff --git a/src/test/ui/unsized/unsized6.stderr b/src/test/ui/unsized/unsized6.stderr
index 8e5734d..38ed50d 100644
--- a/src/test/ui/unsized/unsized6.stderr
+++ b/src/test/ui/unsized/unsized6.stderr
@@ -9,6 +9,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
+LL + fn f1<W: ?Sized, X: ?Sized, Y, Z: ?Sized>(x: &X) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:7:12
@@ -20,6 +25,11 @@
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
+LL + fn f1<W: ?Sized, X, Y: ?Sized, Z: ?Sized>(x: &X) {
+ |
error[E0277]: the size for values of type `Z` cannot be known at compilation time
--> $DIR/unsized6.rs:11:12
@@ -31,6 +41,11 @@
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
+LL + fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z>(x: &X) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:15:9
@@ -42,6 +57,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
+LL + fn f2<X, Y: ?Sized>(x: &X) {
+ |
error[E0277]: the size for values of type `Y` cannot be known at compilation time
--> $DIR/unsized6.rs:17:12
@@ -53,6 +73,11 @@
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= note: only the last element of a tuple may have a dynamically sized type
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
+LL + fn f2<X: ?Sized, Y>(x: &X) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:22:9
@@ -64,6 +89,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:24:9
@@ -76,6 +106,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:26:10
@@ -88,6 +123,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:30:9
@@ -99,6 +139,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:32:9
@@ -111,6 +156,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:34:10
@@ -123,6 +173,11 @@
|
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:38:18
@@ -133,10 +188,15 @@
| this type parameter needs to be `std::marker::Sized`
|
= help: unsized fn params are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn g1<X: ?Sized>(x: X) {}
+LL + fn g1<X>(x: X) {}
+ |
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn g1<X: ?Sized>(x: &X) {}
- | ^
+ | +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:40:22
@@ -147,10 +207,15 @@
| this type parameter needs to be `std::marker::Sized`
|
= help: unsized fn params are gated as an unstable feature
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - fn g2<X: ?Sized + T>(x: X) {}
+LL + fn g2<X: T>(x: X) {}
+ |
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn g2<X: ?Sized + T>(x: &X) {}
- | ^
+ | +
error: aborting due to 13 previous errors
diff --git a/src/test/ui/unsized/unsized7.stderr b/src/test/ui/unsized/unsized7.stderr
index 7dbddd4..3246e26 100644
--- a/src/test/ui/unsized/unsized7.stderr
+++ b/src/test/ui/unsized/unsized7.stderr
@@ -1,18 +1,25 @@
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized7.rs:12:21
|
-LL | trait T1<Z: T> {
- | - required by this bound in `T1`
-...
LL | impl<X: ?Sized + T> T1<X> for S3<X> {
| - ^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
+note: required by a bound in `T1`
+ --> $DIR/unsized7.rs:7:10
+ |
+LL | trait T1<Z: T> {
+ | ^ required by this bound in `T1`
+help: consider removing the `?Sized` bound to make the type parameter `Sized`
+ |
+LL - impl<X: ?Sized + T> T1<X> for S3<X> {
+LL + impl<X: T> T1<X> for S3<X> {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait T1<Z: T + ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
diff --git a/src/test/ui/unused/unused-attr-macro-rules.rs b/src/test/ui/unused/unused-attr-macro-rules.rs
deleted file mode 100644
index 396137a..0000000
--- a/src/test/ui/unused/unused-attr-macro-rules.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-#![deny(unused_attributes)]
-// Unused attributes on macro_rules requires special handling since the
-// macro_rules definition does not survive towards HIR.
-
-// A sample of various built-in attributes.
-#[macro_export]
-#[macro_use] //~ ERROR unused attribute
-#[path="foo"] //~ ERROR unused attribute
-#[recursion_limit="1"] //~ ERROR unused attribute
- //~| ERROR crate-level attribute should be an inner attribute
-macro_rules! foo {
- () => {};
-}
-
-// The following should not warn about unused attributes.
-#[allow(unused)]
-macro_rules! foo2 {
- () => {};
-}
-
-#[cfg(FALSE)]
-macro_rules! foo {
- () => {};
-}
-
-/// Some docs
-#[deprecated]
-#[doc = "more docs"]
-#[macro_export]
-macro_rules! bar {
- () => {};
-}
-
-fn main() {}
diff --git a/src/test/ui/unused/unused-attr-macro-rules.stderr b/src/test/ui/unused/unused-attr-macro-rules.stderr
deleted file mode 100644
index 4606be0..0000000
--- a/src/test/ui/unused/unused-attr-macro-rules.stderr
+++ /dev/null
@@ -1,32 +0,0 @@
-error: unused attribute
- --> $DIR/unused-attr-macro-rules.rs:7:1
- |
-LL | #[macro_use]
- | ^^^^^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/unused-attr-macro-rules.rs:1:9
- |
-LL | #![deny(unused_attributes)]
- | ^^^^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr-macro-rules.rs:8:1
- |
-LL | #[path="foo"]
- | ^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr-macro-rules.rs:9:1
- |
-LL | #[recursion_limit="1"]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/unused-attr-macro-rules.rs:9:1
- |
-LL | #[recursion_limit="1"]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
-
diff --git a/src/test/ui/unused/unused-attr.rs b/src/test/ui/unused/unused-attr.rs
deleted file mode 100644
index cb8ac0e..0000000
--- a/src/test/ui/unused/unused-attr.rs
+++ /dev/null
@@ -1,49 +0,0 @@
-#![deny(unused_attributes)]
-#![feature(rustc_attrs)]
-
-#![rustc_dummy] //~ ERROR unused attribute
-
-#[rustc_dummy] //~ ERROR unused attribute
-extern crate core;
-
-#[rustc_dummy] //~ ERROR unused attribute
-use std::collections;
-
-#[rustc_dummy] //~ ERROR unused attribute
-extern "C" {
- #[rustc_dummy] //~ ERROR unused attribute
- fn foo();
-}
-
-#[rustc_dummy] //~ ERROR unused attribute
-mod foo {
- #[rustc_dummy] //~ ERROR unused attribute
- pub enum Foo {
- #[rustc_dummy] //~ ERROR unused attribute
- Bar,
- }
-}
-
-#[rustc_dummy] //~ ERROR unused attribute
-fn bar(f: foo::Foo) {
- match f {
- #[rustc_dummy] //~ ERROR unused attribute
- foo::Foo::Bar => {}
- }
-}
-
-#[rustc_dummy] //~ ERROR unused attribute
-struct Foo {
- #[rustc_dummy] //~ ERROR unused attribute
- a: isize
-}
-
-#[rustc_dummy] //~ ERROR unused attribute
-trait Baz {
- #[rustc_dummy] //~ ERROR unused attribute
- fn blah(&self);
- #[rustc_dummy] //~ ERROR unused attribute
- fn blah2(&self) {}
-}
-
-fn main() {}
diff --git a/src/test/ui/unused/unused-attr.stderr b/src/test/ui/unused/unused-attr.stderr
deleted file mode 100644
index 707521b..0000000
--- a/src/test/ui/unused/unused-attr.stderr
+++ /dev/null
@@ -1,98 +0,0 @@
-error: unused attribute
- --> $DIR/unused-attr.rs:4:1
- |
-LL | #![rustc_dummy]
- | ^^^^^^^^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/unused-attr.rs:1:9
- |
-LL | #![deny(unused_attributes)]
- | ^^^^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:6:1
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:9:1
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:12:1
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:14:5
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:18:1
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:20:5
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:22:9
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:27:1
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:30:9
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:35:1
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:37:5
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:41:1
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:43:5
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: unused attribute
- --> $DIR/unused-attr.rs:45:5
- |
-LL | #[rustc_dummy]
- | ^^^^^^^^^^^^^^
-
-error: aborting due to 15 previous errors
-
diff --git a/src/test/ui/unused/unused-doc-comments-edge-cases.stderr b/src/test/ui/unused/unused-doc-comments-edge-cases.stderr
deleted file mode 100644
index 14db5f6..0000000
--- a/src/test/ui/unused/unused-doc-comments-edge-cases.stderr
+++ /dev/null
@@ -1,61 +0,0 @@
-error: expected expression, found keyword `else`
- --> $DIR/unused-doc-comments-edge-cases.rs:17:5
- |
-LL | else {
- | ^^^^ expected expression
-
-error[E0658]: attributes on expressions are experimental
- --> $DIR/unused-doc-comments-edge-cases.rs:23:5
- |
-LL | /// useless doc comment
- | ^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
- = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
- = help: `///` is for documentation comments. For a plain comment, use `//`.
-
-error: unused doc comment
- --> $DIR/unused-doc-comments-edge-cases.rs:6:9
- |
-LL | /// useless doc comment
- | ^^^^^^^^^^^^^^^^^^^^^^^
-LL |
-LL | _ => false,
- | ---------- rustdoc does not generate documentation for match arms
- |
-note: the lint level is defined here
- --> $DIR/unused-doc-comments-edge-cases.rs:1:9
- |
-LL | #![deny(unused_doc_comments)]
- | ^^^^^^^^^^^^^^^^^^^
- = help: use `//` for a plain comment
-
-error: unused doc comment
- --> $DIR/unused-doc-comments-edge-cases.rs:23:5
- |
-LL | /// useless doc comment
- | ^^^^^^^^^^^^^^^^^^^^^^^
-...
-LL | num == 3
- | --- rustdoc does not generate documentation for expressions
- |
- = help: use `//` for a plain comment
-
-error[E0308]: mismatched types
- --> $DIR/unused-doc-comments-edge-cases.rs:14:9
- |
-LL | / if num == 3 {
-LL | | true
- | | ^^^^ expected `()`, found `bool`
-LL | | }
- | |_____- expected this to be `()`
- |
-help: you might have meant to return this value
- |
-LL | return true;
- | ^^^^^^ ^
-
-error: aborting due to 5 previous errors
-
-Some errors have detailed explanations: E0308, E0658.
-For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/use/use-mod/use-mod-4.stderr b/src/test/ui/use/use-mod/use-mod-4.stderr
index a29bd07..5bb04b2 100644
--- a/src/test/ui/use/use-mod/use-mod-4.stderr
+++ b/src/test/ui/use/use-mod/use-mod-4.stderr
@@ -6,12 +6,13 @@
|
help: consider importing the module directly
|
-LL | use foo;
- | --
+LL - use foo::self;
+LL + use foo;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::{self};
- | ^ ^
+ | + +
error[E0429]: `self` imports are only allowed within a { } list
--> $DIR/use-mod-4.rs:4:13
@@ -21,12 +22,13 @@
|
help: consider importing the module directly
|
-LL | use std::mem;
- | --
+LL - use std::mem::self;
+LL + use std::mem;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use std::mem::{self};
- | ^ ^
+ | + +
error[E0432]: unresolved import `foo`
--> $DIR/use-mod-4.rs:1:5
diff --git a/src/test/ui/use/use-mod/use-mod-5.stderr b/src/test/ui/use/use-mod/use-mod-5.stderr
index ebb71c5..627cf73 100644
--- a/src/test/ui/use/use-mod/use-mod-5.stderr
+++ b/src/test/ui/use/use-mod/use-mod-5.stderr
@@ -6,12 +6,13 @@
|
help: consider importing the module directly
|
-LL | use foo::bar;
- | --
+LL - use foo::bar::self;
+LL + use foo::bar;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::bar::{self};
- | ^ ^
+ | + +
error: aborting due to previous error
diff --git a/src/test/ui/use/use-mod/use-mod-6.stderr b/src/test/ui/use/use-mod/use-mod-6.stderr
index 36fdf9c..7be6e75 100644
--- a/src/test/ui/use/use-mod/use-mod-6.stderr
+++ b/src/test/ui/use/use-mod/use-mod-6.stderr
@@ -6,12 +6,13 @@
|
help: consider importing the module directly
|
-LL | use foo::bar as abc;
- | --
+LL - use foo::bar::self as abc;
+LL + use foo::bar as abc;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::bar::{self as abc};
- | ^ ^
+ | + +
error: aborting due to previous error
diff --git a/src/test/ui/variants/variant-namespacing.stderr b/src/test/ui/variants/variant-namespacing.stderr
index 3954da4..9e91ff7 100644
--- a/src/test/ui/variants/variant-namespacing.stderr
+++ b/src/test/ui/variants/variant-namespacing.stderr
@@ -11,7 +11,7 @@
help: you can use `as` to change the binding name of the import
|
LL | pub use variant_namespacing::XE::{XStruct as OtherXStruct, XTuple, XUnit};
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `XTuple` is defined multiple times
--> $DIR/variant-namespacing.rs:24:44
@@ -26,7 +26,7 @@
help: you can use `as` to change the binding name of the import
|
LL | pub use variant_namespacing::XE::{XStruct, XTuple as OtherXTuple, XUnit};
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `XUnit` is defined multiple times
--> $DIR/variant-namespacing.rs:24:52
@@ -41,7 +41,7 @@
help: you can use `as` to change the binding name of the import
|
LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit as OtherXUnit};
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Struct` is defined multiple times
--> $DIR/variant-namespacing.rs:28:13
@@ -56,7 +56,7 @@
help: you can use `as` to change the binding name of the import
|
LL | pub use E::{Struct as OtherStruct, Tuple, Unit};
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Tuple` is defined multiple times
--> $DIR/variant-namespacing.rs:28:21
@@ -71,7 +71,7 @@
help: you can use `as` to change the binding name of the import
|
LL | pub use E::{Struct, Tuple as OtherTuple, Unit};
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Unit` is defined multiple times
--> $DIR/variant-namespacing.rs:28:28
@@ -86,7 +86,7 @@
help: you can use `as` to change the binding name of the import
|
LL | pub use E::{Struct, Tuple, Unit as OtherUnit};
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/variants/variant-used-as-type.stderr b/src/test/ui/variants/variant-used-as-type.stderr
index 096dd16..64424ab 100644
--- a/src/test/ui/variants/variant-used-as-type.stderr
+++ b/src/test/ui/variants/variant-used-as-type.stderr
@@ -7,9 +7,9 @@
help: try using the variant's enum
|
LL | B(E),
- | ^
+ | ~
LL | B(Ty),
- | ^^
+ | ~~
error[E0573]: expected type, found variant `E::A`
--> $DIR/variant-used-as-type.rs:17:6
@@ -20,9 +20,9 @@
help: try using the variant's enum
|
LL | impl E {}
- | ^
+ | ~
LL | impl Ty {}
- | ^^
+ | ~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/wf/hir-wf-check-erase-regions.stderr b/src/test/ui/wf/hir-wf-check-erase-regions.stderr
index 203f099..0d9b962 100644
--- a/src/test/ui/wf/hir-wf-check-erase-regions.stderr
+++ b/src/test/ui/wf/hir-wf-check-erase-regions.stderr
@@ -1,30 +1,30 @@
error[E0277]: `&T` is not an iterator
- --> $DIR/hir-wf-check-erase-regions.rs:7:5
+ --> $DIR/hir-wf-check-erase-regions.rs:7:21
|
LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&T` is not an iterator
- |
- ::: $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
- |
-LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
- | ------------ required by this bound in `Flatten`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&T` is not an iterator
|
= help: the trait `Iterator` is not implemented for `&T`
= note: required because of the requirements on the impl of `IntoIterator` for `&T`
+note: required by a bound in `Flatten`
+ --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
+ |
+LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
+ | ^^^^^^^^^^^^ required by this bound in `Flatten`
error[E0277]: `&T` is not an iterator
--> $DIR/hir-wf-check-erase-regions.rs:10:27
|
LL | fn into_iter(self) -> Self::IntoIter {
| ^^^^^^^^^^^^^^ `&T` is not an iterator
- |
- ::: $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
- |
-LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
- | ------------ required by this bound in `Flatten`
|
= help: the trait `Iterator` is not implemented for `&T`
= note: required because of the requirements on the impl of `IntoIterator` for `&T`
+note: required by a bound in `Flatten`
+ --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
+ |
+LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
+ | ^^^^^^^^^^^^ required by this bound in `Flatten`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/wf/issue-87495.rs b/src/test/ui/wf/issue-87495.rs
new file mode 100644
index 0000000..5aab743
--- /dev/null
+++ b/src/test/ui/wf/issue-87495.rs
@@ -0,0 +1,8 @@
+// Regression test for the ICE described in #87495.
+
+trait T {
+ const CONST: (bool, dyn T);
+ //~^ ERROR: the trait `T` cannot be made into an object [E0038]
+}
+
+fn main() {}
diff --git a/src/test/ui/wf/issue-87495.stderr b/src/test/ui/wf/issue-87495.stderr
new file mode 100644
index 0000000..010200b
--- /dev/null
+++ b/src/test/ui/wf/issue-87495.stderr
@@ -0,0 +1,18 @@
+error[E0038]: the trait `T` cannot be made into an object
+ --> $DIR/issue-87495.rs:4:25
+ |
+LL | const CONST: (bool, dyn T);
+ | ^^^^^ `T` cannot be made into an object
+ |
+ = help: consider moving `CONST` to another trait
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+ --> $DIR/issue-87495.rs:4:11
+ |
+LL | trait T {
+ | - this trait cannot be made into an object...
+LL | const CONST: (bool, dyn T);
+ | ^^^^^ ...because it contains this associated `const`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/wf/wf-complex-assoc-type.stderr b/src/test/ui/wf/wf-complex-assoc-type.stderr
index c366519..ef613e3 100644
--- a/src/test/ui/wf/wf-complex-assoc-type.stderr
+++ b/src/test/ui/wf/wf-complex-assoc-type.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `bool: MyTrait` is not satisfied
--> $DIR/wf-complex-assoc-type.rs:9:28
|
-LL | struct AssertMyTrait<T: MyTrait>(T);
- | ------- required by this bound in `AssertMyTrait`
-...
LL | type MyItem = Option<((AssertMyTrait<bool>, u8))>;
| ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `bool`
+ |
+note: required by a bound in `AssertMyTrait`
+ --> $DIR/wf-complex-assoc-type.rs:2:25
+ |
+LL | struct AssertMyTrait<T: MyTrait>(T);
+ | ^^^^^^^ required by this bound in `AssertMyTrait`
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-const-type.stderr b/src/test/ui/wf/wf-const-type.stderr
index d2e6854..5a6d66e 100644
--- a/src/test/ui/wf/wf-const-type.stderr
+++ b/src/test/ui/wf/wf-const-type.stderr
@@ -1,13 +1,15 @@
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
--> $DIR/wf-const-type.rs:10:12
|
-LL | struct IsCopy<T:Copy> { t: T }
- | ---- required by this bound in `IsCopy`
-...
LL | const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
|
= note: required because of the requirements on the impl of `Copy` for `Option<NotCopy>`
+note: required by a bound in `IsCopy`
+ --> $DIR/wf-const-type.rs:7:17
+ |
+LL | struct IsCopy<T:Copy> { t: T }
+ | ^^^^ required by this bound in `IsCopy`
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-enum-bound.stderr b/src/test/ui/wf/wf-enum-bound.stderr
index 7819110..d39fc0c 100644
--- a/src/test/ui/wf/wf-enum-bound.stderr
+++ b/src/test/ui/wf/wf-enum-bound.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `U: Copy` is not satisfied
--> $DIR/wf-enum-bound.rs:10:14
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-...
LL | where T: ExtraCopy<U>
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-enum-bound.rs:7:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider further restricting type parameter `U`
|
LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-enum-fields-struct-variant.stderr b/src/test/ui/wf/wf-enum-fields-struct-variant.stderr
index 4bfb241..c12d625 100644
--- a/src/test/ui/wf/wf-enum-fields-struct-variant.stderr
+++ b/src/test/ui/wf/wf-enum-fields-struct-variant.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `A: Copy` is not satisfied
--> $DIR/wf-enum-fields-struct-variant.rs:13:12
|
-LL | struct IsCopy<T:Copy> {
- | ---- required by this bound in `IsCopy`
-...
LL | f: IsCopy<A>
| ^^^^^^^^^ the trait `Copy` is not implemented for `A`
|
+note: required by a bound in `IsCopy`
+ --> $DIR/wf-enum-fields-struct-variant.rs:7:17
+ |
+LL | struct IsCopy<T:Copy> {
+ | ^^^^ required by this bound in `IsCopy`
help: consider restricting type parameter `A`
|
LL | enum AnotherEnum<A: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-enum-fields.stderr b/src/test/ui/wf/wf-enum-fields.stderr
index c8a75af..ac3301a 100644
--- a/src/test/ui/wf/wf-enum-fields.stderr
+++ b/src/test/ui/wf/wf-enum-fields.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `A: Copy` is not satisfied
--> $DIR/wf-enum-fields.rs:12:17
|
-LL | struct IsCopy<T:Copy> {
- | ---- required by this bound in `IsCopy`
-...
LL | SomeVariant(IsCopy<A>)
| ^^^^^^^^^ the trait `Copy` is not implemented for `A`
|
+note: required by a bound in `IsCopy`
+ --> $DIR/wf-enum-fields.rs:7:17
+ |
+LL | struct IsCopy<T:Copy> {
+ | ^^^^ required by this bound in `IsCopy`
help: consider restricting type parameter `A`
|
LL | enum SomeEnum<A: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-fn-where-clause.stderr b/src/test/ui/wf/wf-fn-where-clause.stderr
index e463e3d..2aec641 100644
--- a/src/test/ui/wf/wf-fn-where-clause.stderr
+++ b/src/test/ui/wf/wf-fn-where-clause.stderr
@@ -1,27 +1,31 @@
error[E0277]: the trait bound `U: Copy` is not satisfied
--> $DIR/wf-fn-where-clause.rs:8:24
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-LL |
LL | fn foo<T,U>() where T: ExtraCopy<U>
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-fn-where-clause.rs:6:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider further restricting type parameter `U`
|
LL | fn foo<T,U>() where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
--> $DIR/wf-fn-where-clause.rs:12:16
|
LL | fn bar() where Vec<dyn Copy>:, {}
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
-...
-LL | struct Vec<T> {
- | - required by this bound in `Vec`
|
= help: the trait `Sized` is not implemented for `(dyn Copy + 'static)`
+note: required by a bound in `Vec`
+ --> $DIR/wf-fn-where-clause.rs:16:12
+ |
+LL | struct Vec<T> {
+ | ^ required by this bound in `Vec`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/wf-fn-where-clause.rs:16:12
|
diff --git a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr b/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
index f6b4893..66bfdbc 100644
--- a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
+++ b/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
@@ -1,20 +1,26 @@
error[E0277]: the trait bound `(): Foo` is not satisfied
--> $DIR/wf-foreign-fn-decl-ret.rs:11:25
|
-LL | pub trait Foo {
- | ------------- required by this bound in `Foo`
-...
LL | pub fn lint_me() -> <() as Foo>::Assoc;
| ^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
+ |
+note: required by a bound in `Foo`
+ --> $DIR/wf-foreign-fn-decl-ret.rs:6:1
+ |
+LL | pub trait Foo {
+ | ^^^^^^^^^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `u32: Unsatisfied` is not satisfied
--> $DIR/wf-foreign-fn-decl-ret.rs:14:32
|
-LL | pub struct Bar<T: Unsatisfied>(T);
- | ----------- required by this bound in `Bar`
-...
LL | pub fn lint_me_aswell() -> Bar<u32>;
| ^^^^^^^^ the trait `Unsatisfied` is not implemented for `u32`
+ |
+note: required by a bound in `Bar`
+ --> $DIR/wf-foreign-fn-decl-ret.rs:4:19
+ |
+LL | pub struct Bar<T: Unsatisfied>(T);
+ | ^^^^^^^^^^^ required by this bound in `Bar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/wf/wf-impl-associated-type-region.stderr b/src/test/ui/wf/wf-impl-associated-type-region.stderr
index f3b32ad..3f32419 100644
--- a/src/test/ui/wf/wf-impl-associated-type-region.stderr
+++ b/src/test/ui/wf/wf-impl-associated-type-region.stderr
@@ -1,10 +1,10 @@
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-impl-associated-type-region.rs:10:5
+ --> $DIR/wf-impl-associated-type-region.rs:10:16
|
LL | impl<'a, T> Foo<'a> for T {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Bar = &'a T;
- | ^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
+ | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-impl-associated-type-trait.stderr b/src/test/ui/wf/wf-impl-associated-type-trait.stderr
index 0d4480f..bdf8bba 100644
--- a/src/test/ui/wf/wf-impl-associated-type-trait.stderr
+++ b/src/test/ui/wf/wf-impl-associated-type-trait.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: MyHash` is not satisfied
--> $DIR/wf-impl-associated-type-trait.rs:17:16
|
-LL | pub struct MySet<T:MyHash> {
- | ------ required by this bound in `MySet`
-...
LL | type Bar = MySet<T>;
| ^^^^^^^^ the trait `MyHash` is not implemented for `T`
|
+note: required by a bound in `MySet`
+ --> $DIR/wf-impl-associated-type-trait.rs:8:20
+ |
+LL | pub struct MySet<T:MyHash> {
+ | ^^^^^^ required by this bound in `MySet`
help: consider restricting type parameter `T`
|
LL | impl<T: MyHash> Foo for T {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-impl-self-type.stderr b/src/test/ui/wf/wf-impl-self-type.stderr
index bc30fc9..3713217 100644
--- a/src/test/ui/wf/wf-impl-self-type.stderr
+++ b/src/test/ui/wf/wf-impl-self-type.stderr
@@ -3,13 +3,13 @@
|
LL | impl Foo for Option<[u8]> {}
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- ::: $SRC_DIR/core/src/option.rs:LL:COL
- |
-LL | pub enum Option<T> {
- | - required by this bound in `Option`
|
= help: the trait `Sized` is not implemented for `[u8]`
+note: required by a bound in `Option`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub enum Option<T> {
+ | ^ required by this bound in `Option`
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-in-fn-arg.stderr b/src/test/ui/wf/wf-in-fn-arg.stderr
index ca90e92..83a4a59 100644
--- a/src/test/ui/wf/wf-in-fn-arg.stderr
+++ b/src/test/ui/wf/wf-in-fn-arg.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/wf-in-fn-arg.rs:10:15
|
-LL | struct MustBeCopy<T:Copy> {
- | ---- required by this bound in `MustBeCopy`
-...
LL | fn bar<T>(_: &MustBeCopy<T>)
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `MustBeCopy`
+ --> $DIR/wf-in-fn-arg.rs:6:21
+ |
+LL | struct MustBeCopy<T:Copy> {
+ | ^^^^ required by this bound in `MustBeCopy`
help: consider restricting type parameter `T`
|
LL | fn bar<T: std::marker::Copy>(_: &MustBeCopy<T>)
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-in-fn-ret.stderr b/src/test/ui/wf/wf-in-fn-ret.stderr
index f9a9625..7eeb974 100644
--- a/src/test/ui/wf/wf-in-fn-ret.stderr
+++ b/src/test/ui/wf/wf-in-fn-ret.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/wf-in-fn-ret.rs:10:16
|
-LL | struct MustBeCopy<T:Copy> {
- | ---- required by this bound in `MustBeCopy`
-...
LL | fn bar<T>() -> MustBeCopy<T>
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `MustBeCopy`
+ --> $DIR/wf-in-fn-ret.rs:6:21
+ |
+LL | struct MustBeCopy<T:Copy> {
+ | ^^^^ required by this bound in `MustBeCopy`
help: consider restricting type parameter `T`
|
LL | fn bar<T: std::marker::Copy>() -> MustBeCopy<T>
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-in-fn-type-arg.stderr b/src/test/ui/wf/wf-in-fn-type-arg.stderr
index 20aa977..be5e9d4 100644
--- a/src/test/ui/wf/wf-in-fn-type-arg.stderr
+++ b/src/test/ui/wf/wf-in-fn-type-arg.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/wf-in-fn-type-arg.rs:9:11
|
-LL | struct MustBeCopy<T:Copy> {
- | ---- required by this bound in `MustBeCopy`
-...
LL | x: fn(MustBeCopy<T>)
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `MustBeCopy`
+ --> $DIR/wf-in-fn-type-arg.rs:3:21
+ |
+LL | struct MustBeCopy<T:Copy> {
+ | ^^^^ required by this bound in `MustBeCopy`
help: consider restricting type parameter `T`
|
LL | struct Bar<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-in-fn-type-ret.stderr b/src/test/ui/wf/wf-in-fn-type-ret.stderr
index 48af696..8fcfcb0 100644
--- a/src/test/ui/wf/wf-in-fn-type-ret.stderr
+++ b/src/test/ui/wf/wf-in-fn-type-ret.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/wf-in-fn-type-ret.rs:9:16
|
-LL | struct MustBeCopy<T:Copy> {
- | ---- required by this bound in `MustBeCopy`
-...
LL | x: fn() -> MustBeCopy<T>
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `MustBeCopy`
+ --> $DIR/wf-in-fn-type-ret.rs:3:21
+ |
+LL | struct MustBeCopy<T:Copy> {
+ | ^^^^ required by this bound in `MustBeCopy`
help: consider restricting type parameter `T`
|
LL | struct Foo<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-in-fn-where-clause.stderr b/src/test/ui/wf/wf-in-fn-where-clause.stderr
index 7cb9af1..160a738 100644
--- a/src/test/ui/wf/wf-in-fn-where-clause.stderr
+++ b/src/test/ui/wf/wf-in-fn-where-clause.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `U: Copy` is not satisfied
--> $DIR/wf-in-fn-where-clause.rs:10:14
|
-LL | trait MustBeCopy<T:Copy> {
- | ---- required by this bound in `MustBeCopy`
-...
LL | where T: MustBeCopy<U>
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
|
+note: required by a bound in `MustBeCopy`
+ --> $DIR/wf-in-fn-where-clause.rs:6:20
+ |
+LL | trait MustBeCopy<T:Copy> {
+ | ^^^^ required by this bound in `MustBeCopy`
help: consider further restricting type parameter `U`
|
LL | where T: MustBeCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-in-obj-type-trait.stderr b/src/test/ui/wf/wf-in-obj-type-trait.stderr
index b3b919a..f556b67 100644
--- a/src/test/ui/wf/wf-in-obj-type-trait.stderr
+++ b/src/test/ui/wf/wf-in-obj-type-trait.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/wf-in-obj-type-trait.rs:11:19
|
-LL | struct MustBeCopy<T:Copy> {
- | ---- required by this bound in `MustBeCopy`
-...
LL | x: dyn Object<MustBeCopy<T>>
| ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `MustBeCopy`
+ --> $DIR/wf-in-obj-type-trait.rs:5:21
+ |
+LL | struct MustBeCopy<T:Copy> {
+ | ^^^^ required by this bound in `MustBeCopy`
help: consider restricting type parameter `T`
|
LL | struct Bar<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr
index 8e0ce55..e723d1b 100644
--- a/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr
+++ b/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `U: Copy` is not satisfied
--> $DIR/wf-inherent-impl-method-where-clause.rs:12:27
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-...
LL | fn foo(self) where T: ExtraCopy<U>
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-inherent-impl-method-where-clause.rs:7:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider restricting type parameter `U`
|
LL | impl<T,U: std::marker::Copy> Foo<T,U> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-inherent-impl-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-where-clause.stderr
index bf8077b..39e0d34 100644
--- a/src/test/ui/wf/wf-inherent-impl-where-clause.stderr
+++ b/src/test/ui/wf/wf-inherent-impl-where-clause.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `U: Copy` is not satisfied
--> $DIR/wf-inherent-impl-where-clause.rs:11:29
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-...
LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-inherent-impl-where-clause.rs:7:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider further restricting type parameter `U`
|
LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
index 4c25ab9..68c1e90 100644
--- a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
+++ b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
@@ -1,18 +1,18 @@
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:5
+ --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:16
|
LL | impl<'a, T> Trait<'a, T> for usize {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = &'a fn(T);
- | ^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a fn(T)` does not outlive the data it points at
+ | ^^^^^^^^^ ...so that the reference type `&'a fn(T)` does not outlive the data it points at
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
+ --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:16
|
LL | impl<'a, T> Trait<'a, T> for u32 {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = &'a dyn Baz<T>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
+ | ^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
error: aborting due to 2 previous errors
diff --git a/src/test/ui/wf/wf-static-type.stderr b/src/test/ui/wf/wf-static-type.stderr
index a981846..c45bd57 100644
--- a/src/test/ui/wf/wf-static-type.stderr
+++ b/src/test/ui/wf/wf-static-type.stderr
@@ -1,13 +1,15 @@
error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
--> $DIR/wf-static-type.rs:10:13
|
-LL | struct IsCopy<T:Copy> { t: T }
- | ---- required by this bound in `IsCopy`
-...
LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
|
= note: required because of the requirements on the impl of `Copy` for `Option<NotCopy>`
+note: required by a bound in `IsCopy`
+ --> $DIR/wf-static-type.rs:7:17
+ |
+LL | struct IsCopy<T:Copy> { t: T }
+ | ^^^^ required by this bound in `IsCopy`
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-struct-bound.stderr b/src/test/ui/wf/wf-struct-bound.stderr
index e85f359..6248e3e 100644
--- a/src/test/ui/wf/wf-struct-bound.stderr
+++ b/src/test/ui/wf/wf-struct-bound.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `U: Copy` is not satisfied
--> $DIR/wf-struct-bound.rs:10:14
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-...
LL | where T: ExtraCopy<U>
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-struct-bound.rs:7:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider further restricting type parameter `U`
|
LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-struct-field.stderr b/src/test/ui/wf/wf-struct-field.stderr
index 62ef6bb..78a8da8 100644
--- a/src/test/ui/wf/wf-struct-field.stderr
+++ b/src/test/ui/wf/wf-struct-field.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `A: Copy` is not satisfied
--> $DIR/wf-struct-field.rs:12:11
|
-LL | struct IsCopy<T:Copy> {
- | ---- required by this bound in `IsCopy`
-...
LL | data: IsCopy<A>
| ^^^^^^^^^ the trait `Copy` is not implemented for `A`
|
+note: required by a bound in `IsCopy`
+ --> $DIR/wf-struct-field.rs:7:17
+ |
+LL | struct IsCopy<T:Copy> {
+ | ^^^^ required by this bound in `IsCopy`
help: consider restricting type parameter `A`
|
LL | struct SomeStruct<A: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-associated-type-bound.stderr b/src/test/ui/wf/wf-trait-associated-type-bound.stderr
index 51adfdb..8297700 100644
--- a/src/test/ui/wf/wf-trait-associated-type-bound.stderr
+++ b/src/test/ui/wf/wf-trait-associated-type-bound.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/wf-trait-associated-type-bound.rs:10:17
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-...
LL | type Type1: ExtraCopy<T>;
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-trait-associated-type-bound.rs:7:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider restricting type parameter `T`
|
LL | trait SomeTrait<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-associated-type-region.stderr b/src/test/ui/wf/wf-trait-associated-type-region.stderr
index ae681ba..6e2cc8a 100644
--- a/src/test/ui/wf/wf-trait-associated-type-region.stderr
+++ b/src/test/ui/wf/wf-trait-associated-type-region.stderr
@@ -1,8 +1,8 @@
error[E0309]: the associated type `<Self as SomeTrait<'a>>::Type1` may not live long enough
- --> $DIR/wf-trait-associated-type-region.rs:9:5
+ --> $DIR/wf-trait-associated-type-region.rs:9:18
|
LL | type Type2 = &'a Self::Type1;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<Self as SomeTrait<'a>>::Type1: 'a`...
= note: ...so that the reference type `&'a <Self as SomeTrait<'a>>::Type1` does not outlive the data it points at
diff --git a/src/test/ui/wf/wf-trait-associated-type-trait.stderr b/src/test/ui/wf/wf-trait-associated-type-trait.stderr
index d1c2c65..a73c3a2 100644
--- a/src/test/ui/wf/wf-trait-associated-type-trait.stderr
+++ b/src/test/ui/wf/wf-trait-associated-type-trait.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `<Self as SomeTrait>::Type1: Copy` is not satisfied
--> $DIR/wf-trait-associated-type-trait.rs:11:19
|
-LL | struct IsCopy<T:Copy> { x: T }
- | ---- required by this bound in `IsCopy`
-...
LL | type Type2 = (IsCopy<Self::Type1>, bool);
| ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `<Self as SomeTrait>::Type1`
|
+note: required by a bound in `IsCopy`
+ --> $DIR/wf-trait-associated-type-trait.rs:7:17
+ |
+LL | struct IsCopy<T:Copy> { x: T }
+ | ^^^^ required by this bound in `IsCopy`
help: consider further restricting the associated type
|
LL | trait SomeTrait where <Self as SomeTrait>::Type1: Copy {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-bound.stderr b/src/test/ui/wf/wf-trait-bound.stderr
index c9e818f..bace3e3 100644
--- a/src/test/ui/wf/wf-trait-bound.stderr
+++ b/src/test/ui/wf/wf-trait-bound.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `U: Copy` is not satisfied
--> $DIR/wf-trait-bound.rs:10:14
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-...
LL | where T: ExtraCopy<U>
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `U`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-trait-bound.rs:7:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider further restricting type parameter `U`
|
LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-default-fn-arg.stderr b/src/test/ui/wf/wf-trait-default-fn-arg.stderr
index 2a12953..8c3d056 100644
--- a/src/test/ui/wf/wf-trait-default-fn-arg.stderr
+++ b/src/test/ui/wf/wf-trait-default-fn-arg.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
--> $DIR/wf-trait-default-fn-arg.rs:11:23
|
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | -- required by this bound in `Bar`
-...
LL | fn bar(&self, x: &Bar<Self>) {
| ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-default-fn-arg.rs:8:14
+ |
+LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar(&self, x: &Bar<Self>) where Self: Eq {
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-default-fn-ret.stderr b/src/test/ui/wf/wf-trait-default-fn-ret.stderr
index 4382a8f..6422e86 100644
--- a/src/test/ui/wf/wf-trait-default-fn-ret.stderr
+++ b/src/test/ui/wf/wf-trait-default-fn-ret.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
--> $DIR/wf-trait-default-fn-ret.rs:11:22
|
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | -- required by this bound in `Bar`
-...
LL | fn bar(&self) -> Bar<Self> {
| ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-default-fn-ret.rs:8:14
+ |
+LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar(&self) -> Bar<Self> where Self: Eq {
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr b/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr
index 16c0424..f260d57 100644
--- a/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr
+++ b/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
--> $DIR/wf-trait-default-fn-where-clause.rs:11:31
|
-LL | trait Bar<T:Eq+?Sized> { }
- | -- required by this bound in `Bar`
-...
LL | fn bar<A>(&self) where A: Bar<Self> {
| ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-default-fn-where-clause.rs:8:13
+ |
+LL | trait Bar<T:Eq+?Sized> { }
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar<A>(&self) where A: Bar<Self>, Self: Eq {
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-fn-arg.stderr b/src/test/ui/wf/wf-trait-fn-arg.stderr
index 7693aa6..3bd1f48 100644
--- a/src/test/ui/wf/wf-trait-fn-arg.stderr
+++ b/src/test/ui/wf/wf-trait-fn-arg.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
--> $DIR/wf-trait-fn-arg.rs:10:23
|
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | -- required by this bound in `Bar`
-...
LL | fn bar(&self, x: &Bar<Self>);
| ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-fn-arg.rs:7:14
+ |
+LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar(&self, x: &Bar<Self>) where Self: Eq;
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-fn-ret.stderr b/src/test/ui/wf/wf-trait-fn-ret.stderr
index bd0bbc0..a59ba34 100644
--- a/src/test/ui/wf/wf-trait-fn-ret.stderr
+++ b/src/test/ui/wf/wf-trait-fn-ret.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
--> $DIR/wf-trait-fn-ret.rs:10:22
|
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | -- required by this bound in `Bar`
-...
LL | fn bar(&self) -> &Bar<Self>;
| ^^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-fn-ret.rs:7:14
+ |
+LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar(&self) -> &Bar<Self> where Self: Eq;
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-fn-where-clause.stderr b/src/test/ui/wf/wf-trait-fn-where-clause.stderr
index 62e5318..d064f7f 100644
--- a/src/test/ui/wf/wf-trait-fn-where-clause.stderr
+++ b/src/test/ui/wf/wf-trait-fn-where-clause.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
--> $DIR/wf-trait-fn-where-clause.rs:10:49
|
-LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
- | -- required by this bound in `Bar`
-...
LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy;
| ^^^^ the trait `Eq` is not implemented for `Self`
|
+note: required by a bound in `Bar`
+ --> $DIR/wf-trait-fn-where-clause.rs:7:14
+ |
+LL | struct Bar<T:Eq+?Sized> { value: Box<T> }
+ | ^^ required by this bound in `Bar`
help: consider further restricting `Self`
|
LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy, Self: Eq;
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/wf/wf-trait-superbound.stderr b/src/test/ui/wf/wf-trait-superbound.stderr
index 6926983..cd49243 100644
--- a/src/test/ui/wf/wf-trait-superbound.stderr
+++ b/src/test/ui/wf/wf-trait-superbound.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/wf-trait-superbound.rs:9:21
|
-LL | trait ExtraCopy<T:Copy> { }
- | ---- required by this bound in `ExtraCopy`
-LL |
LL | trait SomeTrait<T>: ExtraCopy<T> {
| ^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `ExtraCopy`
+ --> $DIR/wf-trait-superbound.rs:7:19
+ |
+LL | trait ExtraCopy<T:Copy> { }
+ | ^^^^ required by this bound in `ExtraCopy`
help: consider restricting type parameter `T`
|
LL | trait SomeTrait<T: std::marker::Copy>: ExtraCopy<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr
index 356ba34..0df5f91 100644
--- a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr
+++ b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/where-clause-constraints-are-local-for-inherent-impl.rs:13:22
|
-LL | fn require_copy<T: Copy>(x: T) {}
- | ---- required by this bound in `require_copy`
-...
LL | require_copy(self.x);
| ^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `require_copy`
+ --> $DIR/where-clause-constraints-are-local-for-inherent-impl.rs:1:20
+ |
+LL | fn require_copy<T: Copy>(x: T) {}
+ | ^^^^ required by this bound in `require_copy`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr
index d84242c..97d651e 100644
--- a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr
+++ b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr
@@ -1,16 +1,18 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/where-clause-constraints-are-local-for-trait-impl.rs:18:22
|
-LL | fn require_copy<T: Copy>(x: T) {}
- | ---- required by this bound in `require_copy`
-...
LL | require_copy(self.x);
| ^^^^^^ the trait `Copy` is not implemented for `T`
|
+note: required by a bound in `require_copy`
+ --> $DIR/where-clause-constraints-are-local-for-trait-impl.rs:1:20
+ |
+LL | fn require_copy<T: Copy>(x: T) {}
+ | ^^^^ required by this bound in `require_copy`
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo<T> for Bar<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr b/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr
index 9e19b9a..ba18119 100644
--- a/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr
+++ b/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr
@@ -1,11 +1,14 @@
error[E0277]: the trait bound `Struct: Eq` is not satisfied
--> $DIR/where-clauses-unsatisfied.rs:6:10
|
-LL | fn equal<T>(a: &T, b: &T) -> bool where T : Eq { a == b }
- | -- required by this bound in `equal`
-...
LL | drop(equal(&Struct, &Struct))
| ^^^^^ the trait `Eq` is not implemented for `Struct`
+ |
+note: required by a bound in `equal`
+ --> $DIR/where-clauses-unsatisfied.rs:1:45
+ |
+LL | fn equal<T>(a: &T, b: &T) -> bool where T : Eq { a == b }
+ | ^^ required by this bound in `equal`
error: aborting due to previous error
diff --git a/src/test/ui/where-clauses/where-for-self-2.nll.stderr b/src/test/ui/where-clauses/where-for-self-2.nll.stderr
index d0c476d..f65db78 100644
--- a/src/test/ui/where-clauses/where-for-self-2.nll.stderr
+++ b/src/test/ui/where-clauses/where-for-self-2.nll.stderr
@@ -1,8 +1,11 @@
-error: higher-ranked subtype error
+error: implementation of `Bar` is not general enough
--> $DIR/where-for-self-2.rs:23:5
|
LL | foo(&X);
- | ^^^^^^^
+ | ^^^^^^^ implementation of `Bar` is not general enough
+ |
+ = note: `&'0 u32` must implement `Bar`, for any lifetime `'0`...
+ = note: ...but `Bar` is actually implemented for the type `&'static u32`
error: aborting due to previous error
diff --git a/src/test/ui/while-let.stderr b/src/test/ui/while-let.stderr
index d2f96f6..17e8830 100644
--- a/src/test/ui/while-let.stderr
+++ b/src/test/ui/while-let.stderr
@@ -1,8 +1,8 @@
warning: irrefutable `while let` pattern
- --> $DIR/while-let.rs:7:13
+ --> $DIR/while-let.rs:7:19
|
LL | while let $p = $e $b
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^
...
LL | / foo!(_a, 1, {
LL | | println!("irrefutable pattern");
@@ -15,10 +15,10 @@
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `while let` pattern
- --> $DIR/while-let.rs:7:13
+ --> $DIR/while-let.rs:7:19
|
LL | while let $p = $e $b
- | ^^^^^^^^^^^^^^^^^^^^
+ | ^^^
...
LL | / bar!(_a, 1, {
LL | | println!("irrefutable pattern");
@@ -30,13 +30,10 @@
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `while let` pattern
- --> $DIR/while-let.rs:27:5
+ --> $DIR/while-let.rs:27:11
|
-LL | / while let _a = 1 {
-LL | | println!("irrefutable pattern");
-LL | | break;
-LL | | }
- | |_____^
+LL | while let _a = 1 {
+ | ^^^^^^^^^^
|
= note: this pattern will always match, so the loop will never exit
= help: consider instead using a `loop { ... }` with a `let` inside it
diff --git a/src/test/ui/wrong-ret-type.stderr b/src/test/ui/wrong-ret-type.stderr
index 5498dae..8e240a0 100644
--- a/src/test/ui/wrong-ret-type.stderr
+++ b/src/test/ui/wrong-ret-type.stderr
@@ -9,7 +9,7 @@
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | fn mk_int() -> usize { let i: isize = 3; return i.try_into().unwrap(); }
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/xc-private-method.stderr b/src/test/ui/xc-private-method.stderr
index 69b414c..0eabc59 100644
--- a/src/test/ui/xc-private-method.stderr
+++ b/src/test/ui/xc-private-method.stderr
@@ -3,7 +3,7 @@
|
LL | let _ = xc_private_method_lib::Struct::static_meth_struct();
| ^^^^^^^^^^^^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/xc-private-method-lib.rs:8:5
|
LL | fn static_meth_struct() -> Struct {
@@ -14,7 +14,7 @@
|
LL | let _ = xc_private_method_lib::Enum::static_meth_enum();
| ^^^^^^^^^^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/xc-private-method-lib.rs:23:5
|
LL | fn static_meth_enum() -> Enum {
diff --git a/src/test/ui/xc-private-method2.stderr b/src/test/ui/xc-private-method2.stderr
index 685ce0e..b569882 100644
--- a/src/test/ui/xc-private-method2.stderr
+++ b/src/test/ui/xc-private-method2.stderr
@@ -3,7 +3,7 @@
|
LL | let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct();
| ^^^^^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/xc-private-method-lib.rs:12:5
|
LL | fn meth_struct(&self) -> isize {
@@ -14,7 +14,7 @@
|
LL | let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum();
| ^^^^^^^^^ private associated function
- |
+ |
::: $DIR/auxiliary/xc-private-method-lib.rs:27:5
|
LL | fn meth_enum(&self) -> isize {
diff --git a/src/test/ui/xcrate/xcrate-unit-struct.stderr b/src/test/ui/xcrate/xcrate-unit-struct.stderr
index 3dc8b90..cee3145 100644
--- a/src/test/ui/xcrate/xcrate-unit-struct.stderr
+++ b/src/test/ui/xcrate/xcrate-unit-struct.stderr
@@ -3,7 +3,7 @@
|
LL | let _ = xcrate_unit_struct::StructWithFields;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `xcrate_unit_struct::StructWithFields { foo: val }`
- |
+ |
::: $DIR/auxiliary/xcrate_unit_struct.rs:20:1
|
LL | pub struct StructWithFields {