summaryrefslogtreecommitdiffstats
path: root/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/coercion/coerce-expect-unsized-ascribed.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/coercion/coerce-expect-unsized-ascribed.rs')
-rw-r--r--src/test/ui/coercion/coerce-expect-unsized-ascribed.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs b/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs
deleted file mode 100644
index d7b11317a..000000000
--- a/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs
+++ /dev/null
@@ -1,32 +0,0 @@
-// A version of coerce-expect-unsized that uses type ascription.
-// Doesn't work so far, but supposed to work eventually
-
-#![feature(box_syntax, type_ascription)]
-
-use std::fmt::Debug;
-
-pub fn main() {
- let _ = type_ascribe!(box { [1, 2, 3] }, Box<[i32]>); //~ ERROR mismatched types
- let _ = type_ascribe!(box if true { [1, 2, 3] } else { [1, 3, 4] }, Box<[i32]>); //~ ERROR mismatched types
- let _ = type_ascribe!(box match true { true => [1, 2, 3], false => [1, 3, 4] }, Box<[i32]>);
- //~^ ERROR mismatched types
- let _ = type_ascribe!(box { |x| (x as u8) }, Box<dyn Fn(i32) -> _>); //~ ERROR mismatched types
- let _ = type_ascribe!(box if true { false } else { true }, Box<dyn Debug>); //~ ERROR mismatched types
- let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box<dyn Debug>); //~ ERROR mismatched types
-
- let _ = type_ascribe!(&{ [1, 2, 3] }, &[i32]); //~ ERROR mismatched types
- let _ = type_ascribe!(&if true { [1, 2, 3] } else { [1, 3, 4] }, &[i32]); //~ ERROR mismatched types
- let _ = type_ascribe!(&match true { true => [1, 2, 3], false => [1, 3, 4] }, &[i32]);
- //~^ ERROR mismatched types
- let _ = type_ascribe!(&{ |x| (x as u8) }, &dyn Fn(i32) -> _); //~ ERROR mismatched types
- let _ = type_ascribe!(&if true { false } else { true }, &dyn Debug); //~ ERROR mismatched types
- let _ = type_ascribe!(&match true { true => 'a', false => 'b' }, &dyn Debug); //~ ERROR mismatched types
-
- let _ = type_ascribe!(Box::new([1, 2, 3]), Box<[i32]>); //~ ERROR mismatched types
- let _ = type_ascribe!(Box::new(|x| (x as u8)), Box<dyn Fn(i32) -> _>); //~ ERROR mismatched types
-
- let _ = type_ascribe!(vec![
- Box::new(|x| (x as u8)),
- box |x| (x as i16 as u8),
- ], Vec<Box<dyn Fn(i32) -> _>>);
-}