Skip to content

Commit 71722b9

Browse files
committed
Fix rebase issues
1 parent d0209c4 commit 71722b9

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

src/librustc_mir/hair/pattern/_match.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ fn all_constructors<'a, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
647647
.map(|v| Variant(v.did))
648648
.collect()
649649
}
650-
ty::TyChar if exhaustive_integer_patterns => {
650+
ty::Char if exhaustive_integer_patterns => {
651651
let endpoint = |c: char| {
652652
let ty = ty::ParamEnv::empty().and(cx.tcx.types.char);
653653
ty::Const::from_bits(cx.tcx, c as u128, ty)
@@ -658,7 +658,7 @@ fn all_constructors<'a, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
658658
ConstantRange(endpoint('\u{E000}'), endpoint('\u{10FFFF}'), RangeEnd::Included),
659659
]
660660
}
661-
ty::TyInt(ity) if exhaustive_integer_patterns => {
661+
ty::Int(ity) if exhaustive_integer_patterns => {
662662
// FIXME(49937): refactor these bit manipulations into interpret.
663663
let bits = Integer::from_attr(cx.tcx, SignedInt(ity)).size().bits() as u128;
664664
let min = 1u128 << (bits - 1);
@@ -668,7 +668,7 @@ fn all_constructors<'a, 'tcx: 'a>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
668668
ty::Const::from_bits(cx.tcx, max as u128, ty),
669669
RangeEnd::Included)]
670670
}
671-
ty::TyUint(uty) if exhaustive_integer_patterns => {
671+
ty::Uint(uty) if exhaustive_integer_patterns => {
672672
// FIXME(49937): refactor these bit manipulations into interpret.
673673
let bits = Integer::from_attr(cx.tcx, UnsignedInt(uty)).size().bits() as u128;
674674
let max = !0u128 >> (128 - bits);
@@ -861,7 +861,7 @@ impl<'tcx> IntRange<'tcx> {
861861
// The return value of `signed_bias` should be XORed with an endpoint to encode/decode it.
862862
fn signed_bias(tcx: TyCtxt<'_, 'tcx, 'tcx>, ty: Ty<'tcx>) -> u128 {
863863
match ty.sty {
864-
ty::TyInt(ity) => {
864+
ty::Int(ity) => {
865865
let bits = Integer::from_attr(tcx, SignedInt(ity)).size().bits() as u128;
866866
1u128 << (bits - 1)
867867
}
@@ -1382,7 +1382,7 @@ fn slice_pat_covered_by_constructor<'tcx>(
13821382
fn should_treat_range_exhaustively(tcx: TyCtxt<'_, 'tcx, 'tcx>, ctor: &Constructor<'tcx>) -> bool {
13831383
if tcx.features().exhaustive_integer_patterns {
13841384
if let ConstantValue(value) | ConstantRange(value, _, _) = ctor {
1385-
if let ty::TyChar | ty::TyInt(_) | ty::TyUint(_) = value.ty.sty {
1385+
if let ty::Char | ty::Int(_) | ty::Uint(_) = value.ty.sty {
13861386
return true;
13871387
}
13881388
}

src/librustc_mir/interpret/cast.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use super::{EvalContext, Machine, PlaceTy, OpTy, Value};
1515
impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
1616
fn type_is_fat_ptr(&self, ty: Ty<'tcx>) -> bool {
1717
match ty.sty {
18-
ty::TyRawPtr(ty::TypeAndMut { ty, .. }) |
19-
ty::TyRef(_, ty, _) => !self.type_is_sized(ty),
20-
ty::TyAdt(def, _) if def.is_box() => !self.type_is_sized(ty.boxed_ty()),
18+
ty::RawPtr(ty::TypeAndMut { ty, .. }) |
19+
ty::Ref(_, ty, _) => !self.type_is_sized(ty),
20+
ty::Adt(def, _) if def.is_box() => !self.type_is_sized(ty.boxed_ty()),
2121
_ => false,
2222
}
2323
}
@@ -313,19 +313,19 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
313313
let (src_pointee_ty, dest_pointee_ty) = self.tcx.struct_lockstep_tails(sty, dty);
314314

315315
match (&src_pointee_ty.sty, &dest_pointee_ty.sty) {
316-
(&ty::TyArray(_, length), &ty::TySlice(_)) => {
316+
(&ty::Array(_, length), &ty::Slice(_)) => {
317317
let ptr = self.read_value(src)?.to_scalar_ptr()?;
318318
// u64 cast is from usize to u64, which is always good
319319
let val = Value::new_slice(ptr, length.unwrap_usize(self.tcx.tcx), self.tcx.tcx);
320320
self.write_value(val, dest)
321321
}
322-
(&ty::TyDynamic(..), &ty::TyDynamic(..)) => {
322+
(&ty::Dynamic(..), &ty::Dynamic(..)) => {
323323
// For now, upcasts are limited to changes in marker
324324
// traits, and hence never actually require an actual
325325
// change to the vtable.
326326
self.copy_op(src, dest)
327327
}
328-
(_, &ty::TyDynamic(ref data, _)) => {
328+
(_, &ty::Dynamic(ref data, _)) => {
329329
// Initial cast from sized to dyn trait
330330
let trait_ref = data.principal().unwrap().with_self_ty(
331331
*self.tcx,
@@ -348,13 +348,13 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
348348
dest: PlaceTy<'tcx>,
349349
) -> EvalResult<'tcx> {
350350
match (&src.layout.ty.sty, &dest.layout.ty.sty) {
351-
(&ty::TyRef(_, s, _), &ty::TyRef(_, d, _)) |
352-
(&ty::TyRef(_, s, _), &ty::TyRawPtr(TypeAndMut { ty: d, .. })) |
353-
(&ty::TyRawPtr(TypeAndMut { ty: s, .. }),
354-
&ty::TyRawPtr(TypeAndMut { ty: d, .. })) => {
351+
(&ty::Ref(_, s, _), &ty::Ref(_, d, _)) |
352+
(&ty::Ref(_, s, _), &ty::RawPtr(TypeAndMut { ty: d, .. })) |
353+
(&ty::RawPtr(TypeAndMut { ty: s, .. }),
354+
&ty::RawPtr(TypeAndMut { ty: d, .. })) => {
355355
self.unsize_into_ptr(src, dest, s, d)
356356
}
357-
(&ty::TyAdt(def_a, _), &ty::TyAdt(def_b, _)) => {
357+
(&ty::Adt(def_a, _), &ty::Adt(def_b, _)) => {
358358
assert_eq!(def_a, def_b);
359359
if def_a.is_box() || def_b.is_box() {
360360
if !def_a.is_box() || !def_b.is_box() {

src/librustc_mir/interpret/place.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,15 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
236236
let pointee_type = val.layout.ty.builtin_deref(true).unwrap().ty;
237237
let layout = self.layout_of(pointee_type)?;
238238
let mplace = match self.tcx.struct_tail(pointee_type).sty {
239-
ty::TyDynamic(..) => {
239+
ty::Dynamic(..) => {
240240
let (ptr, vtable) = val.to_scalar_dyn_trait()?;
241241
MemPlace {
242242
ptr,
243243
align: layout.align,
244244
extra: PlaceExtra::Vtable(vtable),
245245
}
246246
}
247-
ty::TyStr | ty::TySlice(_) => {
247+
ty::Str | ty::Slice(_) => {
248248
let (ptr, len) = val.to_scalar_slice(self)?;
249249
MemPlace {
250250
ptr,
@@ -358,9 +358,9 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
358358
// Compute extra and new layout
359359
let inner_len = len - to - from;
360360
let (extra, ty) = match base.layout.ty.sty {
361-
ty::TyArray(inner, _) =>
361+
ty::Array(inner, _) =>
362362
(PlaceExtra::None, self.tcx.mk_array(inner, inner_len)),
363-
ty::TySlice(..) =>
363+
ty::Slice(..) =>
364364
(PlaceExtra::Length(inner_len), base.layout.ty),
365365
_ =>
366366
bug!("cannot subslice non-array type: `{:?}`", base.layout.ty),

src/librustc_mir/interpret/validity.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
139139
// char gets a special treatment, because its number space is not contiguous so `TyLayout`
140140
// has no special checks for chars
141141
match ty.sty {
142-
ty::TyChar => {
142+
ty::Char => {
143143
debug_assert_eq!(size.bytes(), 4);
144144
if ::std::char::from_u32(bits as u32).is_none() {
145145
return validation_failure!(
@@ -323,23 +323,23 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
323323
fn aggregate_field_path_elem(&self, ty: Ty<'tcx>, variant: usize, field: usize) -> PathElem {
324324
match ty.sty {
325325
// generators and closures.
326-
ty::TyClosure(def_id, _) | ty::TyGenerator(def_id, _, _) => {
326+
ty::Closure(def_id, _) | ty::Generator(def_id, _, _) => {
327327
let node_id = self.tcx.hir.as_local_node_id(def_id).unwrap();
328328
let freevar = self.tcx.with_freevars(node_id, |fv| fv[field]);
329329
PathElem::ClosureVar(self.tcx.hir.name(freevar.var_id()))
330330
}
331331

332332
// tuples
333-
ty::TyTuple(_) => PathElem::TupleElem(field),
333+
ty::Tuple(_) => PathElem::TupleElem(field),
334334

335335
// enums
336-
ty::TyAdt(def, ..) if def.is_enum() => {
336+
ty::Adt(def, ..) if def.is_enum() => {
337337
let variant = &def.variants[variant];
338338
PathElem::Field(variant.fields[field].ident.name)
339339
}
340340

341341
// other ADTs
342-
ty::TyAdt(def, _) => PathElem::Field(def.non_enum_variant().fields[field].ident.name),
342+
ty::Adt(def, _) => PathElem::Field(def.non_enum_variant().fields[field].ident.name),
343343

344344
// nothing else has an aggregate layout
345345
_ => bug!("aggregate_field_path_elem: got non-aggregate type {:?}", ty),

src/test/ui/issues/issue-46332.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
// Original Levenshtein distance for both of this is 1. We improved accuracy with
1212
// additional case insensitive comparison.
1313

14-
struct Uint {}
14+
struct TyUint {}
1515

16-
struct Int {}
16+
struct TyInt {}
1717

1818
fn main() {
1919
TyUInt {};

src/test/ui/privacy/private-inferred-type-1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
trait Arr0 {
1212
fn arr0_secret(&self);
1313
}
14-
trait Param {
14+
trait TyParam {
1515
fn ty_param_secret(&self);
1616
}
1717

1818
mod m {
1919
struct Priv;
2020

2121
impl ::Arr0 for [Priv; 0] { fn arr0_secret(&self) {} }
22-
impl ::Param for Option<Priv> { fn ty_param_secret(&self) {} }
22+
impl ::TyParam for Option<Priv> { fn ty_param_secret(&self) {} }
2323
}
2424

2525
fn main() {

0 commit comments

Comments
 (0)