|
4 | 4 | //! We walk the set of items and, for each member, generate new constraints. |
5 | 5 |
|
6 | 6 | use hir::def_id::DefId; |
7 | | -use rustc::mir::interpret::ConstValue; |
8 | 7 | use rustc::ty::subst::{SubstsRef, UnpackedKind}; |
9 | 8 | use rustc::ty::{self, Ty, TyCtxt}; |
10 | 9 | use rustc::hir; |
@@ -239,8 +238,8 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { |
239 | 238 | UnpackedKind::Type(ty) => { |
240 | 239 | self.add_constraints_from_ty(current, ty, variance_i) |
241 | 240 | } |
242 | | - UnpackedKind::Const(ct) => { |
243 | | - self.add_constraints_from_const(current, ct, variance_i) |
| 241 | + UnpackedKind::Const(_) => { |
| 242 | + // Consts impose no constraints. |
244 | 243 | } |
245 | 244 | } |
246 | 245 | } |
@@ -275,9 +274,8 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { |
275 | 274 | self.add_constraints_from_mt(current, &ty::TypeAndMut { ty, mutbl }, variance); |
276 | 275 | } |
277 | 276 |
|
278 | | - ty::Array(typ, len) => { |
| 277 | + ty::Array(typ, _) => { |
279 | 278 | self.add_constraints_from_ty(current, typ, variance); |
280 | | - self.add_constraints_from_const(current, len, variance); |
281 | 279 | } |
282 | 280 |
|
283 | 281 | ty::Slice(typ) => { |
@@ -395,8 +393,8 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { |
395 | 393 | UnpackedKind::Type(ty) => { |
396 | 394 | self.add_constraints_from_ty(current, ty, variance_i) |
397 | 395 | } |
398 | | - UnpackedKind::Const(ct) => { |
399 | | - self.add_constraints_from_const(current, ct, variance_i) |
| 396 | + UnpackedKind::Const(_) => { |
| 397 | + // Consts impose no constraints. |
400 | 398 | } |
401 | 399 | } |
402 | 400 | } |
@@ -449,24 +447,6 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { |
449 | 447 | } |
450 | 448 | } |
451 | 449 |
|
452 | | - fn add_constraints_from_const( |
453 | | - &mut self, |
454 | | - current: &CurrentItem, |
455 | | - ct: &ty::Const<'tcx>, |
456 | | - variance: VarianceTermPtr<'a> |
457 | | - ) { |
458 | | - debug!( |
459 | | - "add_constraints_from_const(ct={:?}, variance={:?})", |
460 | | - ct, |
461 | | - variance |
462 | | - ); |
463 | | - |
464 | | - self.add_constraints_from_ty(current, ct.ty, variance); |
465 | | - if let ConstValue::Param(ref data) = ct.val { |
466 | | - self.add_constraint(current, data.index, variance); |
467 | | - } |
468 | | - } |
469 | | - |
470 | 450 | /// Adds constraints appropriate for a mutability-type pair |
471 | 451 | /// appearing in a context with ambient variance `variance` |
472 | 452 | fn add_constraints_from_mt(&mut self, |
|
0 commit comments