Skip to content

Commit a991dae

Browse files
committed
---
yaml --- r: 184154 b: refs/heads/beta c: b3c00a6 h: refs/heads/master v: v3
1 parent cfb86a0 commit a991dae

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
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: c5579ca340b346f1b685887f7784c2e7f2090dcb
34+
refs/heads/beta: b3c00a69f23b68cba2901eb98b3de7dfc6990396
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: c65fb1a81e5dc58cf171cc47f65de9e6e2119247

branches/beta/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)