Skip to content

Commit 3e5121d

Browse files
---
yaml --- r: 118055 b: refs/heads/try c: 1380893 h: refs/heads/master i: 118053: 218f164 118051: 147bf80 118047: bf67346 v: v3
1 parent 35e5b2a commit 3e5121d

File tree

23 files changed

+182
-146
lines changed

23 files changed

+182
-146
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3770c42a4959cbabc73da52abc7e3db96657974e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d6736a1440d42f6af967a8a20ab8d73522112b72
5-
refs/heads/try: 729ee203387cc3a3f7387cffd018aba93b0110e6
5+
refs/heads/try: 138089355d7a1bc28fa58f2bea7680af96bd5b92
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/doc/rust.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,6 @@ Unsafe operations are those that potentially violate the memory-safety guarantee
10361036
The following language level features cannot be used in the safe subset of Rust:
10371037

10381038
- Dereferencing a [raw pointer](#pointer-types).
1039-
- Reading or writing a [mutable static variable](#mutable-statics).
10401039
- Calling an unsafe function (including an intrinsic or foreign function).
10411040

10421041
##### Unsafe functions

branches/try/src/liballoc/arc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ impl<T: Send + Share + Clone> Arc<T> {
160160
// reference count is guaranteed to be 1 at this point, and we required
161161
// the Arc itself to be `mut`, so we're returning the only possible
162162
// reference to the inner data.
163-
let inner = unsafe { &mut *self._ptr };
164-
&mut inner.data
163+
unsafe { mem::transmute::<&_, &mut _>(self.deref()) }
165164
}
166165
}
167166

branches/try/src/libcore/cmp.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
//! assert!(SketchyNum {num: 25} != SketchyNum {num: 57});
3838
//! ```
3939
40-
pub use PartialEq = cmp::Eq;
41-
pub use PartialOrd = cmp::Ord;
42-
4340
/// Trait for values that can be compared for equality and inequality.
4441
///
4542
/// This trait allows partial equality, where types can be unordered instead of

branches/try/src/libnative/io/file_win32.rs

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,6 @@ impl FileDesc {
9090
pub fn handle(&self) -> libc::HANDLE {
9191
unsafe { libc::get_osfhandle(self.fd()) as libc::HANDLE }
9292
}
93-
94-
// A version of seek that takes &self so that tell can call it
95-
// - the private seek should of course take &mut self.
96-
fn seek_common(&self, pos: i64, style: io::SeekStyle) -> Result<u64, IoError> {
97-
let whence = match style {
98-
io::SeekSet => libc::FILE_BEGIN,
99-
io::SeekEnd => libc::FILE_END,
100-
io::SeekCur => libc::FILE_CURRENT,
101-
};
102-
unsafe {
103-
let mut newpos = 0;
104-
match libc::SetFilePointerEx(self.handle(), pos, &mut newpos,
105-
whence) {
106-
0 => Err(super::last_error()),
107-
_ => Ok(newpos as u64),
108-
}
109-
}
110-
}
111-
11293
}
11394

11495
impl io::Reader for FileDesc {
@@ -170,13 +151,26 @@ impl rtio::RtioFileStream for FileDesc {
170151
}
171152
Ok(())
172153
}
173-
174154
fn seek(&mut self, pos: i64, style: io::SeekStyle) -> Result<u64, IoError> {
175-
self.seek_common(pos, style)
155+
let whence = match style {
156+
io::SeekSet => libc::FILE_BEGIN,
157+
io::SeekEnd => libc::FILE_END,
158+
io::SeekCur => libc::FILE_CURRENT,
159+
};
160+
unsafe {
161+
let mut newpos = 0;
162+
match libc::SetFilePointerEx(self.handle(), pos, &mut newpos,
163+
whence) {
164+
0 => Err(super::last_error()),
165+
_ => Ok(newpos as u64),
166+
}
167+
}
176168
}
177-
178169
fn tell(&self) -> Result<u64, IoError> {
179-
self.seek_common(0, io::SeekCur)
170+
// This transmute is fine because our seek implementation doesn't
171+
// actually use the mutable self at all.
172+
// FIXME #13933: Remove/justify all `&T` to `&mut T` transmutes
173+
unsafe { mem::transmute::<&_, &mut FileDesc>(self).seek(0, io::SeekCur) }
180174
}
181175

182176
fn fsync(&mut self) -> Result<(), IoError> {

branches/try/src/librustc/middle/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a> CFGBuilder<'a> {
113113
self.add_node(pat.id, [pred])
114114
}
115115

116-
ast::PatBox(subpat) |
116+
ast::PatUniq(subpat) |
117117
ast::PatRegion(subpat) |
118118
ast::PatIdent(_, _, Some(subpat)) => {
119119
let subpat_exit = self.pat(subpat, pred);

branches/try/src/librustc/middle/check_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ fn pat_ctor_id(cx: &MatchCheckCtxt, p: @Pat) -> Option<ctor> {
383383
_ => Some(single)
384384
}
385385
}
386-
PatBox(_) | PatTup(_) | PatRegion(..) => {
386+
PatUniq(_) | PatTup(_) | PatRegion(..) => {
387387
Some(single)
388388
}
389389
PatVec(ref before, slice, ref after) => {
@@ -764,7 +764,7 @@ fn specialize(cx: &MatchCheckCtxt,
764764
PatTup(args) => {
765765
Some(args.iter().map(|x| *x).collect::<Vec<_>>().append(r.tail()))
766766
}
767-
PatBox(a) | PatRegion(a) => {
767+
PatUniq(a) | PatRegion(a) => {
768768
Some((vec!(a)).append(r.tail()))
769769
}
770770
PatLit(expr) => {
@@ -924,7 +924,7 @@ fn find_refutable(cx: &MatchCheckCtxt, pat: &Pat, spans: &mut Vec<Span>) {
924924
}
925925

926926
match pat.node {
927-
PatBox(sub) | PatRegion(sub) | PatIdent(_, _, Some(sub)) => {
927+
PatUniq(sub) | PatRegion(sub) | PatIdent(_, _, Some(sub)) => {
928928
find_refutable(cx, sub, spans)
929929
}
930930
PatWild | PatWildMulti | PatIdent(_, _, None) => {}

branches/try/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ impl<'t,TYPER:Typer> MemCategorizationContext<'t,TYPER> {
10641064
}
10651065
}
10661066

1067-
ast::PatBox(subpat) | ast::PatRegion(subpat) => {
1067+
ast::PatUniq(subpat) | ast::PatRegion(subpat) => {
10681068
// @p1, ~p1
10691069
let subcmt = self.cat_deref(pat, cmt, 0);
10701070
if_ok!(self.cat_pattern(subcmt, subpat, op));

branches/try/src/librustc/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor,
671671
subpats.iter().any(|&p| is_binding_pat(p))
672672
}
673673

674-
ast::PatBox(subpat) => {
674+
ast::PatUniq(subpat) => {
675675
is_binding_pat(subpat)
676676
}
677677

branches/try/src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ fn enter_uniq<'a, 'b>(
838838
let dummy = @ast::Pat {id: 0, node: ast::PatWild, span: DUMMY_SP};
839839
enter_match(bcx, dm, m, col, val, |p| {
840840
match p.node {
841-
ast::PatBox(sub) => {
841+
ast::PatUniq(sub) => {
842842
Some(vec!(sub))
843843
}
844844
_ => {
@@ -1105,7 +1105,7 @@ macro_rules! any_pat (
11051105
)
11061106

11071107
fn any_uniq_pat(m: &[Match], col: uint) -> bool {
1108-
any_pat!(m, ast::PatBox(_))
1108+
any_pat!(m, ast::PatUniq(_))
11091109
}
11101110

11111111
fn any_region_pat(m: &[Match], col: uint) -> bool {
@@ -2270,7 +2270,7 @@ fn bind_irrefutable_pat<'a>(
22702270
binding_mode, cleanup_scope);
22712271
}
22722272
}
2273-
ast::PatBox(inner) => {
2273+
ast::PatUniq(inner) => {
22742274
let llbox = Load(bcx, val);
22752275
bcx = bind_irrefutable_pat(bcx, inner, llbox, binding_mode, cleanup_scope);
22762276
}

0 commit comments

Comments
 (0)