-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
- Loading branch information
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
tests/ui/associated-inherent-types/issue-109071.no_gate.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
error[E0637]: `&` without an explicit lifetime name cannot be used here | ||
--> $DIR/issue-109071.rs:8:17 | ||
| | ||
LL | type Item = &[T]; | ||
| ^ explicit lifetime name needed here | ||
|
||
error[E0107]: missing generics for struct `Windows` | ||
--> $DIR/issue-109071.rs:7:9 | ||
| | ||
LL | impl<T> Windows { | ||
| ^^^^^^^ expected 1 generic argument | ||
| | ||
note: struct defined here, with 1 generic parameter: `T` | ||
--> $DIR/issue-109071.rs:5:8 | ||
| | ||
LL | struct Windows<T> {} | ||
| ^^^^^^^ - | ||
help: add missing generic argument | ||
| | ||
LL | impl<T> Windows<T> { | ||
| +++ | ||
|
||
error[E0658]: inherent associated types are unstable | ||
--> $DIR/issue-109071.rs:8:5 | ||
| | ||
LL | type Item = &[T]; | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information | ||
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0107, E0637, E0658. | ||
For more information about an error, try `rustc --explain E0107`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// revisions: with_gate no_gate | ||
#![cfg_attr(with_gate, feature(inherent_associated_types))] | ||
#![cfg_attr(with_gate, allow(incomplete_features))] | ||
|
||
struct Windows<T> {} | ||
|
||
impl<T> Windows { //~ ERROR: missing generics for struct `Windows` | ||
type Item = &[T]; //~ ERROR: `&` without an explicit lifetime name cannot be used here | ||
//[no_gate]~^ ERROR: inherent associated types are unstable | ||
|
||
fn next() -> Option<Self::Item> {} | ||
} | ||
|
||
impl<T> Windows<T> { | ||
fn T() -> Option<Self::Item> {} | ||
} | ||
|
||
fn main() {} |
26 changes: 26 additions & 0 deletions
26
tests/ui/associated-inherent-types/issue-109071.with_gate.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error[E0637]: `&` without an explicit lifetime name cannot be used here | ||
--> $DIR/issue-109071.rs:8:17 | ||
| | ||
LL | type Item = &[T]; | ||
| ^ explicit lifetime name needed here | ||
|
||
error[E0107]: missing generics for struct `Windows` | ||
--> $DIR/issue-109071.rs:7:9 | ||
| | ||
LL | impl<T> Windows { | ||
| ^^^^^^^ expected 1 generic argument | ||
| | ||
note: struct defined here, with 1 generic parameter: `T` | ||
--> $DIR/issue-109071.rs:5:8 | ||
| | ||
LL | struct Windows<T> {} | ||
| ^^^^^^^ - | ||
help: add missing generic argument | ||
| | ||
LL | impl<T> Windows<T> { | ||
| +++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0107, E0637. | ||
For more information about an error, try `rustc --explain E0107`. |