Skip to content

Commit b219c0c

Browse files
committed
---
yaml --- r: 219629 b: refs/heads/snap-stage3 c: c98e46c h: refs/heads/master i: 219627: 270ad22 v: v3
1 parent 6a1402b commit b219c0c

File tree

19 files changed

+181
-353
lines changed

19 files changed

+181
-353
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: c044791d80ea0dc5c4b57b6030a67b69f8510239
3-
refs/heads/snap-stage3: 0bf0ea3a521c520171d5ef44edc84e456ae499ce
3+
refs/heads/snap-stage3: c98e46c7cabd44a306ac52c95d961bcebd899b0f
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
*.exe
2020
*.fn
2121
*.html
22-
*.kdev4
2322
*.ky
2423
*.ll
2524
*.llvm

branches/snap-stage3/RELEASES.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Version 1.1.0 (June 2015)
66
Highlights
77
----------
88

9-
* The [`std::fs` module has been expanded][fs] to expand the set of
9+
* The [`std::fs` module has been expanded][fs-expand] to expand the set of
1010
functionality exposed:
1111
* `DirEntry` now supports optimizations like `file_type` and `metadata` which
1212
don't incur a syscall on some platforms.
@@ -23,11 +23,11 @@ Highlights
2323
Libraries
2424
---------
2525

26-
* The [`str::split_whitespace`] method splits a string on unicode
26+
* The `str::split_whitespace` method splits a string on unicode
2727
whitespace boundaries.
2828
* On both Windows and Unix, new extension traits provide conversion of
2929
I/O types to and from the underlying system handles. On Unix, these
30-
traits are [`FromRawFd`] and [`AsRawFd`], on Windows `FromRawHandle`
30+
traits are [`FrowRawFd`] and [`AsRawFd`], on Windows `FromRawHandle`
3131
and `AsRawHandle`. These are implemented for `File`, `TcpStream`,
3232
`TcpListener`, and `UpdSocket`. Further implementations for
3333
`std::process` will be stabilized later.
@@ -79,7 +79,8 @@ Misc
7979
* [The `drop_with_repr_extern` lint warns about mixing `repr(C)`
8080
with `Drop`][drop].
8181

