Skip to content

Commit a88256e

Browse files
committed
---
yaml --- r: 235706 b: refs/heads/stable c: 000e870 h: refs/heads/master v: v3
1 parent e480714 commit a88256e

Some content is hidden

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

76 files changed

+652
-2557
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: cb4f102e38ef306e7e8e4ac747f25799b4cf7415
32+
refs/heads/stable: 000e870554dd15c827389ce352166f67d9c51323
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/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))

branches/stable/src/doc/trpl/ffi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ libraries:
340340
Note that frameworks are only available on OSX targets.
341341
342342
The different `kind` values are meant to differentiate how the native library
343-
participates in linkage. From a linkage perspective, the Rust compiler creates
343+
participates in linkage. From a linkage perspective, the rust compiler creates
344344
two flavors of artifacts: partial (rlib/staticlib) and final (dylib/binary).
345345
Native dynamic library and framework dependencies are propagated to the final
346346
artifact boundary, while static library dependencies are not propagated at
@@ -350,9 +350,9 @@ artifact.
350350
A few examples of how this model can be used are:
351351
352352
* A native build dependency. Sometimes some C/C++ glue is needed when writing
353-
some Rust code, but distribution of the C/C++ code in a library format is just
353+
some rust code, but distribution of the C/C++ code in a library format is just
354354
a burden. In this case, the code will be archived into `libfoo.a` and then the
355-
Rust crate would declare a dependency via `#[link(name = "foo", kind =
355+
rust crate would declare a dependency via `#[link(name = "foo", kind =
356356
"static")]`.
357357
358358
Regardless of the flavor of output for the crate, the native static library
@@ -361,7 +361,7 @@ A few examples of how this model can be used are:
361361
362362
* A normal dynamic dependency. Common system libraries (like `readline`) are
363363
available on a large number of systems, and often a static copy of these
364-
libraries cannot be found. When this dependency is included in a Rust crate,
364+
libraries cannot be found. When this dependency is included in a rust crate,
365365
partial targets (like rlibs) will not link to the library, but when the rlib
366366
is included in a final target (like a binary), the native library will be
367367
linked in.

branches/stable/src/doc/trpl/installing-rust.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The first step to using Rust is to install it! There are a number of ways to
44
install Rust, but the easiest is to use the `rustup` script. If you're on Linux
5-
or a Mac, all you need to do is this:
5+
or a Mac, all you need to do is this:
66

77
> Note: you don't need to type in the `$`s, they just indicate the start of
88
> each command. You’ll see many tutorials and examples around the web that
@@ -25,12 +25,6 @@ $ sh rustup.sh
2525
[insecurity]: http://curlpipesh.tumblr.com
2626

2727
If you're on Windows, please download the appropriate [installer][install-page].
28-
**NOTE:** By default, the Windows installer will not add Rust to the %PATH%
29-
system variable. If this is the only version of Rust you are installing and you
30-
want to be able to run it from the command line, click on "Advanced" on the
31-
install dialog and on the "Product Features" page ensure "Add to PATH" is
32-
installed on the local hard drive.
33-
3428

3529
[install-page]: http://www.rust-lang.org/install.html
3630

@@ -93,11 +87,6 @@ rustc 1.0.0 (a59de37e9 2015-05-13)
9387

9488
If you did, Rust has been installed successfully! Congrats!
9589

96-
If you didn't and you're on Windows, check that Rust is in your %PATH% system
97-
variable. If it isn't, run the installer again, select "Change" on the "Change,
98-
repair, or remove installation" page and ensure "Add to PATH" is installed on
99-
the local hard drive.
100-
10190
This installer also installs a copy of the documentation locally, so you can
10291
read it offline. On UNIX systems, `/usr/local/share/doc/rust` is the location.
10392
On Windows, it's in a `share/doc` directory, inside wherever you installed Rust
@@ -112,5 +101,5 @@ resources include [the user’s forum][users], and
112101

113102
[irc]: irc://irc.mozilla.org/#rust
114103
[mibbit]: http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
115-
[users]: http://users.rust-lang.org/
104+
[users]: http://users.rust-lang.org/
116105
[stackoverflow]: http://stackoverflow.com/questions/tagged/rust

branches/stable/src/doc/trpl/release-channels.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,3 @@ This will help alert the team in case there’s an accidental regression.
4343
Additionally, testing against nightly can catch regressions even sooner, and so
4444
if you don’t mind a third build, we’d appreciate testing against all channels.
4545

46-
As an example, many Rust programmers use [Travis](https://travis-ci.org/) to
47-
test their crates, which is free for open source projects. Travis [supports
48-
Rust directly][travis], and you can use a `.travis.yml` file like this to
49-
test on all channels:
50-
51-
```yaml
52-
language: rust
53-
rust:
54-
- nightly
55-
- beta
56-
- stable
57-
58-
matrix:
59-
allow_failures:
60-
- rust: nightly
61-
```
62-
63-
[travis]: http://docs.travis-ci.com/user/languages/rust/
64-
65-
With this configuration, Travis will test all three channels, but if something
66-
breaks on nightly, it won’t fail your build. A similar configuration is
67-
recommended for any CI system, check the documentation of the one you’re
68-
using for more details.

branches/stable/src/doc/trpl/unsafe.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,10 @@ that you normally can not do. Just three. Here they are:
100100

101101
That’s it. It’s important that `unsafe` does not, for example, ‘turn off the
102102
borrow checker’. Adding `unsafe` to some random Rust code doesn’t change its
103-
semantics, it won’t just start accepting anything. But it will let you write
104-
things that _do_ break some of the rules.
103+
semantics, it won’t just start accepting anything.
105104

106-
You will also encounter the `unsafe` keyword when writing bindings to foreign
107-
(non-Rust) interfaces. You're encouraged to write a safe, native Rust interface
108-
around the methods provided by the library.
109-
110-
Let’s go over the basic three abilities listed, in order.
105+
But it will let you write things that _do_ break some of the rules. Let’s go
106+
over these three abilities in order.
111107

112108
## Access or update a `static mut`
113109

branches/stable/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() {}

branches/stable/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

branches/stable/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]

branches/stable/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
}

branches/stable/src/libcore/iter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,7 +2555,7 @@ impl<I: RandomAccessIterator, F> RandomAccessIterator for Inspect<I, F>
25552555
#[unstable(feature = "iter_unfold")]
25562556
#[derive(Clone)]
25572557
#[deprecated(since = "1.2.0",
2558-
reason = "has not gained enough traction to retain its position \
2558+
reason = "has gained enough traction to retain its position \
25592559
in the standard library")]
25602560
#[allow(deprecated)]
25612561
pub struct Unfold<St, F> {
@@ -2567,7 +2567,7 @@ pub struct Unfold<St, F> {
25672567

25682568
#[unstable(feature = "iter_unfold")]
25692569
#[deprecated(since = "1.2.0",
2570-
reason = "has not gained enough traction to retain its position \
2570+
reason = "has gained enough traction to retain its position \
25712571
in the standard library")]
25722572
#[allow(deprecated)]
25732573
impl<A, St, F> Unfold<St, F> where F: FnMut(&mut St) -> Option<A> {
@@ -3018,7 +3018,7 @@ type IterateState<T, F> = (F, Option<T>, bool);
30183018
/// from a given seed value.
30193019
#[unstable(feature = "iter_iterate")]
30203020
#[deprecated(since = "1.2.0",
3021-
reason = "has not gained enough traction to retain its position \
3021+
reason = "has gained enough traction to retain its position \
30223022
in the standard library")]
30233023
#[allow(deprecated)]
30243024
pub type Iterate<T, F> = Unfold<IterateState<T, F>, fn(&mut IterateState<T, F>) -> Option<T>>;
@@ -3027,7 +3027,7 @@ pub type Iterate<T, F> = Unfold<IterateState<T, F>, fn(&mut IterateState<T, F>)
30273027
/// repeated applications of the given function `f`.
30283028
#[unstable(feature = "iter_iterate")]
30293029
#[deprecated(since = "1.2.0",
3030-
reason = "has not gained enough traction to retain its position \
3030+
reason = "has gained enough traction to retain its position \
30313031
in the standard library")]
30323032
#[allow(deprecated)]
30333033
pub fn iterate<T, F>(seed: T, f: F) -> Iterate<T, F> where

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,12 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> {
871871
Section: Comparing strings
872872
*/
873873

874-
// share the implementation of the lang-item vs. non-lang-item
875-
// eq_slice.
874+
/// Bytewise slice equality
876875
/// NOTE: This function is (ab)used in rustc::middle::trans::_match
877876
/// to compare &[u8] byte slices that are not necessarily valid UTF-8.
877+
#[lang = "str_eq"]
878878
#[inline]
879-
fn eq_slice_(a: &str, b: &str) -> bool {
879+
fn eq_slice(a: &str, b: &str) -> bool {
880880
// NOTE: In theory n should be libc::size_t and not usize, but libc is not available here
881881
#[allow(improper_ctypes)]
882882
extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; }
@@ -887,15 +887,6 @@ fn eq_slice_(a: &str, b: &str) -> bool {
887887
}
888888
}
889889

890-
/// Bytewise slice equality
891-
/// NOTE: This function is (ab)used in rustc::middle::trans::_match
892-
/// to compare &[u8] byte slices that are not necessarily valid UTF-8.
893-
#[lang = "str_eq"]
894-
#[inline]
895-
fn eq_slice(a: &str, b: &str) -> bool {
896-
eq_slice_(a, b)
897-
}
898-
899890
/*
900891
Section: Misc
901892
*/

branches/stable/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

branches/stable/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

branches/stable/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,

branches/stable/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)