Stop special casing top level TAIT

This commit is contained in:
Matthew Jasper 2020-05-10 11:57:58 +01:00
parent d77e86142f
commit 4e49e67c44
44 changed files with 326 additions and 427 deletions

View file

@ -108,18 +108,12 @@ type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses
//~| ERROR could not find defining uses
//~| ERROR could not find defining uses
type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses
//~| ERROR could not find defining uses
//~| ERROR could not find defining uses
type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses
//~| ERROR could not find defining uses
//~| ERROR could not find defining uses
type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR could not find defining uses

View file

@ -223,30 +223,6 @@ LL | fn FAPIT3(_: impl Iterator<Item: 'static, Item: 'static>) {}
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:62:42
|
LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() }
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:64:42
|
LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() }
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:66:45
|
LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() }
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:75:39
|
@ -367,12 +343,6 @@ LL | type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
| |
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:108:1
|
LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:108:36
|
@ -381,14 +351,38 @@ LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
| |
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:113:1
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:62:42
|
LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | fn FRPIT1() -> impl Iterator<Item: Copy, Item: Send> { iter::empty() }
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:113:36
--> $DIR/duplicate.rs:64:42
|
LL | fn FRPIT2() -> impl Iterator<Item: Copy, Item: Copy> { iter::empty() }
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:66:45
|
LL | fn FRPIT3() -> impl Iterator<Item: 'static, Item: 'static> { iter::empty() }
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:108:51
|
LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
| ^^^^^^^^^
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:111:36
|
LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| ---------- ^^^^^^^^^^ re-bound here
@ -396,13 +390,13 @@ LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:118:1
--> $DIR/duplicate.rs:111:51
|
LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| ^^^^^^^^^
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:118:39
--> $DIR/duplicate.rs:114:39
|
LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -410,13 +404,19 @@ LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:123:1
--> $DIR/duplicate.rs:114:57
|
LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| ^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:117:14
|
LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:123:40
--> $DIR/duplicate.rs:117:40
|
LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
| ---------- ^^^^^^^^^^ re-bound here
@ -424,13 +424,13 @@ LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:128:1
--> $DIR/duplicate.rs:122:14
|
LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:128:40
--> $DIR/duplicate.rs:122:40
|
LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
| ---------- ^^^^^^^^^^ re-bound here
@ -438,13 +438,13 @@ LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:133:1
--> $DIR/duplicate.rs:127:14
|
LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:133:43
--> $DIR/duplicate.rs:127:43
|
LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -452,7 +452,7 @@ LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:139:36
--> $DIR/duplicate.rs:133:36
|
LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -460,7 +460,7 @@ LL | trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:141:36
--> $DIR/duplicate.rs:135:36
|
LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -468,7 +468,7 @@ LL | trait TRI2<T: Iterator<Item: Copy, Item: Copy>> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:143:39
--> $DIR/duplicate.rs:137:39
|
LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -476,7 +476,7 @@ LL | trait TRI3<T: Iterator<Item: 'static, Item: 'static>> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:145:34
--> $DIR/duplicate.rs:139:34
|
LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -484,7 +484,7 @@ LL | trait TRS1: Iterator<Item: Copy, Item: Send> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:147:34
--> $DIR/duplicate.rs:141:34
|
LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -492,7 +492,7 @@ LL | trait TRS2: Iterator<Item: Copy, Item: Copy> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:149:37
--> $DIR/duplicate.rs:143:37
|
LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -500,7 +500,7 @@ LL | trait TRS3: Iterator<Item: 'static, Item: 'static> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:151:45
--> $DIR/duplicate.rs:145:45
|
LL | trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -508,7 +508,7 @@ LL | trait TRW1<T> where T: Iterator<Item: Copy, Item: Send> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:153:45
--> $DIR/duplicate.rs:147:45
|
LL | trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -516,7 +516,7 @@ LL | trait TRW2<T> where T: Iterator<Item: Copy, Item: Copy> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:155:48
--> $DIR/duplicate.rs:149:48
|
LL | trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -524,7 +524,7 @@ LL | trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:157:46
--> $DIR/duplicate.rs:151:46
|
LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -532,7 +532,7 @@ LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:157:46
--> $DIR/duplicate.rs:151:46
|
LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -540,7 +540,7 @@ LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:160:46
--> $DIR/duplicate.rs:154:46
|
LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -548,7 +548,7 @@ LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:160:46
--> $DIR/duplicate.rs:154:46
|
LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -556,7 +556,7 @@ LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:163:49
--> $DIR/duplicate.rs:157:49
|
LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -564,7 +564,7 @@ LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:163:49
--> $DIR/duplicate.rs:157:49
|
LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -572,7 +572,7 @@ LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:166:43
--> $DIR/duplicate.rs:160:43
|
LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
| ---------- ^^^^^^^^^^ re-bound here
@ -580,7 +580,7 @@ LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:168:43
--> $DIR/duplicate.rs:162:43
|
LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
| ---------- ^^^^^^^^^^ re-bound here
@ -588,7 +588,7 @@ LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:170:46
--> $DIR/duplicate.rs:164:46
|
LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -596,7 +596,7 @@ LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:173:40
--> $DIR/duplicate.rs:167:40
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ---------- ^^^^^^^^^^ re-bound here
@ -604,7 +604,7 @@ LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:177:44
--> $DIR/duplicate.rs:171:44
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ---------- ^^^^^^^^^^ re-bound here
@ -612,7 +612,7 @@ LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:181:43
--> $DIR/duplicate.rs:175:43
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -620,113 +620,77 @@ LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| `Item` bound here first
error: could not find defining uses
--> $DIR/duplicate.rs:108:24
|
LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:108:36
|
LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:113:24
|
LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:113:36
|
LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:118:24
|
LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:118:39
|
LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:123:28
--> $DIR/duplicate.rs:117:28
|
LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:123:40
--> $DIR/duplicate.rs:117:40
|
LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:128:28
--> $DIR/duplicate.rs:122:28
|
LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:128:40
--> $DIR/duplicate.rs:122:40
|
LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:133:28
--> $DIR/duplicate.rs:127:28
|
LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:133:43
--> $DIR/duplicate.rs:127:43
|
LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:173:28
--> $DIR/duplicate.rs:167:28
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:173:40
--> $DIR/duplicate.rs:167:40
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:177:32
--> $DIR/duplicate.rs:171:32
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:177:44
--> $DIR/duplicate.rs:171:44
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:181:28
--> $DIR/duplicate.rs:175:28
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:181:43
--> $DIR/duplicate.rs:175:43
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: aborting due to 96 previous errors; 1 warning emitted
error: aborting due to 90 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0719`.

View file

@ -9,10 +9,14 @@ trait Bar {
impl Bar for () {
type Baa = impl Debug; //~ ERROR `impl Trait` in type aliases is unstable
fn define() -> Self::Baa { 0 }
fn define() -> Self::Baa {
0
}
}
fn define() -> Foo { 0 }
fn define() -> Foo {
0
}
trait TraitWithDefault {
type Assoc = impl Debug;
@ -26,20 +30,20 @@ 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` not allowed outside of function
//~| ERROR `impl Trait` not allowed outside of function
//~| ERROR `impl Trait` not allowed outside of function
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>);
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
//~| ERROR `impl Trait` not allowed outside of function
//~| ERROR `impl Trait` not allowed outside of function
//~| ERROR `impl Trait` not allowed outside of function
fn define() -> Self::Baa { (vec![true], 0u8, 0i32..1) }
fn define() -> Self::Baa {
(vec![true], 0u8, 0i32..1)
}
}
fn main() {}

