Skip to content

Commit 7765394

Browse files
committed
---
yaml --- r: 211837 b: refs/heads/auto c: a85150b h: refs/heads/master i: 211835: 5b7b43d v: v3
1 parent c089f84 commit 7765394

File tree

20 files changed

+169
-67
lines changed

20 files changed

+169
-67
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 3af8e14cd13090d7630b40bf7515d228e3bd8fa9
13+
refs/heads/auto: a85150b58aa33213ea3df746a980b1cbd690a612
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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/auto/mk/main.mk

Lines changed: 0 additions & 4 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)
@@ -334,7 +331,6 @@ endif
334331
ifdef CFG_VER_HASH
335332
export CFG_VER_HASH
336333
endif
337-
export CFG_BUILD_DATE
338334
export CFG_VERSION
339335
export CFG_VERSION_WIN
340336
export CFG_RELEASE

branches/auto/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/auto/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/auto/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/auto/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]: borrowing.html#The-Rules
92+
[borrowing]: references-and-borrowing.html#borrowing
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/auto/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/auto/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/auto/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
//!

branches/auto/src/libcore/option.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl<T> Option<T> {
320320
///
321321
/// ```{.should_panic}
322322
/// let x: Option<&str> = None;
323-
/// x.expect("the world is ending"); // panics with `world is ending`
323+
/// x.expect("the world is ending"); // panics with `the world is ending`
324324
/// ```
325325
#[inline]
326326
#[stable(feature = "rust1", since = "1.0.0")]
@@ -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")]
@@ -422,7 +424,8 @@ impl<T> Option<T> {
422424
}
423425
}
424426

425-
/// Applies a function to the contained value or returns a default.
427+
/// Applies a function to the contained value (if any),
428+
/// or returns a `default` (if not).
426429
///
427430
/// # Examples
428431
///
@@ -435,14 +438,15 @@ impl<T> Option<T> {
435438
/// ```
436439
#[inline]
437440
#[stable(feature = "rust1", since = "1.0.0")]
438-
pub fn map_or<U, F: FnOnce(T) -> U>(self, def: U, f: F) -> U {
441+
pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U {
439442
match self {
440443
Some(t) => f(t),
441-
None => def
444+
None => default,
442445
}
443446
}
444447

445-
/// Applies a function to the contained value or computes a default.
448+
/// Applies a function to the contained value (if any),
449+
/// or computes a `default` (if not).
446450
///
447451
/// # Examples
448452
///
@@ -457,10 +461,10 @@ impl<T> Option<T> {
457461
/// ```
458462
#[inline]
459463
#[stable(feature = "rust1", since = "1.0.0")]
460-
pub fn map_or_else<U, D: FnOnce() -> U, F: FnOnce(T) -> U>(self, def: D, f: F) -> U {
464+
pub fn map_or_else<U, D: FnOnce() -> U, F: FnOnce(T) -> U>(self, default: D, f: F) -> U {
461465
match self {
462466
Some(t) => f(t),
463-
None => def()
467+
None => default()
464468
}
465469
}
466470

branches/auto/src/librustc/diagnostics.rs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,38 @@ for the entire lifetime of a program. Creating a boxed value allocates memory on
176176
the heap at runtime, and therefore cannot be done at compile time.
177177
"##,
178178

179+
E0011: r##"
180+
Initializers for constants and statics are evaluated at compile time.
181+
User-defined operators rely on user-defined functions, which cannot be evaluated
182+
at compile time.
183+
184+
Bad example:
185+
186+
```
187+
use std::ops::Index;
188+
189+
struct Foo { a: u8 }
190+
191+
impl Index<u8> for Foo {
192+
type Output = u8;
193+
194+
fn index<'a>(&'a self, idx: u8) -> &'a u8 { &self.a }
195+
}
196+
197+
const a: Foo = Foo { a: 0u8 };
198+
const b: u8 = a[0]; // Index trait is defined by the user, bad!
199+
```
200+
201+
Only operators on builtin types are allowed.
202+
203+
Example:
204+
205+
```
206+
const a: &'static [i32] = &[1, 2, 3];
207+
const b: i32 = a[0]; // Good!
208+
```
209+
"##,
210+
179211
E0013: r##"
180212
Static and const variables can refer to other const variables. But a const
181213
variable cannot refer to a static variable. For example, `Y` cannot refer to `X`
@@ -899,7 +931,6 @@ static mut BAR: Option<Vec<i32>> = None;
899931

900932

901933
register_diagnostics! {
902-
E0011,
903934
E0014,
904935
E0016,
905936
E0017,

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

0 commit comments

Comments
 (0)