1
Fork 0

update cfgs

This commit is contained in:
Boxy 2025-04-02 21:28:54 +01:00
parent 609eacbb22
commit c93005ee65
24 changed files with 29 additions and 140 deletions

View file

@ -315,7 +315,7 @@ mod helper {
use super::*;
pub(super) type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
impl<O: ForestObligation> ObligationForest<O> {
#[cfg_attr(not(bootstrap), define_opaque(ObligationTreeIdGenerator))]
#[define_opaque(ObligationTreeIdGenerator)]
pub fn new() -> ObligationForest<O> {
ObligationForest {
nodes: vec![],

View file

@ -208,7 +208,7 @@ pub type LazyFallbackBundle = Arc<LazyLock<FluentBundle, impl FnOnce() -> Fluent
/// Return the default `FluentBundle` with standard "en-US" diagnostic messages.
#[instrument(level = "trace", skip(resources))]
#[cfg_attr(not(bootstrap), define_opaque(LazyFallbackBundle))]
#[define_opaque(LazyFallbackBundle)]
pub fn fallback_fluent_bundle(
resources: Vec<&'static str>,
with_directionality_markers: bool,

View file

@ -454,7 +454,7 @@ mod helper {
/// Like [`SwitchTargets::target_for_value`], but returning the same type as
/// [`Terminator::successors`].
#[inline]
#[cfg_attr(not(bootstrap), define_opaque(Successors))]
#[define_opaque(Successors)]
pub fn successors_for_value(&self, value: u128) -> Successors<'_> {
let target = self.target_for_value(value);
(&[]).into_iter().copied().chain(Some(target))
@ -463,7 +463,7 @@ mod helper {
impl<'tcx> TerminatorKind<'tcx> {
#[inline]
#[cfg_attr(not(bootstrap), define_opaque(Successors))]
#[define_opaque(Successors)]
pub fn successors(&self) -> Successors<'_> {
use self::TerminatorKind::*;
match *self {
@ -502,7 +502,7 @@ mod helper {
}
#[inline]
#[cfg_attr(not(bootstrap), define_opaque(SuccessorsMut))]
#[define_opaque(SuccessorsMut)]
pub fn successors_mut(&mut self) -> SuccessorsMut<'_> {
use self::TerminatorKind::*;
match *self {

View file

@ -25,7 +25,7 @@ pub trait EraseType: Copy {
pub type Erase<T: EraseType> = Erased<impl Copy>;
#[inline(always)]
#[cfg_attr(not(bootstrap), define_opaque(Erase))]
#[define_opaque(Erase)]
pub fn erase<T: EraseType>(src: T) -> Erase<T> {
// Ensure the sizes match
const {
@ -49,7 +49,7 @@ pub fn erase<T: EraseType>(src: T) -> Erase<T> {
/// Restores an erased value.
#[inline(always)]
#[cfg_attr(not(bootstrap), define_opaque(Erase))]
#[define_opaque(Erase)]
pub fn restore<T: EraseType>(value: Erase<T>) -> T {
let value: Erased<<T as EraseType>::Result> = value;
// See comment in `erase` for why we use `transmute_unchecked`.

View file

@ -6,7 +6,7 @@
// tidy-alphabetical-start
#![allow(rustc::usage_of_type_ir_inherent)]
#![cfg_attr(not(bootstrap), allow(rustc::usage_of_type_ir_traits))]
#![allow(rustc::usage_of_type_ir_traits)]
// tidy-alphabetical-end
pub mod canonicalizer;

View file

@ -1,12 +1,12 @@
// tidy-alphabetical-start
#![allow(rustc::usage_of_ty_tykind)]
#![allow(rustc::usage_of_type_ir_inherent)]
#![allow(rustc::usage_of_type_ir_traits)]
#![cfg_attr(
feature = "nightly",
feature(associated_type_defaults, never_type, rustc_attrs, negative_impls)
)]
#![cfg_attr(feature = "nightly", allow(internal_features))]
#![cfg_attr(not(bootstrap), allow(rustc::usage_of_type_ir_traits))]
// tidy-alphabetical-end
extern crate self as rustc_type_ir;