Skip to content

Commit b37cc75

Browse files
committed
Auto merge of #40995 - alexcrichton:beta-next, r=alexcrichton
Backport PRs to beta Backport of * #40967 * #40836 * #40779 * #40888 Also includes a cargo submodule update
2 parents bf403d0 + 4371f21 commit b37cc75

File tree

14 files changed

+139
-54
lines changed

14 files changed

+139
-54
lines changed

.travis.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ matrix:
4040
- env: IMAGE=x86_64-gnu-distcheck
4141
- env: IMAGE=x86_64-gnu-incremental
4242

43-
# OSX builders
43+
# OSX builders running tests, these run the full test suite.
44+
#
45+
# Note that the compiler is compiled to target 10.8 here because the Xcode
46+
# version that we're using, 8.2, cannot compile LLVM for OSX 10.7.
4447
- env: >
4548
RUST_CHECK_TARGET=check
4649
RUST_CONFIGURE_ARGS=--build=x86_64-apple-darwin
@@ -68,6 +71,12 @@ matrix:
6871
osx_image: xcode8.2
6972
install: *osx_install_sccache
7073
74+
# OSX builders producing releases. These do not run the full test suite and
75+
# just produce a bunch of artifacts.
76+
#
77+
# Note that these are running in the `xcode7` image instead of the
78+
# `xcode8.2` image as above. That's because we want to build releases for
79+
# OSX 10.7 and `xcode7` is the latest Xcode able to compile LLVM for 10.7.
7180
- env: >
7281
RUST_CHECK_TARGET=dist
7382
RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --enable-extended"
@@ -76,10 +85,9 @@ matrix:
7685
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
7786
SCCACHE_ERROR_LOG=/tmp/sccache.log
7887
RUST_LOG=sccache=debug
79-
MACOSX_DEPLOYMENT_TARGET=10.8
80-
MACOSX_STD_DEPLOYMENT_TARGET=10.7
88+
MACOSX_DEPLOYMENT_TARGET=10.7
8189
os: osx
82-
osx_image: xcode8.2
90+
osx_image: xcode7
8391
install: >
8492
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 &&
8593
chmod +x /usr/local/bin/sccache
@@ -91,10 +99,9 @@ matrix:
9199
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
92100
SCCACHE_ERROR_LOG=/tmp/sccache.log
93101
RUST_LOG=sccache=debug
94-
MACOSX_DEPLOYMENT_TARGET=10.8
95-
MACOSX_STD_DEPLOYMENT_TARGET=10.7
102+
MACOSX_DEPLOYMENT_TARGET=10.7
96103
os: osx
97-
osx_image: xcode8.2
104+
osx_image: xcode7
98105
install: *osx_install_sccache
99106
100107
# "alternate" deployments, these are "nightlies" but don't have assertions
@@ -110,10 +117,9 @@ matrix:
110117
RUSTC_RETRY_LINKER_ON_SEGFAULT=1
111118
SCCACHE_ERROR_LOG=/tmp/sccache.log
112119
RUST_LOG=sccache=debug
113-
MACOSX_DEPLOYMENT_TARGET=10.8
114-
MACOSX_STD_DEPLOYMENT_TARGET=10.7
120+
MACOSX_DEPLOYMENT_TARGET=10.7
115121
os: osx
116-
osx_image: xcode8.2
122+
osx_image: xcode7
117123
install: *osx_install_sccache
118124
119125
env:

cargo

src/librustc/infer/error_reporting/mod.rs

