Skip to content

Commit

Permalink
Set package.metadata.rust-analyzer.rustc_private=true in Cargo.toml
Browse files Browse the repository at this point in the history
By setting this value in the Cargo.toml rust-analyzer understands that
rustfmt uses compiler-internals using `extern crate`.

This is a universal step that all developers will need to take in order to
get better type hints and code completion suggestions for
compiler-internals in their editor.

**Note**: users will also need to install the `rustc-dev` component via
`rustup` and add the following to their rust-analyzer configuration:

```json
{
    "rust-analyzer.rustcSource": "discover",
    "rust-analyzer.updates.channel": "nightly"
}
```
  • Loading branch information
ytmimi authored and calebcartwright committed Jun 18, 2022
1 parent 33c6074 commit 3de1a09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ rustfmt-config_proc_macro = { version = "0.2", path = "config_proc_macro" }
rustc-workspace-hack = "1.0.0"

# Rustc dependencies are loaded from the sysroot, Cargo doesn't know about them.

[package.metadata.rust-analyzer]
# This package uses #[feature(rustc_private)]
rustc_private = true

0 comments on commit 3de1a09

Please sign in to comment.