about summary refs log tree commit diff
path: root/tests/ui/traits
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2023-10-03 13:50:07 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2023-10-03 13:59:59 +0200
commit3f0a327fbbb28c90fb33425aa8871d0c0d4a9c48 (patch)
treef09be77a86f1b129688cb969289b31c4f5754c40 /tests/ui/traits
parenta1c7a1c89f61adc43e9674af3c9c120eb6271a91 (diff)
downloadrust-3f0a327fbbb28c90fb33425aa8871d0c0d4a9c48.tar.gz
rust-3f0a327fbbb28c90fb33425aa8871d0c0d4a9c48.zip
non_lifetime_binders: fix ICE in lint opaque-hidden-inferred-bound
Diffstat (limited to 'tests/ui/traits')
-rw-r--r--tests/ui/traits/non_lifetime_binders/on-rpit.rs16
-rw-r--r--tests/ui/traits/non_lifetime_binders/on-rpit.stderr11
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/traits/non_lifetime_binders/on-rpit.rs b/tests/ui/traits/non_lifetime_binders/on-rpit.rs
new file mode 100644
index 00000000000..c501e057e28
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/on-rpit.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+trait Trait<T: ?Sized> {}
+
+impl<T: ?Sized> Trait<T> for i32 {}
+
+fn produce() -> impl for<T> Trait<T> {
+    16
+}
+
+fn main() {
+    let _ = produce();
+}
diff --git a/tests/ui/traits/non_lifetime_binders/on-rpit.stderr b/tests/ui/traits/non_lifetime_binders/on-rpit.stderr
new file mode 100644
index 00000000000..34c56068c5c
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/on-rpit.stderr
@@ -0,0 +1,11 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/on-rpit.rs:3:12
+   |
+LL | #![feature(non_lifetime_binders)]
+   |            ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
+   = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+