View file

@ -17,7 +17,7 @@ LL | type Baa = impl Debug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: associated type defaults are unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:18:5
--> $DIR/feature-gate-type_alias_impl_trait.rs:22:5
|
LL | type Assoc = impl Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -26,7 +26,7 @@ LL | type Assoc = impl Debug;
= help: add `#![feature(associated_type_defaults)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:18:18
--> $DIR/feature-gate-type_alias_impl_trait.rs:22:18
|
LL | type Assoc = impl Debug;
| ^^^^^^^^^^
@ -35,7 +35,7 @@ LL | type Assoc = impl Debug;
= 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-type_alias_impl_trait.rs:24:24
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:24
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
@ -44,7 +44,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= 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-type_alias_impl_trait.rs:24:37
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:37
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
@ -53,7 +53,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= 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-type_alias_impl_trait.rs:24:49
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:49
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -62,7 +62,7 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= 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-type_alias_impl_trait.rs:24:70
--> $DIR/feature-gate-type_alias_impl_trait.rs:28:70
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
@ -71,84 +71,48 @@ LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl D
= 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-type_alias_impl_trait.rs:34:21
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:21
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
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(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:34:34
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:34
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
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(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:34:46
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:46
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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(type_alias_impl_trait)]` to the crate attributes to enable
error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/feature-gate-type_alias_impl_trait.rs:34:67
--> $DIR/feature-gate-type_alias_impl_trait.rs:39:67
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
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(type_alias_impl_trait)]` to the crate attributes to enable
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:18:18
--> $DIR/feature-gate-type_alias_impl_trait.rs:22:18
|
LL | type Assoc = impl Debug;
| ^^^^^^^^^^
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:24:24
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:24:37
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:24:49
|
LL | type NestedFree = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:34:21
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:34:34
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^
error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
--> $DIR/feature-gate-type_alias_impl_trait.rs:34:46
|
LL | type Baa = (Vec<impl Debug>, impl Debug, impl Iterator<Item = impl Debug>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 19 previous errors
error: aborting due to 13 previous errors
Some errors have detailed explanations: E0562, E0658.
For more information about an error, try `rustc --explain E0562`.

View file

@ -2,22 +2,24 @@
// the purposes of coherence checking
#![feature(type_alias_impl_trait)]
trait OpaqueTrait { }
impl<T> OpaqueTrait for T { }
trait OpaqueTrait {}
impl<T> OpaqueTrait for T {}
type OpaqueType = impl OpaqueTrait;
fn mk_opaque() -> OpaqueType { () }
fn mk_opaque() -> OpaqueType {
()
}
#[derive(Debug)]
struct D<T>(T);
trait AnotherTrait { }
impl<T: Send> AnotherTrait for T { }
trait AnotherTrait {}
impl<T: Send> AnotherTrait for T {}
// This is in error, because we cannot assume that `OpaqueType: !Send`.
// (We treat opaque types as "foreign types" that could grow more impls
// in the future.)
impl AnotherTrait for D<OpaqueType> {
//~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<OpaqueType>`
//~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
}
fn main() {}

