Skip to content

Commit 195ea5c

Browse files
committed
---
yaml --- r: 235961 b: refs/heads/stable c: 77e9228 h: refs/heads/master i: 235959: 455a87c v: v3
1 parent f0d4fab commit 195ea5c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6810
-683
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 10387d6839752ac6a8cd937b5f3fbd6a94c58f69
32+
refs/heads/stable: 77e9228b4ad0a10f76921edf46dd8578f3d64630
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@
66
*.rs rust
77
src/etc/pkg/rust-logo.ico binary
88
src/etc/pkg/rust-logo.png binary
9+
src/rt/msvc/* -whitespace
10+
src/rt/valgrind/* -whitespace
911
*.woff binary

branches/stable/src/doc/trpl/crates-and-modules.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,6 @@ Hello in English: Hello!
355355
Goodbye in English: Goodbye.
356356
```
357357
358-
`pub` also applies to `struct`s and their member fields. In keeping with Rust’s
359-
tendency toward safety, simply making a `struct` public won't automatically
360-
make its members public: you must mark the fields individually with `pub`.
361-
362358
Now that our functions are public, we can use them. Great! However, typing out
363359
`phrases::english::greetings::hello()` is very long and repetitive. Rust has
364360
another keyword for importing names into the current scope, so that you can

branches/stable/src/libcollections/vec_deque.rs

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ impl<T> VecDeque<T> {
231231
/// buf.push_back(3);
232232
/// buf.push_back(4);
233233
/// buf.push_back(5);
234-
/// assert_eq!(buf.get(1), Some(&4));
234+
/// assert_eq!(buf.get(1).unwrap(), &4);
235235
/// ```
236236
#[stable(feature = "rust1", since = "1.0.0")]
237237
pub fn get(&self, index: usize) -> Option<&T> {
@@ -852,14 +852,12 @@ impl<T> VecDeque<T> {
852852
///
853853
/// let mut buf = VecDeque::new();
854854
/// assert_eq!(buf.swap_back_remove(0), None);
855-
/// buf.push_back(1);
856-
/// buf.push_back(2);
857-
/// buf.push_back(3);
858-
///
859-
/// assert_eq!(buf.swap_back_remove(0), Some(1));
860-
/// assert_eq!(buf.len(), 2);
861-
/// assert_eq!(buf[0], 3);
862-
/// assert_eq!(buf[1], 2);
855+
/// buf.push_back(5);
856+
/// buf.push_back(99);
857+
/// buf.push_back(15);
858+
/// buf.push_back(20);
859+
/// buf.push_back(10);
860+
/// assert_eq!(buf.swap_back_remove(1), Some(99));
863861
/// ```
864862
#[unstable(feature = "deque_extras",
865863
reason = "the naming of this function may be altered")]
@@ -888,14 +886,12 @@ impl<T> VecDeque<T> {
888886
///
889887
/// let mut buf = VecDeque::new();
890888
/// assert_eq!(buf.swap_front_remove(0), None);
891-
/// buf.push_back(1);
892-
/// buf.push_back(2);
893-
/// buf.push_back(3);
894-
///
895-
/// assert_eq!(buf.swap_front_remove(2), Some(3));
896-
/// assert_eq!(buf.len(), 2);
897-
/// assert_eq!(buf[0], 2);
898-
/// assert_eq!(buf[1], 1);
889+
/// buf.push_back(15);
890+
/// buf.push_back(5);
891+
/// buf.push_back(10);
892+
/// buf.push_back(99);
893+
/// buf.push_back(20);
894+
/// assert_eq!(buf.swap_front_remove(3), Some(99));
899895
/// ```
900896
#[unstable(feature = "deque_extras",
901897
reason = "the naming of this function may be altered")]
@@ -1127,12 +1123,12 @@ impl<T> VecDeque<T> {
11271123
/// use std::collections::VecDeque;
11281124
///
11291125
/// let mut buf = VecDeque::new();
1130-
/// buf.push_back(1);
1131-
/// buf.push_back(2);
1132-
/// buf.push_back(3);
1133-
///
1134-
/// assert_eq!(buf.remove(1), Some(2));
1135-
/// assert_eq!(buf.get(1), Some(&3));
1126+
/// buf.push_back(5);
1127+
/// buf.push_back(10);
1128+
/// buf.push_back(12);
1129+
/// buf.push_back(15);
1130+
/// buf.remove(2);
1131+
/// assert_eq!(Some(&15), buf.get(2));
11361132
/// ```
11371133
#[stable(feature = "rust1", since = "1.0.0")]
11381134
pub fn remove(&mut self, index: usize) -> Option<T> {

branches/stable/src/libcore/slice.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,11 @@ impl<T> SliceExt for [T] {
300300

301301
#[inline]
302302
fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
303-
let len = self.len();
304-
let ptr = self.as_mut_ptr();
305-
assert!(mid <= len);
306303
unsafe {
307-
(from_raw_parts_mut(ptr, mid),
308-
from_raw_parts_mut(ptr.offset(mid as isize), len - mid))
304+
let self2: &mut [T] = mem::transmute_copy(&self);
305+
306+
(ops::IndexMut::index_mut(self, ops::RangeTo { end: mid } ),
307+
ops::IndexMut::index_mut(self2, ops::RangeFrom { start: mid } ))
309308
}
310309
}
311310

branches/stable/src/liblibc/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ pub mod types {
10091009
use types::os::arch::posix88::{uid_t};
10101010

10111011
pub type nlink_t = u16;
1012-
pub type blksize_t = u32;
1012+
pub type blksize_t = i32;
10131013
pub type blkcnt_t = i64;
10141014
pub type fflags_t = u32;
10151015
#[repr(C)]
@@ -1035,7 +1035,7 @@ pub mod types {
10351035
pub st_lspare: int32_t,
10361036
pub st_birthtime: time_t,
10371037
pub st_birthtime_nsec: c_long,
1038-
pub __unused: [u8; 8],
1038+
pub __unused: [uint8_t; 2],
10391039
}
10401040

10411041
#[repr(C)]
@@ -1103,7 +1103,7 @@ pub mod types {
11031103
use types::os::arch::posix88::{uid_t};
11041104

11051105
pub type nlink_t = u16;
1106-
pub type blksize_t = u32;
1106+
pub type blksize_t = i64;
11071107
pub type blkcnt_t = i64;
11081108
pub type fflags_t = u32;
11091109
#[repr(C)]
@@ -1129,6 +1129,7 @@ pub mod types {
11291129
pub st_lspare: int32_t,
11301130
pub st_birthtime: time_t,
11311131
pub st_birthtime_nsec: c_long,
1132+
pub __unused: [uint8_t; 2],
11321133
}
11331134

11341135
#[repr(C)]

branches/stable/src/librustc/lint/context.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use lint::builtin;
3434
use util::nodemap::FnvHashMap;
3535

3636
use std::cell::RefCell;
37-
use std::cmp;
3837
use std::mem;
3938
use syntax::ast_util::IdVisitingOperation;
4039
use syntax::attr::AttrMetaMethods;
@@ -67,9 +66,6 @@ pub struct LintStore {
6766
/// Map of registered lint groups to what lints they expand to. The bool
6867
/// is true if the lint group was added by a plugin.
6968
lint_groups: FnvHashMap<&'static str, (Vec<LintId>, bool)>,
70-
71-
/// Maximum level a lint can be
72-
lint_cap: Option<Level>,
7369
}
7470

7571
/// The targed of the `by_name` map, which accounts for renaming/deprecation.
@@ -98,10 +94,7 @@ impl LintStore {
9894
}
9995
}
10096

101-
fn set_level(&mut self, lint: LintId, mut lvlsrc: LevelSource) {
102-
if let Some(cap) = self.lint_cap {
103-
lvlsrc.0 = cmp::min(lvlsrc.0, cap);
104-
}
97+
fn set_level(&mut self, lint: LintId, lvlsrc: LevelSource) {
10598
if lvlsrc.0 == Allow {
10699
self.levels.remove(&lint);
107100
} else {
@@ -116,7 +109,6 @@ impl LintStore {
116109
by_name: FnvHashMap(),
117110
levels: FnvHashMap(),
118111
lint_groups: FnvHashMap(),
119-
lint_cap: None,
120112
}
121113
}
122114

@@ -235,13 +227,6 @@ impl LintStore {
235227
}
236228
}
237229
}
238-
239-
self.lint_cap = sess.opts.lint_cap;
240-
if let Some(cap) = self.lint_cap {
241-
for level in self.levels.iter_mut().map(|p| &mut (p.1).0) {
242-
*level = cmp::min(*level, cap);
243-
}
244-
}
245230
}
246231
}
247232

branches/stable/src/librustc/session/config.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ pub struct Options {
8484
pub debug_assertions: bool,
8585
pub debuginfo: DebugInfoLevel,
8686
pub lint_opts: Vec<(String, lint::Level)>,
87-
pub lint_cap: Option<lint::Level>,
8887
pub describe_lints: bool,
8988
pub output_types: Vec<OutputType>,
9089
// This was mutable for rustpkg, which updates search paths based on the
@@ -204,7 +203,6 @@ pub fn basic_options() -> Options {
204203
optimize: No,
205204
debuginfo: NoDebugInfo,
206205
lint_opts: Vec::new(),
207-
lint_cap: None,
208206
describe_lints: false,
209207
output_types: Vec::new(),
210208
search_paths: SearchPaths::new(),
@@ -796,9 +794,6 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
796794
opt::multi("A", "allow", "Set lint allowed", "OPT"),
797795
opt::multi("D", "deny", "Set lint denied", "OPT"),
798796
opt::multi("F", "forbid", "Set lint forbidden", "OPT"),
799-
opt::multi("", "cap-lints", "Set the most restrictive lint level. \
800-
More restrictive lints are capped at this \
801-
level", "LEVEL"),
802797
opt::multi("C", "codegen", "Set a codegen option", "OPT[=VALUE]"),
803798
opt::flag("V", "version", "Print version info and exit"),
804799
opt::flag("v", "verbose", "Use verbose output"),
@@ -867,12 +862,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
867862
}
868863
}
869864

870-
let lint_cap = matches.opt_str("cap-lints").map(|cap| {
871-
lint::Level::from_str(&cap).unwrap_or_else(|| {
872-
early_error(&format!("unknown lint level: `{}`", cap))
873-
})
874-
});
875-
876865
let debugging_opts = build_debugging_options(matches);
877866

878867
let parse_only = debugging_opts.parse_only;
@@ -1036,7 +1025,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
10361025
optimize: opt_level,
10371026
debuginfo: debuginfo,
10381027
lint_opts: lint_opts,
1039-
lint_cap: lint_cap,
10401028
describe_lints: describe_lints,
10411029
output_types: output_types,
10421030
search_paths: search_paths,

branches/stable/src/librustc_resolve/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,22 +2654,23 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
26542654
let pat_id = pattern.id;
26552655
walk_pat(pattern, |pattern| {
26562656
match pattern.node {
2657-
PatIdent(binding_mode, ref path1, ref at_rhs) => {
2658-
// The meaning of PatIdent with no type parameters
2657+
PatIdent(binding_mode, ref path1, _) => {
2658+
2659+
// The meaning of pat_ident with no type parameters
26592660
// depends on whether an enum variant or unit-like struct
26602661
// with that name is in scope. The probing lookup has to
26612662
// be careful not to emit spurious errors. Only matching
26622663
// patterns (match) can match nullary variants or
2663-
// unit-like structs. For binding patterns (let
2664-
// and the LHS of @-patterns), matching such a value is
2665-
// simply disallowed (since it's rarely what you want).
2666-
let const_ok = mode == RefutableMode && at_rhs.is_none();
2664+
// unit-like structs. For binding patterns (let), matching
2665+
// such a value is simply disallowed (since it's rarely
2666+
// what you want).
26672667

26682668
let ident = path1.node;
26692669
let renamed = mtwt::resolve(ident);
26702670

26712671
match self.resolve_bare_identifier_pattern(ident.name, pattern.span) {
2672-
FoundStructOrEnumVariant(def, lp) if const_ok => {
2672+
FoundStructOrEnumVariant(def, lp)
2673+
if mode == RefutableMode => {
26732674
debug!("(resolving pattern) resolving `{}` to \
26742675
struct or enum variant",
26752676
renamed);
@@ -2692,7 +2693,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
26922693
renamed)
26932694
);
26942695
}
2695-
FoundConst(def, lp) if const_ok => {
2696+
FoundConst(def, lp) if mode == RefutableMode => {
26962697
debug!("(resolving pattern) resolving `{}` to \
26972698
constant",
26982699
renamed);

0 commit comments

Comments
 (0)