diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-17 00:19:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-17 00:19:34 +0100 |
| commit | cc60e210767f0110c5c1910bdf3c47633aae62bf (patch) | |
| tree | aee97585979ac1b0a2779856ba396abe8023f1d1 | |
| parent | dd6534ae878b7361b08c29d994d6767027ebfae8 (diff) | |
| parent | 27a476839f9fbedbecddf2f42bf40a94c4558ef1 (diff) | |
| download | rust-cc60e210767f0110c5c1910bdf3c47633aae62bf.tar.gz rust-cc60e210767f0110c5c1910bdf3c47633aae62bf.zip | |
Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot
Implement partial support for non-lifetime binders This implements support for non-lifetime binders. It's pretty useless currently, but I wanted to put this up so the implementation can be discussed. Specifically, this piggybacks off of the late-bound lifetime collection code in `rustc_hir_typeck::collect::lifetimes`. This seems like a necessary step given the fact we don't resolve late-bound regions until this point, and binders are sometimes merged. Q: I'm not sure if I should go along this route, or try to modify the earlier nameres code to compute the right bound var indices for type and const binders eagerly... If so, I'll need to rename all these queries to something more appropriate (I've done this for `resolve_lifetime::Region` -> `resolve_lifetime::ResolvedArg`) cc rust-lang/types-team#81 r? `@ghost`
| -rw-r--r-- | clippy_lints/src/ptr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index d88409c356e..fc550936165 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -505,13 +505,13 @@ fn check_mut_from_ref<'tcx>(cx: &LateContext<'tcx>, sig: &FnSig<'_>, body: Optio if let FnRetTy::Return(ty) = sig.decl.output && let Some((out, Mutability::Mut, _)) = get_ref_lm(ty) { - let out_region = cx.tcx.named_region(out.hir_id); + let out_region = cx.tcx.named_bound_var(out.hir_id); let args: Option<Vec<_>> = sig .decl .inputs .iter() .filter_map(get_ref_lm) - .filter(|&(lt, _, _)| cx.tcx.named_region(lt.hir_id) == out_region) + .filter(|&(lt, _, _)| cx.tcx.named_bound_var(lt.hir_id) == out_region) .map(|(_, mutability, span)| (mutability == Mutability::Not).then_some(span)) .collect(); if let Some(args) = args |
