about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-06-13 07:36:45 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-07-26 19:00:30 +0200
commita2254d5d7c57be00cc640c0f7a8e21b320e947aa (patch)
tree016552dc2fb54b88a46be82da86354f9b954f72c
parentc9b31839b624345d59fda6e595b9abae71fcea13 (diff)
downloadrust-a2254d5d7c57be00cc640c0f7a8e21b320e947aa.tar.gz
rust-a2254d5d7c57be00cc640c0f7a8e21b320e947aa.zip
Do not produce extra lifetime parameters when not needed.
-rw-r--r--compiler/rustc_resolve/src/late.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 9b5fd4ea6d1..bc5668bcec0 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -1632,6 +1632,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
                 | PathSource::Struct
                 | PathSource::TupleStruct(..) => false,
             };
+            if !missing && !segment.has_generic_args {
+                continue;
+            }
 
             let elided_lifetime_span = if segment.has_generic_args {
                 // If there are brackets, but not generic arguments, then use the opening bracket