Skip to content

Commit 01918b7

Browse files
authored
Clean up compile errors in vscode (#2565)
1 parent 5d5351a commit 01918b7

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

.vscode/settings.json

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
{
2-
"rust-analyzer.cargo.cfgs": {
3-
// This adds an extra cfg to rust-analyzer so we can prevent it from
4-
// analyzing tests with a lot of generated code. These can cause it to
5-
// hang or run slowly in general, which is bad for workflows.
6-
"rust_analyzer": null,
7-
}
8-
}
1+
{
2+
// Extra cfgs added to rust-analyzer.
3+
"rust-analyzer.cargo.cfgs": [
4+
// Expensive-to-compile tests can `cfg(not(rust_analyzer))` to avoid
5+
// slowing developers down.
6+
"rust_analyzer",
7+
// Converting unions to bytes currently requires a `cfg` feature.
8+
// Used in some tests.
9+
// See https://github.com/google/zerocopy/discussions/1802.
10+
"zerocopy_derive_union_into_bytes"
11+
],
12+
// The above list is duplicated so that the `cfg`s are also used in `cargo check`.
13+
// See https://github.com/rust-lang/rust-analyzer/issues/19926.
14+
"rust-analyzer.cargo.extraEnv": {
15+
"RUSTFLAGS": "--cfg rust_analyzer --cfg zerocopy_derive_union_into_bytes"
16+
}
17+
}

0 commit comments

Comments
 (0)