summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs')
-rw-r--r--tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs b/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs
new file mode 100644
index 000000000..a1f38e69e
--- /dev/null
+++ b/tests/ui/traits/next-solver/dont-type_of-tait-in-defining-scope.rs
@@ -0,0 +1,24 @@
+// revisions: is_send not_send
+// compile-flags: -Znext-solver
+//[is_send] check-pass
+
+#![feature(type_alias_impl_trait)]
+
+#[cfg(is_send)]
+type Foo = impl Send;
+
+#[cfg(not_send)]
+type Foo = impl Sized;
+
+fn needs_send<T: Send>() {}
+
+fn test(_: Foo) {
+ needs_send::<Foo>();
+ //[not_send]~^ ERROR type annotations needed: cannot satisfy `Foo: Send`
+}
+
+fn defines(_: Foo) {
+ let _: Foo = ();
+}
+
+fn main() {}