Skip to content

Commit 5ea55ee

Browse files
committed
---
yaml --- r: 272873 b: refs/heads/beta c: 559683c h: refs/heads/master i: 272871: 88aac56
1 parent 3f3c803 commit 5ea55ee

File tree

45 files changed

+410
-735
lines changed

Some content is hidden

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

45 files changed

+410
-735
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 79f914fdb90b21e7ec4a224671df59357e5cc49d
26+
refs/heads/beta: 559683cdedf09bc58c468ab5eb0d7b19e57aeb61
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ build.
7777
7878
Download [MinGW from
7979
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
80-
`threads=win32,exceptions=dwarf/seh` flavor when installing. Also, make sure to install to a path without spaces in it. After installing,
80+
`threads=win32,exceptions=dwarf/seh` flavor when installing. After installing,
8181
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
8282
installing from pacman should be just fine.
8383

branches/beta/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ COMPRT_AR_$(1) := $$(AR_$(1))
253253
# We chomp -Werror here because GCC warns about the type signature of
254254
# builtins not matching its own and the build fails. It's a bit hacky,
255255
# but what can we do, we're building libclang-rt using GCC ......
256-
COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -Wno-error -std=c99
256+
COMPRT_CFLAGS_$(1) := $$(filter-out -Werror -Werror=*,$$(CFG_GCCISH_CFLAGS_$(1))) -std=c99
257257

258258
# FreeBSD Clang's packaging is problematic; it doesn't copy unwind.h to
259259
# the standard include directory. This should really be in our changes to
@@ -361,7 +361,7 @@ $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
361361
CC="$$(CC_$(1))" \
362362
AR="$$(AR_$(1))" \
363363
RANLIB="$$(AR_$(1)) s" \
364-
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1)) -Wno-error -fno-stack-protector" \
364+
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) -fno-stack-protector" \
365365
$(S)src/libbacktrace/configure --build=$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$(CFG_GNU_TRIPLE_$(1)))
366366
$$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \
367367
$$(BACKTRACE_BUILD_DIR_$(1))/config.h

