Skip to content

Commit bc0c76d

Browse files
committed
fix for latest rustc
1 parent ada5edb commit bc0c76d

File tree

6 files changed

+10
-8
lines changed

6 files changed

+10
-8
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
d595b113584f8f446957469951fd5d31adc2a44e
1+
a9ec99f4201ec33026a468ef1289f98a95b4d71a

src/bin/miri-rustc-tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct MiriCompilerCalls {
3030
impl rustc_driver::Callbacks for MiriCompilerCalls {
3131
fn after_parsing(&mut self, compiler: &interface::Compiler) -> bool {
3232
let attr = (
33-
String::from("miri"),
33+
syntax::symbol::Symbol::intern("miri"),
3434
syntax::feature_gate::AttributeType::Whitelisted,
3535
);
3636
compiler.session().plugin_attributes.borrow_mut().push(attr);
@@ -47,7 +47,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
4747
impl<'a, 'tcx: 'a, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'a, 'tcx> {
4848
fn visit_item(&mut self, i: &'hir hir::Item) {
4949
if let hir::ItemKind::Fn(.., body_id) = i.node {
50-
if i.attrs.iter().any(|attr| attr.check_name("test")) {
50+
if i.attrs.iter().any(|attr| attr.check_name(syntax::symbol::sym::test)) {
5151
let config = MiriConfig { validate: true, args: vec![], seed: None };
5252
let did = self.0.hir().body_owner_def_id(body_id);
5353
println!("running test: {}", self.0.def_path_debug_str(did));

src/bin/miri.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct MiriCompilerCalls {
2727
impl rustc_driver::Callbacks for MiriCompilerCalls {
2828
fn after_parsing(&mut self, compiler: &interface::Compiler) -> bool {
2929
let attr = (
30-
String::from("miri"),
30+
syntax::symbol::Symbol::intern("miri"),
3131
syntax::feature_gate::AttributeType::Whitelisted,
3232
);
3333
compiler.session().plugin_attributes.borrow_mut().push(attr);

src/fn_call.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use rustc::ty::layout::{Align, LayoutOf, Size};
33
use rustc::hir::def_id::DefId;
44
use rustc::mir;
55
use syntax::attr;
6+
use syntax::symbol::sym;
67

78
use rand::RngCore;
89

@@ -141,7 +142,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
141142
) -> EvalResult<'tcx> {
142143
let this = self.eval_context_mut();
143144
let attrs = this.tcx.get_attrs(def_id);
144-
let link_name = match attr::first_attr_value_str_by_name(&attrs, "link_name") {
145+
let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {
145146
Some(name) => name.as_str(),
146147
None => this.tcx.item_name(def_id).as_str(),
147148
};

src/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
1414
this.tcx
1515
.crates()
1616
.iter()
17-
.find(|&&krate| this.tcx.original_crate_name(krate) == path[0])
17+
.find(|&&krate| this.tcx.original_crate_name(krate).as_str() == path[0])
1818
.and_then(|krate| {
1919
let krate = DefId {
2020
krate: *krate,
@@ -25,7 +25,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
2525

2626
while let Some(segment) = path_it.next() {
2727
for item in mem::replace(&mut items, Default::default()).iter() {
28-
if item.ident.name == *segment {
28+
if item.ident.name.as_str() == *segment {
2929
if path_it.peek().is_none() {
3030
return Some(ty::Instance::mono(this.tcx.tcx, item.res.def_id()));
3131
}

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ pub use rustc_mir::interpret::*;
3737
pub use rustc_mir::interpret::{self, AllocMap, PlaceTy};
3838
use syntax::attr;
3939
use syntax::source_map::DUMMY_SP;
40+
use syntax::symbol::sym;
4041

4142
pub use crate::fn_call::EvalContextExt as MissingFnsEvalContextExt;
4243
pub use crate::operator::EvalContextExt as OperatorEvalContextExt;
@@ -478,7 +479,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
478479
memory_extra: &Self::MemoryExtra,
479480
) -> EvalResult<'tcx, Cow<'tcx, Allocation<Tag, Self::AllocExtra>>> {
480481
let attrs = tcx.get_attrs(def_id);
481-
let link_name = match attr::first_attr_value_str_by_name(&attrs, "link_name") {
482+
let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {
482483
Some(name) => name.as_str(),
483484
None => tcx.item_name(def_id).as_str(),
484485
};

0 commit comments

Comments
 (0)