Skip to content

Commit 58cc626

Browse files
committed
Auto merge of #52481 - Mark-Simulacrum:stable-next, r=alexcrichton
1.27.2 stable release This is essentially a backport of #52232. I've set the release date for Friday, July 20th. r? @alexcrichton
2 parents 5f2b325 + 9ea66dc commit 58cc626

File tree

5 files changed

+43
-5
lines changed

5 files changed

+43
-5
lines changed

RELEASES.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version 1.27.2 (2018-07-20)
2+
===========================
3+
4+
Compatibility Notes
5+
-------------------
6+
7+
- The borrow checker was fixed to avoid potential unsoundness when using
8+
match ergonomics: [#52213][52213].
9+
10+
[52213]: https://github.com/rust-lang/rust/issues/52213
11+
112
Version 1.27.1 (2018-07-10)
213
===========================
314

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use Build;
2424
use config::Config;
2525

2626
// The version number
27-
pub const CFG_RELEASE_NUM: &str = "1.27.1";
27+
pub const CFG_RELEASE_NUM: &str = "1.27.2";
2828

2929
pub struct GitInfo {
3030
inner: Option<Info>,

src/librustc/middle/mem_categorization.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
13251325
ref ty => span_bug!(pat.span, "tuple pattern unexpected type {:?}", ty),
13261326
};
13271327
for (i, subpat) in subpats.iter().enumerate_and_adjust(expected_len, ddpos) {
1328-
let subpat_ty = self.pat_ty_unadjusted(&subpat)?; // see (*2)
1328+
let subpat_ty = self.pat_ty_adjusted(&subpat)?; // see (*2)
13291329
let interior = InteriorField(FieldIndex(i, Name::intern(&i.to_string())));
13301330
let subcmt = Rc::new(self.cat_imm_interior(pat, cmt.clone(), subpat_ty, interior));
13311331
self.cat_pattern_(subcmt, &subpat, op)?;

src/librustc_typeck/check/regionck.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ use rustc::hir::{self, PatKind};
105105

106106
// a variation on try that just returns unit
107107
macro_rules! ignore_err {
108-
($e:expr) => (match $e { Ok(e) => e, Err(_) => return () })
108+
($e:expr) => (match $e { Ok(e) => e, Err(_) => {
109+
debug!("ignoring mem-categorization error!");
110+
return ()
111+
}})
109112
}
110113

111114
///////////////////////////////////////////////////////////////////////////
@@ -1036,7 +1039,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
10361039
debug!("link_pattern(discr_cmt={:?}, root_pat={:?})",
10371040
discr_cmt,
10381041
root_pat);
1039-
let _ = self.with_mc(|mc| {
1042+
ignore_err!(self.with_mc(|mc| {
10401043
mc.cat_pattern(discr_cmt, root_pat, |sub_cmt, sub_pat| {
10411044
match sub_pat.node {
10421045
// `ref x` pattern
@@ -1051,7 +1054,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
10511054
_ => {}
10521055
}
10531056
})
1054-
});
1057+
}));
10551058
}
10561059

10571060
/// Link lifetime of borrowed pointer resulting from autoref to lifetimes in the value being

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

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
12+
match (&t,) { //~ ERROR cannot infer an appropriate lifetime
13+
((u,),) => u,
14+
}
15+
}
16+
17+
fn main() {
18+
let x = {
19+
let y = Box::new((42,));
20+
transmute_lifetime(&y)
21+
};
22+
23+
println!("{}", x);
24+
}

0 commit comments

Comments
 (0)