View file

@ -1,11 +1,11 @@
error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<OpaqueType>`:
--> $DIR/auto-trait.rs:19:1
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 { }
LL | impl<T: Send> AnotherTrait for T {}
| -------------------------------- first implementation here
...
LL | impl AnotherTrait for D<OpaqueType> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<OpaqueType>`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0277]: the trait bound `S: std::marker::Copy` is not satisfied in `(S, T)`
--> $DIR/issue-55872-1.rs:12:5
--> $DIR/issue-55872-1.rs:12:14
|
LL | type E = impl Copy;
| ^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `S`
| ^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `S`
|
= note: required because it appears within the type `(S, T)`
= note: the return type of a function must have a statically known size
@ -12,10 +12,10 @@ LL | impl<S: Default + std::marker::Copy> Bar for S {
| ^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied in `(S, T)`
--> $DIR/issue-55872-1.rs:12:5
--> $DIR/issue-55872-1.rs:12:14
|
LL | type E = impl Copy;
| ^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `T`
| ^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `T`
|
= note: required because it appears within the type `(S, T)`
= note: the return type of a function must have a statically known size

View file

@ -1,8 +1,8 @@
error[E0277]: the trait bound `impl std::future::Future: std::marker::Copy` is not satisfied
--> $DIR/issue-55872-2.rs:13:5
--> $DIR/issue-55872-2.rs:13:14
|
LL | type E = impl Copy;
| ^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `impl std::future::Future`
| ^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `impl std::future::Future`
|
= note: the return type of a function must have a statically known size

View file

@ -2,21 +2,22 @@
// other trait
#![feature(type_alias_impl_trait)]
trait OpaqueTrait { }
impl<T> OpaqueTrait for T { }
trait OpaqueTrait {}
impl<T> OpaqueTrait for T {}
type OpaqueType = impl OpaqueTrait;
fn mk_opaque() -> OpaqueType { () }
fn mk_opaque() -> OpaqueType {
()
}
#[derive(Debug)]
struct D<T>(T);
trait AnotherTrait { }
impl<T: std::fmt::Debug> AnotherTrait for T { }
trait AnotherTrait {}
impl<T: std::fmt::Debug> AnotherTrait for T {}
// This is in error, because we cannot assume that `OpaqueType: !Debug`
impl AnotherTrait for D<OpaqueType> {
//~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<OpaqueType>`
//~^ ERROR conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
}
fn main() {}

View file

@ -1,13 +1,13 @@
error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<OpaqueType>`:
--> $DIR/negative-reasoning.rs:18:1
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 { }
LL | impl<T: std::fmt::Debug> AnotherTrait for T {}
| ------------------------------------------- first implementation here
...
LL | impl AnotherTrait for D<OpaqueType> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<OpaqueType>`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<impl OpaqueTrait>`
|
= note: upstream crates may add a new impl of trait `std::fmt::Debug` for type `OpaqueType` in future versions
= 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

View file

@ -256,16 +256,16 @@ LL | let _in_return_in_local_variable = || -> impl Fn() { || {} };
| ^^^^^^^^^
error: could not find defining uses
--> $DIR/where-allowed.rs:155:1
|
LL | type InTypeAlias<R> = impl Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/where-allowed.rs:119:5
--> $DIR/where-allowed.rs:119:16
|
LL | type Out = impl Debug;
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/where-allowed.rs:155:23
|
LL | type InTypeAlias<R> = impl Debug;
| ^^^^^^^^^^
error: aborting due to 42 previous errors

View file

@ -10,5 +10,5 @@ extern crate std;
trait Animal { }
fn main() {
pub type ServeFut = impl Animal;
pub type ServeFut = /*impl Trait*/;
}

View file

@ -62,10 +62,10 @@ LL | type U = impl Trait;
| -------------------- not a function or closure
error: could not find defining uses
--> $DIR/inline-trait-and-foreign-items.rs:26:5
--> $DIR/inline-trait-and-foreign-items.rs:26:14
|
LL | type U = impl Trait;
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^
error: aborting due to 6 previous errors; 2 warnings emitted

View file

@ -1,5 +1,4 @@
#![feature(type_alias_impl_trait)]
#![deny(improper_ctypes)]
type A = impl Fn();
@ -10,7 +9,7 @@ pub fn ret_closure() -> A {
extern "C" {
pub fn a(_: A);
//~^ ERROR `extern` block uses type `A`, which is not FFI-safe
//~^ ERROR `extern` block uses type `impl std::ops::Fn<()>`, which is not FFI-safe
}
fn main() {}

View file

@ -1,11 +1,11 @@
error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/opaque-ty-ffi-unsafe.rs:12:17
error: `extern` block uses type `impl std::ops::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:3:9
--> $DIR/opaque-ty-ffi-unsafe.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^

View file

@ -9,7 +9,9 @@ mod m {
trait PrivTr {}
impl PrivTr for Priv {}
pub trait PubTrAux1<T> {}
pub trait PubTrAux2 { type A; }
pub trait PubTrAux2 {
type A;
}
impl<T> PubTrAux1<T> for u8 {}
impl PubTrAux2 for u8 {
type A = Priv;
@ -41,8 +43,9 @@ mod m {
type Exist = impl PrivTr;
//~^ ERROR private trait `m::PrivTr` in public interface
//~| ERROR private trait `m::PrivTr` in public interface
fn infer_exist() -> Self::Exist { Priv }
fn infer_exist() -> Self::Exist {
Priv
}
}
}

View file

@ -1,5 +1,5 @@
error[E0446]: private type `m::Priv` in public interface
--> $DIR/private-in-public-assoc-ty.rs:15:9
--> $DIR/private-in-public-assoc-ty.rs:17:9
|
LL | struct Priv;
| - `m::Priv` declared as private
@ -8,7 +8,7 @@ LL | type A = Priv;
| ^^^^^^^^^^^^^^ can't leak private type
warning: private trait `m::PrivTr` in public interface (error E0445)
--> $DIR/private-in-public-assoc-ty.rs:21:5
--> $DIR/private-in-public-assoc-ty.rs:23:5
|
LL | / pub trait PubTr {
LL | |
@ -24,7 +24,7 @@ LL | | }
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
warning: private type `m::Priv` in public interface (error E0446)
--> $DIR/private-in-public-assoc-ty.rs:21:5
--> $DIR/private-in-public-assoc-ty.rs:23:5
|
LL | / pub trait PubTr {
LL | |
@ -39,7 +39,7 @@ LL | | }
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
warning: private type `m::Priv` in public interface (error E0446)
--> $DIR/private-in-public-assoc-ty.rs:21:5
--> $DIR/private-in-public-assoc-ty.rs:23:5
|
LL | / pub trait PubTr {
LL | |
@ -54,7 +54,7 @@ LL | | }
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
error[E0446]: private type `m::Priv` in public interface
--> $DIR/private-in-public-assoc-ty.rs:32:9
--> $DIR/private-in-public-assoc-ty.rs:34:9
|
LL | struct Priv;
| - `m::Priv` declared as private
@ -63,7 +63,7 @@ LL | type Alias4 = Priv;
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0446]: private type `m::Priv` in public interface
--> $DIR/private-in-public-assoc-ty.rs:39:9
--> $DIR/private-in-public-assoc-ty.rs:41:9
|
LL | struct Priv;
| - `m::Priv` declared as private
@ -72,7 +72,7 @@ LL | type Alias1 = Priv;
| ^^^^^^^^^^^^^^^^^^^ can't leak private type
error[E0445]: private trait `m::PrivTr` in public interface
--> $DIR/private-in-public-assoc-ty.rs:42:9
--> $DIR/private-in-public-assoc-ty.rs:44:9
|
LL | trait PrivTr {}
| - `m::PrivTr` declared as private
@ -80,16 +80,7 @@ LL | trait PrivTr {}
LL | type Exist = impl PrivTr;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error[E0445]: private trait `m::PrivTr` in public interface
--> $DIR/private-in-public-assoc-ty.rs:42:9
|
LL | trait PrivTr {}
| - `m::PrivTr` declared as private
...
LL | type Exist = impl PrivTr;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait
error: aborting due to 5 previous errors; 3 warnings emitted
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`.

View file

@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/issue-68621.rs:14:5
--> $DIR/issue-68621.rs:14:19
|
LL | type Future = impl Trait;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0277]: the trait bound `T: TraitWithAssoc` is not satisfied
--> $DIR/bound_reduction2.rs:10:1
--> $DIR/bound_reduction2.rs:10:15
|
LL | type Foo<V> = impl Trait<V>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitWithAssoc` is not implemented for `T`
| ^^^^^^^^^^^^^ the trait `TraitWithAssoc` is not implemented for `T`
|
help: consider further restricting this bound
|

View file

@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/declared_but_never_defined.rs:6:1
--> $DIR/declared_but_never_defined.rs:6:12
|
LL | type Bar = impl std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/declared_but_not_defined_in_scope.rs:7:5
--> $DIR/declared_but_not_defined_in_scope.rs:7:20
|
LL | pub type Boo = impl ::std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -13,16 +13,16 @@ LL | let z: i32 = x;
| expected due to this
...
LL | type WrongGeneric<T> = impl 'static;
| ------------------------------------ the found opaque type
| ------------ the found opaque type
|
= note: expected type `i32`
found opaque type `WrongGeneric::<&{integer}>`
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:9:1
--> $DIR/generic_type_does_not_live_long_enough.rs:9:24
|
LL | type WrongGeneric<T> = impl 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
| ^^^^^^^^^^^^ ...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`

View file

@ -5,10 +5,10 @@ LL | type Underconstrained<T: Trait> = impl 'static;
| ^^^^^^^^^^^^
error[E0277]: the trait bound `T: Trait` is not satisfied
--> $DIR/generic_underconstrained.rs:6:1
--> $DIR/generic_underconstrained.rs:6:35
|
LL | type Underconstrained<T: Trait> = impl 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
| ^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
|
= note: the return type of a function must have a statically known size
help: consider restricting type parameter `T`

View file

@ -11,10 +11,10 @@ LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
| ^^^^^^^^^^^^
error[E0277]: `U` doesn't implement `std::fmt::Debug`
--> $DIR/generic_underconstrained2.rs:5:1
--> $DIR/generic_underconstrained2.rs:5:45
|
LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
| ^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
...
LL | 5u32
| ---- this returned value is of type `u32`
@ -27,10 +27,10 @@ LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
| ^^^^^^^^^^^^^^^^^
error[E0277]: `V` doesn't implement `std::fmt::Debug`
--> $DIR/generic_underconstrained2.rs:14:1
--> $DIR/generic_underconstrained2.rs:14:46
|
LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
| ^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`
...
LL | 5u32
| ---- this returned value is of type `u32`

View file

@ -1,8 +1,8 @@
error[E0631]: type mismatch in closure arguments
--> $DIR/issue-57611-trait-alias.rs:17:5
--> $DIR/issue-57611-trait-alias.rs:17:16
|
LL | type Bar = impl Baz<Self, Self>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r X) -> _`
| ^^^^^^^^^^^^^^^^^^^^ expected signature of `for<'r> fn(&'r X) -> _`
...
LL | |x| x
| ----- found signature of `fn(_) -> _`
@ -10,10 +10,10 @@ LL | |x| x
= note: the return type of a function must have a statically known size
error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-57611-trait-alias.rs:21:9: 21:14] as std::ops::FnOnce<(&'r X,)>>::Output == &'r X`
--> $DIR/issue-57611-trait-alias.rs:17:5
--> $DIR/issue-57611-trait-alias.rs:17:16
|
LL | type Bar = impl Baz<Self, Self>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter, found concrete lifetime
| ^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter, found concrete lifetime
|
= note: the return type of a function must have a statically known size

