Use rustc_private instead of crates.io dependencies

- Update rust-toolchain to also install `rustc-dev` component
This commit is contained in:
Joshua Nelson 2021-02-16 22:25:41 -05:00 committed by Caleb Cartwright
parent 6767c1d051
commit 61ee1089f0
5 changed files with 16 additions and 35 deletions

View file

@ -64,34 +64,4 @@ thiserror = "1.0"
# for more information.
rustc-workspace-hack = "1.0.0"
[dependencies.rustc_ast]
package = "rustc-ap-rustc_ast"
version = "712.0.0"
[dependencies.rustc_ast_pretty]
package = "rustc-ap-rustc_ast_pretty"
version = "712.0.0"
[dependencies.rustc_data_structures]
package = "rustc-ap-rustc_data_structures"
version = "712.0.0"
[dependencies.rustc_errors]
package = "rustc-ap-rustc_errors"
version = "712.0.0"
[dependencies.rustc_expand]
package = "rustc-ap-rustc_expand"
version = "712.0.0"
[dependencies.rustc_parse]
package = "rustc-ap-rustc_parse"
version = "712.0.0"
[dependencies.rustc_session]
package = "rustc-ap-rustc_session"
version = "712.0.0"
[dependencies.rustc_span]
package = "rustc-ap-rustc_span"
version = "712.0.0"
# Rustc dependencies are loaded from the sysroot, Cargo doesn't know about them.

View file

@ -2,8 +2,6 @@
#![recursion_limit = "256"]
extern crate proc_macro;
mod attrs;
mod config_type;
mod item_enum;

View file

@ -1 +1,3 @@
nightly-2021-03-26
[toolchain]
channel = "nightly-2021-03-26"
components = ["rustc-dev"]

View file

@ -376,7 +376,7 @@ impl Rewrite for ast::Attribute {
}
}
impl<'a> Rewrite for [ast::Attribute] {
impl Rewrite for [ast::Attribute] {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String> {
if self.is_empty() {
return Some(String::new());

View file

@ -1,3 +1,4 @@
#![feature(rustc_private)]
#![deny(rust_2018_idioms)]
#![warn(unreachable_pub)]
@ -9,6 +10,16 @@ extern crate lazy_static;
#[macro_use]
extern crate log;
// N.B. these crates are loaded from the sysroot, so they need extern crate.
extern crate rustc_ast;
extern crate rustc_ast_pretty;
extern crate rustc_data_structures;
extern crate rustc_errors;
extern crate rustc_expand;
extern crate rustc_parse;
extern crate rustc_session;
extern crate rustc_span;
use std::cell::RefCell;
use std::collections::HashMap;
use std::fmt;