From 3de1a095e0ed52ade1b88d165d44d80455d3e6c5 Mon Sep 17 00:00:00 2001 From: Yacin Tmimi Date: Thu, 16 Jun 2022 08:51:19 -0400 Subject: [PATCH] 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" } ``` --- Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) 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