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:
Benjamin Coenen 2020-04-08 18:12:15 +02:00
parent 18a5e16483
commit 8f1dba6f9a
4 changed files with 30 additions and 43 deletions

View file

@ -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###""###);
}