This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +79
-0
lines changed
tests/ui/associated-inherent-types Expand file tree Collapse file tree 3 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 1+ error[E0637]: `&` without an explicit lifetime name cannot be used here
2+ --> $DIR/issue-109071.rs:8:17
3+ |
4+ LL | type Item = &[T];
5+ | ^ explicit lifetime name needed here
6+
7+ error[E0107]: missing generics for struct `Windows`
8+ --> $DIR/issue-109071.rs:7:9
9+ |
10+ LL | impl<T> Windows {
11+ | ^^^^^^^ expected 1 generic argument
12+ |
13+ note: struct defined here, with 1 generic parameter: `T`
14+ --> $DIR/issue-109071.rs:5:8
15+ |
16+ LL | struct Windows<T> {}
17+ | ^^^^^^^ -
18+ help: add missing generic argument
19+ |
20+ LL | impl<T> Windows<T> {
21+ | +++
22+
23+ error[E0658]: inherent associated types are unstable
24+ --> $DIR/issue-109071.rs:8:5
25+ |
26+ LL | type Item = &[T];
27+ | ^^^^^^^^^^^^^^^^^
28+ |
29+ = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
30+ = help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
31+
32+ error: aborting due to 3 previous errors
33+
34+ Some errors have detailed explanations: E0107, E0637, E0658.
35+ For more information about an error, try `rustc --explain E0107`.
Original file line number Diff line number Diff line change 1+ // revisions: with_gate no_gate
2+ #![ cfg_attr( with_gate, feature( inherent_associated_types) ) ]
3+ #![ cfg_attr( with_gate, allow( incomplete_features) ) ]
4+
5+ struct Windows < T > { }
6+
7+ impl < T > Windows { //~ ERROR: missing generics for struct `Windows`
8+ type Item = & [ T ] ; //~ ERROR: `&` without an explicit lifetime name cannot be used here
9+ //[no_gate]~^ ERROR: inherent associated types are unstable
10+
11+ fn next ( ) -> Option < Self :: Item > { }
12+ }
13+
14+ impl < T > Windows < T > {
15+ fn T ( ) -> Option < Self :: Item > { }
16+ }
17+
18+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0637]: `&` without an explicit lifetime name cannot be used here
2+ --> $DIR/issue-109071.rs:8:17
3+ |
4+ LL | type Item = &[T];
5+ | ^ explicit lifetime name needed here
6+
7+ error[E0107]: missing generics for struct `Windows`
8+ --> $DIR/issue-109071.rs:7:9
9+ |
10+ LL | impl<T> Windows {
11+ | ^^^^^^^ expected 1 generic argument
12+ |
13+ note: struct defined here, with 1 generic parameter: `T`
14+ --> $DIR/issue-109071.rs:5:8
15+ |
16+ LL | struct Windows<T> {}
17+ | ^^^^^^^ -
18+ help: add missing generic argument
19+ |
20+ LL | impl<T> Windows<T> {
21+ | +++
22+
23+ error: aborting due to 2 previous errors
24+
25+ Some errors have detailed explanations: E0107, E0637.
26+ For more information about an error, try `rustc --explain E0107`.
You can’t perform that action at this time.
0 commit comments