82-
[`str::split_whitespace`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace
82+
[`split_whitespace`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace
83+
[`Iterator::cloned`]: http://doc.rust-lang.org/nightly/core/iter/trait.Iterator.html#method.cloned
8384
[`FromRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.FromRawFd.html
8485
[`AsRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.AsRawFd.html
8586
[`std::os::unix::symlink`]: http://doc.rust-lang.org/nightly/std/os/unix/fs/fn.symlink.html
@@ -249,6 +250,7 @@ Misc
249250
[sw]: https://github.com/rust-lang/rfcs/blob/master/text/1054-str-words.md
250251
[th]: https://github.com/rust-lang/rfcs/blob/master/text/0909-move-thread-local-to-std-thread.md
251252
[send-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0458-send-improvements.md
253+
[scoped]: http://static.rust-lang.org/doc/master/std/thread/fn.scoped.html
252254
[moar-ufcs]: https://github.com/rust-lang/rust/pull/22172
253255
[prim-inherent]: https://github.com/rust-lang/rust/pull/23104
254256
[overflow]: https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md
@@ -258,10 +260,12 @@ Misc
258260
[string-pattern]: https://github.com/rust-lang/rust/pull/22466
259261
[oibit-final]: https://github.com/rust-lang/rust/pull/21689
260262
[reflect]: https://github.com/rust-lang/rust/pull/23712
263+
[debug-builder]: https://github.com/rust-lang/rfcs/blob/master/text/0640-debug-improvements.md
261264
[conversion]: https://github.com/rust-lang/rfcs/pull/529
262265
[num-traits]: https://github.com/rust-lang/rust/pull/23549
263266
[index-value]: https://github.com/rust-lang/rust/pull/23601
264267
[dropck]: https://github.com/rust-lang/rfcs/pull/769
268+
[fundamental]: https://github.com/rust-lang/rfcs/pull/1023
265269
[ci-compare]: https://gist.github.com/brson/a30a77836fbec057cbee
266270
[fn-inherit]: https://github.com/rust-lang/rust/pull/23282
267271
[fn-blanket]: https://github.com/rust-lang/rust/pull/23895
@@ -364,6 +368,7 @@ Version 1.0.0-alpha.2 (February 2015)
364368
[osstr]: https://github.com/rust-lang/rust/pull/21488
365369
[osstr-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0517-io-os-reform.md
366370
[Self]: https://github.com/rust-lang/rust/pull/22158
371+
[ufcs]: https://github.com/rust-lang/rust/pull/21077
367372
[ufcs-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md
368373
[un]: https://github.com/rust-lang/rust/pull/22256
369374

branches/snap-stage3/mk/cfg/x86_64-pc-windows-msvc.mk

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,64 @@ CFG_RUN_x86_64-pc-windows-msvc=$(2)
2323
CFG_RUN_TARG_x86_64-pc-windows-msvc=$(call CFG_RUN_x86_64-pc-windows-msvc,,$(2))
2424
CFG_GNU_TRIPLE_x86_64-pc-windows-msvc := x86_64-pc-win32
2525

26+
# These two environment variables are scraped by the `./configure` script and
27+
# are necessary for `cl.exe` to find standard headers (the INCLUDE variable) and
28+
# for `link.exe` to find standard libraries (the LIB variable).
29+
ifdef CFG_MSVC_INCLUDE_PATH
30+
export INCLUDE := $(CFG_MSVC_INCLUDE_PATH)
31+
endif
32+
ifdef CFG_MSVC_LIB_PATH
33+
export LIB := $(CFG_MSVC_LIB_PATH)
34+
endif
35+
36+
# Unfortunately `link.exe` is also a program in `/usr/bin` on MinGW installs,
37+
# but it's not the one that we want. As a result we make sure that our detected
38+
# `link.exe` shows up in PATH first.
39+
ifdef CFG_MSVC_LINK
40+
export PATH := $(CFG_MSVC_ROOT)/VC/bin/amd64:$(PATH)
41+
endif
42+
43+
# There are more comments about this available in the target specification for
44+
# Windows MSVC in the compiler, but the gist of it is that we use `llvm-ar.exe`
45+
# instead of `lib.exe` for assembling archives, so we need to inject this custom
46+
# dependency here.
47+
NATIVE_TOOL_DEPS_core_T_x86_64-pc-windows-msvc += llvm-ar.exe
48+
INSTALLED_BINS_x86_64-pc-windows-msvc += llvm-ar.exe
49+
50+
# When working with MSVC on windows, each DLL needs to explicitly declare its
51+
# interface to the outside world through some means. The options for doing so
52+
# include:
53+
#
54+
# 1. A custom attribute on each function itself
55+
# 2. A linker argument saying what to export
56+
# 3. A file which lists all symbols that need to be exported
57+
#
58+
# The Rust compiler takes care (1) for us for all Rust code by annotating all
59+
# public-facing functions with dllexport, but we have a few native dependencies
60+
# which need to cross the DLL boundary. The most important of these dependencies
61+
# is LLVM which is linked into `rustc_llvm.dll` but primarily used from
62+
# `rustc_trans.dll`. This means that many of LLVM's C API functions need to be
63+
# exposed from `rustc_llvm.dll` to be forwarded over the boundary.
64+
#
65+
# Unfortunately, at this time, LLVM does not handle this sort of exportation on
66+
# Windows for us, so we're forced to do it ourselves if we want it (which seems
67+
# like the path of least resistance right now). To do this we generate a `.DEF`
68+
# file [1] which we then custom-pass to the linker when building the rustc_llvm
69+
# crate. This DEF file list all symbols that are exported from
70+
# `src/librustc_llvm/lib.rs` and is generated by a small python script.
71+
#
72+
# Fun times!
73+
#
74+
# [1]: https://msdn.microsoft.com/en-us/library/28d6s79h.aspx
75+
RUSTFLAGS_rustc_llvm_T_x86_64-pc-windows-msvc += \
76+
-C link-args="-DEF:x86_64-pc-windows-msvc/rt/rustc_llvm.def"
77+
CUSTOM_DEPS_rustc_llvm_T_x86_64-pc-windows-msvc += \
78+
x86_64-pc-windows-msvc/rt/rustc_llvm.def
79+
80+
x86_64-pc-windows-msvc/rt/rustc_llvm.def: $(S)src/etc/mklldef.py \
81+
$(S)src/librustc_llvm/lib.rs
82+
$(CFG_PYTHON) $^ $@ rustc_llvm-$(CFG_FILENAME_EXTRA)
83+
2684
# All windows nightiles are currently a GNU triple, so this MSVC triple is not
2785
# bootstrapping from itself. This is relevant during stage0, and other parts of
2886
# the build system take this into account.

branches/snap-stage3/mk/platform.mk

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -238,72 +238,3 @@ endef
238238

239239
$(foreach target,$(CFG_TARGET), \
240240
$(eval $(call CFG_MAKE_TOOLCHAIN,$(target))))
241-
242-
# These two environment variables are scraped by the `./configure` script and
243-
# are necessary for `cl.exe` to find standard headers (the INCLUDE variable) and
244-
# for `link.exe` to find standard libraries (the LIB variable).
245-
ifdef CFG_MSVC_INCLUDE_PATH
246-
export INCLUDE := $(CFG_MSVC_INCLUDE_PATH)
247-
endif
248-
ifdef CFG_MSVC_LIB_PATH
249-
export LIB := $(CFG_MSVC_LIB_PATH)
250-
endif
251-
252-
# Unfortunately `link.exe` is also a program in `/usr/bin` on MinGW installs,
253-
# but it's not the one that we want. As a result we make sure that our detected
254-
# `link.exe` shows up in PATH first.
255-
ifdef CFG_MSVC_LINK
256-
export PATH := $(CFG_MSVC_ROOT)/VC/bin/amd64:$(PATH)
257-
endif
258-
259-
# There are more comments about this available in the target specification for
260-
# Windows MSVC in the compiler, but the gist of it is that we use `llvm-ar.exe`
261-
# instead of `lib.exe` for assembling archives, so we need to inject this custom
262-
# dependency here.
263-
define ADD_LLVM_AR_TO_MSVC_DEPS
264-
ifeq ($$(findstring msvc,$(1)),msvc)
265-
NATIVE_TOOL_DEPS_core_T_$(1) += llvm-ar.exe
266-
INSTALLED_BINS_$(1) += llvm-ar.exe
267-
endif
268-
endef
269-
270-
$(foreach target,$(CFG_TARGET), \
271-
$(eval $(call ADD_LLVM_AR_TO_MSVC_DEPS,$(target))))
272-
273-
# When working with MSVC on windows, each DLL needs to explicitly declare its
274-
# interface to the outside world through some means. The options for doing so
275-
# include:
276-
#
277-
# 1. A custom attribute on each function itself
278-
# 2. A linker argument saying what to export
279-
# 3. A file which lists all symbols that need to be exported
280-
#
281-
# The Rust compiler takes care (1) for us for all Rust code by annotating all
282-
# public-facing functions with dllexport, but we have a few native dependencies
283-
# which need to cross the DLL boundary. The most important of these dependencies
284-
# is LLVM which is linked into `rustc_llvm.dll` but primarily used from
285-
# `rustc_trans.dll`. This means that many of LLVM's C API functions need to be
286-
# exposed from `rustc_llvm.dll` to be forwarded over the boundary.
287-
#
288-
# Unfortunately, at this time, LLVM does not handle this sort of exportation on
289-
# Windows for us, so we're forced to do it ourselves if we want it (which seems
290-
# like the path of least resistance right now). To do this we generate a `.DEF`
291-
# file [1] which we then custom-pass to the linker when building the rustc_llvm
292-
# crate. This DEF file list all symbols that are exported from
293-
# `src/librustc_llvm/lib.rs` and is generated by a small python script.
294-
#
295-
# Fun times!
296-
#
297-
# [1]: https://msdn.microsoft.com/en-us/library/28d6s79h.aspx
298-
define ADD_RUSTC_LLVM_DEF_TO_MSVC
299-
ifeq ($$(findstring msvc,$(1)),msvc)
300-
RUSTFLAGS_rustc_llvm_T_$(1) += -C link-args="-DEF:$(1)/rt/rustc_llvm.def"
301-
CUSTOM_DEPS_rustc_llvm_T_$(1) += $(1)/rt/rustc_llvm.def
302-
303-
$(1)/rt/rustc_llvm.def: $$(S)src/etc/mklldef.py $$(S)src/librustc_llvm/lib.rs
304-
$$(CFG_PYTHON) $$^ $$@ rustc_llvm-$$(CFG_FILENAME_EXTRA)
305-
endif
306-
endef
307-
308-
$(foreach target,$(CFG_TARGET), \
309-
$(eval $(call ADD_RUSTC_LLVM_DEF_TO_MSVC,$(target))))

branches/snap-stage3/mk/rt.mk

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,9 @@ NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
5353
NATIVE_DEPS_miniz_$(1) = miniz.c
5454
NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
5555
rust_android_dummy.c
56-
NATIVE_DEPS_rustrt_native_$(1) := arch/$$(HOST_$(1))/record_sp.S
57-
ifeq ($$(findstring msvc,$(1)),msvc)
58-
NATIVE_DEPS_rustrt_native_$(1) += rust_try_msvc_64.ll
59-
else
60-
NATIVE_DEPS_rustrt_native_$(1) += rust_try.ll
61-
endif
56+
NATIVE_DEPS_rustrt_native_$(1) := \
57+
rust_try.ll \
58+
arch/$$(HOST_$(1))/record_sp.S
6259
NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
6360
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
6461

branches/snap-stage3/src/doc/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,11 +1047,8 @@ This is a list of behavior not considered *unsafe* in Rust terms, but that may
10471047
be undesired.
10481048

10491049
* Deadlocks
1050-
* Reading data from private fields (`std::repr`)
10511050
* Leaks of memory and other resources
10521051
* Exiting without calling destructors
1053-
* Sending signals
1054-
* Accessing/modifying the file system
10551052
* Integer overflow
10561053
- Overflow is considered "unexpected" behavior and is always user-error,
10571054
unless the `wrapping` primitives are used. In non-optimized builds, the compiler

branches/snap-stage3/src/liballoc/boxed.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<T : ?Sized> Box<T> {
116116
/// of `T` and releases memory. Since the way `Box` allocates and
117117
/// releases memory is unspecified, the only valid pointer to pass
118118
/// to this function is the one taken from another `Box` with
119-
/// `Box::into_raw` function.
119+
/// `boxed::into_raw` function.
120120
///
121121
/// Function is unsafe, because improper use of this function may
122122
/// lead to memory problems like double-free, for example if the
@@ -140,8 +140,10 @@ impl<T : ?Sized> Box<T> {
140140
/// # Examples
141141
/// ```
142142
/// # #![feature(box_raw)]
143+
/// use std::boxed;
144+
///
143145
/// let seventeen = Box::new(17u32);
144-
/// let raw = Box::into_raw(seventeen);
146+
/// let raw = boxed::into_raw(seventeen);
145147
/// let boxed_again = unsafe { Box::from_raw(raw) };
146148
/// ```
147149
#[unstable(feature = "box_raw", reason = "may be renamed")]

branches/snap-stage3/src/liballoc/boxed_test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ fn deref() {
7676

7777
#[test]
7878
fn raw_sized() {
79-
let x = Box::new(17);
80-
let p = Box::into_raw(x);
8179
unsafe {
80+
let x = Box::new(17);
81+
let p = boxed::into_raw(x);
8282
assert_eq!(17, *p);
8383
*p = 19;
8484
let y = Box::from_raw(p);
@@ -105,9 +105,9 @@ fn raw_trait() {
105105
}
106106
}
107107

108-
let x: Box<Foo> = Box::new(Bar(17));
109-
let p = Box::into_raw(x);
110108
unsafe {
109+
let x: Box<Foo> = Box::new(Bar(17));
110+
let p = boxed::into_raw(x);
111111
assert_eq!(17, (*p).get());
112112
(*p).set(19);
113113
let y: Box<Foo> = Box::from_raw(p);

branches/snap-stage3/src/libcore/ptr.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@
5050
//!
5151
//! ```
5252
//! # #![feature(box_raw)]
53-
//! let my_speed: Box<i32> = Box::new(88);
54-
//! let my_speed: *mut i32 = Box::into_raw(my_speed);
53+
//! use std::boxed;
5554
//!
56-
//! // By taking ownership of the original `Box<T>` though
57-
//! // we are obligated to put it together later to be destroyed.
5855
//! unsafe {
56+
//! let my_speed: Box<i32> = Box::new(88);
57+
//! let my_speed: *mut i32 = boxed::into_raw(my_speed);
58+
//!
59+
//! // By taking ownership of the original `Box<T>` though
60+
//! // we are obligated to put it together later to be destroyed.
5961
//! drop(Box::from_raw(my_speed));
6062
//! }
6163
//! ```

branches/snap-stage3/src/librustc_trans/back/link.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,13 +1214,11 @@ fn add_upstream_rust_crates(cmd: &mut Linker, sess: &Session,
12141214

12151215
// Just need to tell the linker about where the library lives and
12161216
// what its name is
1217-
let parent = cratepath.parent();
1218-
if let Some(dir) = parent {
1217+
if let Some(dir) = cratepath.parent() {
12191218
cmd.include_path(&fix_windows_verbatim_for_gcc(dir));
12201219
}
12211220
let filestem = cratepath.file_stem().unwrap().to_str().unwrap();
1222-
cmd.link_rust_dylib(&unlib(&sess.target, filestem),
1223-
parent.unwrap_or(Path::new("")));
1221+
cmd.link_dylib(&unlib(&sess.target, filestem));
12241222
}
12251223
}
12261224

branches/snap-stage3/src/librustc_trans/back/linker.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use std::ffi::OsString;
1212
use std::path::{Path, PathBuf};
1313
use std::process::Command;
14-
use std::fs;
1514

1615
use rustc_back::archive;
1716
use session::Session;
@@ -26,7 +25,6 @@ use session::config;
2625
/// MSVC linker (e.g. `link.exe`) is being used.
2726
pub trait Linker {
2827
fn link_dylib(&mut self, lib: &str);
29-
fn link_rust_dylib(&mut self, lib: &str, path: &Path);
3028
fn link_framework(&mut self, framework: &str);
3129
fn link_staticlib(&mut self, lib: &str);
3230
fn link_rlib(&mut self, lib: &Path);
@@ -69,10 +67,6 @@ impl<'a> Linker for GnuLinker<'a> {
6967
fn position_independent_executable(&mut self) { self.cmd.arg("-pie"); }
7068
fn args(&mut self, args: &[String]) { self.cmd.args(args); }
7169

72-
fn link_rust_dylib(&mut self, lib: &str, _path: &Path) {
73-
self.cmd.arg("-l").arg(lib);
74-
}
75-
7670
fn link_framework(&mut self, framework: &str) {
7771
self.cmd.arg("-framework").arg(framework);
7872
}
@@ -195,18 +189,6 @@ impl<'a> Linker for MsvcLinker<'a> {
195189
fn link_dylib(&mut self, lib: &str) {
196190
self.cmd.arg(&format!("{}.lib", lib));
197191
}
198-
199-
fn link_rust_dylib(&mut self, lib: &str, path: &Path) {
200-
// When producing a dll, the MSVC linker may not actually emit a
201-
// `foo.lib` file if the dll doesn't actually export any symbols, so we
202-
// check to see if the file is there and just omit linking to it if it's
203-
// not present.
204-
let name = format!("{}.lib", lib);
205-
if fs::metadata(&path.join(&name)).is_ok() {
206-
self.cmd.arg(name);
207-
}
208-
}
209-
210192
fn link_staticlib(&mut self, lib: &str) {
211193
self.cmd.arg(&format!("{}.lib", lib));
212194
}

branches/snap-stage3/src/librustc_trans/trans/base.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -832,14 +832,9 @@ pub fn store_ty<'blk, 'tcx>(cx: Block<'blk, 'tcx>, v: ValueRef, dst: ValueRef, t
832832
return;
833833
}
834834

835-
if common::type_is_fat_ptr(cx.tcx(), t) {
836-
Store(cx, ExtractValue(cx, v, abi::FAT_PTR_ADDR), expr::get_dataptr(cx, dst));
837-
Store(cx, ExtractValue(cx, v, abi::FAT_PTR_EXTRA), expr::get_len(cx, dst));
838-
} else {
839-
let store = Store(cx, from_arg_ty(cx, v, t), to_arg_ty_ptr(cx, dst, t));
840-
unsafe {
841-
llvm::LLVMSetAlignment(store, type_of::align_of(cx.ccx(), t));
842-
}
835+
let store = Store(cx, from_arg_ty(cx, v, t), to_arg_ty_ptr(cx, dst, t));
836+
unsafe {
837+
llvm::LLVMSetAlignment(store, type_of::align_of(cx.ccx(), t));
843838
}
844839
}
845840

0 commit comments

Comments
 (0)