mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
fix(assists): remove item_const
which had default value when implement missing members`
This commit is contained in:
parent
ac60077ee5
commit
a4f071afd5
3 changed files with 12 additions and 4 deletions
|
@ -196,6 +196,7 @@ trait Foo {
|
||||||
type Output;
|
type Output;
|
||||||
|
|
||||||
const CONST: usize = 42;
|
const CONST: usize = 42;
|
||||||
|
const CONST_2: i32;
|
||||||
|
|
||||||
fn foo(&self);
|
fn foo(&self);
|
||||||
fn bar(&self);
|
fn bar(&self);
|
||||||
|
@ -213,6 +214,7 @@ trait Foo {
|
||||||
type Output;
|
type Output;
|
||||||
|
|
||||||
const CONST: usize = 42;
|
const CONST: usize = 42;
|
||||||
|
const CONST_2: i32;
|
||||||
|
|
||||||
fn foo(&self);
|
fn foo(&self);
|
||||||
fn bar(&self);
|
fn bar(&self);
|
||||||
|
@ -226,7 +228,7 @@ impl Foo for S {
|
||||||
|
|
||||||
$0type Output;
|
$0type Output;
|
||||||
|
|
||||||
const CONST: usize = 42;
|
const CONST_2: i32;
|
||||||
|
|
||||||
fn foo(&self) {
|
fn foo(&self) {
|
||||||
todo!()
|
todo!()
|
||||||
|
@ -658,6 +660,7 @@ trait Foo {
|
||||||
type Output;
|
type Output;
|
||||||
|
|
||||||
const CONST: usize = 42;
|
const CONST: usize = 42;
|
||||||
|
const CONST_2: i32;
|
||||||
|
|
||||||
fn valid(some: u32) -> bool { false }
|
fn valid(some: u32) -> bool { false }
|
||||||
fn foo(some: u32) -> bool;
|
fn foo(some: u32) -> bool;
|
||||||
|
@ -669,13 +672,16 @@ trait Foo {
|
||||||
type Output;
|
type Output;
|
||||||
|
|
||||||
const CONST: usize = 42;
|
const CONST: usize = 42;
|
||||||
|
const CONST_2: i32;
|
||||||
|
|
||||||
fn valid(some: u32) -> bool { false }
|
fn valid(some: u32) -> bool { false }
|
||||||
fn foo(some: u32) -> bool;
|
fn foo(some: u32) -> bool;
|
||||||
}
|
}
|
||||||
struct S;
|
struct S;
|
||||||
impl Foo for S {
|
impl Foo for S {
|
||||||
$0fn valid(some: u32) -> bool { false }
|
$0const CONST: usize = 42;
|
||||||
|
|
||||||
|
fn valid(some: u32) -> bool { false }
|
||||||
}"#,
|
}"#,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1019,8 +1019,6 @@ struct Foo {
|
||||||
impl foo::Bar for Foo {
|
impl foo::Bar for Foo {
|
||||||
$0type Qux;
|
$0type Qux;
|
||||||
|
|
||||||
const Baz: usize = 42;
|
|
||||||
|
|
||||||
const Fez: usize;
|
const Fez: usize;
|
||||||
|
|
||||||
fn foo() {
|
fn foo() {
|
||||||
|
|
|
@ -119,6 +119,10 @@ pub fn filter_assoc_items(
|
||||||
(default_methods, def.body()),
|
(default_methods, def.body()),
|
||||||
(DefaultMethods::Only, Some(_)) | (DefaultMethods::No, None)
|
(DefaultMethods::Only, Some(_)) | (DefaultMethods::No, None)
|
||||||
),
|
),
|
||||||
|
ast::AssocItem::Const(def) => matches!(
|
||||||
|
(default_methods, def.body()),
|
||||||
|
(DefaultMethods::Only, Some(_)) | (DefaultMethods::No, None)
|
||||||
|
),
|
||||||
_ => default_methods == DefaultMethods::No,
|
_ => default_methods == DefaultMethods::No,
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
|
|
Loading…
Reference in a new issue