fix for latest rustc
This commit is contained in:
parent
ada5edbf96
commit
bc0c76d861
@ -1 +1 @@
|
||||
d595b113584f8f446957469951fd5d31adc2a44e
|
||||
a9ec99f4201ec33026a468ef1289f98a95b4d71a
|
||||
|
@ -30,7 +30,7 @@ struct MiriCompilerCalls {
|
||||
impl rustc_driver::Callbacks for MiriCompilerCalls {
|
||||
fn after_parsing(&mut self, compiler: &interface::Compiler) -> bool {
|
||||
let attr = (
|
||||
String::from("miri"),
|
||||
syntax::symbol::Symbol::intern("miri"),
|
||||
syntax::feature_gate::AttributeType::Whitelisted,
|
||||
);
|
||||
compiler.session().plugin_attributes.borrow_mut().push(attr);
|
||||
@ -47,7 +47,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
|
||||
impl<'a, 'tcx: 'a, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'a, 'tcx> {
|
||||
fn visit_item(&mut self, i: &'hir hir::Item) {
|
||||
if let hir::ItemKind::Fn(.., body_id) = i.node {
|
||||
if i.attrs.iter().any(|attr| attr.check_name("test")) {
|
||||
if i.attrs.iter().any(|attr| attr.check_name(syntax::symbol::sym::test)) {
|
||||
let config = MiriConfig { validate: true, args: vec![], seed: None };
|
||||
let did = self.0.hir().body_owner_def_id(body_id);
|
||||
println!("running test: {}", self.0.def_path_debug_str(did));
|
||||
|
@ -27,7 +27,7 @@ struct MiriCompilerCalls {
|
||||
impl rustc_driver::Callbacks for MiriCompilerCalls {
|
||||
fn after_parsing(&mut self, compiler: &interface::Compiler) -> bool {
|
||||
let attr = (
|
||||
String::from("miri"),
|
||||
syntax::symbol::Symbol::intern("miri"),
|
||||
syntax::feature_gate::AttributeType::Whitelisted,
|
||||
);
|
||||
compiler.session().plugin_attributes.borrow_mut().push(attr);
|
||||
|
@ -3,6 +3,7 @@ use rustc::ty::layout::{Align, LayoutOf, Size};
|
||||
use rustc::hir::def_id::DefId;
|
||||
use rustc::mir;
|
||||
use syntax::attr;
|
||||
use syntax::symbol::sym;
|
||||
|
||||
use rand::RngCore;
|
||||
|
||||
@ -141,7 +142,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
|
||||
) -> EvalResult<'tcx> {
|
||||
let this = self.eval_context_mut();
|
||||
let attrs = this.tcx.get_attrs(def_id);
|
||||
let link_name = match attr::first_attr_value_str_by_name(&attrs, "link_name") {
|
||||
let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {
|
||||
Some(name) => name.as_str(),
|
||||
None => this.tcx.item_name(def_id).as_str(),
|
||||
};
|
||||
|
@ -14,7 +14,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
|
||||
this.tcx
|
||||
.crates()
|
||||
.iter()
|
||||
.find(|&&krate| this.tcx.original_crate_name(krate) == path[0])
|
||||
.find(|&&krate| this.tcx.original_crate_name(krate).as_str() == path[0])
|
||||
.and_then(|krate| {
|
||||
let krate = DefId {
|
||||
krate: *krate,
|
||||
@ -25,7 +25,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
|
||||
|
||||
while let Some(segment) = path_it.next() {
|
||||
for item in mem::replace(&mut items, Default::default()).iter() {
|
||||
if item.ident.name == *segment {
|
||||
if item.ident.name.as_str() == *segment {
|
||||
if path_it.peek().is_none() {
|
||||
return Some(ty::Instance::mono(this.tcx.tcx, item.res.def_id()));
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ pub use rustc_mir::interpret::*;
|
||||
pub use rustc_mir::interpret::{self, AllocMap, PlaceTy};
|
||||
use syntax::attr;
|
||||
use syntax::source_map::DUMMY_SP;
|
||||
use syntax::symbol::sym;
|
||||
|
||||
pub use crate::fn_call::EvalContextExt as MissingFnsEvalContextExt;
|
||||
pub use crate::operator::EvalContextExt as OperatorEvalContextExt;
|
||||
@ -478,7 +479,7 @@ impl<'a, 'mir, 'tcx> Machine<'a, 'mir, 'tcx> for Evaluator<'tcx> {
|
||||
memory_extra: &Self::MemoryExtra,
|
||||
) -> EvalResult<'tcx, Cow<'tcx, Allocation<Tag, Self::AllocExtra>>> {
|
||||
let attrs = tcx.get_attrs(def_id);
|
||||
let link_name = match attr::first_attr_value_str_by_name(&attrs, "link_name") {
|
||||
let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {
|
||||
Some(name) => name.as_str(),
|
||||
None => tcx.item_name(def_id).as_str(),
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user