Make the rustc_data_structures dependency optional

This commit is contained in:
Nadrieril 2023-12-11 20:59:32 +01:00
parent 16bd6ac3ed
commit e646c9f723
5 changed files with 28 additions and 13 deletions

View file

@ -556,14 +556,20 @@ use smallvec::{smallvec, SmallVec};
use std::fmt;
use rustc_arena::TypedArena;
use rustc_data_structures::{captures::Captures, stack::ensure_sufficient_stack};
use crate::constructor::{Constructor, ConstructorSet};
use crate::pat::{DeconstructedPat, WitnessPat};
use crate::{MatchArm, MatchCx};
use crate::{Captures, MatchArm, MatchCx};
use self::ValidityConstraint::*;
#[cfg(feature = "rustc")]
use rustc_data_structures::stack::ensure_sufficient_stack;
#[cfg(not(feature = "rustc"))]
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
f()
}
#[derive(Clone)]
pub(crate) struct PatCtxt<'a, 'p, Cx: MatchCx> {
pub(crate) cx: &'a Cx,