Skip to content

Commit f3f2449

Browse files
committed
---
yaml --- r: 221166 b: refs/heads/tmp c: bc4daf7 h: refs/heads/master v: v3
1 parent 19033a6 commit f3f2449

Some content is hidden

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

55 files changed

+1636
-582
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: c8bab9d06a179028a0d5129aa62f09d694d9cc49
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 2e919b4c5107a584ffcf58e4b39a001275845fec
28+
refs/heads/tmp: bc4daf7e945bf9fff93e41e129d600514f7135df
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: e58601ab085591c71a27ae82137fc313222c2270
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/mk/rt.mk

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ NATIVE_DEPS_miniz_$(1) = miniz.c
5454
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
5555
rust_android_dummy.c
5656
NATIVE_DEPS_rustrt_native_$(1) := arch/$$(HOST_$(1))/record_sp.S
57-
ifeq ($$(findstring msvc,$(1)),msvc)
58-
ifeq ($$(findstring i686,$(1)),i686)
59-
NATIVE_DEPS_rustrt_native_$(1) += rust_try_msvc_32.ll
60-
else
61-
NATIVE_DEPS_rustrt_native_$(1) += rust_try_msvc_64.ll
62-
endif
63-
else
64-
NATIVE_DEPS_rustrt_native_$(1) += rust_try.ll
65-
endif
6657
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
6758
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
6859

@@ -76,14 +67,6 @@ NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
7667

7768
RT_OUTPUT_DIR_$(1) := $(1)/rt
7869

79-
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
80-
$$(LLVM_CONFIG_$$(CFG_BUILD))
81-
@mkdir -p $$(@D)
82-
@$$(call E, compile: $$@)
83-
$$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
84-
-filetype=obj -mtriple=$$(CFG_LLVM_TARGET_$(1)) \
85-
-relocation-model=pic -o $$@ $$<
86-
8770
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
8871
@mkdir -p $$(@D)
8972
@$$(call E, compile: $$@)
@@ -122,7 +105,6 @@ define THIRD_PARTY_LIB
122105
OBJS_$(2)_$(1) := $$(NATIVE_DEPS_$(2)_$(1):%=$$(RT_OUTPUT_DIR_$(1))/%)
123106
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.c=.o)
124107
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.cpp=.o)
125-
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.ll=.o)
126108
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.S=.o)
127109
NATIVE_$(2)_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),$(2))
128110
$$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))

branches/tmp/src/liballoc/lib.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,3 @@ pub fn oom() -> ! {
135135
// allocate.
136136
unsafe { core::intrinsics::abort() }
137137
}
138-
139-
// FIXME(#14344): When linking liballoc with libstd, this library will be linked
140-
// as an rlib (it only exists as an rlib). It turns out that an
141-
// optimized standard library doesn't actually use *any* symbols
142-
// from this library. Everything is inlined and optimized away.
143-
// This means that linkers will actually omit the object for this
144-
// file, even though it may be needed in the future.
145-
//
146-
// To get around this for now, we define a dummy symbol which
147-
// will never get inlined so the stdlib can call it. The stdlib's
148-
// reference to this symbol will cause this library's object file
149-
// to get linked in to libstd successfully (the linker won't
150-
// optimize it out).
151-
#[doc(hidden)]
152-
#[unstable(feature = "issue_14344_fixme")]
153-
#[cfg(stage0)]
154-
pub fn fixme_14344_be_sure_to_link_to_collections() {}

branches/tmp/src/libcollections/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,6 @@ pub mod btree_set {
133133
pub use btree::set::*;
134134
}
135135

136-
137-
// FIXME(#14344) this shouldn't be necessary
138-
#[doc(hidden)]
139-
#[unstable(feature = "issue_14344_fixme")]
140-
#[cfg(stage0)]
141-
pub fn fixme_14344_be_sure_to_link_to_collections() {}
142-
143136
#[cfg(not(test))]
144137
mod std {
145138
pub use core::ops; // RangeFull

branches/tmp/src/libcollections/string.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,23 +979,20 @@ impl ops::Index<ops::RangeFull> for String {
979979
}
980980
}
981981

982-
#[cfg(not(stage0))]
983982
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
984983
impl ops::IndexMut<ops::Range<usize>> for String {
985984
#[inline]
986985
fn index_mut(&mut self, index: ops::Range<usize>) -> &mut str {
987986
&mut self[..][index]
988987
}
989988
}
990-
#[cfg(not(stage0))]
991989
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
992990
impl ops::IndexMut<ops::RangeTo<usize>> for String {
993991
#[inline]
994992
fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut str {
995993
&mut self[..][index]
996994
}
997995
}
998-
#[cfg(not(stage0))]
999996
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
1000997
impl ops::IndexMut<ops::RangeFrom<usize>> for String {
1001998
#[inline]

branches/tmp/src/libcore/intrinsics.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,4 +602,10 @@ extern "rust-intrinsic" {
602602
/// Returns the value of the discriminant for the variant in 'v',
603603
/// cast to a `u64`; if `T` has no discriminant, returns 0.
604604
pub fn discriminant_value<T>(v: &T) -> u64;
605+
606+
/// Rust's "try catch" construct which invokes the function pointer `f` with
607+
/// the data pointer `data`, returning the exception payload if an exception
608+
/// is thrown (aka the thread panics).
609+
#[cfg(not(stage0))]
610+
pub fn try(f: fn(*mut u8), data: *mut u8) -> *mut u8;
605611
}

branches/tmp/src/liblibc/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6535,8 +6535,4 @@ pub mod funcs {
65356535
}
65366536
}
65376537

