]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/trivial-bounds/trivial-bounds-leak.rs
1 // Check that false bounds don't leak
2 #![feature(trivial_bounds)]
8 fn return_str() -> str where str: Sized
{
9 *"Sized".to_string().into_boxed_str()
12 fn cant_return_str() -> str { //~ ERROR
13 *"Sized".to_string().into_boxed_str()
16 fn my_function() where i32: Foo
20 generic_function(5i32);
24 3i32.test(); //~ ERROR
25 Foo
::test(&4i32); //~ ERROR
26 generic_function(5i32); //~ ERROR
29 fn generic_function
<T
: Foo
>(t
: T
) {}