diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2025-01-28 14:34:47 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2025-01-28 14:54:02 +0100 |
| commit | 8e68c3fc623d94031c14019bee22fcab76edfdea (patch) | |
| tree | 383f9576d82ab707a421ba794a0a2979690a996b | |
| parent | 165f2760cab192ecc3154e821ed5c85c2a90f3da (diff) | |
| download | rust-8e68c3fc623d94031c14019bee22fcab76edfdea.tar.gz rust-8e68c3fc623d94031c14019bee22fcab76edfdea.zip | |
Disable `Receiver` based autoderef temporarily
3 files changed, 8 insertions, 6 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs b/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs index 62feca5f8cb..e0e366f4501 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/autoderef.rs @@ -194,7 +194,11 @@ pub(crate) fn deref_by_trait( } let trait_id = || { - if use_receiver_trait { + // FIXME: Remove the `false` once `Receiver` needs to be stabilized, doing so will + // effectively bump the MSRV of rust-analyzer to 1.84 due to 1.83 and below lacking the + // blanked impl on `Deref`. + #[expect(clippy::overly_complex_bool_expr)] + if use_receiver_trait && false { if let Some(receiver) = db.lang_item(table.trait_env.krate, LangItem::Receiver).and_then(|l| l.as_trait()) { diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/tests/method_resolution.rs b/src/tools/rust-analyzer/crates/hir-ty/src/tests/method_resolution.rs index 8866de22dfb..e5f791ea6ff 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/tests/method_resolution.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/tests/method_resolution.rs @@ -2163,9 +2163,9 @@ impl Receiver for Bar { fn main() { let bar = Bar; let _v1 = bar.foo1(); - //^^^ type: i32 + //^^^ type: {unknown} let _v2 = bar.foo2(); - //^^^ type: bool + //^^^ type: {unknown} } "#, ); diff --git a/src/tools/rust-analyzer/crates/ide-completion/src/completions/dot.rs b/src/tools/rust-analyzer/crates/ide-completion/src/completions/dot.rs index 0557265f235..b38b9ac1f53 100644 --- a/src/tools/rust-analyzer/crates/ide-completion/src/completions/dot.rs +++ b/src/tools/rust-analyzer/crates/ide-completion/src/completions/dot.rs @@ -1500,9 +1500,7 @@ fn main() { bar.$0 } "#, - expect![[r#" - me foo() fn(self: Bar) -"#]], + expect![[r#""#]], ); } |
