Skip to content

Commit f045b21

Browse files
Add removed comments back in self-outlives-lint
1 parent ce16189 commit f045b21

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

compiler/rustc_typeck/src/check/wfcheck.rs

-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ fn check_gat_where_clauses(tcx: TyCtxt<'_>, associated_items: &[hir::TraitItemRe
342342
param_env,
343343
required_bounds_by_item.get(&item_def_id),
344344
);
345-
// FIXME(compiler-errors): Do we want to add a assoc ty default to the wf_tys?
346345
gather_gat_bounds(
347346
tcx,
348347
param_env,

src/test/ui/generic-associated-types/self-outlives-lint.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![feature(generic_associated_types)]
22

3+
// check-fail
4+
35
use std::fmt::Debug;
46

57
// We have a `&'a self`, so we need a `Self: 'a`
@@ -115,6 +117,7 @@ trait TraitLifetime<'a> {
115117
}
116118

117119
// Like above, but we have a where clause that can prove what we want
120+
// FIXME: we require two bounds (`where Self: 'a, Self: 'b`) when we should only require one
118121
trait TraitLifetimeWhere<'a> where Self: 'a {
119122
type Bar<'b>;
120123
//~^ missing required

src/test/ui/generic-associated-types/self-outlives-lint.stderr

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: missing required bound on `Item`
2-
--> $DIR/self-outlives-lint.rs:7:5
2+
--> $DIR/self-outlives-lint.rs:9:5
33
|
44
LL | type Item<'x>;
55
| ^^^^^^^^^^^^^-
@@ -10,7 +10,7 @@ LL | type Item<'x>;
1010
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
1111

1212
error: missing required bound on `Out`
13-
--> $DIR/self-outlives-lint.rs:23:5
13+
--> $DIR/self-outlives-lint.rs:25:5
1414
|
1515
LL | type Out<'x>;
1616
| ^^^^^^^^^^^^-
@@ -21,7 +21,7 @@ LL | type Out<'x>;
2121
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
2222

2323
error: missing required bound on `Out`
24-
--> $DIR/self-outlives-lint.rs:37:5
24+
--> $DIR/self-outlives-lint.rs:39:5
2525
|
2626
LL | type Out<'x>;
2727
| ^^^^^^^^^^^^-
@@ -32,7 +32,7 @@ LL | type Out<'x>;
3232
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
3333

3434
error: missing required bounds on `Out`
35-
--> $DIR/self-outlives-lint.rs:44:5
35+
--> $DIR/self-outlives-lint.rs:46:5
3636
|
3737
LL | type Out<'x, 'y>;
3838
| ^^^^^^^^^^^^^^^^-
@@ -43,7 +43,7 @@ LL | type Out<'x, 'y>;
4343
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
4444

4545
error: missing required bound on `Out`
46-
--> $DIR/self-outlives-lint.rs:59:5
46+
--> $DIR/self-outlives-lint.rs:61:5
4747
|
4848
LL | type Out<'x, D>;
4949
| ^^^^^^^^^^^^^^^-
@@ -54,7 +54,7 @@ LL | type Out<'x, D>;
5454
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
5555

5656
error: missing required bound on `Out`
57-
--> $DIR/self-outlives-lint.rs:75:5
57+
--> $DIR/self-outlives-lint.rs:77:5
5858
|
5959
LL | type Out<'x, D>;
6060
| ^^^^^^^^^^^^^^^-
@@ -65,7 +65,7 @@ LL | type Out<'x, D>;
6565
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
6666

6767
error: missing required bound on `Out`
68-
--> $DIR/self-outlives-lint.rs:90:5
68+
--> $DIR/self-outlives-lint.rs:92:5
6969
|
7070
LL | type Out<'x, D>;
7171
| ^^^^^^^^^^^^^^^-
@@ -76,7 +76,7 @@ LL | type Out<'x, D>;
7676
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
7777

7878
error: missing required bounds on `Bar`
79-
--> $DIR/self-outlives-lint.rs:112:5
79+
--> $DIR/self-outlives-lint.rs:114:5
8080
|
8181
LL | type Bar<'b>;
8282
| ^^^^^^^^^^^^-
@@ -87,7 +87,7 @@ LL | type Bar<'b>;
8787
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
8888

8989
error: missing required bound on `Bar`
90-
--> $DIR/self-outlives-lint.rs:119:5
90+
--> $DIR/self-outlives-lint.rs:122:5
9191
|
9292
LL | type Bar<'b>;
9393
| ^^^^^^^^^^^^-
@@ -98,7 +98,7 @@ LL | type Bar<'b>;
9898
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
9999

100100
error: missing required bound on `Bar`
101-
--> $DIR/self-outlives-lint.rs:126:5
101+
--> $DIR/self-outlives-lint.rs:129:5
102102
|
103103
LL | type Bar<'b>;
104104
| ^^^^^^^^^^^^-
@@ -109,7 +109,7 @@ LL | type Bar<'b>;
109109
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
110110

111111
error: missing required bound on `Item`
112-
--> $DIR/self-outlives-lint.rs:139:5
112+
--> $DIR/self-outlives-lint.rs:142:5
113113
|
114114
LL | type Item<'a>;
115115
| ^^^^^^^^^^^^^-
@@ -120,7 +120,7 @@ LL | type Item<'a>;
120120
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
121121

122122
error: missing required bound on `Iterator`
123-
--> $DIR/self-outlives-lint.rs:141:5
123+
--> $DIR/self-outlives-lint.rs:144:5
124124
|
125125
LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
126126
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
@@ -131,7 +131,7 @@ LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
131131
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
132132

133133
error: missing required bound on `Item`
134-
--> $DIR/self-outlives-lint.rs:147:5
134+
--> $DIR/self-outlives-lint.rs:150:5
135135
|
136136
LL | type Item<'a>;
137137
| ^^^^^^^^^^^^^-
@@ -142,7 +142,7 @@ LL | type Item<'a>;
142142
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
143143

144144
error: missing required bound on `Bar`
145-
--> $DIR/self-outlives-lint.rs:156:5
145+
--> $DIR/self-outlives-lint.rs:159:5
146146
|
147147
LL | type Bar<'a, 'b>;
148148
| ^^^^^^^^^^^^^^^^-
@@ -153,7 +153,7 @@ LL | type Bar<'a, 'b>;
153153
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
154154

155155
error: missing required bound on `Fut`
156-
--> $DIR/self-outlives-lint.rs:172:5
156+
--> $DIR/self-outlives-lint.rs:175:5
157157
|
158158
LL | type Fut<'out>;
159159
| ^^^^^^^^^^^^^^-

0 commit comments

Comments
 (0)