Skip to content

Commit 61ee108

Browse files
jyn514calebcartwright
authored andcommitted
Use rustc_private instead of crates.io dependencies
- Update rust-toolchain to also install `rustc-dev` component
1 parent 6767c1d commit 61ee108

File tree

5 files changed

+16
-35
lines changed

5 files changed

+16
-35
lines changed

Cargo.toml

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,34 +64,4 @@ thiserror = "1.0"
6464
# for more information.
6565
rustc-workspace-hack = "1.0.0"
6666

67-
[dependencies.rustc_ast]
68-
package = "rustc-ap-rustc_ast"
69-
version = "712.0.0"
70-
71-
[dependencies.rustc_ast_pretty]
72-
package = "rustc-ap-rustc_ast_pretty"
73-
version = "712.0.0"
74-
75-
[dependencies.rustc_data_structures]
76-
package = "rustc-ap-rustc_data_structures"
77-
version = "712.0.0"
78-
79-
[dependencies.rustc_errors]
80-
package = "rustc-ap-rustc_errors"
81-
version = "712.0.0"
82-
83-
[dependencies.rustc_expand]
84-
package = "rustc-ap-rustc_expand"
85-
version = "712.0.0"
86-
87-
[dependencies.rustc_parse]
88-
package = "rustc-ap-rustc_parse"
89-
version = "712.0.0"
90-
91-
[dependencies.rustc_session]
92-
package = "rustc-ap-rustc_session"
93-
version = "712.0.0"
94-
95-
[dependencies.rustc_span]
96-
package = "rustc-ap-rustc_span"
97-
version = "712.0.0"
67+
# Rustc dependencies are loaded from the sysroot, Cargo doesn't know about them.

config_proc_macro/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
33
#![recursion_limit = "256"]
44

5-
extern crate proc_macro;
6-
75
mod attrs;
86
mod config_type;
97
mod item_enum;

rust-toolchain

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
nightly-2021-03-26
1+
[toolchain]
2+
channel = "nightly-2021-03-26"
3+
components = ["rustc-dev"]

src/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ impl Rewrite for ast::Attribute {
376376
}
377377
}
378378

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

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![feature(rustc_private)]
12
#![deny(rust_2018_idioms)]
23
#![warn(unreachable_pub)]
34

@@ -9,6 +10,16 @@ extern crate lazy_static;
910
#[macro_use]
1011
extern crate log;
1112

13+
// N.B. these crates are loaded from the sysroot, so they need extern crate.
14+
extern crate rustc_ast;
15+
extern crate rustc_ast_pretty;
16+
extern crate rustc_data_structures;
17+
extern crate rustc_errors;
18+
extern crate rustc_expand;
19+
extern crate rustc_parse;
20+
extern crate rustc_session;
21+
extern crate rustc_span;
22+
1223
use std::cell::RefCell;
1324
use std::collections::HashMap;
1425
use std::fmt;

0 commit comments

Comments
 (0)