Skip to content

Commit 71e56c7

Browse files
committed
---
yaml --- r: 180198 b: refs/heads/tmp c: fa73d1317ab548315678e0da6df18501829dbb64 h: refs/heads/master v: v3
1 parent ece6bb6 commit 71e56c7

File tree

4 files changed

+3
-25
lines changed

4 files changed

+3
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: a0fe12982b77a6fc6ec54b3260d4b9810c55a6c4
37+
refs/heads/tmp: fa73d1317ab548315678e0da6df18501829dbb64

branches/tmp/src/librustc/middle/infer/error_reporting.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,6 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
14351435
infer::MiscVariable(_) => "".to_string(),
14361436
infer::PatternRegion(_) => " for pattern".to_string(),
14371437
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
1438-
infer::AddrOfSlice(_) => " for slice expression".to_string(),
14391438
infer::Autoref(_) => " for autoref".to_string(),
14401439
infer::Coercion(_) => " for automatic coercion".to_string(),
14411440
infer::LateBoundRegion(_, br, infer::FnCall) => {

branches/tmp/src/librustc/middle/infer/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,6 @@ pub enum RegionVariableOrigin<'tcx> {
248248
// Regions created by `&` operator
249249
AddrOfRegion(Span),
250250

251-
// Regions created by `&[...]` literal
252-
AddrOfSlice(Span),
253-
254251
// Regions created as part of an autoref of a method receiver
255252
Autoref(Span),
256253

@@ -1274,7 +1271,6 @@ impl<'tcx> RegionVariableOrigin<'tcx> {
12741271
MiscVariable(a) => a,
12751272
PatternRegion(a) => a,
12761273
AddrOfRegion(a) => a,
1277-
AddrOfSlice(a) => a,
12781274
Autoref(a) => a,
12791275
Coercion(ref a) => a.span(),
12801276
EarlyBoundRegion(a, _) => a,
@@ -1297,7 +1293,6 @@ impl<'tcx> Repr<'tcx> for RegionVariableOrigin<'tcx> {
12971293
AddrOfRegion(a) => {
12981294
format!("AddrOfRegion({})", a.repr(tcx))
12991295
}
1300-
AddrOfSlice(a) => format!("AddrOfSlice({})", a.repr(tcx)),
13011296
Autoref(a) => format!("Autoref({})", a.repr(tcx)),
13021297
Coercion(ref a) => format!("Coercion({})", a.repr(tcx)),
13031298
EarlyBoundRegion(a, b) => {

branches/tmp/src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,24 +3583,8 @@ fn check_expr_with_unifier<'a, 'tcx, F>(fcx: &FnCtxt<'a, 'tcx>,
35833583
// Finally, borrowck is charged with guaranteeing that the
35843584
// value whose address was taken can actually be made to live
35853585
// as long as it needs to live.
3586-
match oprnd.node {
3587-
// String literals are already, implicitly converted to slices.
3588-
//ast::ExprLit(lit) if ast_util::lit_is_str(lit) => fcx.expr_ty(oprnd),
3589-
// Empty slices live in static memory.
3590-
ast::ExprVec(ref elements) if elements.len() == 0 => {
3591-
// Note: we do not assign a lifetime of
3592-
// static. This is because the resulting type
3593-
// `&'static [T]` would require that T outlives
3594-
// `'static`!
3595-
let region = fcx.infcx().next_region_var(
3596-
infer::AddrOfSlice(expr.span));
3597-
ty::mk_rptr(tcx, tcx.mk_region(region), tm)
3598-
}
3599-
_ => {
3600-
let region = fcx.infcx().next_region_var(infer::AddrOfRegion(expr.span));
3601-
ty::mk_rptr(tcx, tcx.mk_region(region), tm)
3602-
}
3603-
}
3586+
let region = fcx.infcx().next_region_var(infer::AddrOfRegion(expr.span));
3587+
ty::mk_rptr(tcx, tcx.mk_region(region), tm)
36043588
};
36053589
fcx.write_ty(id, oprnd_t);
36063590
}

0 commit comments

Comments
 (0)