Skip to content

Commit c1bd534

Browse files
author
Dylan McKay
committed
---
yaml --- r: 232415 b: refs/heads/try c: 7ebc5e5 h: refs/heads/master i: 232413: b597014 232411: 34d18b0 232407: 12f02c2 232399: 2677896 232383: 3ef442d v: v3
1 parent 05c9404 commit c1bd534

File tree

11 files changed

+27
-80
lines changed

11 files changed

+27
-80
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: edeb4f1c86cbf6af8ef9874d4b3af50f721ea1b8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 753a6a9e29d4c8b4ee92345051fef61908c276b6
4+
refs/heads/try: 7ebc5e5134b6a0094a197d27423f9a80dbb38598
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
#![feature(lang_items)]
8484
#![feature(no_std)]
8585
#![feature(nonzero)]
86+
#![feature(num_bits_bytes)]
8687
#![feature(optin_builtin_traits)]
8788
#![feature(placement_in_syntax)]
8889
#![feature(placement_new_protocol)]

branches/try/src/liballoc/raw_vec.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use heap;
1515
use super::oom;
1616
use super::boxed::Box;
1717
use core::ops::Drop;
18+
use core;
1819

1920
/// A low-level utility for more ergonomically allocating, reallocating, and deallocating a
2021
/// a buffer of memory on the heap without having to worry about all the corner cases
@@ -443,11 +444,8 @@ impl<T> Drop for RawVec<T> {
443444
// user-space. e.g. PAE or x32
444445

445446
#[inline]
446-
#[cfg(target_pointer_width = "64")]
447-
fn alloc_guard(_alloc_size: usize) { }
448-
449-
#[inline]
450-
#[cfg(target_pointer_width = "32")]
451447
fn alloc_guard(alloc_size: usize) {
452-
assert!(alloc_size <= ::core::isize::MAX as usize, "capacity overflow");
448+
if core::usize::BITS < 64 {
449+
assert!(alloc_size <= ::core::isize::MAX as usize, "capacity overflow");
450+
}
453451
}

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,12 +1340,7 @@ impl<T> Pointer for *const T {
13401340
f.flags |= 1 << (FlagV1::SignAwareZeroPad as u32);
13411341

13421342
if let None = f.width {
1343-
// The formats need two extra bytes, for the 0x
1344-
if cfg!(target_pointer_width = "32") {
1345-
f.width = Some(10);
1346-
} else {
1347-
f.width = Some(18);
1348-
}
1343+
f.width = Some((::usize::BITS/4) + 2);
13491344
}
13501345
}
13511346
f.flags |= 1 << (FlagV1::Alternate as u32);

branches/try/src/libcore/hash/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ pub trait Hasher {
144144
#[inline]
145145
#[stable(feature = "hasher_write", since = "1.3.0")]
146146
fn write_usize(&mut self, i: usize) {
147-
if cfg!(target_pointer_width = "32") {
148-
self.write_u32(i as u32)
149-
} else {
150-
self.write_u64(i as u64)
151-
}
147+
let bytes = unsafe {
148+
::slice::from_raw_parts(&i as *const usize as *const u8,
149+
mem::size_of::<usize>())
150+
};
151+
self.write(bytes);
152152
}
153153

154154
/// Write a single `i8` into this hasher.

branches/try/src/libcore/iter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,8 +616,6 @@ pub trait Iterator {
616616

617617
/// Tests whether the predicate holds true for all elements in the iterator.
618618
///
619-
/// Does not consume the iterator past the first non-matching element.
620-
///
621619
/// # Examples
622620
///
623621
/// ```
@@ -2236,7 +2234,9 @@ step_impl_signed!(isize i8 i16 i32);
22362234
step_impl_unsigned!(u64);
22372235
#[cfg(target_pointer_width = "64")]
22382236
step_impl_signed!(i64);
2239-
#[cfg(target_pointer_width = "32")]
2237+
// If the target pointer width is not 64-bits, we
2238+
// assume here that it is less than 64-bits.
2239+
#[cfg(not(target_pointer_width = "64"))]
22402240
step_impl_no_between!(u64 i64);
22412241

22422242
/// An adapter for stepping range iterators by a custom amount.

branches/try/src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,25 +2365,6 @@ struct Bar<S, T> { x: Foo<S, T> }
23652365
```
23662366
"##,
23672367

2368-
E0248: r##"
2369-
This error indicates an attempt to use a value where a type is expected. For
2370-
example:
2371-
2372-
```
2373-
enum Foo {
2374-
Bar(u32)
2375-
}
2376-
2377-
fn do_something(x: Foo::Bar) { }
2378-
```
2379-
2380-
In this example, we're attempting to take a type of `Foo::Bar` in the
2381-
do_something function. This is not legal: `Foo::Bar` is a value of type `Foo`,
2382-
not a distinct static type. Likewise, it's not legal to attempt to
2383-
`impl Foo::Bar`: instead, you must `impl Foo` and then pattern match to specify
2384-
behaviour for specific enum variants.
2385-
"##,
2386-
23872368
E0249: r##"
23882369
This error indicates a constant expression for the array length was found, but
23892370
it was not an integer (signed or unsigned) expression.
@@ -2775,6 +2756,7 @@ register_diagnostics! {
27752756
E0245, // not a trait
27762757
E0246, // invalid recursive type
27772758
E0247, // found module name used as a type
2759+
E0248, // found value name used as a type
27782760
E0319, // trait impls for defaulted traits allowed just for structs/enums
27792761
E0320, // recursive overflow during dropck
27802762
E0321, // extended coherence rules for defaulted traits violated

branches/try/src/libsyntax/ext/expand.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,16 @@ pub fn expand_expr(e: P<ast::Expr>, fld: &mut MacroExpander) -> P<ast::Expr> {
385385
// expand <head>
386386
let head = fld.fold_expr(head);
387387

388-
let iter = token::gensym_ident("iter");
388+
// create an hygienic ident
389+
let iter = {
390+
let ident = fld.cx.ident_of("iter");
391+
let new_ident = fresh_name(&ident);
392+
let rename = (ident, new_ident);
393+
let mut rename_list = vec![rename];
394+
let mut rename_fld = IdentRenamer{ renames: &mut rename_list };
395+
396+
rename_fld.fold_ident(ident)
397+
};
389398

390399
let pat_span = fld.new_span(pat.span);
391400
// `::std::option::Option::Some(<pat>) => <body>`

branches/try/src/libsyntax/ext/tt/transcribe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
305305
}
306306
MatchedSeq(..) => {
307307
panic!(r.sp_diag.span_fatal(
308-
sp, /* blame the macro writer */
308+
r.cur_span, /* blame the macro writer */
309309
&format!("variable '{}' is still repeating at this depth",
310310
ident)));
311311
}

branches/try/src/test/parse-fail/macro-repeat.rs

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

branches/try/src/test/run-pass/issue-27639.rs

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

0 commit comments

Comments
 (0)