branches/beta/src/doc/reference.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ Examples of integer literals of various forms:
379379
0usize; // type usize
380380
```
381381

382+
Note that the Rust syntax considers `-1i8` as an application of the [unary minus
383+
operator](#unary-operator-expressions) to an integer literal `1i8`, rather than
384+
a single integer literal.
385+
382386
##### Floating-point literals
383387

384388
A _floating-point literal_ has one of two forms:
@@ -2776,7 +2780,9 @@ Rust defines the following unary operators. They are all written as prefix opera
27762780
before the expression they apply to.
27772781

27782782
* `-`
2779-
: Negation. May only be applied to numeric types.
2783+
: Negation. Signed integer types and floating-point types support negation. It
2784+
is an error to apply negation to unsigned types; for example, the compiler
2785+
rejects `-1u32`.
27802786
* `*`
27812787
: Dereference. When applied to a [pointer](#pointer-types) it denotes the
27822788
pointed-to location. For pointers to mutable locations, the resulting

branches/beta/src/etc/platform-intrinsics/generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ def parse_args():
691691
parser.add_argument('-o', '--out', type=argparse.FileType('w'), default=sys.stdout,
692692
help = 'File to output to (default stdout).')
693693
parser.add_argument('-i', '--info', type=argparse.FileType('r'),
694-
help = 'File containing platform specific information to merge into '
694+
help = 'File containing platform specific information to merge into'
695695
'the input files\' header.')
696696
parser.add_argument('in_', metavar="FILE", type=argparse.FileType('r'), nargs='+',
697697
help = 'JSON files to load')
@@ -735,12 +735,12 @@ def open(self, platform):
735735
736736
use {{Intrinsic, i, i_, u, u_, f, v, v_, agg, p, void}};
737737
use IntrinsicDef::Named;
738-
use rustc::middle::ty::TyCtxt;
738+
use rustc::middle::ty;
739739
740740
// The default inlining settings trigger a pathological behaviour in
741741
// LLVM, which causes makes compilation very slow. See #28273.
742742
#[inline(never)]
743-
pub fn find<'tcx>(_tcx: &TyCtxt<'tcx>, name: &str) -> Option<Intrinsic> {{
743+
pub fn find<'tcx>(_tcx: &ty::ctxt<'tcx>, name: &str) -> Option<Intrinsic> {{
744744
if !name.starts_with("{0}") {{ return None }}
745745
Some(match &name["{0}".len()..] {{'''.format(platform.intrinsic_prefix())
746746

branches/beta/src/etc/platform-intrinsics/x86/fma.json

Lines changed: 0 additions & 47 deletions
This file was deleted.

branches/beta/src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Unicode string slices.
11+
//! Unicode string slices
1212
//!
1313
//! *[See also the `str` primitive type](../primitive.str.html).*
1414

branches/beta/src/libcollectionstest/str.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -346,26 +346,6 @@ fn test_slice_fail() {
346346
&"中华Việt Nam"[0..2];
347347
}
348348

349-
const LOREM_PARAGRAPH: &'static str = "\
350-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse quis lorem sit amet dolor \
351-
ultricies condimentum. Praesent iaculis purus elit, ac malesuada quam malesuada in. Duis sed orci \
352-
eros. Suspendisse sit amet magna mollis, mollis nunc luctus, imperdiet mi. Integer fringilla non \
353-
sem ut lacinia. Fusce varius tortor a risus porttitor hendrerit. Morbi mauris dui, ultricies nec \
354-
tempus vel, gravida nec quam.";
355-
356-
// check the panic includes the prefix of the sliced string
357-
#[test]
358-
#[should_panic(expected="Lorem ipsum dolor sit amet")]
359-
fn test_slice_fail_truncated_1() {
360-
&LOREM_PARAGRAPH[..1024];
361-
}
362-
// check the truncation in the panic message
363-
#[test]
364-
#[should_panic(expected="luctus, im`[...] do not lie on character boundary")]
365-
fn test_slice_fail_truncated_2() {
366-
&LOREM_PARAGRAPH[..1024];
367-
}
368-
369349
#[test]
370350
fn test_slice_from() {
371351
assert_eq!(&"abcd"[0..], "abcd");

branches/beta/src/libcore/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! The `Clone` trait for types that cannot be 'implicitly copied'.
11+
//! The `Clone` trait for types that cannot be 'implicitly copied'
1212
//!
1313
//! In Rust, some simple types are "implicitly copyable" and when you
1414
//! assign them or pass them as arguments, the receiver will get a copy,

branches/beta/src/libcore/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Utilities for formatting and printing strings.
11+
//! Utilities for formatting and printing strings
1212
1313
#![stable(feature = "rust1", since = "1.0.0")]
1414

branches/beta/src/libcore/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Composable external iteration.
11+
//! Composable external iteration
1212
//!
1313
//! If you've found yourself with a collection of some kind, and needed to
1414
//! perform an operation on the elements of said collection, you'll quickly run

branches/beta/src/libcore/mem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Basic functions for dealing with memory.
11+
//! Basic functions for dealing with memory
1212
//!
1313
//! This module contains functions for querying the size and alignment of
1414
//! types, initializing and manipulating memory.

branches/beta/src/libcore/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Overloadable operators.
11+
//! Overloadable operators
1212
//!
1313
//! Implementing these traits allows you to get an effect similar to
1414
//! overloading operators.

branches/beta/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Optional values.
11+
//! Optional values
1212
//!
1313
//! Type `Option` represents an optional value: every `Option`
1414
//! is either `Some` and contains a value, or `None`, and

branches/beta/src/libcore/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// FIXME: talk about offset, copy_memory, copy_nonoverlapping_memory
1212

13-
//! Raw, unsafe pointers, `*const T`, and `*mut T`.
13+
//! Raw, unsafe pointers, `*const T`, and `*mut T`
1414
//!
1515
//! *[See also the pointer primitive types](../../std/primitive.pointer.html).*
1616

branches/beta/src/libcore/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Error handling with the `Result` type.
11+
//! Error handling with the `Result` type
1212
//!
1313
//! `Result<T, E>` is the type used for returning and propagating
1414
//! errors. It is an enum with the variants, `Ok(T)`, representing

branches/beta/src/libcore/str/mod.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,30 +1645,12 @@ pub trait StrExt {
16451645
fn parse<T: FromStr>(&self) -> Result<T, T::Err>;
16461646
}
16471647

1648-
// truncate `&str` to length at most equal to `max`
1649-
// return `true` if it were truncated, and the new str.
1650-
fn truncate_to_char_boundary(s: &str, mut max: usize) -> (bool, &str) {
1651-
if max >= s.len() {
1652-
(false, s)
1653-
} else {
1654-
while !s.is_char_boundary(max) {
1655-
max -= 1;
1656-
}
1657-
(true, &s[..max])
1658-
}
1659-
}
1660-
16611648
#[inline(never)]
16621649
#[cold]
16631650
fn slice_error_fail(s: &str, begin: usize, end: usize) -> ! {
1664-
const MAX_DISPLAY_LENGTH: usize = 256;
1665-
let (truncated, s) = truncate_to_char_boundary(s, MAX_DISPLAY_LENGTH);
1666-
let ellipsis = if truncated { "[...]" } else { "" };
1667-
1668-
assert!(begin <= end, "begin <= end ({} <= {}) when slicing `{}`{}",
1669-
begin, end, s, ellipsis);
1670-
panic!("index {} and/or {} in `{}`{} do not lie on character boundary",
1671-
begin, end, s, ellipsis);
1651+
assert!(begin <= end);
1652+
panic!("index {} and/or {} in `{}` do not lie on character boundary",
1653+
begin, end, s);
16721654
}
16731655

16741656
#[stable(feature = "core", since = "1.6.0")]

branches/beta/src/librustc_data_structures/bitvec.rs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/// A very simple BitVector type.
1212
pub struct BitVector {
13-
data: Vec<u64>,
13+
data: Vec<u64>
1414
}
1515

1616
impl BitVector {
@@ -40,9 +40,7 @@ impl BitVector {
4040
for (i, j) in self.data.iter_mut().zip(&all.data) {
4141
let value = *i;
4242
*i = value | *j;
43-
if value != *i {
44-
changed = true;
45-
}
43+
if value != *i { changed = true; }
4644
}
4745
changed
4846
}
@@ -58,15 +56,15 @@ impl BitVector {
5856
BitVectorIter {
5957
iter: self.data.iter(),
6058
current: 0,
61-
idx: 0,
59+
idx: 0
6260
}
6361
}
6462
}
6563

6664
pub struct BitVectorIter<'a> {
6765
iter: ::std::slice::Iter<'a, u64>,
6866
current: u64,
69-
idx: usize,
67+
idx: usize
7068
}
7169

