Skip to content

Commit 8977f2b

Browse files
---
yaml --- r: 220792 b: refs/heads/master c: 0eb7303 h: refs/heads/master v: v3
1 parent b1372b7 commit 8977f2b

Some content is hidden

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

56 files changed

+597
-1637
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d4d4206e5604b86fc4a9b28a8b51d99121cc3a5d
2+
refs/heads/master: 0eb7303c7062792049c0ec4ff2c42565db6d60ff
33
refs/heads/snap-stage3: d4432b37378ec55450e06799f5344b4b0f4b94e0
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/mk/rt.mk

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ 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
5766
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
5867
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
5968

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

6877
RT_OUTPUT_DIR_$(1) := $(1)/rt
6978

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+
7087
$$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
7188
@mkdir -p $$(@D)
7289
@$$(call E, compile: $$@)
@@ -105,6 +122,7 @@ define THIRD_PARTY_LIB
105122
OBJS_$(2)_$(1) := $$(NATIVE_DEPS_$(2)_$(1):%=$$(RT_OUTPUT_DIR_$(1))/%)
106123
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.c=.o)
107124
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.cpp=.o)
125+
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.ll=.o)
108126
OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.S=.o)
109127
NATIVE_$(2)_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),$(2))
110128
$$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))

trunk/src/liballoc/lib.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,20 @@ 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() {}

trunk/src/libcollections/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ 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+
136143
#[cfg(not(test))]
137144
mod std {
138145
pub use core::ops; // RangeFull

trunk/src/libcollections/string.rs

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

982+
#[cfg(not(stage0))]
982983
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
983984
impl ops::IndexMut<ops::Range<usize>> for String {
984985
#[inline]
985986
fn index_mut(&mut self, index: ops::Range<usize>) -> &mut str {
986987
&mut self[..][index]
987988
}
988989
}
990+
#[cfg(not(stage0))]
989991
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
990992
impl ops::IndexMut<ops::RangeTo<usize>> for String {
991993
#[inline]
992994
fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut str {
993995
&mut self[..][index]
994996
}
995997
}
998+
#[cfg(not(stage0))]
996999
#[stable(feature = "derefmut_for_string", since = "1.2.0")]
9971000
impl ops::IndexMut<ops::RangeFrom<usize>> for String {
9981001
#[inline]

trunk/src/libcore/intrinsics.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -602,10 +602,4 @@ 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;
611605
}

trunk/src/liblibc/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6535,4 +6535,8 @@ 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+
65386542
#[test] fn work_on_windows() { } // FIXME #10872 needed for a happy windows

trunk/src/librustc/diagnostics.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -335,24 +335,6 @@ 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-
356338
E0079: r##"
357339
Enum variants which contain no data can be given a custom integer
358340
representation. This error indicates that the value provided is not an

trunk/src/librustc/middle/check_const.rs

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

2727
use middle::cast::{CastKind};
2828
use middle::const_eval;
29-
use middle::const_eval::EvalHint::ExprTypeChecked;
3029
use middle::def;
3130
use middle::expr_use_visitor as euv;
3231
use middle::infer;
@@ -40,7 +39,6 @@ use syntax::codemap::Span;
4039
use syntax::visit::{self, Visitor};
4140

4241
use std::collections::hash_map::Entry;
43-
use std::cmp::Ordering;
4442

4543
// Const qualification, from partial to completely promotable.
4644
bitflags! {
@@ -367,19 +365,6 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
367365
ast::PatRange(ref start, ref end) => {
368366
self.global_expr(Mode::Const, &**start);
369367
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-
}
383368
}
384369
_ => visit::walk_pat(self, p)
385370
}
@@ -472,8 +457,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
472457
match node_ty.sty {
473458
ty::TyUint(_) | ty::TyInt(_) if div_or_rem => {
474459
if !self.qualif.intersects(ConstQualif::NOT_CONST) {
475-
match const_eval::eval_const_expr_partial(
476-
self.tcx, ex, ExprTypeChecked) {
460+
match const_eval::eval_const_expr_partial(self.tcx, ex, None) {
477461
Ok(_) => {}
478462
Err(msg) => {
479463
span_err!(self.tcx.sess, msg.span, E0020,

trunk/src/librustc/middle/check_match.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ 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;
1918
use middle::def::*;
2019
use middle::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor, Init};
2120
use middle::expr_use_visitor::{JustWrite, LoanCause, MutateMode};
@@ -264,7 +263,7 @@ fn check_for_bindings_named_the_same_as_variants(cx: &MatchCheckCtxt, pat: &Pat)
264263
fn check_for_static_nan(cx: &MatchCheckCtxt, pat: &Pat) {
265264
ast_util::walk_pat(pat, |p| {
266265
if let ast::PatLit(ref expr) = p.node {
267-
match eval_const_expr_partial(cx.tcx, &**expr, ExprTypeChecked) {
266+
match eval_const_expr_partial(cx.tcx, &**expr, None) {
268267
Ok(ConstVal::Float(f)) if f.is_nan() => {
269268
span_warn!(cx.tcx.sess, p.span, E0003,
270269
"unmatchable NaN in pattern, \

0 commit comments

Comments
 (0)