View file

@ -8,20 +8,20 @@ LL | type Item = impl Bug;
= 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:8:5
--> $DIR/issue-60371.rs:8:17
|
LL | type Item = impl Bug;
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Bug` is not implemented for `()`
| ^^^^^^^^ the trait `Bug` is not implemented for `()`
|
= help: the following implementations were found:
<&() as Bug>
= note: the return type of a function must have a statically known size
error: could not find defining uses
--> $DIR/issue-60371.rs:8:5
--> $DIR/issue-60371.rs:8:17
|
LL | type Item = impl Bug;
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^
error: aborting due to 3 previous errors

View file

@ -1,10 +1,10 @@
error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:8:5: 8:28] as std::ops::FnOnce<()>>::Output == ()`
--> $DIR/issue-63279.rs:5:1
--> $DIR/issue-63279.rs:5:16
|
LL | type Closure = impl FnOnce();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found `()`
| ^^^^^^^^^^^^^ expected opaque type, found `()`
|
= note: expected opaque type `Closure`
= note: expected opaque type `impl std::ops::FnOnce<()>`
found unit type `()`
= note: the return type of a function must have a statically known size

View file

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/never_reveal_concrete_type.rs:13:27
|
LL | type NoReveal = impl std::fmt::Debug;
| ------------------------------------- the found opaque type
| -------------------- the found opaque type
...
LL | let _: &'static str = x;
| ------------ ^ expected `&str`, found opaque type
@ -10,9 +10,9 @@ LL | let _: &'static str = x;
| expected due to this
|
= note: expected reference `&'static str`
found opaque type `NoReveal`
found opaque type `impl std::fmt::Debug`
error[E0605]: non-primitive cast: `NoReveal` as `&'static str`
error[E0605]: non-primitive cast: `impl std::fmt::Debug` as `&'static str`
--> $DIR/never_reveal_concrete_type.rs:14:13
|
LL | let _ = x as &'static str;

