Skip to content

Commit 93ce38f

Browse files
author
Ulrik Sverdrup
committed
---
yaml --- r: 218878 b: refs/heads/snap-stage3 c: 0ac24d6 h: refs/heads/master v: v3
1 parent 39a60a6 commit 93ce38f

File tree

24 files changed

+106
-234
lines changed

24 files changed

+106
-234
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: 04abc050944857d82f9aaa897369c58a82230d87
3+
refs/heads/snap-stage3: 0ac24d6bffd2381358c164969f002b2c9f3c1316
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/configure

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ opt rpath 0 "build rpaths into rustc itself"
565565
# This is used by the automation to produce single-target nightlies
566566
opt dist-host-only 0 "only install bins for the host architecture"
567567
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
568-
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
568+
opt llvm-version-check 1 "don't check if the LLVM version is supported, build anyway"
569569

570570
# Optimization and debugging options. These may be overridden by the release channel, etc.
571571
opt_nosave optimize 1 "build optimized rust code"
@@ -593,7 +593,6 @@ valopt musl-root "/usr/local" "MUSL root installation directory"
593593
opt_nosave manage-submodules 1 "let the build manage the git submodules"
594594
opt_nosave clang 0 "prefer clang to gcc for building the runtime"
595595
opt_nosave jemalloc 1 "build liballoc with jemalloc"
596-
opt elf-tls 1 "elf thread local storage on platforms where supported"
597596

598597
valopt_nosave prefix "/usr/local" "set installation prefix"
599598
valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"

branches/snap-stage3/mk/crates.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,3 @@ TOOL_INPUTS_$(1) := $$(call rwildcard,$$(dir $$(TOOL_SOURCE_$(1))),*.rs)
150150
endef
151151

152152
$(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate))))
153-
154-
ifdef CFG_DISABLE_ELF_TLS
155-
RUSTFLAGS_std := --cfg no_elf_tls
156-
endif

branches/snap-stage3/mk/main.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
7474
endif
7575
endif
7676

77+
CFG_BUILD_DATE = $(shell date +%F)
78+
CFG_VERSION += (built $(CFG_BUILD_DATE))
79+
7780
# Windows exe's need numeric versions - don't use anything but
7881
# numbers and dots here
7982
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
@@ -331,6 +334,7 @@ endif
331334
ifdef CFG_VER_HASH
332335
export CFG_VER_HASH
333336
endif
337+
export CFG_BUILD_DATE
334338
export CFG_VERSION
335339
export CFG_VERSION_WIN
336340
export CFG_RELEASE

branches/snap-stage3/mk/tests.mk

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,24 +172,23 @@ check: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2 tidy
172172
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
173173

174174
# As above but don't bother running tidy.
175-
check-notidy: check-sanitycheck cleantmptestlogs cleantestlibs all check-stage2
175+
check-notidy: cleantmptestlogs cleantestlibs all check-stage2
176176
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
177177

178178
# A slightly smaller set of tests for smoke testing.
179-
check-lite: check-sanitycheck cleantestlibs cleantmptestlogs \
179+
check-lite: cleantestlibs cleantmptestlogs \
180180
$(foreach crate,$(TEST_TARGET_CRATES),check-stage2-$(crate)) \
181181
check-stage2-rpass check-stage2-rpass-valgrind \
182182
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
183183
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
184184

185185
# Only check the 'reference' tests: rpass/cfail/rfail/rmake.
186-
check-ref: check-sanitycheck cleantestlibs cleantmptestlogs check-stage2-rpass \
187-
check-stage2-rpass-valgrind check-stage2-rfail check-stage2-cfail check-stage2-pfail \
188-
check-stage2-rmake
186+
check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
187+
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-rmake
189188
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
190189

191190
# Only check the docs.
192-
check-docs: check-sanitycheck cleantestlibs cleantmptestlogs check-stage2-docs
191+
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
193192
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
194193

