diff --git a/mk/main.mk b/mk/main.mk index de5adfd129786..32d1fcf3968fc 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -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 diff --git a/src/doc/index.md b/src/doc/index.md index c4725c26e46bd..f561cf5d70f56 100644 --- a/src/doc/index.md +++ b/src/doc/index.md @@ -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) + diff --git a/src/doc/trpl/iterators.md b/src/doc/trpl/iterators.md index c391a0ea9b6ea..249c1cc7e34f6 100644 --- a/src/doc/trpl/iterators.md +++ b/src/doc/trpl/iterators.md @@ -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) diff --git a/src/doc/trpl/raw-pointers.md b/src/doc/trpl/raw-pointers.md index 4a37af3c22782..0f189adf40abf 100644 --- a/src/doc/trpl/raw-pointers.md +++ b/src/doc/trpl/raw-pointers.md @@ -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 diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 7563bb76b52f8..c328a58f0770e 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -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")] diff --git a/src/libcore/option.rs b/src/libcore/option.rs index f7e8480e250dc..8d2d725251220 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -409,9 +409,11 @@ impl Option { /// Convert an `Option` into an `Option`, consuming the original: /// /// ``` - /// let num_as_str: Option = Some("10".to_string()); - /// // `Option::map` takes self *by value*, consuming `num_as_str` - /// let num_as_int: Option = 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")] diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d91a26ed4ee9b..49879b472feb7 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -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())); } diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index 575322e63526d..aaebdc34cd464 100644 --- a/src/librustdoc/html/static/main.css +++ b/src/librustdoc/html/static/main.css @@ -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; } diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs index e31d97b324038..c22f5d073de89 100644 --- a/src/libstd/num/f32.rs +++ b/src/libstd/num/f32.rs @@ -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 { diff --git a/src/libstd/num/f64.rs b/src/libstd/num/f64.rs index e87855ffd4eed..cde0b567ade0f 100644 --- a/src/libstd/num/f64.rs +++ b/src/libstd/num/f64.rs @@ -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 {