rust/tests/ui/higher-rank-trait-bounds/hrtb-precedence-of-plus.rs

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

14 lines
367 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616
// Test that `Fn(isize) -> isize + 'static` parses as `(Fn(isize) -> isize) +
// 'static` and not `Fn(isize) -> (isize + 'static)`. The latter would
// cause a compilation error. Issue #18772.
2019-05-28 18:47:21 +00:00
fn adder(y: isize) -> Box<dyn Fn(isize) -> isize + 'static> {
Box::new(move |x| y + x)
}
fn main() {}