Skip to content

Commit

Permalink
remove implicit field
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Dec 15, 2021
1 parent d445c12 commit 979937e
Show file tree
Hide file tree
Showing 40 changed files with 122 additions and 162 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/type_check/canonical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
trait_ref,
constness: ty::BoundConstness::NotConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
}))),
locations,
category,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ impl Visitor<'tcx> for Checker<'mir, 'tcx> {
trait_ref,
constness: ty::BoundConstness::ConstIfConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Qualif for NeedsNonConstDrop {
trait_ref,
constness: ty::BoundConstness::ConstIfConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
}),
);

Expand Down
44 changes: 22 additions & 22 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,24 +165,24 @@ pub struct ImplHeader<'tcx> {
pub predicates: Vec<Predicate<'tcx>>,
}

#[derive(
Copy,
Clone,
PartialEq,
Eq,
Hash,
TyEncodable,
TyDecodable,
HashStable,
Debug,
TypeFoldable
)]
pub enum ImplicitBound {
/// `T: Trait`
No,
/// implicit `T: Sized`
Yes,
}
// #[derive(
// Copy,
// Clone,
// PartialEq,
// Eq,
// Hash,
// TyEncodable,
// TyDecodable,
// HashStable,
// Debug,
// TypeFoldable
// )]
// pub enum ImplicitBound {
// /// `T: Trait`
// No,
// /// implicit `T: Sized`
// Yes,
// }

#[derive(
Copy,
Expand Down Expand Up @@ -541,12 +541,12 @@ impl<'tcx> Predicate<'tcx> {
trait_ref,
constness,
polarity,
implicit,
// implicit,
}) => Some(PredicateKind::Trait(TraitPredicate {
trait_ref,
constness,
polarity: polarity.flip()?,
implicit,
// implicit,
})),

_ => None,
Expand Down Expand Up @@ -753,7 +753,7 @@ pub struct TraitPredicate<'tcx> {

pub polarity: ImplPolarity,

pub implicit: ImplicitBound,
// pub implicit: ImplicitBound,
}

pub type PolyTraitPredicate<'tcx> = ty::Binder<'tcx, TraitPredicate<'tcx>>;
Expand Down Expand Up @@ -1450,7 +1450,7 @@ impl PolyTraitRef<'tcx> {
trait_ref,
constness,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
})
}
#[inline]
Expand Down
30 changes: 15 additions & 15 deletions compiler/rustc_middle/src/ty/relate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -788,20 +788,20 @@ impl<'tcx> Relate<'tcx> for GenericArg<'tcx> {
}
}

impl<'tcx> Relate<'tcx> for ty::ImplicitBound {
fn relate<R: TypeRelation<'tcx>>(
_relation: &mut R,
a: ty::ImplicitBound,
b: ty::ImplicitBound,
) -> RelateResult<'tcx, ty::ImplicitBound> {
match (a, b) {
(ty::ImplicitBound::No, ty::ty::ImplicitBound::No) => Ok(ty::ImplicitBound::No),
(ty::ImplicitBound::Yes, ty::ty::ImplicitBound::Yes)
| (ty::ImplicitBound::Yes, ty::ty::ImplicitBound::No)
| (ty::ImplicitBound::No, ty::ty::ImplicitBound::Yes) => Ok(ty::ImplicitBound::Yes),
}
}
}
// impl<'tcx> Relate<'tcx> for ty::ImplicitBound {
// fn relate<R: TypeRelation<'tcx>>(
// _relation: &mut R,
// a: ty::ImplicitBound,
// b: ty::ImplicitBound,
// ) -> RelateResult<'tcx, ty::ImplicitBound> {
// match (a, b) {
// (ty::ImplicitBound::No, ty::ty::ImplicitBound::No) => Ok(ty::ImplicitBound::No),
// (ty::ImplicitBound::Yes, ty::ty::ImplicitBound::Yes)
// | (ty::ImplicitBound::Yes, ty::ty::ImplicitBound::No)
// | (ty::ImplicitBound::No, ty::ty::ImplicitBound::Yes) => Ok(ty::ImplicitBound::Yes),
// }
// }
// }

