Skip to content

Commit dab8f3d

Browse files
Ariel Ben-Yehudaarielb1
authored andcommitted
---
yaml --- r: 234223 b: refs/heads/beta c: caa10c3 h: refs/heads/master i: 234221: 03ed008 234219: c189a88 234215: e5e997c 234207: 0374f3b v: v3
1 parent 570b746 commit dab8f3d

Some content is hidden

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

83 files changed

+250
-425
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: e629dba0ee190cab49df0c5db299fb8d77264dda
26+
refs/heads/beta: caa10c3bde60ce0d9b5401771c443bff51d2a8e2
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/doc/trpl/advanced-linking.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,33 @@ $ mkdir musldist
8080
$ PREFIX=$(pwd)/musldist
8181
$
8282
$ # Build musl
83-
$ curl -O http://www.musl-libc.org/releases/musl-1.1.10.tar.gz
83+
$ wget http://www.musl-libc.org/releases/musl-1.1.10.tar.gz
84+
[...]
8485
$ tar xf musl-1.1.10.tar.gz
8586
$ cd musl-1.1.10/
8687
musl-1.1.10 $ ./configure --disable-shared --prefix=$PREFIX
88+
[...]
8789
musl-1.1.10 $ make
90+
[...]
8891
musl-1.1.10 $ make install
92+
[...]
8993
musl-1.1.10 $ cd ..
9094
$ du -h musldist/lib/libc.a
9195
2.2M musldist/lib/libc.a
9296
$
9397
$ # Build libunwind.a
94-
$ curl -O http://llvm.org/releases/3.7.0/llvm-3.7.0.src.tar.xz
95-
$ tar xf llvm-3.7.0.src.tar.xz
96-
$ cd llvm-3.7.0.src/projects/
97-
llvm-3.7.0.src/projects $ curl http://llvm.org/releases/3.7.0/libcxxabi-3.7.0.src.tar.xz | tar xJf -
98-
llvm-3.7.0.src/projects $ mv libcxxabi-3.7.0.src libcxxabi
99-
llvm-3.7.0.src/projects $ curl http://llvm.org/releases/3.7.0/libunwind-3.7.0.src.tar.xz | tar xJf -
100-
llvm-3.7.0.src/projects $ mv libunwind-3.7.0.src libunwind
101-
llvm-3.7.0.src/projects $ mkdir libunwind/build
102-
llvm-3.7.0.src/projects $ cd libunwind/build
103-
llvm-3.7.0.src/projects/libunwind/build $ cmake -DLLVM_PATH=../../.. -DLIBUNWIND_ENABLE_SHARED=0 ..
104-
llvm-3.7.0.src/projects/libunwind/build $ make
105-
llvm-3.7.0.src/projects/libunwind/build $ cp lib/libunwind.a $PREFIX/lib/
106-
llvm-3.7.0.src/projects/libunwind/build $ cd ../../../../
98+
$ wget http://llvm.org/releases/3.6.1/llvm-3.6.1.src.tar.xz
99+
$ tar xf llvm-3.6.1.src.tar.xz
100+
$ cd llvm-3.6.1.src/projects/
101+
llvm-3.6.1.src/projects $ svn co http://llvm.org/svn/llvm-project/libcxxabi/trunk/ libcxxabi
102+
llvm-3.6.1.src/projects $ svn co http://llvm.org/svn/llvm-project/libunwind/trunk/ libunwind
103+
llvm-3.6.1.src/projects $ sed -i 's#^\(include_directories\).*$#\0\n\1(../libcxxabi/include)#' libunwind/CMakeLists.txt
104+
llvm-3.6.1.src/projects $ mkdir libunwind/build
105+
llvm-3.6.1.src/projects $ cd libunwind/build
106+
llvm-3.6.1.src/projects/libunwind/build $ cmake -DLLVM_PATH=../../.. -DLIBUNWIND_ENABLE_SHARED=0 ..
107+
llvm-3.6.1.src/projects/libunwind/build $ make
108+
llvm-3.6.1.src/projects/libunwind/build $ cp lib/libunwind.a $PREFIX/lib/
109+
llvm-3.6.1.src/projects/libunwind/build $ cd cd ../../../../
107110
$ du -h musldist/lib/libunwind.a
108111
164K musldist/lib/libunwind.a
109112
$

