This commit is contained in:
Ralf Jung 2020-08-08 10:27:23 +02:00
parent cf633d0e89
commit 07a4383ac8
4 changed files with 4 additions and 6 deletions

View File

@ -1 +1 @@
1d69e3b1d753951bc7df0f02d6fd4719065d98c3
c92fc8db8b009b7661cff31fa59a7c0348653bd0

View File

@ -38,7 +38,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
if let hir::ItemKind::Fn(.., body_id) = i.kind {
if i.attrs
.iter()
.any(|attr| attr.check_name(rustc_span::symbol::sym::test))
.any(|attr| self.0.sess.check_name(attr, rustc_span::symbol::sym::test))
{
let config = miri::MiriConfig::default();
let did = self.0.hir().body_owner_def_id(body_id).to_def_id();

View File

@ -11,7 +11,6 @@ use std::fmt;
use log::trace;
use rand::rngs::StdRng;
use rustc_ast::attr;
use rustc_data_structures::fx::FxHashMap;
use rustc_middle::{
mir,
@ -442,7 +441,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
def_id: DefId,
) -> InterpResult<'tcx, AllocId> {
let attrs = memory.tcx.get_attrs(def_id);
let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {
let link_name = match memory.tcx.sess.first_attr_value_str_by_name(&attrs, sym::link_name) {
Some(name) => name,
None => memory.tcx.item_name(def_id),
};

View File

@ -7,7 +7,6 @@ use rustc_middle::{mir, ty};
use rustc_target::abi::{Align, Size};
use rustc_apfloat::Float;
use rustc_span::symbol::sym;
use rustc_ast::attr;
use crate::*;
use helpers::check_arg_count;
@ -117,7 +116,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
) -> InterpResult<'tcx, Option<&'mir mir::Body<'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, sym::link_name) {
let link_name = match this.tcx.sess.first_attr_value_str_by_name(&attrs, sym::link_name) {
Some(name) => name.as_str(),
None => this.tcx.item_name(def_id).as_str(),
};