summaryrefslogtreecommitdiff
path: root/tests/ui/lazy-type-alias
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-08 03:30:56 +0200
committerGitHub <noreply@github.com>2023-08-08 03:30:56 +0200
commit418b91a3d7abade84a652b55634c88cc7d06b7da (patch)
treebaf98c7159e7e6ec8d25d400ae18c94063a27840 /tests/ui/lazy-type-alias
parent3cd0a109a8a603dd1d6be5a102c404bb53bd67be (diff)
parentba4a2f7cb72016613ac4b1fe66ee2f6704d9cd73 (diff)
Rollup merge of #114594 - compiler-errors:new-solver-resolve-aliases, r=lcnr
Structurally normalize weak and inherent in new solver It seems pretty obvious to me that we should be normalizing weak and inherent aliases too, since they can always be normalized. This PR still leaves open the question of what to do with opaques, though 💀 **Also**, we need to structurally resolve the target of a coercion, for the UI test to work. r? `@lcnr`
Diffstat (limited to 'tests/ui/lazy-type-alias')
-rw-r--r--tests/ui/lazy-type-alias/coerce-behind-lazy.current.stderr11
-rw-r--r--tests/ui/lazy-type-alias/coerce-behind-lazy.next.stderr11
-rw-r--r--tests/ui/lazy-type-alias/coerce-behind-lazy.rs16
3 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/lazy-type-alias/coerce-behind-lazy.current.stderr b/tests/ui/lazy-type-alias/coerce-behind-lazy.current.stderr
new file mode 100644
index 00000000000..98b3921dec4
--- /dev/null
+++ b/tests/ui/lazy-type-alias/coerce-behind-lazy.current.stderr
@@ -0,0 +1,11 @@
+warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/coerce-behind-lazy.rs:5:12
+ |
+LL | #![feature(lazy_type_alias)]
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lazy-type-alias/coerce-behind-lazy.next.stderr b/tests/ui/lazy-type-alias/coerce-behind-lazy.next.stderr
new file mode 100644
index 00000000000..98b3921dec4
--- /dev/null
+++ b/tests/ui/lazy-type-alias/coerce-behind-lazy.next.stderr
@@ -0,0 +1,11 @@
+warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/coerce-behind-lazy.rs:5:12
+ |
+LL | #![feature(lazy_type_alias)]
+ | ^^^^^^^^^^^^^^^
+ |
+ = note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
+ = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/lazy-type-alias/coerce-behind-lazy.rs b/tests/ui/lazy-type-alias/coerce-behind-lazy.rs
new file mode 100644
index 00000000000..745eadb9625
--- /dev/null
+++ b/tests/ui/lazy-type-alias/coerce-behind-lazy.rs
@@ -0,0 +1,16 @@
+// check-pass
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
+#![feature(lazy_type_alias)]
+//~^ WARN the feature `lazy_type_alias` is incomplete
+
+use std::any::Any;
+
+type Coerce = Box<dyn Any>;
+
+fn test() -> Coerce {
+ Box::new(1)
+}
+
+fn main() {}