View file

@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/no_inferrable_concrete_type.rs:6:1
--> $DIR/no_inferrable_concrete_type.rs:6:12
|
LL | type Foo = impl Copy;
| ^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^
error: aborting due to previous error

View file

@ -2,7 +2,7 @@ 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
| ---------------------- the found opaque type
...
LL | let _: &str = bomp();
| ---- ^^^^^^ expected `&str`, found opaque type
@ -10,20 +10,20 @@ LL | let _: &str = bomp();
| expected due to this
|
= note: expected reference `&str`
found opaque type `Boo`
found opaque type `impl std::fmt::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
| ---------------------- the expected opaque type
...
LL | fn bomp() -> boo::Boo {
| -------- expected `Boo` because of return type
| -------- expected `impl std::fmt::Debug` because of return type
LL | ""
| ^^ expected opaque type, found `&str`
|
= note: expected opaque type `Boo`
= note: expected opaque type `impl std::fmt::Debug`
found reference `&'static str`
error: aborting due to 2 previous errors

View file

@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/type-alias-impl-trait-with-cycle-error.rs:3:1
--> $DIR/type-alias-impl-trait-with-cycle-error.rs:3:12
|
LL | type Foo = impl Fn() -> Foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/type-alias-impl-trait-with-cycle-error2.rs:7:1
--> $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