diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-04-29 23:54:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-29 23:54:41 +0200 |
| commit | 2003d833a5b96b81e47eeaf9b26ba8f6a097d072 (patch) | |
| tree | ca8d1bcdbc2cd4e833b476a79dbb1f1fb3297d26 /src | |
| parent | 0b96be79de8cc02483d32d4f503d54a91fcc0a4a (diff) | |
| parent | 6e349c7f075d6791eec4c90aa3f2865dfd594da7 (diff) | |
| download | rust-2003d833a5b96b81e47eeaf9b26ba8f6a097d072.tar.gz rust-2003d833a5b96b81e47eeaf9b26ba8f6a097d072.zip | |
Rollup merge of #96559 - cjgillot:elided-path-fn, r=petrochenkov
Use the correct lifetime binder for elided lifetimes in path. Fixes https://github.com/rust-lang/rust/issues/96540
Diffstat (limited to 'src')
| -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() {} |
