-
Notifications
You must be signed in to change notification settings - Fork 1k
Update dev guide with cross checking guides #4876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
42a543a
chore: add rust-analyzer example config
Cloud0310 45e496c
chore(config): add example config for cross checking and rust-analyzer
Cloud0310 2ba367a
docs(dev-guide): mention how to lint Windows-specific code on Unix
Cloud0310 be7787c
docs(dev-guide): mention rust-analyzer support for Windows-specific c…
Cloud0310 97de18a
docs(dev-guide): update platform-specific code guidance
Cloud0310 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Windows cross-checking for #[cfg(windows)] code on UNIX clippy config | ||
| # NOTE: requires a working cross-compiler. | ||
| # see https://rust-lang.github.io/rustup/dev-guide/linting.html#checking-windows-specific-code-on-unix | ||
|
|
||
| [build] | ||
| target = "x86_64-pc-windows-gnu" | ||
|
|
||
| # For clang only: uncomment and append the clang sysroot option per your distro | ||
| # NOTE: may need explicit sysroot config | ||
| # see Sysroot Matrix on https://rust-lang.github.io/rustup/dev-guide/linting.html#lint-1 | ||
| # [env] | ||
| # without explicit sysroot | ||
| # CC_x86_64_pc_windows_gnu = { value = "clang", force = true } | ||
|
|
||
| # with explicit sysroot | ||
| # CC_x86_64_pc_windows_gnu = { value = "clang --sysroot=<sysroot>", force = true } | ||
|
|
||
| # [target.x86_64-pc-windows-gnu] | ||
| # linker = "clang" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| /.settings | ||
| /.idea/ | ||
| /.vscode/ | ||
| rust-analyzer.toml | ||
| *~ | ||
| /**/target | ||
| /home | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Example rust-analyzer config for rustup development. | ||
| # Copy and rename to rust-analyzer.toml for recommended linting and diagnostics. | ||
|
|
||
| [check] | ||
| # Use clippy for checking | ||
| command = "clippy" | ||
|
|
||
| [cargo] | ||
| # Enable the "test" feature for test-specific code | ||
| features = ["test"] | ||
|
|
||
| # Alternatively, enable all features if needed | ||
| # features = "all" | ||
|
|
||
| # Uncomment the section below to enable Windows cross-checking for #[cfg(windows)] code on UNIX. | ||
| # NOTE: requires a working cross-compiler. | ||
| # see https://rust-lang.github.io/rustup/dev-guide/linting.html#checking-windows-specific-code-on-unix | ||
| # target = "x86_64-pc-windows-gnu" | ||
|
|
||
| # For clang only: uncomment and append the clang sysroot option per your distro | ||
| # NOTE: may need explicit sysroot config. | ||
| # see https://rust-lang.github.io/rustup/dev-guide/linting.html#lint-1 | ||
| # [cargo.extraEnv] | ||
| # CC_x86_64_pc_windows_gnu = "clang" | ||
| # CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER = "clang" | ||
|
|
||
| [diagnostics] | ||
| # Disable all dimming of inactive code due to current `cfg` | ||
| disabled = ["inactive-code"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.