impl<'tcx> Relate<'tcx> for ty::ImplPolarity {
fn relate<R: TypeRelation<'tcx>>(
Expand All @@ -827,7 +827,7 @@ impl<'tcx> Relate<'tcx> for ty::TraitPredicate<'tcx> {
trait_ref: relation.relate(a.trait_ref, b.trait_ref)?,
constness: relation.relate(a.constness, b.constness)?,
polarity: relation.relate(a.polarity, b.polarity)?,
implicit: relation.relate(a.implicit, b.implicit)?,
// implicit: relation.relate(a.implicit, b.implicit)?,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/structural_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::TraitPredicate<'a> {
trait_ref,
constness: self.constness,
polarity: self.polarity,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ impl<'tcx> PolyTraitRef<'tcx> {
trait_ref,
constness: ty::BoundConstness::NotConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_privacy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ where
trait_ref,
constness: _,
polarity: _,
implicit: _,
// implicit: _,
}) => self.visit_trait(trait_ref),
ty::PredicateKind::Projection(ty::ProjectionPredicate { projection_ty, ty }) => {
ty.visit_with(self)?;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl AutoTraitFinder<'tcx> {
constness: ty::BoundConstness::NotConst,
// Auto traits are positive
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
}));

let computed_preds = param_env.caller_bounds().iter();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ pub fn vtable_trait_upcasting_coercion_new_vptr_slot(
trait_ref,
constness: ty::BoundConstness::NotConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> {
// we have to prove. No need to canonicalize and all that for
// such cases.
if let ty::PredicateKind::Trait(trait_ref) = key.value.predicate.kind().skip_binder() {
if trait_ref.implicit == ty::ImplicitBound::Yes {
return Some(());
}
if let Some(sized_def_id) = tcx.lang_items().sized_trait() {
if trait_ref.def_id() == sized_def_id {
if trait_ref.self_ty().is_trivially_sized(tcx) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/relationships.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub(crate) fn update<'tcx, T>(
trait_ref,
constness: predicate.constness,
polarity: predicate.polarity,
implicit: predicate.implicit,
// implicit: predicate.implicit,
})
})
.to_predicate(infcx.tcx),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
},
constness: ty::BoundConstness::NotConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
}));
copy_obligation.recursion_depth = depth + 1;
self.assemble_candidates_from_impls(&copy_obligation, &mut new_candidates);
Expand All @@ -952,7 +952,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
},
constness: ty::BoundConstness::ConstIfConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::No,
// implicit: ty::ImplicitBound::No,
}));

