From 5363f350887b1e5b5dd21a86f88c8af9d7fea6da Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:25 +0200 Subject: Merging upstream version 1.67.1+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/coercion/coerce-expect-unsized-ascribed.rs | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/test/ui/coercion/coerce-expect-unsized-ascribed.rs') diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs b/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs index c139e823c..d7b11317a 100644 --- a/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs +++ b/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs @@ -6,27 +6,27 @@ use std::fmt::Debug; pub fn main() { - let _ = box { [1, 2, 3] }: Box<[i32]>; //~ ERROR mismatched types - let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>; //~ ERROR mismatched types - let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>; + 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 _ = box { |x| (x as u8) }: Box _>; //~ ERROR mismatched types - let _ = box if true { false } else { true }: Box; //~ ERROR mismatched types - let _ = box match true { true => 'a', false => 'b' }: Box; //~ ERROR mismatched types + let _ = type_ascribe!(box { |x| (x as u8) }, Box _>); //~ ERROR mismatched types + let _ = type_ascribe!(box if true { false } else { true }, Box); //~ ERROR mismatched types + let _ = type_ascribe!(box match true { true => 'a', false => 'b' }, Box); //~ ERROR mismatched types - let _ = &{ [1, 2, 3] }: &[i32]; //~ ERROR mismatched types - let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32]; //~ ERROR mismatched types - let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32]; + 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 _ = &{ |x| (x as u8) }: &dyn Fn(i32) -> _; //~ ERROR mismatched types - let _ = &if true { false } else { true }: &dyn Debug; //~ ERROR mismatched types - let _ = &match true { true => 'a', false => 'b' }: &dyn Debug; //~ 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 _ = Box::new([1, 2, 3]): Box<[i32]>; //~ ERROR mismatched types - let _ = Box::new(|x| (x as u8)): Box _>; //~ 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 _>); //~ ERROR mismatched types - let _ = vec![ + let _ = type_ascribe!(vec![ Box::new(|x| (x as u8)), box |x| (x as i16 as u8), - ]: Vec _>>; + ], Vec _>>); } -- cgit v1.2.3