Skip to content

Commit 60f75ad

Browse files
committed
---
yaml --- r: 212141 b: refs/heads/tmp c: 6e97b16 h: refs/heads/master i: 212139: 226a4d4 v: v3
1 parent 97c9d54 commit 60f75ad

File tree

18 files changed

+127
-61
lines changed

18 files changed

+127
-61
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 62e70d35be3fe532c26a400b499c58a18f18dd3a
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: f44d287a769765862518c0de82d87bef4cca2670
35+
refs/heads/tmp: 6e97b16d0277d86fb06a158683ef3c15ece14a62
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: b77d60adb019bb5de05e884a99f3290ec4694137
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ 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"
596597

597598
valopt_nosave prefix "/usr/local" "set installation prefix"
598599
valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"

branches/tmp/mk/crates.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,7 @@ 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/tmp/mk/main.mk

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ 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-
8077
# Windows exe's need numeric versions - don't use anything but
8178
# numbers and dots here
8279
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
@@ -130,9 +127,7 @@ CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)
130127

131128
ifdef CFG_ENABLE_DEBUG_ASSERTIONS
132129
$(info cfg: enabling debug assertions (CFG_ENABLE_DEBUG_ASSERTIONS))
133-
CFG_RUSTC_FLAGS += --cfg debug -C debug-assertions=on
134-
else
135-
CFG_RUSTC_FLAGS += --cfg ndebug
130+
CFG_RUSTC_FLAGS += -C debug-assertions=on
136131
endif
137132

138133
ifdef CFG_ENABLE_DEBUGINFO
@@ -334,7 +329,6 @@ endif
334329
ifdef CFG_VER_HASH
335330
export CFG_VER_HASH
336331
endif
337-
export CFG_BUILD_DATE
338332
export CFG_VERSION
339333
export CFG_VERSION_WIN
340334
export CFG_RELEASE

branches/tmp/mk/tests.mk

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,23 +172,24 @@ 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: cleantmptestlogs cleantestlibs all check-stage2
175+
check-notidy: check-sanitycheck 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: cleantestlibs cleantmptestlogs \
179+
check-lite: check-sanitycheck 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: cleantestlibs cleantmptestlogs check-stage2-rpass check-stage2-rpass-valgrind \
187-
check-stage2-rfail check-stage2-cfail check-stage2-pfail check-stage2-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
188189
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
189190

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

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

branches/tmp/src/doc/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,14 @@ 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/tmp/src/doc/trpl/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ You can chain all three things together: start with an iterator, adapt it
321321
a few times, and then consume the result. Check it out:
322322

323323
```rust
324-
(1..1000)
324+
(1..)
325325
.filter(|&x| x % 2 == 0)
326326
.filter(|&x| x % 3 == 0)
327327
.take(5)

branches/tmp/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*`, respectfully. For more about this use, consult the
80+
C’s `const T*` and `T*`, respectively. For more about this use, consult the
8181
[FFI chapter][ffi].
8282

8383
[ffi]: ffi.html

branches/tmp/src/etc/check-sanitycheck.py

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

1313
import os
14+
import subprocess
1415
import sys
1516
import functools
1617

1718
STATUS = 0
1819

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-
2726
def only_on(platforms):
2827
def decorator(func):
2928
@functools.wraps(func)
@@ -33,8 +32,7 @@ def inner():
3332
return inner
3433
return decorator
3534

