diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-17816.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-17816.rs b/src/test/ui/issues/issue-17816.rs new file mode 100644 index 000000000..7ca47d503 --- /dev/null +++ b/src/test/ui/issues/issue-17816.rs @@ -0,0 +1,10 @@ +// run-pass +#![allow(unused_variables)] +use std::marker::PhantomData; + +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 }; + (sym.function)(vec![]); +} |