rust/tests/ui/issues/issue-17816.rs

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

11 lines
321 B
Rust
Raw Normal View History

//@ run-pass
#![allow(unused_variables)]
use std::marker::PhantomData;
2014-12-07 15:22:06 +00:00
fn main() {
struct Symbol<'a, F: Fn(Vec<&'a str>) -> &'a str> { function: F, marker: PhantomData<&'a ()> }
let f = |x: Vec<&str>| -> &str { "foobar" };
let sym = Symbol { function: f, marker: PhantomData };
2014-12-07 15:22:06 +00:00
(sym.function)(vec![]);
}