+19-23
Original file line numberDiff line numberDiff line change
@@ -426,30 +426,26 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
426426
{
427427
debug!("note_issue_32330: terr={:?}", terr);
428428
match *terr {
429-
TypeError::RegionsInsufficientlyPolymorphic(_, &Region::ReVar(vid)) |
430-
TypeError::RegionsOverlyPolymorphic(_, &Region::ReVar(vid)) => {
431-
match self.region_vars.var_origin(vid) {
432-
RegionVariableOrigin::EarlyBoundRegion(_, _, Some(Issue32330 {
433-
fn_def_id,
434-
region_name
435-
})) => {
436-
diag.note(
437-
&format!("lifetime parameter `{0}` declared on fn `{1}` \
438-
appears only in the return type, \
439-
but here is required to be higher-ranked, \
440-
which means that `{0}` must appear in both \
441-
argument and return types",
442-
region_name,
443-
self.tcx.item_path_str(fn_def_id)));
444-
diag.note(
445-
&format!("this error is the result of a recent bug fix; \
446-
for more information, see issue #33685 \
447-
<https://github.com/rust-lang/rust/issues/33685>"));
448-
}
449-
_ => { }
450-
}
429+
TypeError::RegionsInsufficientlyPolymorphic(_, _, Some(box Issue32330 {
430+
fn_def_id, region_name
431+
})) |
432+
TypeError::RegionsOverlyPolymorphic(_, _, Some(box Issue32330 {
433+
fn_def_id, region_name
434+
})) => {
435+
diag.note(
436+
&format!("lifetime parameter `{0}` declared on fn `{1}` \
437+
appears only in the return type, \
438+
but here is required to be higher-ranked, \
439+
which means that `{0}` must appear in both \
440+
argument and return types",
441+
region_name,
442+
self.tcx.item_path_str(fn_def_id)));
443+
diag.note(
444+
&format!("this error is the result of a recent bug fix; \
445+
for more information, see issue #33685 \
446+
<https://github.com/rust-lang/rust/issues/33685>"));
451447
}
452-
_ => { }
448+
_ => {}
453449
}
454450
}
455451

src/librustc/infer/higher_ranked/mod.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use super::{CombinedSnapshot,
1515
InferCtxt,
1616
LateBoundRegion,
1717
HigherRankedType,
18+
RegionVariableOrigin,
1819
SubregionOrigin,
1920
SkolemizationMap};
2021
use super::combine::CombineFields;
@@ -656,14 +657,27 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
656657
skol_br,
657658
tainted_region);
658659

660+
let issue_32330 = if let &ty::ReVar(vid) = tainted_region {
661+
match self.region_vars.var_origin(vid) {
662+
RegionVariableOrigin::EarlyBoundRegion(_, _, issue_32330) => {
663+
issue_32330.map(Box::new)
664+
}
665+
_ => None
666+
}
667+
} else {
668+
None
669+
};
670+
659671
if overly_polymorphic {
660672
debug!("Overly polymorphic!");
661673
return Err(TypeError::RegionsOverlyPolymorphic(skol_br,
662-
tainted_region));
674+
tainted_region,
675+
issue_32330));
663676
} else {
664677
debug!("Not as polymorphic!");
665678
return Err(TypeError::RegionsInsufficientlyPolymorphic(skol_br,
666-
tainted_region));
679+
tainted_region,
680+
issue_32330));
667681
}
668682
}
669683
}

