about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lib.rs
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2023-12-11 20:59:32 +0100
committerNadrieril <nadrieril+git@gmail.com>2023-12-15 16:58:38 +0100
commite646c9f7230becbe739d5c56fbb9952cb0d1b212 (patch)
tree39cf2c00b62d7f10ddd5e2bdbba328942eca0595 /compiler/rustc_pattern_analysis/src/lib.rs
parent16bd6ac3ed3e63cd6f2464b54026dbeb90ba6bbe (diff)
downloadrust-e646c9f7230becbe739d5c56fbb9952cb0d1b212.tar.gz
rust-e646c9f7230becbe739d5c56fbb9952cb0d1b212.zip
Make the `rustc_data_structures` dependency optional
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs
index 8b7898af5b1..e54f8d90d0d 100644
--- a/compiler/rustc_pattern_analysis/src/lib.rs
+++ b/compiler/rustc_pattern_analysis/src/lib.rs
@@ -79,6 +79,13 @@ pub struct MatchArm<'p, Cx: MatchCx> {
 
 impl<'p, Cx: MatchCx> Copy for MatchArm<'p, Cx> {}
 
+#[cfg(not(feature = "rustc"))]
+pub trait Captures<'a> {}
+#[cfg(not(feature = "rustc"))]
+impl<'a, T: ?Sized> Captures<'a> for T {}
+#[cfg(feature = "rustc")]
+pub use rustc_data_structures::captures::Captures;
+
 /// The entrypoint for this crate. Computes whether a match is exhaustive and which of its arms are
 /// useful, and runs some lints.
 #[cfg(feature = "rustc")]