From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../trivial-bounds-inconsistent-sized.rs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs (limited to 'tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs') diff --git a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs new file mode 100644 index 000000000..bfa083655 --- /dev/null +++ b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs @@ -0,0 +1,27 @@ +// run-pass +// Check tautalogically false `Sized` bounds +#![feature(trivial_bounds)] +#![allow(unused)] + +trait A {} + +impl A for i32 {} + +struct T { + x: X, +} + +struct S(str, str) where str: Sized; +//~^ WARNING Sized does not depend on any type or lifetime + +fn unsized_local() where for<'a> T: Sized { + //~^ WARNING Sized does not depend on any type or lifetime + let x: T = *(Box::new(T { x: 1 }) as Box>); +} + +fn return_str() -> str where str: Sized { + //~^ WARNING Sized does not depend on any type or lifetime + *"Sized".to_string().into_boxed_str() +} + +fn main() {} -- cgit v1.2.3