diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-07-17 16:12:35 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-10-06 14:16:49 +0200 |
| commit | d778e57bf61b2284f33d28486f2ac63faa0422cf (patch) | |
| tree | c6b40557ab5e5f1d9de0724c3926bfd0abb5a28e /src/libstd | |
| parent | 9868df2fd5d9364a1a1d8b22847c7b442a77a88b (diff) | |
| download | rust-d778e57bf61b2284f33d28486f2ac63faa0422cf.tar.gz rust-d778e57bf61b2284f33d28486f2ac63faa0422cf.zip | |
Add RFC 1238's `unsafe_destructor_blind_to_params` (UGEH) where needed.
I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to bootstrap; but of course that alone was not sufficient for `make check`. Later I added `unsafe_destructor_blind_to_params` to collections, in particular `LinkedList` and `RawTable` (the backing representation for `HashMap` and `HashSet`), to get the regression tests exercising cyclic structure from PR #27185 building. ---- Note that the feature is `dropck_parametricity` (which is not the same as the attribute's name). We will almost certainly vary our strategy here in the future, so it makes some sense to have a not-as-ugly name for the feature gate. (The attribute name was deliberately selected to be ugly looking.)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 1 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 32541353a0a..e8796dd10b4 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -999,6 +999,7 @@ impl<K: Clone, V: Clone> Clone for RawTable<K, V> { } impl<K, V> Drop for RawTable<K, V> { + #[unsafe_destructor_blind_to_params] fn drop(&mut self) { if self.capacity == 0 || self.capacity == mem::POST_DROP_USIZE { return; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 10c7190ca0c..9af766ad2af 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -199,6 +199,11 @@ test(no_crate_inject, attr(deny(warnings))), test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))] +// SNAP 1af31d4 +#![allow(unused_features)] +// SNAP 1af31d4 +#![allow(unused_attributes)] + #![feature(alloc)] #![feature(allow_internal_unstable)] #![feature(associated_consts)] @@ -241,6 +246,7 @@ #![feature(unboxed_closures)] #![feature(unicode)] #![feature(unique)] +#![feature(dropck_parametricity)] #![feature(unsafe_no_drop_flag, filling_drop)] #![feature(decode_utf16)] #![feature(unwind_attributes)] |
