mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +00:00
Merge #10057
10057: fix: Remove incorrect assertion in extract_function r=Veykril a=Veykril This assertion is actually just wrong Fixes #10056 bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
3acbf94d29
1 changed files with 3 additions and 6 deletions
|
@ -601,10 +601,7 @@ impl FunctionBody {
|
||||||
if local_ref.is_self(sema.db) {
|
if local_ref.is_self(sema.db) {
|
||||||
match local_ref.source(sema.db).value {
|
match local_ref.source(sema.db).value {
|
||||||
Either::Right(it) => {
|
Either::Right(it) => {
|
||||||
stdx::always!(
|
self_param.replace(it);
|
||||||
self_param.replace(it).is_none(),
|
|
||||||
"body references two different self params"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
Either::Left(_) => {
|
Either::Left(_) => {
|
||||||
stdx::never!(
|
stdx::never!(
|
||||||
|
@ -2369,7 +2366,7 @@ struct S { f: i32 };
|
||||||
|
|
||||||
impl S {
|
impl S {
|
||||||
fn foo(&self) -> i32 {
|
fn foo(&self) -> i32 {
|
||||||
$01+self.f$0
|
$0self.f+self.f$0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
|
@ -2382,7 +2379,7 @@ impl S {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn $0fun_name(&self) -> i32 {
|
fn $0fun_name(&self) -> i32 {
|
||||||
1+self.f
|
self.f+self.f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"#,
|
"#,
|
||||||
|
|
Loading…
Reference in a new issue