Skip to content

Commit 041be6a

Browse files
committed
---
yaml --- r: 273386 b: refs/heads/beta c: c0d989e h: refs/heads/master
1 parent 3cedd1c commit 041be6a

File tree

24 files changed

+1206
-187
lines changed

24 files changed

+1206
-187
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: 7f5c568e0ad7014eda43798fd66fb7f2b8069ff2
26+
refs/heads/beta: c0d989ed6b4b840a290a80ec0cdbc8edbce2ee57
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libcore/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
authors = ["The Rust Project Developers"]
33
name = "core"
44
version = "0.0.0"
5-
build = "build.rs"
65

76
[lib]
87
name = "core"

branches/beta/src/libcore/build.rs

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

branches/beta/src/libcore/intrinsics.rs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,44 +53,53 @@ extern "rust-intrinsic" {
5353
// NB: These intrinsics take raw pointers because they mutate aliased
5454
// memory, which is not valid for either `&` or `&mut`.
5555

56-
#[cfg(all(stage0, not(cargobuild)))]
56+
#[cfg(stage0)]
5757
pub fn atomic_cxchg<T>(dst: *mut T, old: T, src: T) -> T;
58-
#[cfg(all(stage0, not(cargobuild)))]
58+
#[cfg(stage0)]
5959
pub fn atomic_cxchg_acq<T>(dst: *mut T, old: T, src: T) -> T;
60-
#[cfg(all(stage0, not(cargobuild)))]
60+
#[cfg(stage0)]
6161
pub fn atomic_cxchg_rel<T>(dst: *mut T, old: T, src: T) -> T;
62-
#[cfg(all(stage0, not(cargobuild)))]
62+
#[cfg(stage0)]
6363
pub fn atomic_cxchg_acqrel<T>(dst: *mut T, old: T, src: T) -> T;
64-
#[cfg(all(stage0, not(cargobuild)))]
64+
#[cfg(stage0)]
6565
pub fn atomic_cxchg_relaxed<T>(dst: *mut T, old: T, src: T) -> T;
6666

67-
#[cfg(any(not(stage0), cargobuild))]
67+
#[cfg(not(stage0))]
6868
pub fn atomic_cxchg<T>(dst: *mut T, old: T, src: T) -> (T, bool);
69-
#[cfg(any(not(stage0), cargobuild))]
69+
#[cfg(not(stage0))]
7070
pub fn atomic_cxchg_acq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
71-
#[cfg(any(not(stage0), cargobuild))]
71+
#[cfg(not(stage0))]
7272
pub fn atomic_cxchg_rel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
73-
#[cfg(any(not(stage0), cargobuild))]
73+
#[cfg(not(stage0))]
7474
pub fn atomic_cxchg_acqrel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
75-
#[cfg(any(not(stage0), cargobuild))]
75+
#[cfg(not(stage0))]
7676
pub fn atomic_cxchg_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
77-
#[cfg(any(not(stage0), cargobuild))]
77+
#[cfg(not(stage0))]
7878
pub fn atomic_cxchg_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
79-
#[cfg(any(not(stage0), cargobuild))]
79+
#[cfg(not(stage0))]
8080
pub fn atomic_cxchg_failacq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
81-
#[cfg(any(not(stage0), cargobuild))]
81+
#[cfg(not(stage0))]
8282
pub fn atomic_cxchg_acq_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
83-
#[cfg(any(not(stage0), cargobuild))]
83+
#[cfg(not(stage0))]
8484
pub fn atomic_cxchg_acqrel_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
8585

86+
#[cfg(not(stage0))]
8687
pub fn atomic_cxchgweak<T>(dst: *mut T, old: T, src: T) -> (T, bool);
88+
#[cfg(not(stage0))]
8789
pub fn atomic_cxchgweak_acq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
90+
#[cfg(not(stage0))]
8891
pub fn atomic_cxchgweak_rel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
92+
#[cfg(not(stage0))]
8993
pub fn atomic_cxchgweak_acqrel<T>(dst: *mut T, old: T, src: T) -> (T, bool);
94+
#[cfg(not(stage0))]
9095
pub fn atomic_cxchgweak_relaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
96+
#[cfg(not(stage0))]
9197
pub fn atomic_cxchgweak_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
98+
#[cfg(not(stage0))]
9299
pub fn atomic_cxchgweak_failacq<T>(dst: *mut T, old: T, src: T) -> (T, bool);
100+
#[cfg(not(stage0))]
93101
pub fn atomic_cxchgweak_acq_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
102+
#[cfg(not(stage0))]
94103
pub fn atomic_cxchgweak_acqrel_failrelaxed<T>(dst: *mut T, old: T, src: T) -> (T, bool);
95104

96105
pub fn atomic_load<T>(src: *const T) -> T;

branches/beta/src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#![feature(const_fn)]
6565
#![feature(custom_attribute)]
6666
#![feature(fundamental)]
67-
#![feature(inclusive_range_syntax)]
6867
#![feature(intrinsics)]
6968
#![feature(lang_items)]
7069
#![feature(no_core)]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ macro_rules! int_impl {
10081008
/// ```
10091009
#[stable(feature = "rust1", since = "1.0.0")]
10101010
#[inline]
1011-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
1011+
#[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
10121012
pub fn pow(self, mut exp: u32) -> Self {
10131013
let mut base = self;
10141014
let mut acc = Self::one();
@@ -1050,7 +1050,7 @@ macro_rules! int_impl {
10501050
/// ```
10511051
#[stable(feature = "rust1", since = "1.0.0")]
10521052
#[inline]
1053-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
1053+
#[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
10541054
pub fn abs(self) -> Self {
10551055
if self.is_negative() {
10561056
// Note that the #[inline] above means that the overflow
@@ -2015,7 +2015,7 @@ macro_rules! uint_impl {
20152015
/// ```
20162016
#[stable(feature = "rust1", since = "1.0.0")]
20172017
#[inline]
2018-
#[rustc_no_mir] // FIXME #29769 MIR overflow checking is TBD.
2018+
#[cfg_attr(not(stage0), rustc_no_mir)] // FIXME #29769 MIR overflow checking is TBD.
20192019
pub fn pow(self, mut exp: u32) -> Self {
20202020
let mut base = self;
20212021
let mut acc = Self::one();

branches/beta/src/libcore/ops.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,6 +1448,7 @@ pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
14481448

14491449
/// An unbounded range.
14501450
#[derive(Copy, Clone, PartialEq, Eq)]
1451+
#[cfg_attr(stage0, lang = "range_full")] // FIXME remove attribute after next snapshot
14511452
#[stable(feature = "rust1", since = "1.0.0")]
14521453
pub struct RangeFull;
14531454

@@ -1460,6 +1461,7 @@ impl fmt::Debug for RangeFull {
14601461

14611462
/// A (half-open) range which is bounded at both ends.
14621463
#[derive(Clone, PartialEq, Eq)]
1464+
#[cfg_attr(stage0, lang = "range")] // FIXME remove attribute after next snapshot
14631465
#[stable(feature = "rust1", since = "1.0.0")]
14641466
pub struct Range<Idx> {
14651467
/// The lower bound of the range (inclusive).
@@ -1479,6 +1481,7 @@ impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
14791481

14801482
/// A range which is only bounded below.
14811483
#[derive(Clone, PartialEq, Eq)]
1484+
#[cfg_attr(stage0, lang = "range_from")] // FIXME remove attribute after next snapshot
14821485
#[stable(feature = "rust1", since = "1.0.0")]
14831486
pub struct RangeFrom<Idx> {
14841487
/// The lower bound of the range (inclusive).
@@ -1495,6 +1498,7 @@ impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
14951498

14961499
/// A range which is only bounded above.
14971500
#[derive(Copy, Clone, PartialEq, Eq)]
1501+
#[cfg_attr(stage0, lang = "range_to")] // FIXME remove attribute after next snapshot
14981502
#[stable(feature = "rust1", since = "1.0.0")]
14991503
pub struct RangeTo<Idx> {
15001504
/// The upper bound of the range (exclusive).

branches/beta/src/libcore/slice.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,8 @@ impl<T> ops::Index<ops::RangeToInclusive<usize>> for [T] {
632632

633633
#[inline]
634634
fn index(&self, index: ops::RangeToInclusive<usize>) -> &[T] {
635-
self.index(0...index.end)
635+
// SNAP 4d3eebf change this to `0...index.end`
636+
self.index(ops::RangeInclusive::NonEmpty { start: 0, end: index.end })
636637
}
637638
}
638639

@@ -722,7 +723,8 @@ impl<T> ops::IndexMut<ops::RangeInclusive<usize>> for [T] {
722723
impl<T> ops::IndexMut<ops::RangeToInclusive<usize>> for [T] {
723724
#[inline]
724725
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut [T] {
725-
self.index_mut(0...index.end)
726+
// SNAP 4d3eebf change this to `0...index.end`
727+
self.index_mut(ops::RangeInclusive::NonEmpty { start: 0, end: index.end })
726728
}
727729
}
728730

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,8 @@ mod traits {
15241524

15251525
#[inline]
15261526
fn index(&self, index: ops::RangeToInclusive<usize>) -> &str {
1527-
self.index(0...index.end)
1527+
// SNAP 4d3eebf change this to `0...index.end`
1528+
self.index(ops::RangeInclusive::NonEmpty { start: 0, end: index.end })
15281529
}
15291530
}
15301531

@@ -1549,7 +1550,8 @@ mod traits {
15491550
impl ops::IndexMut<ops::RangeToInclusive<usize>> for str {
15501551
#[inline]
15511552
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {
1552-
self.index_mut(0...index.end)
1553+
// SNAP 4d3eebf change this to `0...index.end`
1554+
self.index_mut(ops::RangeInclusive::NonEmpty { start: 0, end: index.end })
15531555
}
15541556
}
15551557
}

branches/beta/src/libcore/sync/atomic.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,7 +1380,7 @@ unsafe fn atomic_sub<T>(dst: *mut T, val: T, order: Ordering) -> T {
13801380
}
13811381

13821382
#[inline]
1383-
#[cfg(any(not(stage0), cargobuild))]
1383+
#[cfg(not(stage0))]
13841384
unsafe fn atomic_compare_exchange<T>(dst: *mut T,
13851385
old: T,
13861386
new: T,
@@ -1408,7 +1408,7 @@ unsafe fn atomic_compare_exchange<T>(dst: *mut T,
14081408
}
14091409

14101410
#[inline]
1411-
#[cfg(all(stage0, not(cargobuild)))]
1411+
#[cfg(stage0)]
14121412
unsafe fn atomic_compare_exchange<T>(dst: *mut T,
14131413
old: T,
14141414
new: T,
@@ -1431,6 +1431,7 @@ unsafe fn atomic_compare_exchange<T>(dst: *mut T,
14311431
}
14321432

14331433
#[inline]
1434+
#[cfg(not(stage0))]
14341435
unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T,
14351436
old: T,
14361437
new: T,
@@ -1457,6 +1458,18 @@ unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T,
14571458
}
14581459
}
14591460

1461+
#[inline]
1462+
#[cfg(stage0)]
1463+
unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T,
1464+
old: T,
1465+
new: T,
1466+
success: Ordering,
1467+
failure: Ordering) -> Result<T, T>
1468+
where T: ::cmp::Eq + ::marker::Copy
1469+
{
1470+
atomic_compare_exchange(dst, old, new, success, failure)
1471+
}
1472+
14601473
#[inline]
14611474
unsafe fn atomic_and<T>(dst: *mut T, val: T, order: Ordering) -> T {
14621475
match order {

branches/beta/src/librustc/middle/ty/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
133133
let infcx = infer::new_infer_ctxt(tcx,
134134
&tcx.tables,
135135
Some(self.clone()),
136-
ProjectionMode::Topmost);
136+
ProjectionMode::AnyFinal);
137137

138138
let adt = match self_type.sty {
139139
ty::TyStruct(struct_def, substs) => {
@@ -548,7 +548,7 @@ impl<'tcx> ty::TyS<'tcx> {
548548
let infcx = infer::new_infer_ctxt(tcx,
549549
&tcx.tables,
550550
Some(param_env.clone()),
551-
ProjectionMode::Topmost);
551+
ProjectionMode::AnyFinal);
552552

553553
let is_impld = traits::type_known_to_meet_builtin_bound(&infcx,
554554
self, bound, span);

branches/beta/src/librustc_back/target/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
//! this module defines the format the JSON file should take, though each
4141
//! underscore in the field names should be replaced with a hyphen (`-`) in the
4242
//! JSON file. Some fields are required in every target specification, such as
43-
//! `llvm-target`, `target-endian`, `target-pointer-width`, `arch`, and
44-
//! `os`. In general, options passed to rustc with `-C` override the target's
43+
//! `data-layout`, `llvm-target`, `target-endian`, `target-pointer-width`, and
44+
//! `arch`. In general, options passed to rustc with `-C` override the target's
4545
//! settings, though `target-feature` and `link-args` will *add* to the list
4646
//! specified by the target, rather than replace.
4747

branches/beta/src/librustc_trans/trans/adt.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -396,15 +396,6 @@ fn represent_type_uncached<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
396396
}
397397
}
398398
}
399-
400-
// If the alignment is smaller than the chosen discriminant size, don't use the
401-
// alignment as the final size.
402-
let min_ty = ll_inttype(&cx, min_ity);
403-
let min_size = machine::llsize_of_real(cx, min_ty);
404-
if (align as u64) < min_size {
405-
use_align = false;
406-
}
407-
408399
let ity = if use_align {
409400
// Use the overall alignment
410401
match align {
@@ -822,11 +813,11 @@ fn generic_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
822813
// FIXME #10604: this breaks when vector types are present.
823814
let (size, align) = union_size_and_align(&sts[..]);
824815
let align_s = align as u64;
816+
assert_eq!(size % align_s, 0);
817+
let align_units = size / align_s - 1;
818+
825819
let discr_ty = ll_inttype(cx, ity);
826820
let discr_size = machine::llsize_of_alloc(cx, discr_ty);
827-
let padded_discr_size = roundup(discr_size, align);
828-
assert_eq!(size % align_s, 0); // Ensure division in align_units comes out evenly
829-
let align_units = (size - padded_discr_size) / align_s;
830821
let fill_ty = match align_s {
831822
1 => Type::array(&Type::i8(cx), align_units),
832823
2 => Type::array(&Type::i16(cx), align_units),
@@ -838,10 +829,10 @@ fn generic_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
838829
_ => panic!("unsupported enum alignment: {}", align)
839830
};
840831
assert_eq!(machine::llalign_of_min(cx, fill_ty), align);
841-
assert_eq!(padded_discr_size % discr_size, 0); // Ensure discr_ty can fill pad evenly
832+
assert_eq!(align_s % discr_size, 0);
842833
let mut fields: Vec<Type> =
843834
[discr_ty,
844-
Type::array(&discr_ty, (padded_discr_size - discr_size)/discr_size),
835+
Type::array(&discr_ty, align_s / discr_size - 1),
845836
fill_ty].iter().cloned().collect();
846837
if delay_drop_flag && dtor_needed {
847838
fields.pop();

branches/beta/src/libstd/fs.rs

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,12 +1457,12 @@ mod tests {
14571457
use prelude::v1::*;
14581458
use io::prelude::*;
14591459

1460-
use env;
14611460
use fs::{self, File, OpenOptions};
14621461
use io::{ErrorKind, SeekFrom};
1463-
use path::{Path, PathBuf};
1464-
use rand::{self, StdRng, Rng};
1462+
use path::Path;
1463+
use rand::{StdRng, Rng};
14651464
use str;
1465+
use sys_common::io::test::{TempDir, tmpdir};
14661466

14671467
#[cfg(windows)]
14681468
use os::windows::fs::{symlink_dir, symlink_file};
@@ -1490,37 +1490,6 @@ mod tests {
14901490
}
14911491
) }
14921492

1493-
pub struct TempDir(PathBuf);
1494-
1495-
impl TempDir {
1496-
fn join(&self, path: &str) -> PathBuf {
1497-
let TempDir(ref p) = *self;
1498-
p.join(path)
1499-
}
1500-
1501-
fn path<'a>(&'a self) -> &'a Path {
1502-
let TempDir(ref p) = *self;
1503-
p
1504-
}
1505-
}
1506-
1507-
impl Drop for TempDir {
1508-
fn drop(&mut self) {
1509-
// Gee, seeing how we're testing the fs module I sure hope that we
1510-
// at least implement this correctly!
1511-
let TempDir(ref p) = *self;
1512-
check!(fs::remove_dir_all(p));
1513-
}
1514-
}
1515-
1516-
pub fn tmpdir() -> TempDir {
1517-
let p = env::temp_dir();
1518-
let mut r = rand::thread_rng();
1519-
let ret = p.join(&format!("rust-{}", r.next_u32()));
1520-
check!(fs::create_dir(&ret));
1521-
TempDir(ret)
1522-
}
1523-
15241493
// Several test fail on windows if the user does not have permission to
15251494
// create symlinks (the `SeCreateSymbolicLinkPrivilege`). Instead of
15261495
// disabling these test on Windows, use this function to test whether we

0 commit comments

Comments
 (0)