Skip to content

Commit 3745a2f

Browse files
committed
---
yaml --- r: 274933 b: refs/heads/stable c: 36a9f0c h: refs/heads/master i: 274931: fb94716
1 parent 7a428b0 commit 3745a2f

File tree

21 files changed

+112
-292
lines changed

21 files changed

+112
-292
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 2808df961bf218dc1844a61efc1906ffdf2808a8
32+
refs/heads/stable: 36a9f0cff16ac8cf20c9b82ea34a2002802a88f7
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: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,7 @@ ifeq ($$(CFG_WINDOWSY_$(1)),1)
148148
else ifeq ($(OSTYPE_$(1)), apple-ios)
149149
JEMALLOC_ARGS_$(1) := --disable-tls
150150
else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
151-
# We force android to have prefixed symbols because apparently replacement of
152-
# the libc allocator doesn't quite work. When this was tested (unprefixed
153-
# symbols), it was found that the `realpath` function in libc would allocate
154-
# with libc malloc (not jemalloc malloc), and then the standard library would
155-
# free with jemalloc free, causing a segfault.
156-
#
157-
# If the test suite passes, however, without symbol prefixes then we should be
158-
# good to go!
159-
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
151+
JEMALLOC_ARGS_$(1) := --disable-tls
160152
endif
161153

162154
ifdef CFG_ENABLE_DEBUG_JEMALLOC
@@ -194,7 +186,7 @@ JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1
194186
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
195187
@$$(call E, make: jemalloc)
196188
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
197-
$$(JEMALLOC_ARGS_$(1)) $(CFG_JEMALLOC_FLAGS) \
189+
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ $(CFG_JEMALLOC_FLAGS) \
198190
--build=$$(CFG_GNU_TRIPLE_$(CFG_BUILD)) --host=$$(CFG_GNU_TRIPLE_$(1)) \
199191
CC="$$(CC_$(1)) $$(CFG_JEMALLOC_CFLAGS_$(1))" \
200192
AR="$$(AR_$(1))" \

branches/stable/src/doc/book/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You get this error:
6868

6969
```text
7070
expected one of `!`, `:`, or `@`, found `)`
71-
fn print_sum(x, y) {
71+
fn print_number(x, y) {
7272
```
7373

7474
This is a deliberate design decision. While full-program inference is possible,

branches/stable/src/doc/book/strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The second, with a `\`, trims the spaces and the newline:
3939

4040
```rust
4141
let s = "foo\
42-
bar";
42+
bar";
4343

