remove outdated opaque type test
This commit is contained in:
parent
beeb8e3af5
commit
f099b241e2
2 changed files with 0 additions and 49 deletions
|
|
@ -1,29 +0,0 @@
|
|||
// Tests that we correctly handle opaque types being used opaquely,
|
||||
// even within their defining scope.
|
||||
//
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
type Foo = impl Copy;
|
||||
|
||||
enum Wrapper<T> {
|
||||
First(T),
|
||||
Second,
|
||||
}
|
||||
|
||||
// This method constrains `Foo` to be `bool`
|
||||
#[define_opaque(Foo)]
|
||||
fn constrained_foo() -> Foo {
|
||||
true
|
||||
}
|
||||
|
||||
// This method does not constrain `Foo`.
|
||||
// Per RFC 2071, function bodies may either
|
||||
// fully constrain an opaque type, or place no
|
||||
// constraints on it.
|
||||
#[define_opaque(Foo)]
|
||||
fn unconstrained_foo() -> Wrapper<Foo> {
|
||||
Wrapper::Second
|
||||
//~^ ERROR: type annotations needed
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
error[E0283]: type annotations needed
|
||||
--> $DIR/fallback.rs:25:5
|
||||
|
|
||||
LL | fn unconstrained_foo() -> Wrapper<Foo> {
|
||||
| ------------ type must be known at this point
|
||||
LL | Wrapper::Second
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| cannot infer type of the type parameter `T` declared on the enum `Wrapper`
|
||||
| return type was inferred to be `Wrapper<_>` here
|
||||
|
|
||||
= note: cannot satisfy `_: Copy`
|
||||
help: consider specifying the generic argument
|
||||
|
|
||||
LL | Wrapper::<T>::Second
|
||||
| +++++
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0283`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue