about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJack Huey <31162821+jackh726@users.noreply.github.com>2022-09-16 09:47:07 -0400
committerJack Huey <31162821+jackh726@users.noreply.github.com>2022-09-16 09:47:07 -0400
commit92b759f517d57b092178a6d6cbadc7856263d910 (patch)
treee403f572b3216f50759d60781859705e5f50ea1b /src/test
parentbba514b7b4f3062139d17ce1e4ab26b396c8ad49 (diff)
downloadrust-92b759f517d57b092178a6d6cbadc7856263d910.tar.gz
rust-92b759f517d57b092178a6d6cbadc7856263d910.zip
Revert "Better errors for implied static bound"
This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs35
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr20
-rw-r--r--src/test/ui/nll/local-outlives-static-via-hrtb.stderr12
3 files changed, 0 insertions, 67 deletions
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs
deleted file mode 100644
index 719d1bd5a4c..00000000000
--- a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// check-fail
-// known-bug
-
-// This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for
-// all 'a where I::Item<'a> is WF", but really means "for all 'a possible"
-
-use std::fmt::Debug;
-
-pub trait LendingIterator {
-    type Item<'this>
-    where
-        Self: 'this;
-}
-
-pub struct WindowsMut<'x> {
-    slice: &'x (),
-}
-
-impl<'y> LendingIterator for WindowsMut<'y> {
-    type Item<'this> = &'this mut () where 'y: 'this;
-}
-
-fn print_items<I>(_iter: I)
-where
-    I: LendingIterator,
-    for<'a> I::Item<'a>: Debug,
-{
-}
-
-fn main() {
-    let slice = &mut ();
-    //~^ temporary value dropped while borrowed
-    let windows = WindowsMut { slice };
-    print_items::<WindowsMut<'_>>(windows);
-}
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr
deleted file mode 100644
index 414999881d4..00000000000
--- a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0716]: temporary value dropped while borrowed
-  --> $DIR/hrtb-implied-1.rs:31:22
-   |
-LL |     let slice = &mut ();
-   |                      ^^ creates a temporary which is freed while still in use
-...
-LL |     print_items::<WindowsMut<'_>>(windows);
-   |     -------------------------------------- argument requires that borrow lasts for `'static`
-LL | }
-   | - temporary value is freed at the end of this statement
-   |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
-  --> $DIR/hrtb-implied-1.rs:26:26
-   |
-LL |     for<'a> I::Item<'a>: Debug,
-   |                          ^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/nll/local-outlives-static-via-hrtb.stderr b/src/test/ui/nll/local-outlives-static-via-hrtb.stderr
index f5c10f3ddea..61009da49ff 100644
--- a/src/test/ui/nll/local-outlives-static-via-hrtb.stderr
+++ b/src/test/ui/nll/local-outlives-static-via-hrtb.stderr
@@ -9,12 +9,6 @@ LL |     assert_static_via_hrtb(&local);
 LL |     assert_static_via_hrtb_with_assoc_type(&&local);
 LL | }
    | - `local` dropped here while still borrowed
-   |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
-  --> $DIR/local-outlives-static-via-hrtb.rs:15:53
-   |
-LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}
-   |                                                     ^^^^^^^^^^^^
 
 error[E0597]: `local` does not live long enough
   --> $DIR/local-outlives-static-via-hrtb.rs:25:45
@@ -26,12 +20,6 @@ LL |     assert_static_via_hrtb_with_assoc_type(&&local);
    |     argument requires that `local` is borrowed for `'static`
 LL | }
    | - `local` dropped here while still borrowed
-   |
-note: due to current limitations in the borrow checker, this implies a `'static` lifetime
-  --> $DIR/local-outlives-static-via-hrtb.rs:19:20
-   |
-LL |     for<'a> &'a T: Reference<AssociatedType = &'a ()>,
-   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors