]> git.lizzy.rs Git - rust.git/blobdiff - crates/assists/src/handlers/introduce_named_lifetime.rs
Wrap remaining self/super/crate in Name{Ref}
[rust.git] / crates / assists / src / handlers / introduce_named_lifetime.rs
index 3f5f44d69162ac243f0e846bd4e4c5cbe237b994..02782eb6deddcf34e644cbf4746cd88c0a62dc15 100644 (file)
@@ -61,7 +61,7 @@ fn generate_fn_def_assist(
     // compute the location which implicitly has the same lifetime as the anonymous lifetime
     let loc_needing_lifetime = if let Some(self_param) = self_param {
         // if we have a self reference, use that
-        Some(self_param.self_token()?.text_range().start())
+        Some(self_param.name()?.syntax().text_range().start())
     } else {
         // otherwise, if there's a single reference parameter without a named liftime, use that
         let fn_params_without_lifetime: Vec<_> = param_list