2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_variables)]
|
2015-02-12 10:29:52 -05:00
|
|
|
use std::marker::PhantomData;
|
|
|
|
|
|
2014-12-07 15:22:06 +00:00
|
|
|
fn main() {
|
2015-02-12 10:29:52 -05:00
|
|
|
struct Symbol<'a, F: Fn(Vec<&'a str>) -> &'a str> { function: F, marker: PhantomData<&'a ()> }
|
2015-03-18 09:22:38 -04:00
|
|
|
let f = |x: Vec<&str>| -> &str { "foobar" };
|
2015-02-12 10:29:52 -05:00
|
|
|
let sym = Symbol { function: f, marker: PhantomData };
|
2014-12-07 15:22:06 +00:00
|
|
|
(sym.function)(vec![]);
|
|
|
|
|
}
|