Skip to content

Commit

Permalink
Merge pull request #19061 from Veykril/push-rwyqqtqmnput
Browse files Browse the repository at this point in the history
Disable `Receiver` based autoderef temporarily
  • Loading branch information
Veykril authored Jan 28, 2025
2 parents a995319 + 8a9992c commit 1f86729
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 5 additions & 1 deletion crates/hir-ty/src/autoderef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/tests/method_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
"#,
);
Expand Down
4 changes: 1 addition & 3 deletions crates/ide-completion/src/completions/dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1500,9 +1500,7 @@ fn main() {
bar.$0
}
"#,
expect![[r#"
me foo() fn(self: Bar)
"#]],
expect![[r#""#]],
);
}

Expand Down

0 comments on commit 1f86729

Please sign in to comment.