diff options
| author | Michael Goulet <michael@errs.io> | 2024-07-02 15:55:17 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-07-02 17:28:03 -0400 |
| commit | b1059ccda210e11c19b3c639a13ddd64de781daf (patch) | |
| tree | a96817d5cd61b9e690e48dc079395ce3905eb7fe /compiler/rustc_lint/src/internal.rs | |
| parent | 3273ccea4b2c1995a7ddd059657ded593eb859c9 (diff) | |
| download | rust-b1059ccda210e11c19b3c639a13ddd64de781daf.tar.gz rust-b1059ccda210e11c19b3c639a13ddd64de781daf.zip | |
Instance::resolve -> Instance::try_resolve, and other nits
Diffstat (limited to 'compiler/rustc_lint/src/internal.rs')
| -rw-r--r-- | compiler/rustc_lint/src/internal.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index 9110cccdc46..772cc2ff8b9 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -88,7 +88,7 @@ declare_lint_pass!(QueryStability => [POTENTIAL_QUERY_INSTABILITY]); impl LateLintPass<'_> for QueryStability { fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { let Some((span, def_id, args)) = typeck_results_of_method_fn(cx, expr) else { return }; - if let Ok(Some(instance)) = ty::Instance::resolve(cx.tcx, cx.param_env, def_id, args) { + if let Ok(Some(instance)) = ty::Instance::try_resolve(cx.tcx, cx.param_env, def_id, args) { let def_id = instance.def_id(); if cx.tcx.has_attr(def_id, sym::rustc_lint_query_instability) { cx.emit_span_lint( @@ -393,7 +393,7 @@ impl LateLintPass<'_> for Diagnostics { }; // Is the callee marked with `#[rustc_lint_diagnostics]`? - let has_attr = ty::Instance::resolve(cx.tcx, cx.param_env, def_id, fn_gen_args) + let has_attr = ty::Instance::try_resolve(cx.tcx, cx.param_env, def_id, fn_gen_args) .ok() .flatten() .is_some_and(|inst| cx.tcx.has_attr(inst.def_id(), sym::rustc_lint_diagnostics)); |
