Make the crate compile on stable
This commit is contained in:
parent
f30c5956f5
commit
63c5b008e1
4 changed files with 25 additions and 3 deletions
|
@ -4348,6 +4348,7 @@ dependencies = [
|
||||||
"rustc_target",
|
"rustc_target",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
"typed-arena",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -5683,6 +5684,12 @@ dependencies = [
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typed-arena"
|
||||||
|
version = "2.0.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typenum"
|
name = "typenum"
|
||||||
version = "1.16.0"
|
version = "1.16.0"
|
||||||
|
|
|
@ -6,24 +6,28 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# tidy-alphabetical-start
|
# tidy-alphabetical-start
|
||||||
rustc_apfloat = "0.2.0"
|
rustc_apfloat = "0.2.0"
|
||||||
rustc_arena = { path = "../rustc_arena" }
|
rustc_arena = { path = "../rustc_arena", optional = true }
|
||||||
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
|
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
|
||||||
rustc_errors = { path = "../rustc_errors", optional = true }
|
rustc_errors = { path = "../rustc_errors", optional = true }
|
||||||
rustc_fluent_macro = { path = "../rustc_fluent_macro", optional = true }
|
rustc_fluent_macro = { path = "../rustc_fluent_macro", optional = true }
|
||||||
rustc_hir = { path = "../rustc_hir", optional = true }
|
rustc_hir = { path = "../rustc_hir", optional = true }
|
||||||
rustc_index = { path = "../rustc_index" }
|
rustc_index = { path = "../rustc_index", default-features = false }
|
||||||
rustc_macros = { path = "../rustc_macros", optional = true }
|
rustc_macros = { path = "../rustc_macros", optional = true }
|
||||||
rustc_middle = { path = "../rustc_middle", optional = true }
|
rustc_middle = { path = "../rustc_middle", optional = true }
|
||||||
rustc_session = { path = "../rustc_session", optional = true }
|
rustc_session = { path = "../rustc_session", optional = true }
|
||||||
rustc_span = { path = "../rustc_span", optional = true }
|
rustc_span = { path = "../rustc_span", optional = true }
|
||||||
rustc_target = { path = "../rustc_target", optional = true }
|
rustc_target = { path = "../rustc_target", optional = true }
|
||||||
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
|
smallvec = { version = "1.8.1", features = ["union"] }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
|
typed-arena = { version = "2.0.2", optional = true }
|
||||||
# tidy-alphabetical-end
|
# tidy-alphabetical-end
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["rustc"]
|
default = ["rustc"]
|
||||||
|
# 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.
|
||||||
rustc = [
|
rustc = [
|
||||||
|
"dep:rustc_arena",
|
||||||
"dep:rustc_data_structures",
|
"dep:rustc_data_structures",
|
||||||
"dep:rustc_errors",
|
"dep:rustc_errors",
|
||||||
"dep:rustc_fluent_macro",
|
"dep:rustc_fluent_macro",
|
||||||
|
@ -33,4 +37,9 @@ rustc = [
|
||||||
"dep:rustc_session",
|
"dep:rustc_session",
|
||||||
"dep:rustc_span",
|
"dep:rustc_span",
|
||||||
"dep:rustc_target",
|
"dep:rustc_target",
|
||||||
|
"smallvec/may_dangle",
|
||||||
|
"rustc_index/nightly",
|
||||||
|
]
|
||||||
|
stable = [
|
||||||
|
"dep:typed-arena",
|
||||||
]
|
]
|
||||||
|
|
|
@ -555,7 +555,12 @@
|
||||||
use smallvec::{smallvec, SmallVec};
|
use smallvec::{smallvec, SmallVec};
|
||||||
use std::fmt;
|
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;
|
use rustc_arena::TypedArena;
|
||||||
|
#[cfg(feature = "stable")]
|
||||||
|
use typed_arena::Arena as TypedArena;
|
||||||
|
|
||||||
use crate::constructor::{Constructor, ConstructorSet};
|
use crate::constructor::{Constructor, ConstructorSet};
|
||||||
use crate::pat::{DeconstructedPat, WitnessPat};
|
use crate::pat::{DeconstructedPat, WitnessPat};
|
||||||
|
|
|
@ -357,6 +357,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
|
||||||
"tracing-tree",
|
"tracing-tree",
|
||||||
"twox-hash",
|
"twox-hash",
|
||||||
"type-map",
|
"type-map",
|
||||||
|
"typed-arena",
|
||||||
"typenum",
|
"typenum",
|
||||||
"unic-langid",
|
"unic-langid",
|
||||||
"unic-langid-impl",
|
"unic-langid-impl",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue