Skip to content

Commit f72564e

Browse files
committed
---
yaml --- r: 184255 b: refs/heads/tmp c: b3c00a6 h: refs/heads/master i: 184253: 9f9c02b 184251: 76ecaef 184247: ade492b 184239: 5ec5977 184223: 6198f86 184191: b8a337d v: v3
1 parent c8fa069 commit f72564e

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: c5579ca340b346f1b685887f7784c2e7f2090dcb
37+
refs/heads/tmp: b3c00a69f23b68cba2901eb98b3de7dfc6990396

branches/tmp/src/libcollections/btree/map.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,22 @@ mod stack {
512512
use super::super::node::handle;
513513
use vec::Vec;
514514

515+
struct InvariantLifetime<'id>(
516+
marker::PhantomData<::core::cell::Cell<&'id ()>>);
517+
518+
impl<'id> InvariantLifetime<'id> {
519+
fn new() -> InvariantLifetime<'id> {
520+
InvariantLifetime(marker::PhantomData)
521+
}
522+
}
523+
515524
/// A generic mutable reference, identical to `&mut` except for the fact that its lifetime
516525
/// parameter is invariant. This means that wherever an `IdRef` is expected, only an `IdRef`
517526
/// with the exact requested lifetime can be used. This is in contrast to normal references,
518527
/// where `&'static` can be used in any function expecting any lifetime reference.
519528
pub struct IdRef<'id, T: 'id> {
520529
inner: &'id mut T,
521-
marker: marker::InvariantLifetime<'id>
530+
_marker: InvariantLifetime<'id>,
522531
}
523532

524533
impl<'id, T> Deref for IdRef<'id, T> {
@@ -560,7 +569,7 @@ mod stack {
560569
pub struct Pusher<'id, 'a, K:'a, V:'a> {
561570
map: &'a mut BTreeMap<K, V>,
562571
stack: Stack<K, V>,
563-
marker: marker::InvariantLifetime<'id>
572+
_marker: InvariantLifetime<'id>,
564573
}
565574

566575
impl<'a, K, V> PartialSearchStack<'a, K, V> {
@@ -595,11 +604,11 @@ mod stack {
595604
let pusher = Pusher {
596605
map: self.map,
597606
stack: self.stack,
598-
marker: marker::InvariantLifetime
607+
_marker: InvariantLifetime::new(),
599608
};
600609
let node = IdRef {
601610
inner: unsafe { &mut *self.next },
602-
marker: marker::InvariantLifetime
611+
_marker: InvariantLifetime::new(),
603612
};
604613

605614
closure(pusher, node)

0 commit comments

Comments
 (0)