Remove FnFlags::IS_IN_EXTERN_BLOCK
This commit is contained in:
parent
134dbc6104
commit
6501e45131
@ -57,10 +57,6 @@ impl FunctionData {
|
|||||||
flags.bits |= FnFlags::IS_VARARGS;
|
flags.bits |= FnFlags::IS_VARARGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if matches!(loc.container, ItemContainerId::ExternBlockId(_)) {
|
|
||||||
flags.bits |= FnFlags::IS_IN_EXTERN_BLOCK;
|
|
||||||
}
|
|
||||||
|
|
||||||
let legacy_const_generics_indices = item_tree
|
let legacy_const_generics_indices = item_tree
|
||||||
.attrs(db, krate, ModItem::from(loc.id.value).into())
|
.attrs(db, krate, ModItem::from(loc.id.value).into())
|
||||||
.by_key("rustc_legacy_const_generics")
|
.by_key("rustc_legacy_const_generics")
|
||||||
@ -114,10 +110,6 @@ impl FunctionData {
|
|||||||
self.flags.bits & FnFlags::IS_UNSAFE != 0
|
self.flags.bits & FnFlags::IS_UNSAFE != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_in_extern_block(&self) -> bool {
|
|
||||||
self.flags.bits & FnFlags::IS_IN_EXTERN_BLOCK != 0
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn is_varargs(&self) -> bool {
|
pub fn is_varargs(&self) -> bool {
|
||||||
self.flags.bits & FnFlags::IS_VARARGS != 0
|
self.flags.bits & FnFlags::IS_VARARGS != 0
|
||||||
}
|
}
|
||||||
|
@ -612,9 +612,6 @@ impl FnFlags {
|
|||||||
pub(crate) const IS_CONST: u8 = 1 << 3;
|
pub(crate) const IS_CONST: u8 = 1 << 3;
|
||||||
pub(crate) const IS_ASYNC: u8 = 1 << 4;
|
pub(crate) const IS_ASYNC: u8 = 1 << 4;
|
||||||
pub(crate) const IS_UNSAFE: u8 = 1 << 5;
|
pub(crate) const IS_UNSAFE: u8 = 1 << 5;
|
||||||
/// Whether the function is located in an `extern` block (*not* whether it is an
|
|
||||||
/// `extern "abi" fn`).
|
|
||||||
pub(crate) const IS_IN_EXTERN_BLOCK: u8 = 1 << 6;
|
|
||||||
pub(crate) const IS_VARARGS: u8 = 1 << 7;
|
pub(crate) const IS_VARARGS: u8 = 1 << 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@ use hir_def::{
|
|||||||
adt::VariantData,
|
adt::VariantData,
|
||||||
expr::{Pat, PatId},
|
expr::{Pat, PatId},
|
||||||
src::HasSource,
|
src::HasSource,
|
||||||
AdtId, AttrDefId, ConstId, EnumId, FunctionId, Lookup, ModuleDefId, StaticId, StructId,
|
AdtId, AttrDefId, ConstId, EnumId, FunctionId, ItemContainerId, Lookup, ModuleDefId, StaticId,
|
||||||
|
StructId,
|
||||||
};
|
};
|
||||||
use hir_expand::{
|
use hir_expand::{
|
||||||
name::{AsName, Name},
|
name::{AsName, Name},
|
||||||
@ -198,7 +199,7 @@ impl<'a> DeclValidator<'a> {
|
|||||||
|
|
||||||
fn validate_func(&mut self, func: FunctionId) {
|
fn validate_func(&mut self, func: FunctionId) {
|
||||||
let data = self.db.function_data(func);
|
let data = self.db.function_data(func);
|
||||||
if data.is_in_extern_block() {
|
if matches!(func.lookup(self.db.upcast()).container, ItemContainerId::ExternBlockId(_)) {
|
||||||
cov_mark::hit!(extern_func_incorrect_case_ignored);
|
cov_mark::hit!(extern_func_incorrect_case_ignored);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user