diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2021-07-14 16:17:56 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2021-07-18 09:30:07 -0300 |
| commit | 4d2d90307d7a7ac70a2cd4545dbe917f79eb9dff (patch) | |
| tree | f735849528cf8a4de1fd45bf43725f603f5f0678 /src/test/ui/impl-trait | |
| parent | bc106ebb5a8f96f905a3d96606b052fbf41b8332 (diff) | |
| download | rust-4d2d90307d7a7ac70a2cd4545dbe917f79eb9dff.tar.gz rust-4d2d90307d7a7ac70a2cd4545dbe917f79eb9dff.zip | |
Remove impl trait bindings handling on const AST lowering
Diffstat (limited to 'src/test/ui/impl-trait')
| -rw-r--r-- | src/test/ui/impl-trait/bindings.rs | 30 | ||||
| -rw-r--r-- | src/test/ui/impl-trait/bindings.stderr | 37 |
2 files changed, 35 insertions, 32 deletions
diff --git a/src/test/ui/impl-trait/bindings.rs b/src/test/ui/impl-trait/bindings.rs deleted file mode 100644 index fd79ba68fbd..00000000000 --- a/src/test/ui/impl-trait/bindings.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![feature(impl_trait_in_bindings)] -//~^ WARN the feature `impl_trait_in_bindings` is incomplete - -fn a<T: Clone>(x: T) { - const foo: impl Clone = x; - //~^ ERROR attempt to use a non-constant value in a constant -} - -fn b<T: Clone>(x: T) { - let _ = move || { - const foo: impl Clone = x; - //~^ ERROR attempt to use a non-constant value in a constant - }; -} - -trait Foo<T: Clone> { - fn a(x: T) { - const foo: impl Clone = x; - //~^ ERROR attempt to use a non-constant value in a constant - } -} - -impl<T: Clone> Foo<T> for i32 { - fn a(x: T) { - const foo: impl Clone = x; - //~^ ERROR attempt to use a non-constant value in a constant - } -} - -fn main() { } diff --git a/src/test/ui/impl-trait/bindings.stderr b/src/test/ui/impl-trait/bindings.stderr index 4da49f4dc7d..05f3f2e0d3e 100644 --- a/src/test/ui/impl-trait/bindings.stderr +++ b/src/test/ui/impl-trait/bindings.stderr @@ -30,6 +30,38 @@ LL | const foo: impl Clone = x; | | | help: consider using `let` instead of `const`: `let foo` +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/bindings.rs:5:16 + | +LL | const foo: impl Clone = x; + | ^^^^^^^^^^ + | + = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/bindings.rs:11:20 + | +LL | const foo: impl Clone = x; + | ^^^^^^^^^^ + | + = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/bindings.rs:18:20 + | +LL | const foo: impl Clone = x; + | ^^^^^^^^^^ + | + = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/bindings.rs:25:20 + | +LL | const foo: impl Clone = x; + | ^^^^^^^^^^ + | + = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable + warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/bindings.rs:1:12 | @@ -39,6 +71,7 @@ LL | #![feature(impl_trait_in_bindings)] = note: `#[warn(incomplete_features)]` on by default = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information -error: aborting due to 4 previous errors; 1 warning emitted +error: aborting due to 8 previous errors; 1 warning emitted -For more information about this error, try `rustc --explain E0435`. +Some errors have detailed explanations: E0435, E0562. +For more information about an error, try `rustc --explain E0435`. |
