diff --git a/Makefile.in b/Makefile.in index 7425e9bd73e95..9d8fdd0de62b2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -272,7 +272,9 @@ ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \ endif .DEFAULT: - @echo "\n======================================================" + @echo + @echo "======================================================" @echo "== If you need help, run 'make help' or 'make tips' ==" - @echo "======================================================\n" + @echo "======================================================" + @echo exit 1 diff --git a/configure b/configure index b7053c5c54f56..a36362e0ada71 100755 --- a/configure +++ b/configure @@ -133,12 +133,13 @@ probe() { } probe_need() { - local V=$1 probe $* + local V=$1 + shift eval VV=\$$V if [ -z "$VV" ] then - err "needed, but unable to find any of: $*" + err "$V needed, but unable to find any of: $*" fi } @@ -725,7 +726,7 @@ if [ -n "$CFG_ENABLE_ORBIT" ]; then putvar CFG_ENABLE_ORBIT; fi step_msg "looking for build programs" -probe_need CFG_CURLORWGET curl wget +probe_need CFG_CURL curl if [ -z "$CFG_PYTHON_PROVIDED" ]; then probe_need CFG_PYTHON python2.7 python2 python fi diff --git a/src/libcore/Cargo.toml b/src/libcore/Cargo.toml index 02fe574b81edd..3b406ac0447f2 100644 --- a/src/libcore/Cargo.toml +++ b/src/libcore/Cargo.toml @@ -2,7 +2,6 @@ authors = ["The Rust Project Developers"] name = "core" version = "0.0.0" -build = "build.rs" [lib] name = "core" diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 0350824ee359d..94baf188bcaee 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -10,7 +10,7 @@ //! rustc compiler intrinsics. //! -//! The corresponding definitions are in librustc_trans/trans/intrinsic.rs. +//! The corresponding definitions are in librustc_trans/intrinsic.rs. //! //! # Volatiles //! diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index b576f77dbd77d..97b57f231b907 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1029,6 +1029,30 @@ struct Bar2; // ok! ``` "##, +E0429: r##" +The `self` keyword cannot appear alone as the last segment in a `use` +declaration. + +Example of erroneous code: + +```compile_fail +use std::fmt::self; // error: `self` imports are only allowed within a { } list +``` + +To use a namespace itself in addition to some of its members, `self` may appear +as part of a brace-enclosed list of imports: + +``` +use std::fmt::{self, Debug}; +``` + +If you only want to import the namespace, do so directly: + +``` +use std::fmt; +``` +"##, + E0430: r##" The `self` import appears more than once in the list. Erroneous code example: @@ -1235,5 +1259,4 @@ register_diagnostics! { E0420, // is not an associated const E0421, // unresolved associated const E0427, // cannot use `ref` binding mode with ... - E0429, // `self` imports are only allowed within a { } list } diff --git a/src/librustc_unicode/char.rs b/src/librustc_unicode/char.rs index 863cada5b8809..77de51b32e226 100644 --- a/src/librustc_unicode/char.rs +++ b/src/librustc_unicode/char.rs @@ -30,13 +30,13 @@ use core::char::CharExt as C; use core::fmt; -use tables::{derived_property, property, general_category, conversions}; +use tables::{conversions, derived_property, general_category, property}; // stable reexports #[stable(feature = "rust1", since = "1.0.0")] -pub use core::char::{MAX, from_u32, from_u32_unchecked, from_digit}; +pub use core::char::{MAX, from_digit, from_u32, from_u32_unchecked}; #[stable(feature = "rust1", since = "1.0.0")] -pub use core::char::{EscapeUnicode, EscapeDefault, EncodeUtf8, EncodeUtf16}; +pub use core::char::{EncodeUtf16, EncodeUtf8, EscapeDefault, EscapeUnicode}; // unstable reexports #[unstable(feature = "unicode", issue = "27783")] @@ -808,16 +808,18 @@ pub fn decode_utf16>(iter: I) -> DecodeUtf16> Iterator for DecodeUtf16 { +impl> Iterator for DecodeUtf16 { type Item = Result; fn next(&mut self) -> Option> { let u = match self.buf.take() { Some(buf) => buf, - None => match self.iter.next() { - Some(u) => u, - None => return None, - }, + None => { + match self.iter.next() { + Some(u) => u, + None => return None, + } + } }; if u < 0xD800 || 0xDFFF < u { diff --git a/src/librustc_unicode/lib.rs b/src/librustc_unicode/lib.rs index 2f7f724e6af8f..b03d7ee79e89c 100644 --- a/src/librustc_unicode/lib.rs +++ b/src/librustc_unicode/lib.rs @@ -43,14 +43,14 @@ pub mod char; #[allow(deprecated)] pub mod str { - pub use u_str::{UnicodeStr, SplitWhitespace}; - pub use u_str::{utf8_char_width, is_utf16}; - pub use u_str::{Utf16Encoder}; + pub use u_str::{SplitWhitespace, UnicodeStr}; + pub use u_str::{is_utf16, utf8_char_width}; + pub use u_str::Utf16Encoder; } // For use in libcollections, not re-exported in libstd. pub mod derived_property { - pub use tables::derived_property::{Cased, Case_Ignorable}; + pub use tables::derived_property::{Case_Ignorable, Cased}; } // For use in libsyntax diff --git a/src/librustc_unicode/u_str.rs b/src/librustc_unicode/u_str.rs index 18734a66871f6..0bac44b837ff2 100644 --- a/src/librustc_unicode/u_str.rs +++ b/src/librustc_unicode/u_str.rs @@ -144,7 +144,9 @@ impl Utf16Encoder { } } -impl Iterator for Utf16Encoder where I: Iterator { +impl Iterator for Utf16Encoder + where I: Iterator +{ type Item = u16; #[inline] diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index bfe3f7b8dd69d..45dacb68e91a6 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -409,8 +409,8 @@ a { .content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; } .content span.struct, .content a.struct, .block a.current.struct { color: #df3600; } -.content a.type { color: #e57300; } -.content a.macro { color: #068000; } +.content span.type, .content a.type, .block a.current.type { color: #e57300; } +.content span.macro, .content a.macro, .block a.current.macro { color: #068000; } .block a.current.crate { font-weight: 500; } .search-input { @@ -453,7 +453,7 @@ a { .content .search-results td:first-child { padding-right: 0; } .content .search-results td:first-child a { padding-right: 10px; } -tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; } +tr.result span.primitive::after { content: ' (primitive type)'; font-style: italic; color: black} body.blur > :not(#help) { filter: blur(8px); diff --git a/src/librustdoc/html/static/styles/main.css b/src/librustdoc/html/static/styles/main.css index aa08cee13ef72..aee6d15b7ca37 100644 --- a/src/librustdoc/html/static/styles/main.css +++ b/src/librustdoc/html/static/styles/main.css @@ -88,8 +88,9 @@ pre { border-bottom-color: #ddd; } -.content a.primitive { color: #39a7bf; } -.content span.externcrate, span.mod, .content a.mod, block a.current.mod { color: #4d76ae; } +.content span.primitive, .content a.primitive, .block a.current.primitive { color: #39a7bf; } +.content span.externcrate, +.content span.mod, .content a.mod, .block a.current.mod { color: #4d76ae; } .content span.fn, .content a.fn, .block a.current.fn, .content span.method, .content a.method, .block a.current.method, .content span.tymethod, .content a.tymethod, .block a.current.tymethod, diff --git a/src/libtest/stats.rs b/src/libtest/stats.rs index 335b6d67209de..1883f0aba23eb 100644 --- a/src/libtest/stats.rs +++ b/src/libtest/stats.rs @@ -11,7 +11,7 @@ #![allow(missing_docs)] #![allow(deprecated)] // Float -use std::cmp::Ordering::{self, Less, Greater, Equal}; +use std::cmp::Ordering::{self, Equal, Greater, Less}; use std::mem; fn local_cmp(x: f64, y: f64) -> Ordering { @@ -35,7 +35,6 @@ fn local_sort(v: &mut [f64]) { /// Trait that provides simple descriptive statistics on a univariate set of numeric samples. pub trait Stats { - /// Sum of the samples. /// /// Note: this method sacrifices performance at the altar of accuracy diff --git a/src/libcore/build.rs b/src/test/compile-fail/issue-32829.rs similarity index 72% rename from src/libcore/build.rs rename to src/test/compile-fail/issue-32829.rs index 255a367e58b45..9ac70882ca28c 100644 --- a/src/libcore/build.rs +++ b/src/test/compile-fail/issue-32829.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![deny(warnings)] +// error-pattern: calls in statics are limited + +static S : u64 = { { panic!("foo"); 0 } }; fn main() { - // Remove this whenever snapshots and rustbuild nightlies are synced. - println!("cargo:rustc-cfg=cargobuild"); - println!("cargo:rerun-if-changed=build.rs") + println!("{:?}", S); } diff --git a/src/test/run-pass/issue-23598.rs b/src/test/run-pass/issue-23958.rs similarity index 100% rename from src/test/run-pass/issue-23598.rs rename to src/test/run-pass/issue-23958.rs