Skip to content

Commit 8948a29

Browse files
committed
adjust for librustc rename; reduce 'extern crate' to rustc crates
1 parent a50d87f commit 8948a29

27 files changed

+67
-64
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ MIRI_LOG=info ./miri run tests/run-pass/vecs.rs
7979
```
8080

8181
Setting `MIRI_LOG` like this will configure logging for Miri itself as well as
82-
the `rustc::mir::interpret` and `rustc_mir::interpret` modules in rustc. You
82+
the `rustc_middle::mir::interpret` and `rustc_mir::interpret` modules in rustc. You
8383
can also do more targeted configuration, e.g. the following helps debug the
8484
stacked borrows implementation:
8585

benches/helpers/miri_helper.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
extern crate getopts;
2-
extern crate miri;
3-
extern crate rustc;
41
extern crate rustc_driver;
52
extern crate rustc_hir;
63
extern crate rustc_interface;
7-
extern crate test;
84

9-
use self::miri::eval_main;
10-
use crate::test::Bencher;
115
use rustc_hir::def_id::LOCAL_CRATE;
126
use rustc_driver::Compilation;
137
use rustc_interface::{interface, Queries};
148

9+
use crate::test::Bencher;
10+
1511
struct MiriCompilerCalls<'a> {
1612
bencher: &'a mut Bencher,
1713
}
@@ -30,7 +26,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls<'_> {
3026

3127
self.bencher.iter(|| {
3228
let config = miri::MiriConfig::default();
33-
eval_main(tcx, entry_def_id, config);
29+
miri::eval_main(tcx, entry_def_id, config);
3430
});
3531
});
3632

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0afdf43dc1d9be4c8b422840166b51dd99e56a16
1+
8926bb497d9b127eb318aea5aed0e745d8381591

src/bin/miri-rustc-tests.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(rustc_private)]
2-
extern crate miri;
3-
extern crate rustc;
2+
3+
extern crate rustc_middle;
44
extern crate rustc_driver;
55
extern crate rustc_hir;
66
extern crate rustc_interface;
@@ -11,15 +11,13 @@ use std::io::Write;
1111
use std::path::Path;
1212
use std::sync::{Arc, Mutex};
1313

14-
use rustc::ty::TyCtxt;
14+
use rustc_middle::ty::TyCtxt;
1515
use rustc_driver::Compilation;
1616
use rustc_hir as hir;
1717
use rustc_hir::def_id::LOCAL_CRATE;
1818
use rustc_hir::itemlikevisit;
1919
use rustc_interface::{interface, Queries};
2020

21-
use miri::MiriConfig;
22-
2321
struct MiriCompilerCalls {
2422
/// whether we are building for the host
2523
host_target: bool,
@@ -42,7 +40,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
4240
.iter()
4341
.any(|attr| attr.check_name(rustc_span::symbol::sym::test))
4442
{
45-
let config = MiriConfig::default();
43+
let config = miri::MiriConfig::default();
4644
let did = self.0.hir().body_owner_def_id(body_id);
4745
println!("running test: {}", self.0.def_path_debug_str(did));
4846
miri::eval_main(self.0, did, config);
@@ -55,7 +53,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
5553
}
5654
tcx.hir().krate().visit_all_item_likes(&mut Visitor(tcx));
5755
} else if let Some((entry_def_id, _)) = tcx.entry_fn(LOCAL_CRATE) {
58-
let config = MiriConfig::default();
56+
let config = miri::MiriConfig::default();
5957
miri::eval_main(tcx, entry_def_id, config);
6058

6159
compiler.session().abort_if_errors();

src/bin/miri.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#![feature(rustc_private)]
22

3-
extern crate env_logger;
4-
extern crate getopts;
5-
#[macro_use]
6-
extern crate log;
7-
extern crate log_settings;
8-
extern crate miri;
9-
extern crate rustc;
3+
extern crate rustc_middle;
104
extern crate rustc_driver;
115
extern crate rustc_hir;
126
extern crate rustc_interface;
@@ -17,12 +11,13 @@ use std::env;
1711
use std::str::FromStr;
1812

1913
use hex::FromHexError;
14+
use log::debug;
2015

2116
use rustc_session::CtfeBacktrace;
2217
use rustc_driver::Compilation;
2318
use rustc_hir::def_id::LOCAL_CRATE;
2419
use rustc_interface::{interface, Queries};
25-
use rustc::ty::TyCtxt;
20+
use rustc_middle::ty::TyCtxt;
2621

2722
struct MiriCompilerCalls {
2823
miri_config: miri::MiriConfig,
@@ -84,7 +79,7 @@ fn init_late_loggers(tcx: TyCtxt<'_>) {
8479
if log::Level::from_str(&var).is_ok() {
8580
env::set_var(
8681
"RUSTC_LOG",
87-
&format!("rustc::mir::interpret={0},rustc_mir::interpret={0}", var),
82+
&format!("rustc_middle::mir::interpret={0},rustc_mir::interpret={0}", var),
8883
);
8984
} else {
9085
env::set_var("RUSTC_LOG", &var);

src/diagnostics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
use std::cell::RefCell;
22
use std::fmt;
33

4+
use log::trace;
5+
46
use rustc_span::DUMMY_SP;
57

68
use crate::*;

src/eval.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::convert::TryFrom;
66
use rand::rngs::StdRng;
77
use rand::SeedableRng;
88

9-
use rustc::ty::layout::LayoutOf;
10-
use rustc::ty::{self, TyCtxt};
9+
use rustc_middle::ty::layout::LayoutOf;
10+
use rustc_middle::ty::{self, TyCtxt};
1111
use rustc_hir::def_id::DefId;
1212

1313
use crate::*;

src/helpers.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use std::convert::TryFrom;
22
use std::mem;
33

4-
use rustc::mir;
5-
use rustc::ty::{
4+
use log::trace;
5+
6+
use rustc_middle::mir;
7+
use rustc_middle::ty::{
68
self,
79
layout::{self, LayoutOf, Size, TyAndLayout},
810
List, TyCtxt,

src/intptrcast.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ use std::cell::RefCell;
22
use std::cmp::max;
33
use std::collections::hash_map::Entry;
44

5+
use log::trace;
56
use rand::Rng;
67

78
use rustc_data_structures::fx::FxHashMap;
8-
use rustc::ty::layout::HasDataLayout;
9+
use rustc_middle::ty::layout::HasDataLayout;
910
use rustc_mir::interpret::{AllocCheck, AllocId, InterpResult, Memory, Machine, Pointer, PointerArithmetic};
1011
use rustc_target::abi::Size;
1112

src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,9 @@
77
#![warn(rust_2018_idioms)]
88
#![allow(clippy::cast_lossless)]
99

10-
#[macro_use]
11-
extern crate log;
12-
// From rustc.
1310
extern crate rustc_apfloat;
1411
extern crate rustc_ast;
15-
#[macro_use]
16-
extern crate rustc;
12+
#[macro_use] extern crate rustc_middle;
1713
extern crate rustc_data_structures;
1814
extern crate rustc_hir;
1915
extern crate rustc_mir;

0 commit comments

Comments
 (0)