diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-29 18:48:48 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-29 18:51:21 +0200 |
| commit | f66de50f8a0b98f539f9882115cb1d1aa4c8e182 (patch) | |
| tree | 5792ab011e94c4fe7536694a38918ae9a497660d /src/test | |
| parent | e85edd9a844b523a02dbd89f3c02cd13e4c9fe46 (diff) | |
| download | rust-f66de50f8a0b98f539f9882115cb1d1aa4c8e182.tar.gz rust-f66de50f8a0b98f539f9882115cb1d1aa4c8e182.zip | |
Use the correct lifetime binder for elided lifetimes in path.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/lifetimes/elided-lifetime-in-path-in-impl-Fn.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/lifetimes/elided-lifetime-in-path-in-impl-Fn.rs b/src/test/ui/lifetimes/elided-lifetime-in-path-in-impl-Fn.rs new file mode 100644 index 00000000000..9c9965d8fb8 --- /dev/null +++ b/src/test/ui/lifetimes/elided-lifetime-in-path-in-impl-Fn.rs @@ -0,0 +1,19 @@ +// check-pass + +struct Foo<'a>(&'a ()); + +fn with_fn() -> fn(Foo) { + |_| () +} + +fn with_impl_fn() -> impl Fn(Foo) { + |_| () +} + +fn with_where_fn<T>() +where + T: Fn(Foo), +{ +} + +fn main() {} |
