From 361cf445b3fc87a5e81b54b3350e8a77026b6214 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 31 Mar 2017 11:04:25 -0700 Subject: [PATCH 1/5] travis: Compile OSX releases with Xcode 7 Unfortunately what we're using right now, Xcode 8.2, cannot compile LLVM for OSX 10.7. We've done this historically and Gecko would like to maintain this compabitiliby. This commit moves our release builders for OSX to using Xcode 7 which can compile LLVM for 10.7. The builders running tests continue to use Xcode 8.2, however, because the LLDB version with Xcode 7, 350, is blacklisted in running our LLDB tests. To continue running LLDB tests we'll stick with Xcode 8.2. --- .travis.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba70497ba3fd9..0fcec25c7e8f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,10 @@ matrix: - env: IMAGE=x86_64-gnu-distcheck - env: IMAGE=x86_64-gnu-incremental - # OSX builders + # OSX builders running tests, these run the full test suite. + # + # Note that the compiler is compiled to target 10.8 here because the Xcode + # version that we're using, 8.2, cannot compile LLVM for OSX 10.7. - env: > RUST_CHECK_TARGET=check RUST_CONFIGURE_ARGS=--build=x86_64-apple-darwin @@ -68,6 +71,12 @@ matrix: osx_image: xcode8.2 install: *osx_install_sccache + # OSX builders producing releases. These do not run the full test suite and + # just produce a bunch of artifacts. + # + # Note that these are running in the `xcode7` image instead of the + # `xcode8.2` image as above. That's because we want to build releases for + # OSX 10.7 and `xcode7` is the latest Xcode able to compile LLVM for 10.7. - env: > RUST_CHECK_TARGET=dist RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --enable-extended" @@ -76,10 +85,9 @@ matrix: RUSTC_RETRY_LINKER_ON_SEGFAULT=1 SCCACHE_ERROR_LOG=/tmp/sccache.log RUST_LOG=sccache=debug - MACOSX_DEPLOYMENT_TARGET=10.8 - MACOSX_STD_DEPLOYMENT_TARGET=10.7 + MACOSX_DEPLOYMENT_TARGET=10.7 os: osx - osx_image: xcode8.2 + osx_image: xcode7 install: > travis_retry curl -o /usr/local/bin/sccache https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-25-sccache-x86_64-apple-darwin && chmod +x /usr/local/bin/sccache @@ -91,10 +99,9 @@ matrix: RUSTC_RETRY_LINKER_ON_SEGFAULT=1 SCCACHE_ERROR_LOG=/tmp/sccache.log RUST_LOG=sccache=debug - MACOSX_DEPLOYMENT_TARGET=10.8 - MACOSX_STD_DEPLOYMENT_TARGET=10.7 + MACOSX_DEPLOYMENT_TARGET=10.7 os: osx - osx_image: xcode8.2 + osx_image: xcode7 install: *osx_install_sccache # "alternate" deployments, these are "nightlies" but don't have assertions @@ -110,10 +117,9 @@ matrix: RUSTC_RETRY_LINKER_ON_SEGFAULT=1 SCCACHE_ERROR_LOG=/tmp/sccache.log RUST_LOG=sccache=debug - MACOSX_DEPLOYMENT_TARGET=10.8 - MACOSX_STD_DEPLOYMENT_TARGET=10.7 + MACOSX_DEPLOYMENT_TARGET=10.7 os: osx - osx_image: xcode8.2 + osx_image: xcode7 install: *osx_install_sccache env: From 04f0c80d361166c8a55509122545c4bd8c39f7ff Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Sun, 26 Mar 2017 14:15:47 +0300 Subject: [PATCH 2/5] store a copy of the Issue32230 info within TypeError The data can't be looked up from the region variable directly, because the region variable might have been destroyed at the end of a snapshot. Fixes #40000. Fixes #40743. --- src/librustc/infer/error_reporting/mod.rs | 42 ++++++++++------------- src/librustc/infer/higher_ranked/mod.rs | 18 ++++++++-- src/librustc/ty/error.rs | 14 ++++---- src/librustc/ty/structural_impls.rs | 10 +++--- src/test/compile-fail/issue-40000.rs | 21 ++++++++++++ 5 files changed, 69 insertions(+), 36 deletions(-) create mode 100644 src/test/compile-fail/issue-40000.rs diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index 21139c8dde2a4..9fa2bc8a2a7a9 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -426,30 +426,26 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { { debug!("note_issue_32330: terr={:?}", terr); match *terr { - TypeError::RegionsInsufficientlyPolymorphic(_, &Region::ReVar(vid)) | - TypeError::RegionsOverlyPolymorphic(_, &Region::ReVar(vid)) => { - match self.region_vars.var_origin(vid) { - RegionVariableOrigin::EarlyBoundRegion(_, _, Some(Issue32330 { - fn_def_id, - region_name - })) => { - diag.note( - &format!("lifetime parameter `{0}` declared on fn `{1}` \ - appears only in the return type, \ - but here is required to be higher-ranked, \ - which means that `{0}` must appear in both \ - argument and return types", - region_name, - self.tcx.item_path_str(fn_def_id))); - diag.note( - &format!("this error is the result of a recent bug fix; \ - for more information, see issue #33685 \ - ")); - } - _ => { } - } + TypeError::RegionsInsufficientlyPolymorphic(_, _, Some(box Issue32330 { + fn_def_id, region_name + })) | + TypeError::RegionsOverlyPolymorphic(_, _, Some(box Issue32330 { + fn_def_id, region_name + })) => { + diag.note( + &format!("lifetime parameter `{0}` declared on fn `{1}` \ + appears only in the return type, \ + but here is required to be higher-ranked, \ + which means that `{0}` must appear in both \ + argument and return types", + region_name, + self.tcx.item_path_str(fn_def_id))); + diag.note( + &format!("this error is the result of a recent bug fix; \ + for more information, see issue #33685 \ + ")); } - _ => { } + _ => {} } } diff --git a/src/librustc/infer/higher_ranked/mod.rs b/src/librustc/infer/higher_ranked/mod.rs index e919f025409c5..e3ffc99c0e967 100644 --- a/src/librustc/infer/higher_ranked/mod.rs +++ b/src/librustc/infer/higher_ranked/mod.rs @@ -15,6 +15,7 @@ use super::{CombinedSnapshot, InferCtxt, LateBoundRegion, HigherRankedType, + RegionVariableOrigin, SubregionOrigin, SkolemizationMap}; use super::combine::CombineFields; @@ -656,14 +657,27 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { skol_br, tainted_region); + let issue_32330 = if let &ty::ReVar(vid) = tainted_region { + match self.region_vars.var_origin(vid) { + RegionVariableOrigin::EarlyBoundRegion(_, _, issue_32330) => { + issue_32330.map(Box::new) + } + _ => None + } + } else { + None + }; + if overly_polymorphic { debug!("Overly polymorphic!"); return Err(TypeError::RegionsOverlyPolymorphic(skol_br, - tainted_region)); + tainted_region, + issue_32330)); } else { debug!("Not as polymorphic!"); return Err(TypeError::RegionsInsufficientlyPolymorphic(skol_br, - tainted_region)); + tainted_region, + issue_32330)); } } } diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 44a3aabc0560a..529aafebefd40 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -39,8 +39,8 @@ pub enum TypeError<'tcx> { RegionsDoesNotOutlive(&'tcx Region, &'tcx Region), RegionsNotSame(&'tcx Region, &'tcx Region), RegionsNoOverlap(&'tcx Region, &'tcx Region), - RegionsInsufficientlyPolymorphic(BoundRegion, &'tcx Region), - RegionsOverlyPolymorphic(BoundRegion, &'tcx Region), + RegionsInsufficientlyPolymorphic(BoundRegion, &'tcx Region, Option>), + RegionsOverlyPolymorphic(BoundRegion, &'tcx Region, Option>), Sorts(ExpectedFound>), IntMismatch(ExpectedFound), FloatMismatch(ExpectedFound), @@ -116,11 +116,11 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { RegionsNoOverlap(..) => { write!(f, "lifetimes do not intersect") } - RegionsInsufficientlyPolymorphic(br, _) => { + RegionsInsufficientlyPolymorphic(br, _, _) => { write!(f, "expected bound lifetime parameter {}, \ found concrete lifetime", br) } - RegionsOverlyPolymorphic(br, _) => { + RegionsOverlyPolymorphic(br, _, _) => { write!(f, "expected concrete lifetime, \ found bound lifetime parameter {}", br) } @@ -253,15 +253,15 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { self.note_and_explain_region(db, "...does not overlap ", region2, ""); } - RegionsInsufficientlyPolymorphic(_, conc_region) => { + RegionsInsufficientlyPolymorphic(_, conc_region, _) => { self.note_and_explain_region(db, "concrete lifetime that was found is ", conc_region, ""); } - RegionsOverlyPolymorphic(_, &ty::ReVar(_)) => { + RegionsOverlyPolymorphic(_, &ty::ReVar(_), _) => { // don't bother to print out the message below for // inference variables, it's not very illuminating. } - RegionsOverlyPolymorphic(_, conc_region) => { + RegionsOverlyPolymorphic(_, conc_region, _) => { self.note_and_explain_region(db, "expected concrete lifetime is ", conc_region, ""); } diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index 49824e8a738d7..9126600e3f653 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -293,11 +293,13 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> { RegionsNoOverlap(a, b) => { return tcx.lift(&(a, b)).map(|(a, b)| RegionsNoOverlap(a, b)) } - RegionsInsufficientlyPolymorphic(a, b) => { - return tcx.lift(&b).map(|b| RegionsInsufficientlyPolymorphic(a, b)) + RegionsInsufficientlyPolymorphic(a, b, ref c) => { + let c = c.clone(); + return tcx.lift(&b).map(|b| RegionsInsufficientlyPolymorphic(a, b, c)) } - RegionsOverlyPolymorphic(a, b) => { - return tcx.lift(&b).map(|b| RegionsOverlyPolymorphic(a, b)) + RegionsOverlyPolymorphic(a, b, ref c) => { + let c = c.clone(); + return tcx.lift(&b).map(|b| RegionsOverlyPolymorphic(a, b, c)) } IntMismatch(x) => IntMismatch(x), FloatMismatch(x) => FloatMismatch(x), diff --git a/src/test/compile-fail/issue-40000.rs b/src/test/compile-fail/issue-40000.rs new file mode 100644 index 0000000000000..9be114ebcb6e0 --- /dev/null +++ b/src/test/compile-fail/issue-40000.rs @@ -0,0 +1,21 @@ +// Copyright 2017 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. + +#![feature(closure_to_fn_coercion)] + +fn main() { + let bar: fn(&mut u32) = |_| {}; //~ ERROR mismatched types + //~| expected concrete lifetime, found bound lifetime parameter + + fn foo(x: Box) {} + let bar = Box::new(|x: &i32| {}) as Box; + foo(bar); //~ ERROR mismatched types + //~| expected concrete lifetime, found bound lifetime parameter +} From 66979c798ee1b77f94665f2313cf5c785f7fa2e9 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Fri, 24 Mar 2017 00:52:46 +0200 Subject: [PATCH 3/5] update LLVM with fix for PR32379 Fixes #40593. --- src/llvm | 2 +- src/rustllvm/llvm-rebuild-trigger | 4 ++++ src/test/run-pass/auxiliary/llvm_pr32379.rs | 15 ++++++++++++++ src/test/run-pass/llvm-pr32379.rs | 23 +++++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/test/run-pass/auxiliary/llvm_pr32379.rs create mode 100644 src/test/run-pass/llvm-pr32379.rs diff --git a/src/llvm b/src/llvm index 859fb26936462..2e951c3ae354b 160000 --- a/src/llvm +++ b/src/llvm @@ -1 +1 @@ -Subproject commit 859fb269364623b17e092efaba3f94e70ce97c5e +Subproject commit 2e951c3ae354bcbd2e50b30798e232949a926b75 diff --git a/src/rustllvm/llvm-rebuild-trigger b/src/rustllvm/llvm-rebuild-trigger index aeabf4a1dd376..6666fdf7aff9b 100644 --- a/src/rustllvm/llvm-rebuild-trigger +++ b/src/rustllvm/llvm-rebuild-trigger @@ -1,4 +1,8 @@ # If this file is modified, then llvm will be (optionally) cleaned and then rebuilt. # The actual contents of this file do not matter, but to trigger a change on the # build bots then the contents should be changed so git updates the mtime. +<<<<<<< HEAD 2017-03-04 +======= +2017-03-23 +>>>>>>> bd52ff1... update LLVM with fix for PR32379 diff --git a/src/test/run-pass/auxiliary/llvm_pr32379.rs b/src/test/run-pass/auxiliary/llvm_pr32379.rs new file mode 100644 index 0000000000000..a7b15bda33627 --- /dev/null +++ b/src/test/run-pass/auxiliary/llvm_pr32379.rs @@ -0,0 +1,15 @@ +// Copyright 2017 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. + +pub fn pr32379(mut data: u64, f1: bool, f2: bool) -> u64 { + if f1 { data &= !2; } + if f2 { data |= 2; } + data +} diff --git a/src/test/run-pass/llvm-pr32379.rs b/src/test/run-pass/llvm-pr32379.rs new file mode 100644 index 0000000000000..5625e81c0e63c --- /dev/null +++ b/src/test/run-pass/llvm-pr32379.rs @@ -0,0 +1,23 @@ +// Copyright 2017 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. + +// aux-build:llvm_pr32379.rs + +// LLVM PR #32379 (https://bugs.llvm.org/show_bug.cgi?id=32379), which +// applies to upstream LLVM 3.9.1, is known to cause rustc itself to be +// miscompiled on ARM (Rust issue #40593). Because cross builds don't test +// our *compiler* on ARM, have a test for the miscompilation directly. + +extern crate llvm_pr32379; + +pub fn main() { + let val = llvm_pr32379::pr32379(2, false, false); + assert_eq!(val, 2); +} From 89f645efe8167dd2843f23c60c68e65204a9f54a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 1 Apr 2017 06:44:07 -0700 Subject: [PATCH 4/5] Update cargo for rustc 1.17.0 --- cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cargo b/cargo index 4a3c0a63b07e9..d8d0940a97a83 160000 --- a/cargo +++ b/cargo @@ -1 +1 @@ -Subproject commit 4a3c0a63b07e9a4feb41cb11de37c92a09db5a60 +Subproject commit d8d0940a97a83ed2e4eb340cafea4ed7f601f158 From 4371f21a3cbf601ca631d0890e67116907a17606 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Thu, 23 Mar 2017 23:05:30 -0400 Subject: [PATCH 5/5] Make the rustdoc sidebar white on `src` pages Fixes #40724 --- src/librustdoc/html/layout.rs | 4 ++-- src/librustdoc/html/static/rustdoc.css | 6 +++--- src/librustdoc/html/static/styles/main.css | 6 +++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 06a816412969b..d6033a69da786 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -54,7 +54,7 @@ r##" {favicon} {in_header} - +