36-
37-
@only_on(('linux', 'darwin', 'freebsd', 'openbsd'))
35+
@only_on(['linux', 'darwin', 'freebsd', 'openbsd'])
3836
def check_rlimit_core():
3937
import resource
4038
soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
@@ -45,8 +43,14 @@ def check_rlimit_core():
4543
set ALLOW_NONZERO_RLIMIT_CORE to ignore this warning
4644
""" % (soft))
4745

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')
4851

4952
def main():
53+
check_console_code_page()
5054
check_rlimit_core()
5155

5256
if __name__ == '__main__':

branches/tmp/src/libcollections/string.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@ impl String {
495495
///
496496
/// ```
497497
/// let s = String::from("hello");
498-
/// let b: &[_] = &[104, 101, 108, 108, 111];
499-
/// assert_eq!(s.as_bytes(), b);
498+
/// assert_eq!(s.as_bytes(), [104, 101, 108, 108, 111]);
500499
/// ```
501500
#[inline]
502501
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/libcore/option.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,11 @@ impl<T> Option<T> {
409409
/// Convert an `Option<String>` into an `Option<usize>`, consuming the original:
410410
///
411411
/// ```
412-
/// let num_as_str: Option<String> = Some("10".to_string());
413-
/// // `Option::map` takes self *by value*, consuming `num_as_str`
414-
/// let num_as_int: Option<usize> = num_as_str.map(|n| n.len());
412+
/// let maybe_some_string = Some(String::from("Hello, World!"));
413+
/// // `Option::map` takes self *by value*, consuming `maybe_some_string`
414+
/// let maybe_some_len = maybe_some_string.map(|s| s.len());
415+
///
416+
/// assert_eq!(maybe_some_len, Some(13));
415417
/// ```
416418
#[inline]
417419
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/librustc_driver/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,6 @@ pub fn commit_date_str() -> Option<&'static str> {
483483
option_env!("CFG_VER_DATE")
484484
}
485485

486-
pub fn build_date_str() -> Option<&'static str> {
487-
option_env!("CFG_BUILD_DATE")
488-
}
489-
490486
/// Prints version information and returns None on success or an error
491487
/// message on panic.
492488
pub fn version(binary: &str, matches: &getopts::Matches) {
@@ -498,7 +494,6 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
498494
println!("binary: {}", binary);
499495
println!("commit-hash: {}", unw(commit_hash_str()));
500496
println!("commit-date: {}", unw(commit_date_str()));
501-
println!("build-date: {}", unw(build_date_str()));
502497
println!("host: {}", config::host_triple());
503498
println!("release: {}", unw(release_str()));
504499
}

branches/tmp/src/librustdoc/html/static/main.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,10 @@ nav.sub {
338338
font-size: 1em;
339339
position: relative;
340340
}
341-
/* Shift "where ..." part of method definition down a line */
342-
.content .method .where { display: block; }
341+
/* Shift "where ..." part of method or fn definition down a line */
342+
.content .method .where, .content .fn .where { display: block; }
343343
/* Bit of whitespace to indent it */
344-
.content .method .where::before { content: ' '; }
344+
.content .method .where::before, .content .fn .where::before { content: ' '; }
345345

346346
.content .methods > div { margin-left: 40px; }
347347

branches/tmp/src/libstd/io/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ pub enum ErrorKind {
9595
/// A parameter was incorrect.
9696
#[stable(feature = "rust1", since = "1.0.0")]
9797
InvalidInput,
98+
/// Data not valid for the operation were encountered.
99+
///
100+
/// Unlike `InvalidInput`, this typically means that the operation
101+
/// parameters were valid, however the error was caused by malformed
102+
/// input data.
103+
#[stable(feature = "io_invalid_data", since = "1.2.0")]
104+
InvalidData,
98105
/// The I/O operation's timeout expired, causing it to be canceled.
99106
#[stable(feature = "rust1", since = "1.0.0")]
100107
TimedOut,

branches/tmp/src/libstd/io/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn append_to_string<F>(buf: &mut String, f: F) -> Result<usize>
8080
let ret = f(g.s);
8181
if str::from_utf8(&g.s[g.len..]).is_err() {
8282
ret.and_then(|_| {
83-
Err(Error::new(ErrorKind::InvalidInput,
83+
Err(Error::new(ErrorKind::InvalidData,
8484
"stream did not contain valid UTF-8"))
8585
})
8686
} else {

branches/tmp/src/libstd/sys/windows/stdio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,5 @@ impl Output {
170170
}
171171

172172
fn invalid_encoding() -> io::Error {
173-
io::Error::new(io::ErrorKind::InvalidInput, "text was not valid unicode")
173+
io::Error::new(io::ErrorKind::InvalidData, "text was not valid unicode")
174174
}

branches/tmp/src/libstd/thread/local.rs

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,37 +99,60 @@ pub struct LocalKey<T> {
9999

100100
/// Declare a new thread local storage key of type `std::thread::LocalKey`.
101101
///
102-
/// See [LocalKey documentation](thread/struct.LocalKey.html) for more information.
102+
/// See [LocalKey documentation](thread/struct.LocalKey.html) for more
103+
/// information.
103104
#[macro_export]
104105
#[stable(feature = "rust1", since = "1.0.0")]
105106
#[allow_internal_unstable]
107+
#[cfg(not(no_elf_tls))]
106108
macro_rules! thread_local {
107109
(static $name:ident: $t:ty = $init:expr) => (
108-
static $name: ::std::thread::LocalKey<$t> = {
109-
#[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
110-
not(target_arch = "aarch64")),
111-
thread_local)]
112-
static __KEY: ::std::thread::__LocalKeyInner<$t> =
113-
::std::thread::__LocalKeyInner::new();
114-
fn __init() -> $t { $init }
115-
fn __getit() -> &'static ::std::thread::__LocalKeyInner<$t> { &__KEY }
116-
::std::thread::LocalKey::new(__getit, __init)
117-
};
110+
static $name: ::std::thread::LocalKey<$t> =
111+
__thread_local_inner!($t, $init,
112+
#[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
113+
not(target_arch = "aarch64")),
114+
thread_local)]);
118115
);
119116
(pub static $name:ident: $t:ty = $init:expr) => (
120-
pub static $name: ::std::thread::LocalKey<$t> = {
121-
#[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
122-
not(target_arch = "aarch64")),
123-
thread_local)]
124-
static __KEY: ::std::thread::__LocalKeyInner<$t> =
125-
::std::thread::__LocalKeyInner::new();
126-
fn __init() -> $t { $init }
127-
fn __getit() -> &'static ::std::thread::__LocalKeyInner<$t> { &__KEY }
128-
::std::thread::LocalKey::new(__getit, __init)
129-
};
117+
pub static $name: ::std::thread::LocalKey<$t> =
118+
__thread_local_inner!($t, $init,
119+
#[cfg_attr(all(any(target_os = "macos", target_os = "linux"),
120+
not(target_arch = "aarch64")),
121+
thread_local)]);
130122
);
131123
}
132124

125+
#[macro_export]
126+
#[stable(feature = "rust1", since = "1.0.0")]
127+
#[allow_internal_unstable]
128+
#[cfg(no_elf_tls)]
129+
macro_rules! thread_local {
130+
(static $name:ident: $t:ty = $init:expr) => (
131+
static $name: ::std::thread::LocalKey<$t> =
132+
__thread_local_inner!($t, $init, #[]);
133+
);
134+
(pub static $name:ident: $t:ty = $init:expr) => (
135+
pub static $name: ::std::thread::LocalKey<$t> =
136+
__thread_local_inner!($t, $init, #[]);
137+
);
138+
}
139+
140+
#[doc(hidden)]
141+
#[unstable(feature = "thread_local_internals",
142+
reason = "should not be necessary")]
143+
#[macro_export]
144+
#[allow_internal_unstable]
145+
macro_rules! __thread_local_inner {
146+
($t:ty, $init:expr, #[$($attr:meta),*]) => {{
147+
$(#[$attr])*
148+
static __KEY: ::std::thread::__LocalKeyInner<$t> =
149+
::std::thread::__LocalKeyInner::new();
150+
fn __init() -> $t { $init }
151+
fn __getit() -> &'static ::std::thread::__LocalKeyInner<$t> { &__KEY }
152+
::std::thread::LocalKey::new(__getit, __init)
153+
}}
154+
}
155+
133156
/// Indicator of the state of a thread local storage key.
134157
#[unstable(feature = "std_misc",
135158
reason = "state querying was recently added")]
@@ -163,7 +186,10 @@ pub enum LocalKeyState {
163186

164187
impl<T: 'static> LocalKey<T> {
165188
#[doc(hidden)]
166-
pub const fn new(inner: fn() -> &'static __KeyInner<T>, init: fn() -> T) -> LocalKey<T> {
189+
#[unstable(feature = "thread_local_internals",
190+
reason = "recently added to create a key")]
191+
pub const fn new(inner: fn() -> &'static __KeyInner<T>,
192+
init: fn() -> T) -> LocalKey<T> {
167193
LocalKey {
168194
inner: inner,
169195
init: init
@@ -240,7 +266,9 @@ impl<T: 'static> LocalKey<T> {
240266
}
241267
}
242268

243-
#[cfg(all(any(target_os = "macos", target_os = "linux"), not(target_arch = "aarch64")))]
269+
#[cfg(all(any(target_os = "macos", target_os = "linux"),
270+
not(target_arch = "aarch64"),
271+
not(no_elf_tls)))]
244272
#[doc(hidden)]
245273
mod imp {
246274
use prelude::v1::*;
@@ -371,7 +399,9 @@ mod imp {
371399
}
372400
}
373401

374-
#[cfg(any(not(any(target_os = "macos", target_os = "linux")), target_arch = "aarch64"))]
402+
#[cfg(any(not(any(target_os = "macos", target_os = "linux")),
403+
target_arch = "aarch64",
404+
no_elf_tls))]
375405
#[doc(hidden)]
376406
mod imp {
377407
use prelude::v1::*;

0 commit comments

Comments
 (0)