mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
feat: add attributes support on struct fields and method #3870
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
parent
18a5e16483
commit
8f1dba6f9a
4 changed files with 30 additions and 43 deletions
|
@ -324,7 +324,7 @@ fn no_such_field_diagnostics() {
|
|||
fn no_such_field_with_feature_flag_diagnostics() {
|
||||
let diagnostics = TestDB::with_files(
|
||||
r#"
|
||||
//- /lib.rs
|
||||
//- /lib.rs crate:foo cfg:feature=foo
|
||||
struct MyStruct {
|
||||
my_val: usize,
|
||||
#[cfg(feature = "foo")]
|
||||
|
@ -336,7 +336,7 @@ fn no_such_field_with_feature_flag_diagnostics() {
|
|||
pub(crate) fn new(my_val: usize, bar: bool) -> Self {
|
||||
Self { my_val, bar }
|
||||
}
|
||||
|
||||
|
||||
#[cfg(not(feature = "foo"))]
|
||||
pub(crate) fn new(my_val: usize, _bar: bool) -> Self {
|
||||
Self { my_val }
|
||||
|
@ -344,7 +344,8 @@ fn no_such_field_with_feature_flag_diagnostics() {
|
|||
}
|
||||
"#,
|
||||
)
|
||||
.diagnostics();
|
||||
.diagnostics()
|
||||
.0;
|
||||
|
||||
assert_snapshot!(diagnostics, "");
|
||||
assert_snapshot!(diagnostics, @r###""###);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue