Skip to content

Commit 6501e45

Browse files
author
Jonas Schievink
committed
Remove FnFlags::IS_IN_EXTERN_BLOCK
1 parent 134dbc6 commit 6501e45

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

crates/hir_def/src/data.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ impl FunctionData {
5757
flags.bits |= FnFlags::IS_VARARGS;
5858
}
5959

60-
if matches!(loc.container, ItemContainerId::ExternBlockId(_)) {
61-
flags.bits |= FnFlags::IS_IN_EXTERN_BLOCK;
62-
}
63-
6460
let legacy_const_generics_indices = item_tree
6561
.attrs(db, krate, ModItem::from(loc.id.value).into())
6662
.by_key("rustc_legacy_const_generics")
@@ -114,10 +110,6 @@ impl FunctionData {
114110
self.flags.bits & FnFlags::IS_UNSAFE != 0
115111
}
116112

117-
pub fn is_in_extern_block(&self) -> bool {
118-
self.flags.bits & FnFlags::IS_IN_EXTERN_BLOCK != 0
119-
}
120-
121113
pub fn is_varargs(&self) -> bool {
122114
self.flags.bits & FnFlags::IS_VARARGS != 0
123115
}

crates/hir_def/src/item_tree.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,6 @@ impl FnFlags {
612612
pub(crate) const IS_CONST: u8 = 1 << 3;
613613
pub(crate) const IS_ASYNC: u8 = 1 << 4;
614614
pub(crate) const IS_UNSAFE: u8 = 1 << 5;
615-
/// Whether the function is located in an `extern` block (*not* whether it is an
616-
/// `extern "abi" fn`).
617-
pub(crate) const IS_IN_EXTERN_BLOCK: u8 = 1 << 6;
618615
pub(crate) const IS_VARARGS: u8 = 1 << 7;
619616
}
620617

crates/hir_ty/src/diagnostics/decl_check.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ use hir_def::{
1919
adt::VariantData,
2020
expr::{Pat, PatId},
2121
src::HasSource,
22-
AdtId, AttrDefId, ConstId, EnumId, FunctionId, Lookup, ModuleDefId, StaticId, StructId,
22+
AdtId, AttrDefId, ConstId, EnumId, FunctionId, ItemContainerId, Lookup, ModuleDefId, StaticId,
23+
StructId,
2324
};
2425
use hir_expand::{
2526
name::{AsName, Name},
@@ -198,7 +199,7 @@ impl<'a> DeclValidator<'a> {
198199

199200
fn validate_func(&mut self, func: FunctionId) {
200201
let data = self.db.function_data(func);
201-
if data.is_in_extern_block() {
202+
if matches!(func.lookup(self.db.upcast()).container, ItemContainerId::ExternBlockId(_)) {
202203
cov_mark::hit!(extern_func_incorrect_case_ignored);
203204
return;
204205
}

0 commit comments

Comments
 (0)