]> git.lizzy.rs Git - rust.git/commitdiff
Add removed comments back in self-outlives-lint
authorMichael Goulet <michael@errs.io>
Mon, 14 Feb 2022 17:08:06 +0000 (09:08 -0800)
committerMichael Goulet <michael@errs.io>
Tue, 15 Feb 2022 17:17:09 +0000 (09:17 -0800)
compiler/rustc_typeck/src/check/wfcheck.rs
src/test/ui/generic-associated-types/self-outlives-lint.rs
src/test/ui/generic-associated-types/self-outlives-lint.stderr

index d18682f5b62b207e1725035f9f42c5c46db8c250..55757251e26fdb1c5acd34182b89d07f71f68356 100644 (file)
@@ -342,7 +342,6 @@ fn check_gat_where_clauses(tcx: TyCtxt<'_>, associated_items: &[hir::TraitItemRe
                             param_env,
                             required_bounds_by_item.get(&item_def_id),
                         );
-                        // FIXME(compiler-errors): Do we want to add a assoc ty default to the wf_tys?
                         gather_gat_bounds(
                             tcx,
                             param_env,
index b91e72c601972abe3d0ec07fe89fd5db7db57c06..300907adbfc11546356902ade82985d5496c45b6 100644 (file)
@@ -1,5 +1,7 @@
 #![feature(generic_associated_types)]
 
+// check-fail
+
 use std::fmt::Debug;
 
 // We have a `&'a self`, so we need a `Self: 'a`
@@ -115,6 +117,7 @@ trait TraitLifetime<'a> {
 }
 
 // Like above, but we have a where clause that can prove what we want
+// FIXME: we require two bounds (`where Self: 'a, Self: 'b`) when we should only require one
 trait TraitLifetimeWhere<'a> where Self: 'a {
     type Bar<'b>;
     //~^ missing required
index ccdfb0c1d794cb73c7e4ac582df5c65c26b286b1..fdb1f50a7764c94d3e61b83ee87851107fc48929 100644 (file)
@@ -1,5 +1,5 @@
 error: missing required bound on `Item`
-  --> $DIR/self-outlives-lint.rs:7:5
+  --> $DIR/self-outlives-lint.rs:9:5
    |
 LL |     type Item<'x>;
    |     ^^^^^^^^^^^^^-
@@ -10,7 +10,7 @@ LL |     type Item<'x>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Out`
-  --> $DIR/self-outlives-lint.rs:23:5
+  --> $DIR/self-outlives-lint.rs:25:5
    |
 LL |     type Out<'x>;
    |     ^^^^^^^^^^^^-
@@ -21,7 +21,7 @@ LL |     type Out<'x>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Out`
-  --> $DIR/self-outlives-lint.rs:37:5
+  --> $DIR/self-outlives-lint.rs:39:5
    |
 LL |     type Out<'x>;
    |     ^^^^^^^^^^^^-
@@ -32,7 +32,7 @@ LL |     type Out<'x>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bounds on `Out`
-  --> $DIR/self-outlives-lint.rs:44:5
+  --> $DIR/self-outlives-lint.rs:46:5
    |
 LL |     type Out<'x, 'y>;
    |     ^^^^^^^^^^^^^^^^-
@@ -43,7 +43,7 @@ LL |     type Out<'x, 'y>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Out`
-  --> $DIR/self-outlives-lint.rs:59:5
+  --> $DIR/self-outlives-lint.rs:61:5
    |
 LL |     type Out<'x, D>;
    |     ^^^^^^^^^^^^^^^-
@@ -54,7 +54,7 @@ LL |     type Out<'x, D>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Out`
-  --> $DIR/self-outlives-lint.rs:75:5
+  --> $DIR/self-outlives-lint.rs:77:5
    |
 LL |     type Out<'x, D>;
    |     ^^^^^^^^^^^^^^^-
@@ -65,7 +65,7 @@ LL |     type Out<'x, D>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Out`
-  --> $DIR/self-outlives-lint.rs:90:5
+  --> $DIR/self-outlives-lint.rs:92:5
    |
 LL |     type Out<'x, D>;
    |     ^^^^^^^^^^^^^^^-
@@ -76,7 +76,7 @@ LL |     type Out<'x, D>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bounds on `Bar`
-  --> $DIR/self-outlives-lint.rs:112:5
+  --> $DIR/self-outlives-lint.rs:114:5
    |
 LL |     type Bar<'b>;
    |     ^^^^^^^^^^^^-
@@ -87,7 +87,7 @@ LL |     type Bar<'b>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Bar`
-  --> $DIR/self-outlives-lint.rs:119:5
+  --> $DIR/self-outlives-lint.rs:122:5
    |
 LL |     type Bar<'b>;
    |     ^^^^^^^^^^^^-
@@ -98,7 +98,7 @@ LL |     type Bar<'b>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Bar`
-  --> $DIR/self-outlives-lint.rs:126:5
+  --> $DIR/self-outlives-lint.rs:129:5
    |
 LL |     type Bar<'b>;
    |     ^^^^^^^^^^^^-
@@ -109,7 +109,7 @@ LL |     type Bar<'b>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Item`
-  --> $DIR/self-outlives-lint.rs:139:5
+  --> $DIR/self-outlives-lint.rs:142:5
    |
 LL |     type Item<'a>;
    |     ^^^^^^^^^^^^^-
@@ -120,7 +120,7 @@ LL |     type Item<'a>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Iterator`
-  --> $DIR/self-outlives-lint.rs:141:5
+  --> $DIR/self-outlives-lint.rs:144:5
    |
 LL |     type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
@@ -131,7 +131,7 @@ LL |     type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Item`
-  --> $DIR/self-outlives-lint.rs:147:5
+  --> $DIR/self-outlives-lint.rs:150:5
    |
 LL |     type Item<'a>;
    |     ^^^^^^^^^^^^^-
@@ -142,7 +142,7 @@ LL |     type Item<'a>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Bar`
-  --> $DIR/self-outlives-lint.rs:156:5
+  --> $DIR/self-outlives-lint.rs:159:5
    |
 LL |     type Bar<'a, 'b>;
    |     ^^^^^^^^^^^^^^^^-
@@ -153,7 +153,7 @@ LL |     type Bar<'a, 'b>;
    = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
 
 error: missing required bound on `Fut`
-  --> $DIR/self-outlives-lint.rs:172:5
+  --> $DIR/self-outlives-lint.rs:175:5
    |
 LL |     type Fut<'out>;
    |     ^^^^^^^^^^^^^^-