only_local: always check for misuse
This commit is contained in:
parent
fc128b6764
commit
6c8265dc56
36 changed files with 343 additions and 382 deletions
|
@ -14,9 +14,9 @@ extern crate tracing;
|
|||
#[macro_use]
|
||||
extern crate rustc_middle;
|
||||
|
||||
use rustc_ast::{self as ast, MetaItem};
|
||||
use rustc_middle::ty;
|
||||
use rustc_session::Session;
|
||||
use rustc_ast::MetaItem;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
||||
pub use self::drop_flag_effects::{
|
||||
|
@ -49,19 +49,13 @@ pub struct MoveDataParamEnv<'tcx> {
|
|||
pub param_env: ty::ParamEnv<'tcx>,
|
||||
}
|
||||
|
||||
pub fn has_rustc_mir_with(
|
||||
_sess: &Session,
|
||||
attrs: &[ast::Attribute],
|
||||
name: Symbol,
|
||||
) -> Option<MetaItem> {
|
||||
for attr in attrs {
|
||||
if attr.has_name(sym::rustc_mir) {
|
||||
let items = attr.meta_item_list();
|
||||
for item in items.iter().flat_map(|l| l.iter()) {
|
||||
match item.meta_item() {
|
||||
Some(mi) if mi.has_name(name) => return Some(mi.clone()),
|
||||
_ => continue,
|
||||
}
|
||||
pub fn has_rustc_mir_with(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Option<MetaItem> {
|
||||
for attr in tcx.get_attrs(def_id, sym::rustc_mir) {
|
||||
let items = attr.meta_item_list();
|
||||
for item in items.iter().flat_map(|l| l.iter()) {
|
||||
match item.meta_item() {
|
||||
Some(mi) if mi.has_name(name) => return Some(mi.clone()),
|
||||
_ => continue,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue