From d5c7ddc38f1e21ae77800a87e84a428dbb3f02a4 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 22 May 2016 08:28:42 +0200 Subject: [PATCH 01/11] Makefile.in: dont use unnecessary escapes in echo --- Makefile.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 From a2b7dfa3493b146936547b0f4ca44cc9cd57dd95 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Sun, 29 May 2016 17:50:08 -0700 Subject: [PATCH 02/11] add explanation for E0429 (`self` use declaration must use brace syntax) This is an item under #32777. --- src/librustc_resolve/diagnostics.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 3514862205289..177a85709e445 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1029,6 +1029,32 @@ struct Bar2; // ok! ``` "##, +E0429: r##" +To import a namespace itself in addition to some of its members, the `self` +keyword may appear in a brace-enclosed list as the last segment in a `use` +declaration. However, `self` cannot be used alone, without the brace +syntax. + +Example of erroneous code: + +```compile_fail +use std::fmt::self; // error: `self` imports are only allowed within a { } list +``` + +If you only want to import the namespace, do so directly: + +``` +use std::fmt; +``` + +If you also want to import members in the same statement, you may use the brace +syntax: + +``` +use std::fmt::{self, Debug}; +``` +"##, + E0430: r##" The `self` import appears more than once in the list. Erroneous code example: @@ -1235,5 +1261,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 } From 06ebda837e50634cd1a73d54ce36a6fdec9688c5 Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Mon, 30 May 2016 16:45:41 -0700 Subject: [PATCH 03/11] revise explanation for E0429 (focus on error first) --- src/librustc_resolve/diagnostics.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 177a85709e445..88eee54852ee4 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1030,10 +1030,8 @@ struct Bar2; // ok! "##, E0429: r##" -To import a namespace itself in addition to some of its members, the `self` -keyword may appear in a brace-enclosed list as the last segment in a `use` -declaration. However, `self` cannot be used alone, without the brace -syntax. +The `self` keyword cannot appear alone as the last segment in a `use` +declaration. Example of erroneous code: @@ -1041,17 +1039,17 @@ Example of erroneous code: use std::fmt::self; // error: `self` imports are only allowed within a { } list ``` -If you only want to import the namespace, do so directly: +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; +use std::fmt::{self, Debug}; ``` -If you also want to import members in the same statement, you may use the brace -syntax: +If you only want to import the namespace, do so directly: ``` -use std::fmt::{self, Debug}; +use std::fmt; ``` "##, From 0eacb9f8f937f6c45f8c5dc753251d4e7ff4f577 Mon Sep 17 00:00:00 2001 From: Jake Goulding Date: Thu, 2 Jun 2016 16:03:12 -0400 Subject: [PATCH 04/11] Correct issue number in test --- src/test/run-pass/{issue-23598.rs => issue-23958.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/test/run-pass/{issue-23598.rs => issue-23958.rs} (100%) 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 From f6a243d231910a42822d4a287f6183698474022a Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 2 Jun 2016 23:58:47 +0200 Subject: [PATCH 05/11] Add regression test for issue #32829 Closes #32829 --- src/test/compile-fail/issue-32829.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/compile-fail/issue-32829.rs diff --git a/src/test/compile-fail/issue-32829.rs b/src/test/compile-fail/issue-32829.rs new file mode 100644 index 0000000000000..9ac70882ca28c --- /dev/null +++ b/src/test/compile-fail/issue-32829.rs @@ -0,0 +1,17 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// error-pattern: calls in statics are limited + +static S : u64 = { { panic!("foo"); 0 } }; + +fn main() { + println!("{:?}", S); +} From 959c5f1a926c50b160f2e38701f6b33b6ddfaea0 Mon Sep 17 00:00:00 2001 From: Reeze Xia Date: Fri, 3 Jun 2016 17:48:49 +0800 Subject: [PATCH 06/11] Update comment The path has changed --- src/libcore/intrinsics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 //! From a7e96af37770c60dfca1ebda832bc414324e8067 Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Fri, 3 Jun 2016 20:53:46 +0900 Subject: [PATCH 07/11] Unsupport wget --- configure | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 From bce5383942744e4e5a588b2ee0ed04be3c81ead7 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 4 Jun 2016 14:19:46 -0700 Subject: [PATCH 08/11] No build.rs for libcore --- src/libcore/Cargo.toml | 1 - src/libcore/build.rs | 17 ----------------- 2 files changed, 18 deletions(-) delete mode 100644 src/libcore/build.rs 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/build.rs b/src/libcore/build.rs deleted file mode 100644 index 255a367e58b45..0000000000000 --- a/src/libcore/build.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![deny(warnings)] - -fn main() { - // Remove this whenever snapshots and rustbuild nightlies are synced. - println!("cargo:rustc-cfg=cargobuild"); - println!("cargo:rerun-if-changed=build.rs") -} From 55af6e48ca4f24284f7dd096b35e3364f5fa674f Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Sat, 4 Jun 2016 23:43:24 +0100 Subject: [PATCH 09/11] rustdoc: Fix a few missing colors in the CSS This adds color to some of the search results and sidebar items which were missing. --- src/librustdoc/html/static/rustdoc.css | 6 +++--- src/librustdoc/html/static/styles/main.css | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) 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, From 8a6a9af9821f7430b842848941eceb1b9ebe58ff Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Sun, 5 Jun 2016 12:19:37 +0530 Subject: [PATCH 10/11] run rustfmt on libtest folder --- src/libtest/stats.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 From f5c071ccfa51a995e6d18b843d706fe716e90ba1 Mon Sep 17 00:00:00 2001 From: Srinivas Reddy Thatiparthy Date: Sun, 5 Jun 2016 12:53:08 +0530 Subject: [PATCH 11/11] run rustfmt on librustc_unicode --- src/librustc_unicode/char.rs | 18 ++++++++++-------- src/librustc_unicode/lib.rs | 8 ++++---- src/librustc_unicode/u_str.rs | 4 +++- 3 files changed, 17 insertions(+), 13 deletions(-) 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]