about summary refs log tree commit diff
path: root/src/librustc_data_structures
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-01-06 07:03:46 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-01-09 08:57:24 +0100
commit69b1e5cc3d3aea6cccd8567d89cc75288f596c2e (patch)
tree8ee6ffbdbf9378c85a16a4f60abaab86c198a40a /src/librustc_data_structures
parent2db97ede2702b64426d3209ce8ec787a16cbf4e7 (diff)
downloadrust-69b1e5cc3d3aea6cccd8567d89cc75288f596c2e.tar.gz
rust-69b1e5cc3d3aea6cccd8567d89cc75288f596c2e.zip
{rustc::util -> rustc_data_structures}::captures
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;