mirror of https://github.com/rust-lang/rust.git
Make all tests use type_alias_impl_trait feature instead of min
This commit is contained in:
parent
5bff8429a0
commit
38bdd0e019
|
@ -287,7 +287,7 @@ impl<'a> PostExpansionVisitor<'a> {
|
|||
if let ast::TyKind::ImplTrait(..) = ty.kind {
|
||||
gate_feature_post!(
|
||||
&self.vis,
|
||||
min_type_alias_impl_trait,
|
||||
type_alias_impl_trait,
|
||||
ty.span,
|
||||
"`impl Trait` in type aliases is unstable"
|
||||
);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// check-pass
|
||||
|
||||
#![feature(trait_alias)]
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
/// look at this trait right here
|
||||
pub trait ThisTrait {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// check-pass
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait ValidTrait {}
|
||||
type ImplTrait = impl ValidTrait;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// check-pass
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait ValidTrait {}
|
||||
type ImplTrait = impl ValidTrait;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//edition:2018
|
||||
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait Foo {
|
||||
type X: std::future::Future<Output = ()>;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait MyTrait {}
|
||||
impl MyTrait for i32 {}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait Backend {}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#![feature(associated_type_bounds)]
|
||||
// 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)]
|
||||
#![feature(untagged_unions)]
|
||||
|
||||
use std::iter;
|
||||
|
|
|
@ -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`.
|
|
@ -1,9 +1,7 @@
|
|||
// 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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
use std::ops::Add;
|
||||
|
||||
|
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
fn main() {}
|
||||
|
||||
|
|
|
@ -3,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -2,7 +2,7 @@ error[E0601]: `main` function not found in crate `imported_main_const_fn_item_ty
|
|||
--> $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 | |
|
||||
... |
|
||||
|
|
|
@ -5,7 +5,7 @@ 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
|
||||
= help: add `#![feature(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
|
||||
|
@ -14,7 +14,7 @@ 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
|
||||
= help: add `#![feature(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
|
||||
|
@ -32,7 +32,7 @@ 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
|
||||
= help: add `#![feature(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
|
||||
|
@ -41,7 +41,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
|
|||
| ^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:29:37
|
||||
|
@ -50,7 +50,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
|
|||
| ^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:29:49
|
||||
|
@ -59,7 +59,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:29:70
|
||||
|
@ -68,7 +68,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
|
|||
| ^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:40:21
|
||||
|
@ -77,7 +77,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
|
|||
| ^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:40:34
|
||||
|
@ -86,7 +86,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
|
|||
| ^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:40:46
|
||||
|
@ -95,7 +95,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
|
|||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:40:67
|
||||
|
@ -104,7 +104,7 @@ LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debu
|
|||
| ^^^^^^^^^^
|
||||
|
|
||||
= 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/feature-gate-min_type_alias_impl_trait.rs:23:18
|
||||
|
|
|
@ -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 @@ fn define() -> Bar {
|
|||
type Foo2 = impl Debug;
|
||||
|
||||
fn define2() {
|
||||
let x = || -> Foo2 { 42 }; //~ ERROR not permitted here
|
||||
let x = || -> Foo2 { 42 };
|
||||
}
|
||||
|
||||
type Foo3 = impl Debug;
|
||||
|
|
|
@ -10,15 +10,6 @@ LL | Bar(42)
|
|||
= 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 @@ error: could not find defining uses
|
|||
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`.
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
//
|
||||
// edition:2018
|
||||
|
||||
// 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)]
|
||||
use std::future::Future;
|
||||
|
||||
pub struct Task<F: Future>(F);
|
||||
|
@ -26,5 +24,5 @@ fn main() {
|
|||
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());
|
||||
}
|
||||
|
|
|
@ -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`.
|
|
@ -5,9 +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))]
|
||||
#![feature(type_alias_impl_trait, rustc_attrs)]
|
||||
#![feature(generator_trait)]
|
||||
|
||||
extern crate metadata_sufficient_for_layout;
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
// build-pass (FIXME(62277): could be check-pass?)
|
||||
|
||||
trait Bar {}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
// build-pass (FIXME(62277): could be check-pass?)
|
||||
|
||||
trait Bar {}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
// build-pass (FIXME(62277): could be check-pass?)
|
||||
|
||||
trait Bar {}
|
||||
|
|
|
@ -1,8 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait OpaqueTrait {}
|
||||
impl<T> OpaqueTrait for T {}
|
||||
|
|
|
@ -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`.
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
|
||||
pub trait Bar {
|
||||
type E: Copy;
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
error[E0276]: impl has stricter requirements than trait
|
||||
--> $DIR/issue-55872-1.rs:14: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:10: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:10: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:14: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`.
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait Bar {
|
||||
type E: Copy;
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
error[E0277]: the trait bound `impl Future: Copy` is not satisfied
|
||||
--> $DIR/issue-55872-2.rs:13: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:15: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`.
|
|
@ -1,7 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait Bar {
|
||||
type E: Copy;
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
type X<'a, 'b> = impl std::fmt::Debug;
|
||||
|
||||
|
|
|
@ -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))]
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
type X = impl Clone;
|
||||
|
||||
fn bar<F: Fn(&i32) + Clone>(f: F) -> F {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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`.
|
|
@ -1,8 +1,6 @@
|
|||
// edition:2018
|
||||
|
||||
// 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)]
|
||||
|
||||
type F = impl core::future::Future<Output = u8>;
|
||||
|
||||
|
|
|
@ -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`.
|
|
@ -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
|
||||
|
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
#[derive(Clone)]
|
||||
struct CopyIfEq<T, U>(T, U);
|
||||
|
|
|
@ -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`.
|
|
@ -1,8 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
#[derive(Clone)]
|
||||
struct CopyIfEq<T, U>(T, U);
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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 {}
|
||||
|
||||
|
|
|
@ -1,8 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait OpaqueTrait {}
|
||||
impl<T> OpaqueTrait for T {}
|
||||
|
|
|
@ -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`.
|
|
@ -3,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait Meow {
|
||||
type MeowType;
|
||||
|
|
|
@ -1,8 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ LL | type Out = 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
|
||||
= 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 @@ LL | type InTypeAlias<R> = 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
|
||||
= 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 @@ LL | type InReturnInTypeAlias<R> = fn() -> 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
|
||||
= 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
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// compile-flags: -Z unpretty=hir
|
||||
|
||||
// revisions: min_tait full_tait
|
||||
#![feature(min_type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#[prelude_import]
|
||||
use ::std::prelude::rust_2015::*;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// 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]
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
// 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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait Animal {}
|
||||
|
||||
|
|
|
@ -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*/;
|
||||
}
|
|
@ -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)]
|
||||
|
|
|
@ -1,7 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
#![warn(unused_attributes)]
|
||||
|
||||
|
|
|
@ -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`.
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait Baz {}
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait Baz {}
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait Baz {}
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait Baz {}
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait TraitA {
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
// check-pass
|
||||
|
||||
// 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)]
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
pub trait Foo {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
#![deny(improper_ctypes)]
|
||||
|
||||
type A = impl Fn();
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,8 +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))]
|
||||
#![feature(type_alias_impl_trait, rustc_attrs)]
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
@ -2,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
mod m {
|
||||
struct Priv;
|
||||
|
|
|
@ -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`.
|
|
@ -1,8 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![deny(private_in_public)]
|
||||
|
||||
pub type Pub = impl Default;
|
||||
|
|
|
@ -1,8 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait Trait {}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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;
|
||||
|
|
|
@ -2,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(const_generics)]
|
||||
//~^ WARN the feature `const_generics` is incomplete
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
|
||||
--> $DIR/assoc-type-const.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
|
||||
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait UnwrapItemsExt {
|
||||
type Iter;
|
||||
|
|
|
@ -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`.
|
|
@ -2,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait UnwrapItemsExt<'a> {
|
||||
type Iter;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// 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)]
|
||||
// build-pass (FIXME(62277): could be check-pass?)
|
||||
|
||||
trait Bar {}
|
||||
|
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub type Foo = impl std::fmt::Debug;
|
||||
|
||||
|
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
pub trait View {
|
||||
type Tmp: Iterator<Item = u32>;
|
||||
|
|
|
@ -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() {
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// 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() {}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
type X<T> = impl Clone;
|
||||
//~^ ERROR the trait bound `T: Clone` is not satisfied
|
||||
|
|
|
@ -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`.
|
|
@ -1,9 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
type X<'a> = impl Into<&'static str> + From<&'a str>;
|
||||
//~^ ERROR mismatched types
|
||||
|
|
|
@ -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`.
|
|
@ -1,7 +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))]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
extern crate foreign_crate;
|
||||
|
||||
|
|
|
@ -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`.
|
|
@ -1,6 +1,4 @@
|
|||
// 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() {}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
@ -1,6 +1,4 @@
|
|||
// 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() {}
|
||||
|
||||
|
|
|
@ -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`.
|
|
@ -1,6 +1,4 @@
|
|||
// 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() {}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue