]> git.proxmox.com Git - rustc.git/blob - tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / trivial-bounds / trivial-bounds-inconsistent-sized.rs
1 // run-pass
2 // Check tautalogically false `Sized` bounds
3 #![feature(trivial_bounds)]
4 #![allow(unused)]
5
6 trait A {}
7
8 impl A for i32 {}
9
10 struct T<X: ?Sized> {
11 x: X,
12 }
13
14 struct S(str, str) where str: Sized;
15 //~^ WARNING Sized does not depend on any type or lifetime
16
17 fn unsized_local() where for<'a> T<dyn A + 'a>: Sized {
18 //~^ WARNING Sized does not depend on any type or lifetime
19 let x: T<dyn A> = *(Box::new(T { x: 1 }) as Box<T<dyn A>>);
20 }
21
22 fn return_str() -> str where str: Sized {
23 //~^ WARNING Sized does not depend on any type or lifetime
24 *"Sized".to_string().into_boxed_str()
25 }
26
27 fn main() {}