about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2023-12-11 21:56:17 +0100
committerNadrieril <nadrieril+git@gmail.com>2023-12-15 16:58:38 +0100
commit63c5b008e12355615a3dfe5b4c83b9a109b2bbc6 (patch)
tree28f6075190d0b1e3ff9ded5067fdb15a94ff3ff3 /compiler/rustc_pattern_analysis/src
parentf30c5956f5a755c532cc2a29f089a908bc0201fe (diff)
downloadrust-63c5b008e12355615a3dfe5b4c83b9a109b2bbc6.tar.gz
rust-63c5b008e12355615a3dfe5b4c83b9a109b2bbc6.zip
Make the crate compile on stable
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
-rw-r--r--compiler/rustc_pattern_analysis/src/usefulness.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs
index 01f3962b31f..3141e992f33 100644
--- a/compiler/rustc_pattern_analysis/src/usefulness.rs
+++ b/compiler/rustc_pattern_analysis/src/usefulness.rs
@@ -555,7 +555,12 @@
 use smallvec::{smallvec, SmallVec};
 use std::fmt;
 
+// It's not possible to only enable the `typed_arena` dependency when the `rustc` feature is off, so
+// we use another feature instead. The crate won't compile if one of these isn't enabled.
+#[cfg(feature = "rustc")]
 use rustc_arena::TypedArena;
+#[cfg(feature = "stable")]
+use typed_arena::Arena as TypedArena;
 
 use crate::constructor::{Constructor, ConstructorSet};
 use crate::pat::{DeconstructedPat, WitnessPat};