Auto merge of #25958 - Manishearth:rollup, r=Manishearth
- Successful merges: #25751, #25821, #25920, #25932, #25933, #25936, #25941, #25949, #25951 - Failed merges:
This commit is contained in:
commit
48e9ef6404
@ -74,9 +74,6 @@ ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
|
||||
endif
|
||||
endif
|
||||
|
||||
CFG_BUILD_DATE = $(shell date +%F)
|
||||
CFG_VERSION += (built $(CFG_BUILD_DATE))
|
||||
|
||||
# Windows exe's need numeric versions - don't use anything but
|
||||
# numbers and dots here
|
||||
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
|
||||
@ -130,9 +127,7 @@ CFG_JEMALLOC_FLAGS += $(JEMALLOC_FLAGS)
|
||||
|
||||
ifdef CFG_ENABLE_DEBUG_ASSERTIONS
|
||||
$(info cfg: enabling debug assertions (CFG_ENABLE_DEBUG_ASSERTIONS))
|
||||
CFG_RUSTC_FLAGS += --cfg debug -C debug-assertions=on
|
||||
else
|
||||
CFG_RUSTC_FLAGS += --cfg ndebug
|
||||
CFG_RUSTC_FLAGS += -C debug-assertions=on
|
||||
endif
|
||||
|
||||
ifdef CFG_ENABLE_DEBUGINFO
|
||||
@ -334,7 +329,6 @@ endif
|
||||
ifdef CFG_VER_HASH
|
||||
export CFG_VER_HASH
|
||||
endif
|
||||
export CFG_BUILD_DATE
|
||||
export CFG_VERSION
|
||||
export CFG_VERSION_WIN
|
||||
export CFG_RELEASE
|
||||
|
@ -86,3 +86,14 @@ something if you know its name.
|
||||
|
||||
If you encounter an error while compiling your code you may be able to look it
|
||||
up in the [Rust Compiler Error Index](error-index.html).
|
||||
|
||||
# Community Translations
|
||||
|
||||
Several projects have been started to translate the documentation into other
|
||||
languages:
|
||||
|
||||
- [Russian](https://github.com/kgv/rust_book_ru)
|
||||
- [Korean](https://github.com/rust-kr/doc.rust-kr.org)
|
||||
- [Chinese](https://github.com/KaiserY/rust-book-chinese)
|
||||
- [Spanish](https://github.com/goyox86/elpr)
|
||||
|
||||
|
@ -321,7 +321,7 @@ You can chain all three things together: start with an iterator, adapt it
|
||||
a few times, and then consume the result. Check it out:
|
||||
|
||||
```rust
|
||||
(1..1000)
|
||||
(1..)
|
||||
.filter(|&x| x % 2 == 0)
|
||||
.filter(|&x| x % 3 == 0)
|
||||
.take(5)
|
||||
|
@ -77,7 +77,7 @@ For more operations on raw pointers, see [their API documentation][rawapi].
|
||||
# FFI
|
||||
|
||||
Raw pointers are useful for FFI: Rust’s `*const T` and `*mut T` are similar to
|
||||
C’s `const T*` and `T*`, respectfully. For more about this use, consult the
|
||||
C’s `const T*` and `T*`, respectively. For more about this use, consult the
|
||||
[FFI chapter][ffi].
|
||||
|
||||
[ffi]: ffi.html
|
||||
|
@ -495,8 +495,7 @@ impl String {
|
||||
///
|
||||
/// ```
|
||||
/// let s = String::from("hello");
|
||||
/// let b: &[_] = &[104, 101, 108, 108, 111];
|
||||
/// assert_eq!(s.as_bytes(), b);
|
||||
/// assert_eq!(s.as_bytes(), [104, 101, 108, 108, 111]);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -409,9 +409,11 @@ impl<T> Option<T> {
|
||||
/// Convert an `Option<String>` into an `Option<usize>`, consuming the original:
|
||||
///
|
||||
/// ```
|
||||
/// let num_as_str: Option<String> = Some("10".to_string());
|
||||
/// // `Option::map` takes self *by value*, consuming `num_as_str`
|
||||
/// let num_as_int: Option<usize> = num_as_str.map(|n| n.len());
|
||||
/// let maybe_some_string = Some(String::from("Hello, World!"));
|
||||
/// // `Option::map` takes self *by value*, consuming `maybe_some_string`
|
||||
/// let maybe_some_len = maybe_some_string.map(|s| s.len());
|
||||
///
|
||||
/// assert_eq!(maybe_some_len, Some(13));
|
||||
/// ```
|
||||
#[inline]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -483,10 +483,6 @@ pub fn commit_date_str() -> Option<&'static str> {
|
||||
option_env!("CFG_VER_DATE")
|
||||
}
|
||||
|
||||
pub fn build_date_str() -> Option<&'static str> {
|
||||
option_env!("CFG_BUILD_DATE")
|
||||
}
|
||||
|
||||
/// Prints version information and returns None on success or an error
|
||||
/// message on panic.
|
||||
pub fn version(binary: &str, matches: &getopts::Matches) {
|
||||
@ -498,7 +494,6 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
|
||||
println!("binary: {}", binary);
|
||||
println!("commit-hash: {}", unw(commit_hash_str()));
|
||||
println!("commit-date: {}", unw(commit_date_str()));
|
||||
println!("build-date: {}", unw(build_date_str()));
|
||||
println!("host: {}", config::host_triple());
|
||||
println!("release: {}", unw(release_str()));
|
||||
}
|
||||
|
@ -338,10 +338,10 @@ nav.sub {
|
||||
font-size: 1em;
|
||||
position: relative;
|
||||
}
|
||||
/* Shift "where ..." part of method definition down a line */
|
||||
.content .method .where { display: block; }
|
||||
/* Shift "where ..." part of method or fn definition down a line */
|
||||
.content .method .where, .content .fn .where { display: block; }
|
||||
/* Bit of whitespace to indent it */
|
||||
.content .method .where::before { content: ' '; }
|
||||
.content .method .where::before, .content .fn .where::before { content: ' '; }
|
||||
|
||||
.content .methods > div { margin-left: 40px; }
|
||||
|
||||
|
@ -660,6 +660,8 @@ impl f32 {
|
||||
///
|
||||
/// assert_eq!(x.max(y), y);
|
||||
/// ```
|
||||
///
|
||||
/// If one of the arguments is NaN, then the other argument is returned.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn max(self, other: f32) -> f32 {
|
||||
@ -674,6 +676,8 @@ impl f32 {
|
||||
///
|
||||
/// assert_eq!(x.min(y), x);
|
||||
/// ```
|
||||
///
|
||||
/// If one of the arguments is NaN, then the other argument is returned.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn min(self, other: f32) -> f32 {
|
||||
|
@ -636,6 +636,8 @@ impl f64 {
|
||||
///
|
||||
/// assert_eq!(x.max(y), y);
|
||||
/// ```
|
||||
///
|
||||
/// If one of the arguments is NaN, then the other argument is returned.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn max(self, other: f64) -> f64 {
|
||||
@ -650,6 +652,8 @@ impl f64 {
|
||||
///
|
||||
/// assert_eq!(x.min(y), x);
|
||||
/// ```
|
||||
///
|
||||
/// If one of the arguments is NaN, then the other argument is returned.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[inline]
|
||||
pub fn min(self, other: f64) -> f64 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user