src/librustc/ty/error.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ pub enum TypeError<'tcx> {
3939
RegionsDoesNotOutlive(&'tcx Region, &'tcx Region),
4040
RegionsNotSame(&'tcx Region, &'tcx Region),
4141
RegionsNoOverlap(&'tcx Region, &'tcx Region),
42-
RegionsInsufficientlyPolymorphic(BoundRegion, &'tcx Region),
43-
RegionsOverlyPolymorphic(BoundRegion, &'tcx Region),
42+
RegionsInsufficientlyPolymorphic(BoundRegion, &'tcx Region, Option<Box<ty::Issue32330>>),
43+
RegionsOverlyPolymorphic(BoundRegion, &'tcx Region, Option<Box<ty::Issue32330>>),
4444
Sorts(ExpectedFound<Ty<'tcx>>),
4545
IntMismatch(ExpectedFound<ty::IntVarValue>),
4646
FloatMismatch(ExpectedFound<ast::FloatTy>),
@@ -116,11 +116,11 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
116116
RegionsNoOverlap(..) => {
117117
write!(f, "lifetimes do not intersect")
118118
}
119-
RegionsInsufficientlyPolymorphic(br, _) => {
119+
RegionsInsufficientlyPolymorphic(br, _, _) => {
120120
write!(f, "expected bound lifetime parameter {}, \
121121
found concrete lifetime", br)
122122
}
123-
RegionsOverlyPolymorphic(br, _) => {
123+
RegionsOverlyPolymorphic(br, _, _) => {
124124
write!(f, "expected concrete lifetime, \
125125
found bound lifetime parameter {}", br)
126126
}
@@ -253,15 +253,15 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
253253
self.note_and_explain_region(db, "...does not overlap ",
254254
region2, "");
255255
}
256-
RegionsInsufficientlyPolymorphic(_, conc_region) => {
256+
RegionsInsufficientlyPolymorphic(_, conc_region, _) => {
257257
self.note_and_explain_region(db, "concrete lifetime that was found is ",
258258
conc_region, "");
259259
}
260-
RegionsOverlyPolymorphic(_, &ty::ReVar(_)) => {
260+
RegionsOverlyPolymorphic(_, &ty::ReVar(_), _) => {
261261
// don't bother to print out the message below for
262262
// inference variables, it's not very illuminating.
263263
}
264-
RegionsOverlyPolymorphic(_, conc_region) => {
264+
RegionsOverlyPolymorphic(_, conc_region, _) => {
265265
self.note_and_explain_region(db, "expected concrete lifetime is ",
266266
conc_region, "");
267267
}

src/librustc/ty/structural_impls.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,13 @@ impl<'a, 'tcx> Lift<'tcx> for ty::error::TypeError<'a> {
293293
RegionsNoOverlap(a, b) => {
294294
return tcx.lift(&(a, b)).map(|(a, b)| RegionsNoOverlap(a, b))
295295
}
296-
RegionsInsufficientlyPolymorphic(a, b) => {
297-
return tcx.lift(&b).map(|b| RegionsInsufficientlyPolymorphic(a, b))
296+
RegionsInsufficientlyPolymorphic(a, b, ref c) => {
297+
let c = c.clone();
298+
return tcx.lift(&b).map(|b| RegionsInsufficientlyPolymorphic(a, b, c))
298299
}
299-
RegionsOverlyPolymorphic(a, b) => {
300-
return tcx.lift(&b).map(|b| RegionsOverlyPolymorphic(a, b))
300+
RegionsOverlyPolymorphic(a, b, ref c) => {
301+
let c = c.clone();
302+
return tcx.lift(&b).map(|b| RegionsOverlyPolymorphic(a, b, c))
301303
}
302304
IntMismatch(x) => IntMismatch(x),
303305
FloatMismatch(x) => FloatMismatch(x),

src/librustdoc/html/layout.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ r##"<!DOCTYPE html>
5454
{favicon}
5555
{in_header}
5656
</head>
57-
<body class="rustdoc">
57+
<body class="rustdoc {css_class}">
5858
<!--[if lte IE 8]>
5959
<div class="warning">
6060
This old browser is unsupported and will most likely display funky
@@ -80,7 +80,7 @@ r##"<!DOCTYPE html>
8080
</form>
8181
</nav>
8282
83-
<section id='main' class="content {css_class}">{content}</section>
83+
<section id='main' class="content">{content}</section>
8484
<section id='search' class="content hidden"></section>
8585
8686
<section class="footer"></section>

src/librustdoc/html/static/rustdoc.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ pre {
141141
padding: 14px;
142142
}
143143

144-
.source pre {
144+
.source .content pre {
145145
padding: 20px;
146146
}
147147

148148
img {
149149
max-width: 100%;
150150
}
151151

152-
.content.source {
152+
.source .content {
153153
margin-top: 50px;
154154
max-width: none;
155155
overflow: visible;
@@ -231,7 +231,7 @@ nav.sub {
231231
padding: 15px 0;
232232
}
233233

234-
.content.source pre.rust {
234+
.source .content pre.rust {
235235
white-space: pre;
236236
overflow: auto;
237237
padding-left: 0;

src/librustdoc/html/static/styles/main.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ pre {
5353
background-color: #fff;
5454
}
5555

56+
.source .sidebar {
57+
background-color: #fff;
58+
}
59+
5660
.sidebar .location {
5761
border-color: #000;
5862
background-color: #fff;
@@ -187,4 +191,4 @@ a.test-arrow:hover{
187191

188192
:target > code {
189193
background: #FDFFD3;
190-
}
194+
}

src/rustllvm/llvm-rebuild-trigger

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4+
<<<<<<< HEAD
45
2017-03-04
6+
=======
7+
2017-03-23
8+
>>>>>>> bd52ff1... update LLVM with fix for PR32379

src/test/compile-fail/issue-40000.rs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![feature(closure_to_fn_coercion)]
12+
13+
fn main() {
14+
let bar: fn(&mut u32) = |_| {}; //~ ERROR mismatched types
15+
//~| expected concrete lifetime, found bound lifetime parameter
16+
17+
fn foo(x: Box<Fn(&i32)>) {}
18+
let bar = Box::new(|x: &i32| {}) as Box<Fn(_)>;
19+
foo(bar); //~ ERROR mismatched types
20+
//~| expected concrete lifetime, found bound lifetime parameter
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn pr32379(mut data: u64, f1: bool, f2: bool) -> u64 {
12+
if f1 { data &= !2; }
13+
if f2 { data |= 2; }
14+
data
15+
}

src/test/run-pass/llvm-pr32379.rs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:llvm_pr32379.rs
12+
13+
// LLVM PR #32379 (https://bugs.llvm.org/show_bug.cgi?id=32379), which
14+
// applies to upstream LLVM 3.9.1, is known to cause rustc itself to be
15+
// miscompiled on ARM (Rust issue #40593). Because cross builds don't test
16+
// our *compiler* on ARM, have a test for the miscompilation directly.
17+
18+
extern crate llvm_pr32379;
19+
20+
pub fn main() {
21+
let val = llvm_pr32379::pr32379(2, false, false);
22+
assert_eq!(val, 2);
23+
}

0 commit comments

Comments
 (0)