diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-01-06 07:03:46 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-01-09 08:57:24 +0100 |
| commit | 69b1e5cc3d3aea6cccd8567d89cc75288f596c2e (patch) | |
| tree | 8ee6ffbdbf9378c85a16a4f60abaab86c198a40a /src/librustc_data_structures | |
| parent | 2db97ede2702b64426d3209ce8ec787a16cbf4e7 (diff) | |
| download | rust-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.rs | 10 | ||||
| -rw-r--r-- | src/librustc_data_structures/lib.rs | 1 |
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; |
