about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_data_structures')
-rw-r--r--src/librustc_data_structures/captures.rs10
-rw-r--r--src/librustc_data_structures/lib.rs1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc_data_structures/captures.rs b/src/librustc_data_structures/captures.rs
new file mode 100644
index 00000000000..26b90ebfd5f
--- /dev/null
+++ b/src/librustc_data_structures/captures.rs
@@ -0,0 +1,10 @@
+/// "Signaling" trait used in impl trait to tag lifetimes that you may
+/// need to capture but don't really need for other reasons.
+/// Basically a workaround; see [this comment] for details.
+///
+/// [this comment]: https://github.com/rust-lang/rust/issues/34511#issuecomment-373423999
+// FIXME(eddyb) false positive, the lifetime parameter is "phantom" but needed.
+#[allow(unused_lifetimes)]
+pub trait Captures<'a> {}
+
+impl<'a, T: ?Sized> Captures<'a> for T {}
diff --git a/src/librustc_data_structures/lib.rs b/src/librustc_data_structures/lib.rs
index d1b7ee9e83e..51a38a7d2ab 100644
--- a/src/librustc_data_structures/lib.rs
+++ b/src/librustc_data_structures/lib.rs
@@ -67,6 +67,7 @@ macro_rules! unlikely {
 pub mod base_n;
 pub mod binary_search_util;
 pub mod box_region;
+pub mod captures;
 pub mod const_cstr;
 pub mod flock;
 pub mod fx;