195194
# Some less critical tests that are not prone to breakage.

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,3 @@ something if you know its name.
8686

8787
If you encounter an error while compiling your code you may be able to look it
8888
up in the [Rust Compiler Error Index](error-index.html).
89-
90-
# Community Translations
91-
92-
Several projects have been started to translate the documentation into other
93-
languages:
94-
95-
- [Russian](https://github.com/kgv/rust_book_ru)
96-
- [Korean](https://github.com/rust-kr/doc.rust-kr.org)
97-
- [Chinese](https://github.com/KaiserY/rust-book-chinese)
98-
- [Spanish](https://github.com/goyox86/elpr)
99-

branches/snap-stage3/src/doc/trpl/guessing-game.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Finally, Cargo generated a ‘Hello, world!’ for us. Check out `src/main.rs`:
3838

3939
```rust
4040
fn main() {
41-
println!("Hello, world!");
41+
println!("Hello, world!")
4242
}
4343
```
4444

@@ -362,7 +362,7 @@ everything that follows it is part of it, until the next section starts.
362362
Cargo uses the dependencies section to know what dependencies on external
363363
crates you have, and what versions you require. In this case, we’ve used version `0.3.0`.
364364
Cargo understands [Semantic Versioning][semver], which is a standard for writing version
365-
numbers. If we wanted to use the latest version we could use `*` or we could use a range
365+
numbers. If we wanted to use the latest version we could use `*` or we could use a range
366366
of versions. [Cargo’s documentation][cargodoc] contains more details.
367367

368368
[semver]: http://semver.org

branches/snap-stage3/src/doc/trpl/installing-rust.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
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:
6-
7-
> Note: you don't need to type in the `$`s, they just indicate the start of
8-
> each command. You’ll see many tutorials and examples around the web that
9-
> follow this convention: `$` for commands run as your regular user, and
10-
> `#` for commands you should be running as an administrator.
5+
or a Mac, all you need to do is this (note that you don't need to type in the
6+
`$`s, they just indicate the start of each command):
117

128
```bash
139
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sh

branches/snap-stage3/src/doc/trpl/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ As we've said before, an iterator is something that we can call the
213213
`.next()` method on repeatedly, and it gives us a sequence of things.
214214
Because you need to call the method, this means that iterators
215215
can be *lazy* and not generate all of the values upfront. This code,
216-
for example, does not actually generate the numbers `1-99`, instead
216+
for example, does not actually generate the numbers `1-100`, instead
217217
creating a value that merely represents the sequence:
218218

219219
```rust

branches/snap-stage3/src/doc/trpl/mutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ philosophy, memory safety, and the mechanism by which Rust guarantees it, the
8989
> * exactly one mutable reference (`&mut T`)
9090
9191
[ownership]: ownership.html
92-
[borrowing]: references-and-borrowing.html#borrowing
92+
[borrowing]: borrowing.html#The-Rules
9393

9494
So, that’s the real definition of ‘immutability’: is this safe to have two
9595
pointers to? In `Arc<T>`’s case, yes: the mutation is entirely contained inside

branches/snap-stage3/src/doc/trpl/raw-pointers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ For more operations on raw pointers, see [their API documentation][rawapi].
7777
# FFI
7878

7979
Raw pointers are useful for FFI: Rust’s `*const T` and `*mut T` are similar to
80-
C’s `const T*` and `T*`, respectively. For more about this use, consult the
80+
C’s `const T*` and `T*`, respectfully. For more about this use, consult the
8181
[FFI chapter][ffi].
8282

8383
[ffi]: ffi.html

branches/snap-stage3/src/etc/check-sanitycheck.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@
1111
# except according to those terms.
1212

1313
import os
14-
import subprocess
1514
import sys
1615
import functools
1716

1817
STATUS = 0
1918

19+
2020
def error_unless_permitted(env_var, message):
2121
global STATUS
2222
if not os.getenv(env_var):
2323
sys.stderr.write(message)
2424
STATUS = 1
2525

26+
2627
def only_on(platforms):
2728
def decorator(func):
2829
@functools.wraps(func)
@@ -32,7 +33,8 @@ def inner():
3233
return inner
3334
return decorator
3435

35-
@only_on(['linux', 'darwin', 'freebsd', 'openbsd'])
36+
37+
@only_on(('linux', 'darwin', 'freebsd', 'openbsd'))
3638
def check_rlimit_core():
3739
import resource
3840
soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
@@ -43,14 +45,8 @@ def check_rlimit_core():
4345
set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning
4446
""" % (soft))
4547

46-
@only_on(['win32'])
47-
def check_console_code_page():
48-
if '65001' not in subprocess.check_output(['cmd', '/c', 'chcp']):
49-
sys.stderr.write('Warning: the console output code page is not UTF-8, \
50-
some tests may fail. Use `cmd /c "chcp 65001"` to setup UTF-8 code page.\n')
5148

5249
def main():
53-
check_console_code_page()
5450
check_rlimit_core()
5551

5652
if __name__ == '__main__':

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

Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa
250250
///
251251
/// Returns `None` if the `Arc<T>` is not unique.
252252
///
253-
/// This function is marked **unsafe** because it is racy if weak pointers
254-
/// are active.
255-
///
256253
/// # Examples
257254
///
258255
/// ```
@@ -261,27 +258,24 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa
261258
/// # fn main() {
262259
/// use alloc::arc::{Arc, get_mut};
263260
///
264-
/// # unsafe {
265261
/// let mut x = Arc::new(3);
266262
/// *get_mut(&mut x).unwrap() = 4;
267263
/// assert_eq!(*x, 4);
268264
///
269265
/// let _y = x.clone();
270266
/// assert!(get_mut(&mut x).is_none());
271267
/// # }
272-
/// # }
273268
/// ```
274269
#[inline]
275270
#[unstable(feature = "alloc")]
276-
pub unsafe fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> {
277-
// FIXME(#24880) potential race with upgraded weak pointers here
271+
pub fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> {
278272
if strong_count(this) == 1 && weak_count(this) == 0 {
279273
// This unsafety is ok because we're guaranteed that the pointer
280274
// returned is the *only* pointer that will ever be returned to T. Our
281275
// reference count is guaranteed to be 1 at this point, and we required
282276
// the Arc itself to be `mut`, so we're returning the only possible
283277
// reference to the inner data.
284-
let inner = &mut **this._ptr;
278+
let inner = unsafe { &mut **this._ptr };
285279
Some(&mut inner.data)
286280
} else {
287281
None
@@ -338,26 +332,19 @@ impl<T: Clone> Arc<T> {
338332
/// This is also referred to as a copy-on-write operation because the inner
339333
/// data is cloned if the reference count is greater than one.
340334
///
341-
/// This method is marked **unsafe** because it is racy if weak pointers
342-
/// are active.
343-
///
344335
/// # Examples
345336
///
346337
/// ```
347338
/// # #![feature(alloc)]
348339
/// use std::sync::Arc;
349340
///
350-
/// # unsafe {
351341
/// let mut five = Arc::new(5);
352342
///
353343
/// let mut_five = five.make_unique();
354-
/// # }
355344
/// ```
356345
#[inline]
357346
#[unstable(feature = "alloc")]
358-
pub unsafe fn make_unique(&mut self) -> &mut T {
359-
// FIXME(#24880) potential race with upgraded weak pointers here
360-
//
347+
pub fn make_unique(&mut self) -> &mut T {
361348
// Note that we hold a strong reference, which also counts as a weak
362349
// reference, so we only clone if there is an additional reference of
363350
// either kind.
@@ -367,7 +354,7 @@ impl<T: Clone> Arc<T> {
367354
}
368355
// As with `get_mut()`, the unsafety is ok because our reference was
369356
// either unique to begin with, or became one upon cloning the contents.
370-
let inner = &mut **self._ptr;
357+
let inner = unsafe { &mut **self._ptr };
371358
&mut inner.data
372359
}
373360
}
@@ -757,43 +744,39 @@ mod tests {
757744

758745
#[test]
759746
fn test_arc_get_mut() {
760-
unsafe {
761-
let mut x = Arc::new(3);
762-
*get_mut(&mut x).unwrap() = 4;
763-
assert_eq!(*x, 4);
764-
let y = x.clone();
765-
assert!(get_mut(&mut x).is_none());
766-
drop(y);
767-
assert!(get_mut(&mut x).is_some());
768-
let _w = x.downgrade();
769-
assert!(get_mut(&mut x).is_none());
770-
}
747+
let mut x = Arc::new(3);
748+
*get_mut(&mut x).unwrap() = 4;
749+
assert_eq!(*x, 4);
750+
let y = x.clone();
751+
assert!(get_mut(&mut x).is_none());
752+
drop(y);
753+
assert!(get_mut(&mut x).is_some());
754+
let _w = x.downgrade();
755+
assert!(get_mut(&mut x).is_none());
771756
}
772757

773758
#[test]
774759
fn test_cowarc_clone_make_unique() {
775-
unsafe {
776-
let mut cow0 = Arc::new(75);
777-
let mut cow1 = cow0.clone();
778-
let mut cow2 = cow1.clone();
779-
780-
assert!(75 == *cow0.make_unique());
781-
assert!(75 == *cow1.make_unique());
782-
assert!(75 == *cow2.make_unique());
783-
784-
*cow0.make_unique() += 1;
785-
*cow1.make_unique() += 2;
786-
*cow2.make_unique() += 3;
787-
788-
assert!(76 == *cow0);
789-
assert!(77 == *cow1);
790-
assert!(78 == *cow2);
791-
792-
// none should point to the same backing memory
793-
assert!(*cow0 != *cow1);
794-
assert!(*cow0 != *cow2);
795-
assert!(*cow1 != *cow2);
796-
}
760+
let mut cow0 = Arc::new(75);
761+
let mut cow1 = cow0.clone();
762+
let mut cow2 = cow1.clone();
763+
764+
assert!(75 == *cow0.make_unique());
765+
assert!(75 == *cow1.make_unique());
766+
assert!(75 == *cow2.make_unique());
767+
768+
*cow0.make_unique() += 1;
769+
*cow1.make_unique() += 2;
770+
*cow2.make_unique() += 3;
771+
772+
assert!(76 == *cow0);
773+
assert!(77 == *cow1);
774+
assert!(78 == *cow2);
775+
776+
// none should point to the same backing memory
777+
assert!(*cow0 != *cow1);
778+
assert!(*cow0 != *cow2);
779+
assert!(*cow1 != *cow2);
797780
}
798781

799782
#[test]
@@ -806,9 +789,7 @@ mod tests {
806789
assert!(75 == *cow1);
807790
assert!(75 == *cow2);
808791

809-
unsafe {
810-
*cow0.make_unique() += 1;
811-
}
792+
*cow0.make_unique() += 1;
812793

813794
assert!(76 == *cow0);
814795
assert!(75 == *cow1);
@@ -829,9 +810,7 @@ mod tests {
829810
assert!(75 == *cow0);
830811
assert!(75 == *cow1_weak.upgrade().unwrap());
831812

832-
unsafe {
833-
*cow0.make_unique() += 1;
834-
}
813+
*cow0.make_unique() += 1;
835814

836815
assert!(76 == *cow0);
837816
assert!(cow1_weak.upgrade().is_none());

branches/snap-stage3/src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//! You can get a non-`'static` `&str` by taking a slice of a `String`:
3131
//!
3232
//! ```
33-
//! let some_string = "Hello, world.".to_string();
33+
//! # let some_string = "Hello, world.".to_string();
3434
//! let s = &some_string;
3535
//! ```
3636
//!

0 commit comments

Comments
 (0)