4444
assert_eq!("foobar", s);
4545
```

branches/stable/src/liballoc_jemalloc/build.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn main() {
5050
.env("AR", &ar)
5151
.env("RANLIB", format!("{} s", ar.display()));
5252

53-
if target.contains("windows") {
53+
if target.contains("windows-gnu") {
5454
// A bit of history here, this used to be --enable-lazy-lock added in
5555
// #14006 which was filed with jemalloc in jemalloc/jemalloc#83 which
5656
// was also reported to MinGW:
@@ -72,19 +72,7 @@ fn main() {
7272
// locking, but requires passing an option due to a historical
7373
// default with jemalloc.
7474
cmd.arg("--disable-lazy-lock");
75-
} else if target.contains("ios") {
76-
cmd.arg("--disable-tls");
77-
} else if target.contains("android") {
78-
// We force android to have prefixed symbols because apparently
79-
// replacement of the libc allocator doesn't quite work. When this was
80-
// tested (unprefixed symbols), it was found that the `realpath`
81-
// function in libc would allocate with libc malloc (not jemalloc
82-
// malloc), and then the standard library would free with jemalloc free,
83-
// causing a segfault.
84-
//
85-
// If the test suite passes, however, without symbol prefixes then we
86-
// should be good to go!
87-
cmd.arg("--with-jemalloc-prefix=je_");
75+
} else if target.contains("ios") || target.contains("android") {
8876
cmd.arg("--disable-tls");
8977
}
9078

@@ -94,6 +82,7 @@ fn main() {
9482

9583
// Turn off broken quarantine (see jemalloc/jemalloc#161)
9684
cmd.arg("--disable-fill");
85+
cmd.arg("--with-jemalloc-prefix=je_");
9786
cmd.arg(format!("--host={}", build_helper::gnu_target(&target)));
9887
cmd.arg(format!("--build={}", build_helper::gnu_target(&host)));
9988

branches/stable/src/liballoc_jemalloc/lib.rs

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,12 @@ use libc::{c_int, c_void, size_t};
4141
#[cfg(not(cargobuild))]
4242
extern {}
4343

44-
// Note that the symbols here are prefixed by default on OSX (we don't
45-
// explicitly request it), and on Android we explicitly request it as
46-
// unprefixing cause segfaults (mismatches in allocators).
4744
extern {
48-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
49-
link_name = "je_mallocx")]
50-
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
51-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
52-
link_name = "je_rallocx")]
53-
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
54-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
55-
link_name = "je_xallocx")]
56-
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
57-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
58-
link_name = "je_sdallocx")]
59-
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
60-
#[cfg_attr(any(target_os = "macos", target_os = "android"),
61-
link_name = "je_nallocx")]
62-
fn nallocx(size: size_t, flags: c_int) -> size_t;
45+
fn je_mallocx(size: size_t, flags: c_int) -> *mut c_void;
46+
fn je_rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
47+
fn je_xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
48+
fn je_sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
49+
fn je_nallocx(size: size_t, flags: c_int) -> size_t;
6350
}
6451

6552
// The minimum alignment guaranteed by the architecture. This value is used to
@@ -91,7 +78,7 @@ fn align_to_flags(align: usize) -> c_int {
9178
#[no_mangle]
9279
pub extern "C" fn __rust_allocate(size: usize, align: usize) -> *mut u8 {
9380
let flags = align_to_flags(align);
94-
unsafe { mallocx(size as size_t, flags) as *mut u8 }
81+
unsafe { je_mallocx(size as size_t, flags) as *mut u8 }
9582
}
9683

9784
#[no_mangle]
@@ -101,7 +88,7 @@ pub extern "C" fn __rust_reallocate(ptr: *mut u8,
10188
align: usize)
10289
-> *mut u8 {
10390
let flags = align_to_flags(align);
104-
unsafe { rallocx(ptr as *mut c_void, size as size_t, flags) as *mut u8 }
91+
unsafe { je_rallocx(ptr as *mut c_void, size as size_t, flags) as *mut u8 }
10592
}
10693

10794
#[no_mangle]
@@ -111,19 +98,19 @@ pub extern "C" fn __rust_reallocate_inplace(ptr: *mut u8,
11198
align: usize)
11299
-> usize {
113100
let flags = align_to_flags(align);
114-
unsafe { xallocx(ptr as *mut c_void, size as size_t, 0, flags) as usize }
101+
unsafe { je_xallocx(ptr as *mut c_void, size as size_t, 0, flags) as usize }
115102
}
116103

117104
#[no_mangle]
118105
pub extern "C" fn __rust_deallocate(ptr: *mut u8, old_size: usize, align: usize) {
119106
let flags = align_to_flags(align);
120-
unsafe { sdallocx(ptr as *mut c_void, old_size as size_t, flags) }
107+
unsafe { je_sdallocx(ptr as *mut c_void, old_size as size_t, flags) }
121108
}
122109

123110
#[no_mangle]
124111
pub extern "C" fn __rust_usable_size(size: usize, align: usize) -> usize {
125112
let flags = align_to_flags(align);
126-
unsafe { nallocx(size as size_t, flags) as usize }
113+
unsafe { je_nallocx(size as size_t, flags) as usize }
127114
}
128115

129116
// These symbols are used by jemalloc on android but the really old android

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ macro_rules! int_impl {
479479
}
480480
}
481481

482-
/// Checked negation. Computes `-self`, returning `None` if `self ==
482+
/// Checked negation. Computes `!self`, returning `None` if `self ==
483483
/// MIN`.
484484
///
485485
/// # Examples

branches/stable/src/libcore/ptr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ pub unsafe fn read<T>(src: *const T) -> T {
127127
tmp
128128
}
129129

