Skip to content

Commit 8c0dd60

Browse files
committed
Addd TraitFlags::COINDUCTIVE
1 parent 490aa68 commit 8c0dd60

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

crates/hir-def/src/signatures.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,14 +395,15 @@ impl ImplSignature {
395395

396396
bitflags::bitflags! {
397397
#[derive(Debug, Clone, Copy, Eq, PartialEq, Default)]
398-
pub struct TraitFlags: u8 {
398+
pub struct TraitFlags: u16 {
399399
const RUSTC_HAS_INCOHERENT_INHERENT_IMPLS = 1 << 1;
400400
const FUNDAMENTAL = 1 << 2;
401401
const UNSAFE = 1 << 3;
402402
const AUTO = 1 << 4;
403403
const SKIP_ARRAY_DURING_METHOD_DISPATCH = 1 << 5;
404404
const SKIP_BOXED_SLICE_DURING_METHOD_DISPATCH = 1 << 6;
405405
const RUSTC_PAREN_SUGAR = 1 << 7;
406+
const COINDUCTIVE = 1 << 8;
406407
}
407408
}
408409

@@ -436,6 +437,9 @@ impl TraitSignature {
436437
if attrs.by_key(sym::rustc_paren_sugar).exists() {
437438
flags |= TraitFlags::RUSTC_PAREN_SUGAR;
438439
}
440+
if attrs.by_key(sym::rustc_coinductive).exists() {
441+
flags |= TraitFlags::COINDUCTIVE;
442+
}
439443
let mut skip_array_during_method_dispatch =
440444
attrs.by_key(sym::rustc_skip_array_during_method_dispatch).exists();
441445
let mut skip_boxed_slice_during_method_dispatch = false;

crates/hir-ty/src/next_solver/interner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ impl<'db> rustc_type_ir::Interner for DbInterner<'db> {
18971897
SolverDefId::TraitId(id) => id,
18981898
_ => unreachable!(),
18991899
};
1900-
self.db().trait_signature(id).flags.contains(TraitFlags::AUTO)
1900+
self.db().trait_signature(id).flags.contains(TraitFlags::COINDUCTIVE)
19011901
}
19021902

19031903
fn trait_is_unsafe(self, trait_def_id: Self::DefId) -> bool {

crates/intern/src/symbol/symbols.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ define_symbols! {
420420
rustc_allow_incoherent_impl,
421421
rustc_builtin_macro,
422422
rustc_coherence_is_core,
423+
rustc_coinductive,
423424
rustc_const_panic_str,
424425
rustc_deallocator,
425426
rustc_deprecated_safe_2024,

0 commit comments

Comments
 (0)