summaryrefslogtreecommitdiffstats
path: root/tests/ui/dyn-star
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:19 +0000
commita0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch)
treefc451898ccaf445814e26b46664d78702178101d /tests/ui/dyn-star
parentAdding debian version 1.71.1+dfsg1-2. (diff)
downloadrustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz
rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/dyn-star')
-rw-r--r--tests/ui/dyn-star/box.rs4
-rw-r--r--tests/ui/dyn-star/param-env-infer.current.stderr18
-rw-r--r--tests/ui/dyn-star/param-env-infer.next.stderr73
-rw-r--r--tests/ui/dyn-star/param-env-infer.rs17
-rw-r--r--tests/ui/dyn-star/param-env-region-infer.current.stderr9
-rw-r--r--tests/ui/dyn-star/param-env-region-infer.next.stderr29
-rw-r--r--tests/ui/dyn-star/param-env-region-infer.rs22
7 files changed, 63 insertions, 109 deletions
diff --git a/tests/ui/dyn-star/box.rs b/tests/ui/dyn-star/box.rs
index d1f1819d9..87c8356a1 100644
--- a/tests/ui/dyn-star/box.rs
+++ b/tests/ui/dyn-star/box.rs
@@ -1,5 +1,7 @@
// run-pass
-// compile-flags: -C opt-level=0
+// revisions: current next
+//[current] compile-flags: -C opt-level=0
+//[next] compile-flags: -Ztrait-solver=next -C opt-level=0
#![feature(dyn_star)]
#![allow(incomplete_features)]
diff --git a/tests/ui/dyn-star/param-env-infer.current.stderr b/tests/ui/dyn-star/param-env-infer.current.stderr
deleted file mode 100644
index b3af7be79..000000000
--- a/tests/ui/dyn-star/param-env-infer.current.stderr
+++ /dev/null
@@ -1,18 +0,0 @@
-warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/param-env-infer.rs:5:12
- |
-LL | #![feature(dyn_star, pointer_like_trait)]
- | ^^^^^^^^
- |
- = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
- = note: `#[warn(incomplete_features)]` on by default
-
-error[E0282]: type annotations needed
- --> $DIR/param-env-infer.rs:13:10
- |
-LL | t as _
- | ^ cannot infer type
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/dyn-star/param-env-infer.next.stderr b/tests/ui/dyn-star/param-env-infer.next.stderr
deleted file mode 100644
index 64d76bb04..000000000
--- a/tests/ui/dyn-star/param-env-infer.next.stderr
+++ /dev/null
@@ -1,73 +0,0 @@
-warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/param-env-infer.rs:5:12
- |
-LL | #![feature(dyn_star, pointer_like_trait)]
- | ^^^^^^^^
- |
- = note: see issue #102425 <https://github.com/rust-lang/rust/issues/102425> for more information
- = note: `#[warn(incomplete_features)]` on by default
-
-error[E0391]: cycle detected when computing type of `make_dyn_star::{opaque#0}`
- --> $DIR/param-env-infer.rs:11:60
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: ...which requires borrow-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires promoting constants in MIR for `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires preparing `make_dyn_star` for borrow checking...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires unsafety-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building MIR for `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires match-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires building THIR for `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires type-checking `make_dyn_star`...
- --> $DIR/param-env-infer.rs:11:1
- |
-LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: ...which requires computing layout of `make_dyn_star::{opaque#0}`...
- = note: ...which requires normalizing `make_dyn_star::{opaque#0}`...
- = note: ...which again requires computing type of `make_dyn_star::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
- --> $DIR/param-env-infer.rs:5:1
- |
-LL | / #![feature(dyn_star, pointer_like_trait)]
-LL | |
-LL | |
-LL | | use std::fmt::Debug;
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/dyn-star/param-env-infer.rs b/tests/ui/dyn-star/param-env-infer.rs
deleted file mode 100644
index 1fb16d768..000000000
--- a/tests/ui/dyn-star/param-env-infer.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// revisions: current next
-//[next] compile-flags: -Ztrait-solver=next
-// incremental
-
-#![feature(dyn_star, pointer_like_trait)]
-//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes
-
-use std::fmt::Debug;
-use std::marker::PointerLike;
-
-fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
- //[next]~^ ERROR cycle detected when computing type of `make_dyn_star::{opaque#0}`
- t as _
- //[current]~^ ERROR type annotations needed
-}
-
-fn main() {}
diff --git a/tests/ui/dyn-star/param-env-region-infer.current.stderr b/tests/ui/dyn-star/param-env-region-infer.current.stderr
new file mode 100644
index 000000000..902053ecf
--- /dev/null
+++ b/tests/ui/dyn-star/param-env-region-infer.current.stderr
@@ -0,0 +1,9 @@
+error[E0282]: type annotations needed
+ --> $DIR/param-env-region-infer.rs:18:10
+ |
+LL | t as _
+ | ^ cannot infer type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/tests/ui/dyn-star/param-env-region-infer.next.stderr b/tests/ui/dyn-star/param-env-region-infer.next.stderr
new file mode 100644
index 000000000..dd724a659
--- /dev/null
+++ b/tests/ui/dyn-star/param-env-region-infer.next.stderr
@@ -0,0 +1,29 @@
+error[E0391]: cycle detected when computing type of `make_dyn_star::{opaque#0}`
+ --> $DIR/param-env-region-infer.rs:16:60
+ |
+LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: ...which requires type-checking `make_dyn_star`...
+ --> $DIR/param-env-region-infer.rs:16:1
+ |
+LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires computing layout of `make_dyn_star::{opaque#0}`...
+ = note: ...which requires normalizing `make_dyn_star::{opaque#0}`...
+ = note: ...which again requires computing type of `make_dyn_star::{opaque#0}`, completing the cycle
+note: cycle used when checking item types in top-level module
+ --> $DIR/param-env-region-infer.rs:10:1
+ |
+LL | / #![feature(dyn_star, pointer_like_trait)]
+LL | | #![allow(incomplete_features)]
+LL | |
+LL | | use std::fmt::Debug;
+... |
+LL | |
+LL | | fn main() {}
+ | |____________^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/dyn-star/param-env-region-infer.rs b/tests/ui/dyn-star/param-env-region-infer.rs
new file mode 100644
index 000000000..537473abc
--- /dev/null
+++ b/tests/ui/dyn-star/param-env-region-infer.rs
@@ -0,0 +1,22 @@
+// revisions: current next
+// Need `-Zdeduplicate-diagnostics=yes` because the number of cycle errors
+// emitted is for some horrible reason platform-specific.
+//[next] compile-flags: -Ztrait-solver=next -Zdeduplicate-diagnostics=yes
+// incremental
+
+// checks that we don't ICE if there are region inference variables in the environment
+// when computing `PointerLike` builtin candidates.
+
+#![feature(dyn_star, pointer_like_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+use std::marker::PointerLike;
+
+fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
+ //[next]~^ ERROR cycle detected when computing
+ t as _
+ //[current]~^ ERROR type annotations needed
+}
+
+fn main() {}