From c588de34ac46e885d68e16413456819bfa69ab50 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 2 Feb 2017 19:24:20 -0800 Subject: [PATCH 1/9] rustbuild: Add x.py to source tarballs We should be sure to add our build system entry point! Closes #39476 --- src/bootstrap/dist.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 370d567258aac..9878d1c08bac1 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -381,7 +381,8 @@ pub fn rust_src(build: &Build) { "README.md", "RELEASES.md", "configure", - "Makefile.in" + "Makefile.in", + "x.py", ]; let src_dirs = [ "man", From 9661ce3ea9ef5c1da779f79a59c2c8e6dd86d766 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 4 Feb 2017 01:18:10 +0300 Subject: [PATCH 2/9] libbacktrace: Fix uninitialized variable --- src/libbacktrace/pecoff.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libbacktrace/pecoff.c b/src/libbacktrace/pecoff.c index 04e0bafb14981..2d6a9877219dc 100644 --- a/src/libbacktrace/pecoff.c +++ b/src/libbacktrace/pecoff.c @@ -607,7 +607,9 @@ coff_add (struct backtrace_state *state, int descriptor, // against the upstream libbacktrace, that's what's going on. uint32_t str_size; off_t str_off; - struct backtrace_view syms_view; + // NOTE: upstream doesn't have `{0}`, this is a fix for Rust issue #39468. + // If syms_view is not initialized, then `free(syms_view.base)` may segfault later. + struct backtrace_view syms_view = {0}; off_t syms_off; size_t syms_size; int syms_view_valid; From c354ba169ca2d1d884d8c7553729fef66e7564f1 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 4 Feb 2017 01:12:38 +0000 Subject: [PATCH 3/9] Update relnotes for 1.15.1 I already checked this into stable, but it needs to be on master/beta too. --- RELEASES.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RELEASES.md b/RELEASES.md index 99d6b7709ede9..f26c0b6b61161 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,11 @@ +Version 1.15.1 (2017-02-07) +=========================== + +* [Fix IntoIter::as_mut_slice's signature][39466] + +[39466]: https://github.com/rust-lang/rust/pull/39466 + + Version 1.15.0 (2017-02-02) =========================== From 8ee6855000225f6c358c89d3c120b9d8136b8e0a Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Sat, 4 Feb 2017 16:27:45 +0800 Subject: [PATCH 4/9] Uninhabited while-let pattern fix --- src/librustc_const_eval/check_match.rs | 19 +++++++++++++++---- src/librustc_const_eval/lib.rs | 1 + src/test/compile-fail/uninhabited-patterns.rs | 8 ++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index 0b1f2465a4d59..ce478f1a4504e 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::ptr; use _match::{MatchCheckCtxt, Matrix, expand_pattern, is_useful}; use _match::Usefulness::*; use _match::WitnessPreference::*; @@ -302,10 +303,20 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>, let &(ref first_arm_pats, _) = &arms[0]; let first_pat = &first_arm_pats[0]; let span = first_pat.0.span; - struct_span_err!(cx.tcx.sess, span, E0165, - "irrefutable while-let pattern") - .span_label(span, &format!("irrefutable pattern")) - .emit(); + + // check which arm we're on. + if ptr::eq(first_arm_pats, pats) { + let mut diagnostic = Diagnostic::new(Level::Warning, + "unreachable pattern"); + diagnostic.set_span(pat.span); + cx.tcx.sess.add_lint_diagnostic(lint::builtin::UNREACHABLE_PATTERNS, + hir_pat.id, diagnostic); + } else { + struct_span_err!(cx.tcx.sess, span, E0165, + "irrefutable while-let pattern") + .span_label(span, &format!("irrefutable pattern")) + .emit(); + } }, hir::MatchSource::ForLoopDesugar | diff --git a/src/librustc_const_eval/lib.rs b/src/librustc_const_eval/lib.rs index 2b6f487c2c942..5cd9d61580d45 100644 --- a/src/librustc_const_eval/lib.rs +++ b/src/librustc_const_eval/lib.rs @@ -29,6 +29,7 @@ #![feature(box_patterns)] #![feature(box_syntax)] #![feature(const_fn)] +#![feature(ptr_eq)] extern crate arena; #[macro_use] extern crate syntax; diff --git a/src/test/compile-fail/uninhabited-patterns.rs b/src/test/compile-fail/uninhabited-patterns.rs index 0de29f3a8d737..4c894b0bdd3dd 100644 --- a/src/test/compile-fail/uninhabited-patterns.rs +++ b/src/test/compile-fail/uninhabited-patterns.rs @@ -24,6 +24,10 @@ struct NotSoSecretlyEmpty { _priv: !, } +fn foo() -> Option { + None +} + fn main() { let x: &[!] = &[]; @@ -45,5 +49,9 @@ fn main() { Err(Err(_y)) => (), Err(Ok(_y)) => (), //~ ERROR unreachable pattern } + + while let Some(_y) = foo() { + //~^ ERROR unreachable pattern + } } From 9a7834ba61534fbd723b72259717aa1493c9b2d0 Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Sun, 5 Feb 2017 16:41:32 +0800 Subject: [PATCH 5/9] Remove use of ptr::eq --- src/librustc_const_eval/check_match.rs | 31 +++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index ce478f1a4504e..f53d451152fbc 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -8,7 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use std::ptr; use _match::{MatchCheckCtxt, Matrix, expand_pattern, is_useful}; use _match::Usefulness::*; use _match::WitnessPreference::*; @@ -274,7 +273,7 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>, let mut seen = Matrix::empty(); let mut catchall = None; let mut printed_if_let_err = false; - for &(ref pats, guard) in arms { + for (arm_index, &(ref pats, guard)) in arms.iter().enumerate() { for &(pat, hir_pat) in pats { let v = vec![pat]; @@ -305,17 +304,23 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>, let span = first_pat.0.span; // check which arm we're on. - if ptr::eq(first_arm_pats, pats) { - let mut diagnostic = Diagnostic::new(Level::Warning, - "unreachable pattern"); - diagnostic.set_span(pat.span); - cx.tcx.sess.add_lint_diagnostic(lint::builtin::UNREACHABLE_PATTERNS, - hir_pat.id, diagnostic); - } else { - struct_span_err!(cx.tcx.sess, span, E0165, - "irrefutable while-let pattern") - .span_label(span, &format!("irrefutable pattern")) - .emit(); + match arm_index { + // The arm with the user-specified pattern. + 0 => { + let mut diagnostic = Diagnostic::new(Level::Warning, + "unreachable pattern"); + diagnostic.set_span(pat.span); + cx.tcx.sess.add_lint_diagnostic(lint::builtin::UNREACHABLE_PATTERNS, + hir_pat.id, diagnostic); + }, + // The arm with the wildcard pattern. + 1 => { + struct_span_err!(cx.tcx.sess, span, E0165, + "irrefutable while-let pattern") + .span_label(span, &format!("irrefutable pattern")) + .emit(); + }, + _ => bug!(), } }, From c60e36f2015d061e4b2fc92ea40c640db0999cf8 Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Sun, 5 Feb 2017 22:29:06 +0800 Subject: [PATCH 6/9] Fix make tidy --- src/librustc_const_eval/check_match.rs | 5 +++-- src/librustc_const_eval/lib.rs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index f53d451152fbc..6f33b4fad769f 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -310,8 +310,9 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>, let mut diagnostic = Diagnostic::new(Level::Warning, "unreachable pattern"); diagnostic.set_span(pat.span); - cx.tcx.sess.add_lint_diagnostic(lint::builtin::UNREACHABLE_PATTERNS, - hir_pat.id, diagnostic); + cx.tcx.sess.add_lint_diagnostic( + lint::builtin::UNREACHABLE_PATTERNS, + hir_pat.id, diagnostic); }, // The arm with the wildcard pattern. 1 => { diff --git a/src/librustc_const_eval/lib.rs b/src/librustc_const_eval/lib.rs index 5cd9d61580d45..2b6f487c2c942 100644 --- a/src/librustc_const_eval/lib.rs +++ b/src/librustc_const_eval/lib.rs @@ -29,7 +29,6 @@ #![feature(box_patterns)] #![feature(box_syntax)] #![feature(const_fn)] -#![feature(ptr_eq)] extern crate arena; #[macro_use] extern crate syntax; From c5370a715ad192a31a78b959d3ba7bcac4cfbcdc Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 6 Feb 2017 13:33:03 -0800 Subject: [PATCH 7/9] Fix a manifest-generation bug on beta Right now all Cargo release tarballs are 'nightly', they're not on the standard channels yet. --- src/tools/build-manifest/src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 8c15a6630a33c..3eaac82d9fa85 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -317,6 +317,8 @@ impl Builder { fn filename(&self, component: &str, target: &str) -> String { if component == "rust-src" { format!("rust-src-{}.tar.gz", self.channel) + } else if component == "cargo" { + format!("cargo-nightly-{}.tar.gz", target) } else { format!("{}-{}-{}.tar.gz", component, self.channel, target) } From 6b3bf649e796f5a6cc14b7429f939cb5103f8719 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 7 Feb 2017 19:48:16 +0000 Subject: [PATCH 8/9] Bump stable release date --- RELEASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index f26c0b6b61161..2df1a83db81ff 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,4 +1,4 @@ -Version 1.15.1 (2017-02-07) +Version 1.15.1 (2017-02-08) =========================== * [Fix IntoIter::as_mut_slice's signature][39466] From a37685c39311c6270f64228aa043ac5988709690 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Fri, 10 Feb 2017 00:30:02 +0000 Subject: [PATCH 9/9] Update 1.15.1 relnotes --- RELEASES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASES.md b/RELEASES.md index 2df1a83db81ff..1de44ef7e6d05 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,9 +1,11 @@ -Version 1.15.1 (2017-02-08) +Version 1.15.1 (2017-02-09) =========================== * [Fix IntoIter::as_mut_slice's signature][39466] +* [Compile compiler builtins with `-fPIC` on 32-bit platforms][39523] [39466]: https://github.com/rust-lang/rust/pull/39466 +[39523]: https://github.com/rust-lang/rust/pull/39523 Version 1.15.0 (2017-02-02)