mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Remove incorrect assertion in extract_function
This commit is contained in:
parent
55d4813561
commit
5c3a93ca9e
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…
Add table
Add a link
Reference in a new issue