let const_drop_stack = self.push_stack(obligation_stack.list(), &const_drop_obligation);
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_trait_selection/src/traits/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ pub fn predicates_for_generics<'tcx>(
cause.span,
cause.body_id,
match predicate.kind().skip_binder() {
ty::PredicateKind::Trait(ty::TraitPredicate {
implicit: ty::ImplicitBound::Yes,
..
}) => traits::ImplicitSizedObligation(def_id, span),
// ty::PredicateKind::Trait(ty::TraitPredicate {
// implicit: ty::ImplicitBound::Yes,
// ..
// }) => traits::ImplicitSizedObligation(def_id, span),
_ => traits::BindingObligation(def_id, span),
},
),
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<'tcx> Bounds<'tcx> {
},
constness: ty::BoundConstness::NotConst,
polarity: ty::ImplPolarity::Positive,
implicit: ty::ImplicitBound::Yes,
// implicit: ty::ImplicitBound::Yes,
}))
.to_predicate(tcx);
(pred, span)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_typeck/src/check/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
},
constness: t.constness,
polarity: t.polarity,
implicit: t.implicit,
// implicit: t.implicit,
}));
let obl = Obligation::new(
o.cause.clone(),
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ fn check_specialization_on<'tcx>(tcx: TyCtxt<'tcx>, predicate: ty::Predicate<'tc
trait_ref,
constness: ty::BoundConstness::NotConst,
polarity: _,
implicit: _,
// implicit: _,
}) => {
if !matches!(
trait_predicate_kind(tcx, predicate),
Expand Down Expand Up @@ -416,7 +416,7 @@ fn trait_predicate_kind<'tcx>(
trait_ref,
constness: ty::BoundConstness::NotConst,
polarity: _,
implicit: _,
// implicit: _,
}) => Some(tcx.trait_def(trait_ref.def_id).specialization_kind),
ty::PredicateKind::Trait(_)
| ty::PredicateKind::RegionOutlives(_)
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/box/into-boxed-slice-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | let _ = Box::into_boxed_slice(boxed_slice);
| required by a bound introduced by this call
|
= help: the trait `Sized` is not implemented for `[u8]`
note: type parameters have an implicit `Sized` obligation
note: required by a bound in `Box::<T, A>::into_boxed_slice`
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | impl<T, A: Allocator> Box<T, A> {
Expand All @@ -31,7 +31,7 @@ LL | let _ = Box::into_boxed_slice(boxed_trait);
| required by a bound introduced by this call
|
= help: the trait `Sized` is not implemented for `dyn Debug`
note: type parameters have an implicit `Sized` obligation
note: required by a bound in `Box::<T, A>::into_boxed_slice`
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
LL | impl<T, A: Allocator> Box<T, A> {
Expand Down
11 changes: 3 additions & 8 deletions src/test/ui/error-codes/E0275.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
error[E0275]: overflow evaluating the requirement `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<B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`
--> $DIR/E0275.rs:5:33
|
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`E0275`)
note: required because it appears within the type `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/E0275.rs:3:8
|
LL | struct Bar<T>(T);
| ^^^
note: required because of the requirements on the impl of `Foo` for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/E0275.rs:5:9
|
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^ ^
= note: 126 redundant requirements hidden
= note: 127 redundant requirements hidden
= note: required because of the requirements on the impl of `Foo` for `Bar<T>`

error: aborting due to previous error
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/extern/extern-types-unsized.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | assert_sized::<A>();
| ^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `A`
note: type parameters have an implicit `Sized` obligation
note: required by a bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
Expand All @@ -27,7 +27,7 @@ note: required because it appears within the type `Foo`
|
LL | struct Foo {
| ^^^
note: type parameters have an implicit `Sized` obligation
note: required by a bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
Expand All @@ -49,7 +49,7 @@ note: required because it appears within the type `Bar<A>`
|
LL | struct Bar<T: ?Sized> {
| ^^^
note: type parameters have an implicit `Sized` obligation
note: required by a bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
Expand All @@ -71,7 +71,7 @@ note: required because it appears within the type `Bar<A>`
|
LL | struct Bar<T: ?Sized> {
| ^^^
note: type parameters have an implicit `Sized` obligation
note: required by a bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ LL | type Assoc = OnlySized<<T as Foo>::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `OnlySized`
--> $DIR/projection-bound-cycle-generic.rs:28:30
--> $DIR/projection-bound-cycle-generic.rs:28:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| ^^^^^ required by this bound in `OnlySized`
| ^ required by this bound in `OnlySized`

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ LL | type Assoc = OnlySized<<T as Foo>::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `OnlySized`
--> $DIR/projection-bound-cycle.rs:30:30
--> $DIR/projection-bound-cycle.rs:30:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| ^^^^^ required by this bound in `OnlySized`
| ^ required by this bound in `OnlySized`

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ LL | impl Tsized for () {}
|
= help: the trait `Sized` is not implemented for `[()]`
note: required by a bound in `Tsized`
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:17
--> $DIR/issue-61631-default-type-param-can-reference-self-in-trait.rs:17:14
|
LL | trait Tsized<P: Sized = [Self]> {}
| ^^^^^ required by this bound in `Tsized`
| ^ required by this bound in `Tsized`

error: aborting due to previous error

Expand Down
Loading

0 comments on commit 979937e

Please sign in to comment.