about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-04-29 23:54:41 +0200
committerGitHub <noreply@github.com>2022-04-29 23:54:41 +0200
commit2003d833a5b96b81e47eeaf9b26ba8f6a097d072 (patch)
treeca8d1bcdbc2cd4e833b476a79dbb1f1fb3297d26 /src
parent0b96be79de8cc02483d32d4f503d54a91fcc0a4a (diff)
parent6e349c7f075d6791eec4c90aa3f2865dfd594da7 (diff)
downloadrust-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.rs19
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() {}