7270
impl<'a> Iterator for BitVectorIter<'a> {
@@ -110,7 +108,7 @@ impl BitMatrix {
110108
let u64s_per_elem = u64s(elements);
111109
BitMatrix {
112110
elements: elements,
113-
vector: vec![0; elements * u64s_per_elem],
111+
vector: vec![0; elements * u64s_per_elem]
114112
}
115113
}
116114

@@ -125,9 +123,9 @@ impl BitMatrix {
125123
let (start, _) = self.range(source);
126124
let (word, mask) = word_mask(target);
127125
let mut vector = &mut self.vector[..];
128-
let v1 = vector[start + word];
126+
let v1 = vector[start+word];
129127
let v2 = v1 | mask;
130-
vector[start + word] = v2;
128+
vector[start+word] = v2;
131129
v1 != v2
132130
}
133131

@@ -138,7 +136,7 @@ impl BitMatrix {
138136
pub fn contains(&self, source: usize, target: usize) -> bool {
139137
let (start, _) = self.range(source);
140138
let (word, mask) = word_mask(target);
141-
(self.vector[start + word] & mask) != 0
139+
(self.vector[start+word] & mask) != 0
142140
}
143141

144142
/// Returns those indices that are reachable from both `a` and
@@ -152,12 +150,8 @@ impl BitMatrix {
152150
for (base, (i, j)) in (a_start..a_end).zip(b_start..b_end).enumerate() {
153151
let mut v = self.vector[i] & self.vector[j];
154152
for bit in 0..64 {
155-
if v == 0 {
156-
break;
157-
}
158-
if v & 0x1 != 0 {
159-
result.push(base * 64 + bit);
160-
}
153+
if v == 0 { break; }
154+
if v & 0x1 != 0 { result.push(base*64 + bit); }
161155
v >>= 1;
162156
}
163157
}
@@ -176,7 +170,9 @@ impl BitMatrix {
176170
let (write_start, write_end) = self.range(write);
177171
let vector = &mut self.vector[..];
178172
let mut changed = false;
179-
for (read_index, write_index) in (read_start..read_end).zip(write_start..write_end) {
173+
for (read_index, write_index) in
174+
(read_start..read_end).zip(write_start..write_end)
175+
{
180176
let v1 = vector[write_index];
181177
let v2 = v1 | vector[read_index];
182178
vector[write_index] = v2;
@@ -208,8 +204,7 @@ fn bitvec_iter_works() {
208204
bitvec.insert(65);
209205
bitvec.insert(66);
210206
bitvec.insert(99);
211-
assert_eq!(bitvec.iter().collect::<Vec<_>>(),
212-
[1, 10, 19, 62, 63, 64, 65, 66, 99]);
207+
assert_eq!(bitvec.iter().collect::<Vec<_>>(), [1, 10, 19, 62, 63, 64, 65, 66, 99]);
213208
}
214209

215210
#[test]
@@ -222,8 +217,7 @@ fn bitvec_iter_works_2() {
222217
bitvec.insert(66);
223218
bitvec.insert(99);
224219
bitvec.insert(299);
225-
assert_eq!(bitvec.iter().collect::<Vec<_>>(),
226-
[1, 10, 19, 62, 66, 99, 299]);
220+
assert_eq!(bitvec.iter().collect::<Vec<_>>(), [1, 10, 19, 62, 66, 99, 299]);
227221

228222
}
229223

0 commit comments

Comments
 (0)