130-
#[allow(missing_docs)]
130+
/// Variant of read_and_zero that writes the specific drop-flag byte
131+
/// (which may be more appropriate than zero).
131132
#[inline(always)]
132133
#[unstable(feature = "filling_drop",
133134
reason = "may play a larger role in std::ptr future extensions",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl Utf8Error {
157157
/// // std::str::from_utf8 returns a Utf8Error
158158
/// let error = str::from_utf8(&sparkle_heart).unwrap_err();
159159
///
160-
/// // the second byte is invalid here
160+
/// // the first byte is invalid here
161161
/// assert_eq!(1, error.valid_up_to());
162162
/// ```
163163
#[stable(feature = "utf8_error", since = "1.5.0")]
@@ -174,10 +174,10 @@ impl Utf8Error {
174174
///
175175
/// If you are sure that the byte slice is valid UTF-8, and you don't want to
176176
/// incur the overhead of the validity check, there is an unsafe version of
177-
/// this function, [`from_utf8_unchecked()`][fromutf8u], which has the same
177+
/// this function, [`from_utf8_unchecked()`][fromutf8], which has the same
178178
/// behavior but skips the check.
179179
///
180-
/// [fromutf8u]: fn.from_utf8_unchecked.html
180+
/// [fromutf8]: fn.from_utf8.html
181181
///
182182
/// If you need a `String` instead of a `&str`, consider
183183
/// [`String::from_utf8()`][string].
@@ -275,7 +275,7 @@ unsafe fn from_raw_parts_mut<'a>(p: *mut u8, len: usize) -> &'a mut str {
275275
/// Converts a slice of bytes to a string slice without checking
276276
/// that the string contains valid UTF-8.
277277
///
278-
/// See the safe version, [`from_utf8()`][fromutf8], for more information.
278+
/// See the safe version, [`from_utf8()`][fromutf8], for more.
279279
///
280280
/// [fromutf8]: fn.from_utf8.html
281281
///

branches/stable/src/librustc_data_structures/fnv.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@ pub fn FnvHashSet<V: Hash + Eq>() -> FnvHashSet<V> {
3535
pub struct FnvHasher(u64);
3636

3737
impl Default for FnvHasher {
38-
#[inline]
3938
fn default() -> FnvHasher { FnvHasher(0xcbf29ce484222325) }
4039
}
4140

4241
impl Hasher for FnvHasher {
43-
#[inline]
4442
fn write(&mut self, bytes: &[u8]) {
4543
let FnvHasher(mut hash) = *self;
4644
for byte in bytes {
@@ -49,7 +47,5 @@ impl Hasher for FnvHasher {
4947
}
5048
*self = FnvHasher(hash);
5149
}
52-
53-
#[inline]
5450
fn finish(&self) -> u64 { self.0 }
5551
}

branches/stable/src/librustc_trans/back/link.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,11 +1253,7 @@ fn add_upstream_rust_crates(cmd: &mut Linker, sess: &Session,
12531253

12541254
if any_objects {
12551255
archive.build();
1256-
if dylib {
1257-
cmd.link_whole_rlib(&fix_windows_verbatim_for_gcc(&dst));
1258-
} else {
1259-
cmd.link_rlib(&fix_windows_verbatim_for_gcc(&dst));
1260-
}
1256+
cmd.link_whole_rlib(&fix_windows_verbatim_for_gcc(&dst));
12611257
}
12621258
});
12631259
}

branches/stable/src/libstd/fs.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,26 +2151,6 @@ mod tests {
21512151
"foo");
21522152
}
21532153

2154-
#[test]
2155-
fn read_link() {
2156-
if cfg!(windows) {
2157-
// directory symlink
2158-
assert_eq!(check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(),
2159-
r"C:\ProgramData");
2160-
// junction
2161-
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(),
2162-
r"C:\Users\Default");
2163-
// junction with special permissions
2164-
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(),
2165-
r"C:\Users");
2166-
}
2167-
let tmpdir = tmpdir();
2168-
let link = tmpdir.join("link");
2169-
if !got_symlink_permission(&tmpdir) { return };
2170-
check!(symlink_file(&"foo", &link));
2171-
assert_eq!(check!(fs::read_link(&link)).to_str().unwrap(), "foo");
2172-
}
2173-
21742154
#[test]
21752155
fn readlink_not_symlink() {
21762156
let tmpdir = tmpdir();

branches/stable/src/libstd/sys/windows/c.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: usize = 16 * 1024;
240240
pub const FSCTL_GET_REPARSE_POINT: DWORD = 0x900a8;
241241
pub const IO_REPARSE_TAG_SYMLINK: DWORD = 0xa000000c;
242242
pub const IO_REPARSE_TAG_MOUNT_POINT: DWORD = 0xa0000003;
243-
pub const SYMLINK_FLAG_RELATIVE: DWORD = 0x00000001;
244243
pub const FSCTL_SET_REPARSE_POINT: DWORD = 0x900a4;
245244
pub const FSCTL_DELETE_REPARSE_POINT: DWORD = 0x900ac;
246245

@@ -534,15 +533,6 @@ pub struct SYMBOLIC_LINK_REPARSE_BUFFER {
534533
pub PathBuffer: WCHAR,
535534
}
536535

537-
#[repr(C)]
538-
pub struct MOUNT_POINT_REPARSE_BUFFER {
539-
pub SubstituteNameOffset: c_ushort,
540-
pub SubstituteNameLength: c_ushort,
541-
pub PrintNameOffset: c_ushort,
542-
pub PrintNameLength: c_ushort,
543-
pub PathBuffer: WCHAR,
544-
}
545-
546536
pub type LPPROGRESS_ROUTINE = ::option::Option<unsafe extern "system" fn(
547537
TotalFileSize: LARGE_INTEGER,
548538
TotalBytesTransferred: LARGE_INTEGER,

0 commit comments

Comments
 (0)