about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2021-08-25 19:14:50 -0300
committerSantiago Pastorino <spastorino@gmail.com>2021-08-25 19:14:50 -0300
commit5df5659a6b96436ae55fd6bd8e9a7dbe7e22b37d (patch)
tree373477730da73e0ce38f4d7d69f42211999779d1
parent7b0e554ee2c94e9b3865a8c2d24d720224512dec (diff)
downloadrust-5df5659a6b96436ae55fd6bd8e9a7dbe7e22b37d.tar.gz
rust-5df5659a6b96436ae55fd6bd8e9a7dbe7e22b37d.zip
Revert "Add type of a let tait test impl trait straight in let"
This reverts commit dbadab54df148b55b2e884440bfaeaa38517e6e8.
This is not part of TAITs, so, if tested should probably be done
elsewhere.
-rw-r--r--src/test/ui/type-alias-impl-trait/type_of_a_let2.rs25
-rw-r--r--src/test/ui/type-alias-impl-trait/type_of_a_let2.stderr21
2 files changed, 0 insertions, 46 deletions
diff --git a/src/test/ui/type-alias-impl-trait/type_of_a_let2.rs b/src/test/ui/type-alias-impl-trait/type_of_a_let2.rs
deleted file mode 100644
index 33d3f164ce1..00000000000
--- a/src/test/ui/type-alias-impl-trait/type_of_a_let2.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-#![feature(type_alias_impl_trait)]
-#![allow(dead_code)]
-
-// FIXME This should be under a feature flag
-
-use std::fmt::Debug;
-
-fn foo1() -> u32 {
-    let x: impl Debug = 22_u32;
-    //~^ ERROR: `impl Trait` not allowed outside of function and method return types [E0562]
-    x // ERROR: we only know x: Debug, we don't know x = u32
-}
-
-fn foo2() -> u32 {
-    let x: impl Debug = 22_u32;
-    //~^ ERROR: `impl Trait` not allowed outside of function and method return types [E0562]
-    let y: impl Debug = x;
-    //~^ ERROR: `impl Trait` not allowed outside of function and method return types [E0562]
-    same_type((x, y)); // ERROR
-    x
-}
-
-fn same_type<T>(x: (T, T)) {}
-
-fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/type_of_a_let2.stderr b/src/test/ui/type-alias-impl-trait/type_of_a_let2.stderr
deleted file mode 100644
index 7a1825a8e2d..00000000000
--- a/src/test/ui/type-alias-impl-trait/type_of_a_let2.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0562]: `impl Trait` not allowed outside of function and method return types
-  --> $DIR/type_of_a_let2.rs:9:12
-   |
-LL |     let x: impl Debug = 22_u32;
-   |            ^^^^^^^^^^
-
-error[E0562]: `impl Trait` not allowed outside of function and method return types
-  --> $DIR/type_of_a_let2.rs:15:12
-   |
-LL |     let x: impl Debug = 22_u32;
-   |            ^^^^^^^^^^
-
-error[E0562]: `impl Trait` not allowed outside of function and method return types
-  --> $DIR/type_of_a_let2.rs:17:12
-   |
-LL |     let y: impl Debug = x;
-   |            ^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0562`.