diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-11-17 11:21:39 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-11-21 20:31:59 +0000 |
| commit | 6f77c97b386f05083f039f0130146addf99eefd9 (patch) | |
| tree | 4bebb22479b94e1134ee458f5f45efaea839ca26 /compiler/rustc_trait_selection/src/traits/auto_trait.rs | |
| parent | d9a02b0fb728ac994883845b1c53630c2dec4657 (diff) | |
| download | rust-6f77c97b386f05083f039f0130146addf99eefd9.tar.gz rust-6f77c97b386f05083f039f0130146addf99eefd9.zip | |
Assert that various types have the right amount of generic args and fix the sites that used the wrong amount
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/auto_trait.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/auto_trait.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/auto_trait.rs b/compiler/rustc_trait_selection/src/traits/auto_trait.rs index 5869bc76b59..3dab34747f7 100644 --- a/compiler/rustc_trait_selection/src/traits/auto_trait.rs +++ b/compiler/rustc_trait_selection/src/traits/auto_trait.rs @@ -86,7 +86,7 @@ impl<'tcx> AutoTraitFinder<'tcx> { ) -> AutoTraitResult<A> { let tcx = self.tcx; - let trait_ref = ty::TraitRef { def_id: trait_did, substs: tcx.mk_substs_trait(ty, &[]) }; + let trait_ref = tcx.mk_trait_ref(trait_did, ty, &[]); let trait_pred = ty::Binder::dummy(trait_ref); @@ -260,10 +260,8 @@ impl<'tcx> AutoTraitFinder<'tcx> { let mut already_visited = FxHashSet::default(); let mut predicates = VecDeque::new(); predicates.push_back(ty::Binder::dummy(ty::TraitPredicate { - trait_ref: ty::TraitRef { - def_id: trait_did, - substs: infcx.tcx.mk_substs_trait(ty, &[]), - }, + trait_ref: infcx.tcx.mk_trait_ref(trait_did, ty, &[]), + constness: ty::BoundConstness::NotConst, // Auto traits are positive polarity: ty::ImplPolarity::Positive, |