6538-
#[doc(hidden)]
6539-
#[cfg(stage0)]
6540-
pub fn issue_14344_workaround() {} // FIXME #14344 force linkage to happen correctly
6541-
65426538
#[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows

branches/tmp/src/librustc/diagnostics.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,24 @@ This error indicates that an attempt was made to divide by zero (or take the
335335
remainder of a zero divisor) in a static or constant expression.
336336
"##,
337337

338+
E0030: r##"
339+
When matching against a range, the compiler verifies that the range is
340+
non-empty. Range patterns include both end-points, so this is equivalent to
341+
requiring the start of the range to be less than or equal to the end of the
342+
range.
343+
344+
For example:
345+
346+
```
347+
match 5u32 {
348+
// This range is ok, albeit pointless.
349+
1 ... 1 => ...
350+
// This range is empty, and the compiler can tell.
351+
1000 ... 5 => ...
352+
}
353+
```
354+
"##,
355+
338356
E0079: r##"
339357
Enum variants which contain no data can be given a custom integer
340358
representation. This error indicates that the value provided is not an

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
use middle::cast::{CastKind};
2828
use middle::const_eval;
29+
use middle::const_eval::EvalHint::ExprTypeChecked;
2930
use middle::def;
3031
use middle::expr_use_visitor as euv;
3132
use middle::infer;
@@ -39,6 +40,7 @@ use syntax::codemap::Span;
3940
use syntax::visit::{self, Visitor};
4041

4142
use std::collections::hash_map::Entry;
43+
use std::cmp::Ordering;
4244

4345
// Const qualification, from partial to completely promotable.
4446
bitflags! {
@@ -365,6 +367,19 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
365367
ast::PatRange(ref start, ref end) => {
366368
self.global_expr(Mode::Const, &**start);
367369
self.global_expr(Mode::Const, &**end);
370+
371+
match const_eval::compare_lit_exprs(self.tcx, start, end) {
372+
Some(Ordering::Less) |
373+
Some(Ordering::Equal) => {}
374+
Some(Ordering::Greater) => {
375+
span_err!(self.tcx.sess, start.span, E0030,
376+
"lower range bound must be less than or equal to upper");
377+
}
378+
None => {
379+
self.tcx.sess.span_bug(
380+
start.span, "literals of different types in range pat");
381+
}
382+
}
368383
}
369384
_ => visit::walk_pat(self, p)
370385
}
@@ -457,7 +472,8 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
457472
match node_ty.sty {
458473
ty::TyUint(_) | ty::TyInt(_) if div_or_rem => {
459474
if !self.qualif.intersects(ConstQualif::NOT_CONST) {
460-
match const_eval::eval_const_expr_partial(self.tcx, ex, None) {
475+
match const_eval::eval_const_expr_partial(
476+
self.tcx, ex, ExprTypeChecked) {
461477
Ok(_) => {}
462478
Err(msg) => {
463479
span_err!(self.tcx.sess, msg.span, E0020,

branches/tmp/src/librustc/middle/check_match.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use self::WitnessPreference::*;
1515
use middle::const_eval::{compare_const_vals, ConstVal};
1616
use middle::const_eval::{eval_const_expr, eval_const_expr_partial};
1717
use middle::const_eval::{const_expr_to_pat, lookup_const_by_id};
18+
use middle::const_eval::EvalHint::ExprTypeChecked;
1819
use middle::def::*;
1920
use middle::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor, Init};
2021
use middle::expr_use_visitor::{JustWrite, LoanCause, MutateMode};
@@ -263,7 +264,7 @@ fn check_for_bindings_named_the_same_as_variants(cx: &MatchCheckCtxt, pat: &Pat)
263264
fn check_for_static_nan(cx: &MatchCheckCtxt, pat: &Pat) {
264265
ast_util::walk_pat(pat, |p| {
265266
if let ast::PatLit(ref expr) = p.node {
266-
match eval_const_expr_partial(cx.tcx, &**expr, None) {
267+
match eval_const_expr_partial(cx.tcx, &**expr, ExprTypeChecked) {
267268
Ok(ConstVal::Float(f)) if f.is_nan() => {
268269
span_warn!(cx.tcx.sess, p.span, E0003,
269270
"unmatchable NaN in pattern, \

0 commit comments

Comments
 (0)