Skip to content

Commit

Permalink
Use rustc_private instead of crates.io dependencies
Browse files Browse the repository at this point in the history
- Update rust-toolchain to also install `rustc-dev` component
  • Loading branch information
jyn514 authored and calebcartwright committed Apr 22, 2021
1 parent 6767c1d commit 61ee108
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 35 deletions.
32 changes: 1 addition & 31 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 0 additions & 2 deletions config_proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#![recursion_limit = "256"]

extern crate proc_macro;

mod attrs;
mod config_type;
mod item_enum;
Expand Down
4 changes: 3 additions & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nightly-2021-03-26
[toolchain]
channel = "nightly-2021-03-26"
components = ["rustc-dev"]
2 changes: 1 addition & 1 deletion src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![feature(rustc_private)]
#![deny(rust_2018_idioms)]
#![warn(unreachable_pub)]

Expand All @@ -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;
Expand Down

0 comments on commit 61ee108

Please sign in to comment.