rust/tests/ui/wf/wf-in-fn-ret.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
255 B
Rust
Raw Normal View History

// Check that we enforce WF conditions also for return types in fn items.
#![feature(rustc_attrs)]
#![allow(dead_code)]
struct MustBeCopy<T: Copy> {
t: T,
}
fn bar<T>() -> MustBeCopy<T> //~ ERROR E0277
//~^ ERROR mismatched types
{
}
fn main() {}