about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYacin Tmimi <yacintmimi@gmail.com>2022-06-16 08:51:19 -0400
committerCaleb Cartwright <calebcartwright@users.noreply.github.com>2022-06-17 19:34:24 -0500
commit3de1a095e0ed52ade1b88d165d44d80455d3e6c5 (patch)
tree555df7c79d7d6f56643ca7aa22d398472cc7da6b
parent33c60740d3e1387a5979cac93785e605de8470e0 (diff)
downloadrust-3de1a095e0ed52ade1b88d165d44d80455d3e6c5.tar.gz
rust-3de1a095e0ed52ade1b88d165d44d80455d3e6c5.zip
Set `package.metadata.rust-analyzer.rustc_private=true` in Cargo.toml
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"
}
```
-rw-r--r--Cargo.toml4
1 files changed, 4 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index f26e9824062..4f5127e1de2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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