branches/beta/src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
#![feature(optin_builtin_traits)]
8080
#![feature(reflect)]
8181
#![feature(rustc_attrs)]
82-
#![feature(unwind_attributes)]
8382
#![cfg_attr(stage0, feature(simd))]
8483
#![cfg_attr(not(stage0), feature(repr_simd, platform_intrinsics))]
8584
#![feature(staged_api)]

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -537,21 +537,25 @@ macro_rules! int_impl {
537537
let mut base = self;
538538
let mut acc = Self::one();
539539

540-
while exp > 1 {
540+
let mut prev_base = self;
541+
let mut base_oflo = false;
542+
while exp > 0 {
541543
if (exp & 1) == 1 {
542-
acc = acc * base;
544+
if base_oflo {
545+
// ensure overflow occurs in the same manner it
546+
// would have otherwise (i.e. signal any exception
547+
// it would have otherwise).
548+
acc = acc * (prev_base * prev_base);
549+
} else {
550+
acc = acc * base;
551+
}
543552
}
553+
prev_base = base;
554+
let (new_base, new_base_oflo) = base.overflowing_mul(base);
555+
base = new_base;
556+
base_oflo = new_base_oflo;
544557
exp /= 2;
545-
base = base * base;
546-
}
547-
548-
// Deal with the final bit of the exponent separately, since
549-
// squaring the base afterwards is not necessary and may cause a
550-
// needless overflow.
551-
if exp == 1 {
552-
acc = acc * base;
553558
}
554-
555559
acc
556560
}
557561

branches/beta/src/libcore/panicking.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ pub fn panic_fmt(fmt: fmt::Arguments, file_line: &(&'static str, u32)) -> ! {
6262
#[allow(improper_ctypes)]
6363
extern {
6464
#[lang = "panic_fmt"]
65-
#[unwind]
6665
fn panic_impl(fmt: fmt::Arguments, file: &'static str, line: u32) -> !;
6766
}
6867
let (file, line) = *file_line;

branches/beta/src/librustc/diagnostics.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,6 @@ register_diagnostics! {
18951895
// E0006 // merged with E0005
18961896
// E0134,
18971897
// E0135,
1898-
E0229, // associated type bindings are not allowed here
18991898
E0264, // unknown external lang item
19001899
E0278, // requirement is not satisfied
19011900
E0279, // requirement is not satisfied

branches/beta/src/librustc/lib.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ pub mod front {
107107
pub mod middle {
108108
pub mod astconv_util;
109109
pub mod astencode;
110-
pub mod cast;
111110
pub mod cfg;
112111
pub mod check_const;
113112
pub mod check_static_recursion;
@@ -124,15 +123,13 @@ pub mod middle {
124123
pub mod effect;
125124
pub mod entry;
126125
pub mod expr_use_visitor;
127-
pub mod fast_reject;
128126
pub mod free_region;
129127
pub mod intrinsicck;
130128
pub mod infer;
131129
pub mod implicator;
132130
pub mod lang_items;
133131
pub mod liveness;
134132
pub mod mem_categorization;
135-
pub mod outlives;
136133
pub mod pat_util;
137134
pub mod privacy;
138135
pub mod reachable;
@@ -143,11 +140,6 @@ pub mod middle {
143140
pub mod subst;
144141
pub mod traits;
145142
pub mod ty;
146-
pub mod ty_fold;
147-
pub mod ty_match;
148-
pub mod ty_relate;
149-
pub mod ty_walk;
150-
pub mod wf;
151143
pub mod weak_lang_items;
152144
}
153145

branches/beta/src/librustc/middle/astconv_util.rs

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,36 @@
1616

1717
use middle::def;
1818
use middle::ty::{self, Ty};
19-
20-
use syntax::codemap::Span;
2119
use rustc_front::hir as ast;
2220

23-
pub fn prohibit_type_params(tcx: &ty::ctxt, segments: &[ast::PathSegment]) {
21+
pub const NO_REGIONS: usize = 1;
22+
pub const NO_TPS: usize = 2;
23+
24+
pub fn check_path_args(tcx: &ty::ctxt, segments: &[ast::PathSegment], flags: usize) {
2425
for segment in segments {
25-
for typ in segment.parameters.types() {
26-
span_err!(tcx.sess, typ.span, E0109,
27-
"type parameters are not allowed on this type");
28-
break;
29-
}
30-
for lifetime in segment.parameters.lifetimes() {
31-
span_err!(tcx.sess, lifetime.span, E0110,
32-
"lifetime parameters are not allowed on this type");
33-
break;
26+
if (flags & NO_TPS) != 0 {
27+
for typ in segment.parameters.types() {
28+
span_err!(tcx.sess, typ.span, E0109,
29+
"type parameters are not allowed on this type");
30+
break;
31+
}
3432
}
35-
for binding in segment.parameters.bindings() {
36-
prohibit_projection(tcx, binding.span);
37-
break;
33+
34+
if (flags & NO_REGIONS) != 0 {
35+
for lifetime in segment.parameters.lifetimes() {
36+
span_err!(tcx.sess, lifetime.span, E0110,
37+
"lifetime parameters are not allowed on this type");
38+
break;
39+
}
3840
}
3941
}
4042
}
4143

42-
pub fn prohibit_projection(tcx: &ty::ctxt, span: Span)
43-
{
44-
span_err!(tcx.sess, span, E0229,
45-
"associated type bindings are not allowed here");
46-
}
47-
4844
pub fn prim_ty_to_ty<'tcx>(tcx: &ty::ctxt<'tcx>,
4945
segments: &[ast::PathSegment],
5046
nty: ast::PrimTy)
5147
-> Ty<'tcx> {
52-
prohibit_type_params(tcx, segments);
48+
check_path_args(tcx, segments, NO_TPS | NO_REGIONS);
5349
match nty {
5450
ast::TyBool => tcx.types.bool,
5551
ast::TyChar => tcx.types.char,

branches/beta/src/librustc/middle/astencode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use metadata::tydecode;
2727
use metadata::tydecode::{DefIdSource, NominalType, TypeWithId};
2828
use metadata::tydecode::{RegionParameter, ClosureSource};
2929
use metadata::tyencode;
30-
use middle::cast;
30+
use middle::ty::cast;
3131
use middle::check_const::ConstQualif;
3232
use middle::def;
3333
use middle::def_id::{DefId, LOCAL_CRATE};

branches/beta/src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// - It's not possible to take the address of a static item with unsafe interior. This is enforced
2525
// by borrowck::gather_loans
2626

27-
use middle::cast::{CastKind};
27+
use middle::ty::cast::{CastKind};
2828
use middle::const_eval;
2929
use middle::const_eval::EvalHint::ExprTypeChecked;
3030
use middle::def;

branches/beta/src/librustc/middle/free_region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! region outlives another and so forth.
1717
1818
use middle::ty::{self, FreeRegion, Region};
19-
use middle::wf::ImpliedBound;
19+
use middle::ty::wf::ImpliedBound;
2020
use rustc_data_structures::transitive_relation::TransitiveRelation;
2121

2222
#[derive(Clone)]

branches/beta/src/librustc/middle/implicator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use middle::infer::{InferCtxt, GenericKind};
1515
use middle::subst::Substs;
1616
use middle::traits;
1717
use middle::ty::{self, RegionEscape, ToPredicate, Ty};
18-
use middle::ty_fold::{TypeFoldable, TypeFolder};
18+
use middle::ty::fold::{TypeFoldable, TypeFolder};
1919

2020
use syntax::ast;
2121
use syntax::codemap::Span;

branches/beta/src/librustc/middle/infer/bivariate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use super::type_variable::{BiTo};
3030

3131
use middle::ty::{self, Ty};
3232
use middle::ty::TyVar;
33-
use middle::ty_relate::{Relate, RelateResult, TypeRelation};
33+
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
3434

3535
pub struct Bivariate<'a, 'tcx: 'a> {
3636
fields: CombineFields<'a, 'tcx>

branches/beta/src/librustc/middle/infer/combine.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ use super::type_variable::{RelationDir, BiTo, EqTo, SubtypeOf, SupertypeOf};
4444
use middle::ty::{TyVar};
4545
use middle::ty::{IntType, UintType};
4646
use middle::ty::{self, Ty, TypeError};
47-
use middle::ty_fold;
48-
use middle::ty_fold::{TypeFolder, TypeFoldable};
49-
use middle::ty_relate::{self, Relate, RelateResult, TypeRelation};
47+
use middle::ty::fold::{TypeFolder, TypeFoldable};
48+
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
5049

5150
use syntax::codemap::Span;
5251
use rustc_front::hir;
@@ -56,7 +55,7 @@ pub struct CombineFields<'a, 'tcx: 'a> {
5655
pub infcx: &'a InferCtxt<'a, 'tcx>,
5756
pub a_is_expected: bool,
5857
pub trace: TypeTrace<'tcx>,
59-
pub cause: Option<ty_relate::Cause>,
58+
pub cause: Option<ty::relate::Cause>,
6059
}
6160

6261
pub fn super_combine_tys<'a,'tcx:'a,R>(infcx: &InferCtxt<'a, 'tcx>,
@@ -108,12 +107,12 @@ pub fn super_combine_tys<'a,'tcx:'a,R>(infcx: &InferCtxt<'a, 'tcx>,
108107
// All other cases of inference are errors
109108
(&ty::TyInfer(_), _) |
110109
(_, &ty::TyInfer(_)) => {
111-
Err(TypeError::Sorts(ty_relate::expected_found(relation, &a, &b)))
110+
Err(TypeError::Sorts(ty::relate::expected_found(relation, &a, &b)))
112111
}
113112

114113

115114
_ => {
116-
ty_relate::super_relate_tys(relation, a, b)
115+
ty::relate::super_relate_tys(relation, a, b)
117116
}
118117
}
119118
}
@@ -293,7 +292,7 @@ struct Generalizer<'cx, 'tcx:'cx> {
293292
cycle_detected: bool,
294293
}
295294

296-
impl<'cx, 'tcx> ty_fold::TypeFolder<'tcx> for Generalizer<'cx, 'tcx> {
295+
impl<'cx, 'tcx> ty::fold::TypeFolder<'tcx> for Generalizer<'cx, 'tcx> {
297296
fn tcx(&self) -> &ty::ctxt<'tcx> {
298297
self.infcx.tcx
299298
}
@@ -319,7 +318,7 @@ impl<'cx, 'tcx> ty_fold::TypeFolder<'tcx> for Generalizer<'cx, 'tcx> {
319318
}
320319
}
321320
_ => {
322-
ty_fold::super_fold_ty(self, t)
321+
ty::fold::super_fold_ty(self, t)
323322
}
324323
}
325324
}
@@ -384,13 +383,13 @@ fn int_unification_error<'tcx>(a_is_expected: bool, v: (ty::IntVarValue, ty::Int
384383
-> ty::TypeError<'tcx>
385384
{
386385
let (a, b) = v;
387-
TypeError::IntMismatch(ty_relate::expected_found_bool(a_is_expected, &a, &b))
386+
TypeError::IntMismatch(ty::relate::expected_found_bool(a_is_expected, &a, &b))
388387
}
389388

390389
fn float_unification_error<'tcx>(a_is_expected: bool,
391390
v: (hir::FloatTy, hir::FloatTy))
392391
-> ty::TypeError<'tcx>
393392
{
394393
let (a, b) = v;
395-
TypeError::FloatMismatch(ty_relate::expected_found_bool(a_is_expected, &a, &b))
394+
TypeError::FloatMismatch(ty::relate::expected_found_bool(a_is_expected, &a, &b))
396395
}

branches/beta/src/librustc/middle/infer/equate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use super::type_variable::{EqTo};
1515

1616
use middle::ty::{self, Ty};
1717
use middle::ty::TyVar;
18-
use middle::ty_relate::{Relate, RelateResult, TypeRelation};
18+
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
1919

2020
pub struct Equate<'a, 'tcx: 'a> {
2121
fields: CombineFields<'a, 'tcx>

branches/beta/src/librustc/middle/infer/freshen.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@
3131
//! inferencer knows "so far".
3232
3333
use middle::ty::{self, Ty, HasTypeFlags};
34-
use middle::ty_fold;
35-
use middle::ty_fold::TypeFoldable;
36-
use middle::ty_fold::TypeFolder;
34+
use middle::ty::fold::TypeFoldable;
35+
use middle::ty::fold::TypeFolder;
3736
use std::collections::hash_map::{self, Entry};
3837

3938
use super::InferCtxt;
@@ -170,7 +169,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
170169
ty::TyTuple(..) |
171170
ty::TyProjection(..) |
172171
ty::TyParam(..) => {
173-
ty_fold::super_fold_ty(self, t)
172+
ty::fold::super_fold_ty(self, t)
174173
}
175174
}
176175
}

branches/beta/src/librustc/middle/infer/glb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use super::lattice::{self, LatticeDir};
1515
use super::Subtype;
1616

1717
use middle::ty::{self, Ty};
18-
use middle::ty_relate::{Relate, RelateResult, TypeRelation};
18+
use middle::ty::relate::{Relate, RelateResult, TypeRelation};
1919

2020
/// "Greatest lower bound" (common subtype)
2121
pub struct Glb<'a, 'tcx: 'a> {

0 commit comments

Comments
 (0)