Skip to content

Commit 43aa137

Browse files
committed
Auto merge of rust-lang#135702 - matthiaskrgr:rollup-7m0e58h, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#135616 (CI: split i686-msvc job to two free runners) - rust-lang#135623 (ci: use ghcr ubuntu image for mingw-check-tidy) - rust-lang#135640 (Drop MIPS glibc 2.23 patches that reside in crosstool-ng now) - rust-lang#135663 (Fix ICE in resolving associated items as non-bindings) - rust-lang#135677 (Small `rustc_resolve` cleanups) - rust-lang#135680 (coverage: Clean up a few things after the counters overhaul) - rust-lang#135697 (Get rid of `ToPolyTraitRef`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1d55f72 + 1cef579 commit 43aa137

33 files changed

+392
-462
lines changed

compiler/rustc_infer/src/traits/util.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_data_structures::fx::FxHashSet;
2-
use rustc_middle::ty::{self, ToPolyTraitRef, TyCtxt};
2+
use rustc_middle::ty::{self, TyCtxt};
33
use rustc_span::{Ident, Span};
44
pub use rustc_type_ir::elaborate::*;
55

@@ -125,8 +125,8 @@ pub fn transitive_bounds_that_define_assoc_item<'tcx>(
125125
.iter_identity_copied()
126126
.map(|(clause, _)| clause.instantiate_supertrait(tcx, trait_ref))
127127
.filter_map(|clause| clause.as_trait_clause())
128-
// FIXME: Negative supertraits are elaborated here lol
129-
.map(|trait_pred| trait_pred.to_poly_trait_ref()),
128+
.filter(|clause| clause.polarity() == ty::PredicatePolarity::Positive)
129+
.map(|clause| clause.map_bound(|clause| clause.trait_ref)),
130130
);
131131

132132
return Some(trait_ref);

compiler/rustc_middle/src/mir/coverage.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ impl ConditionId {
7171

7272
/// Enum that can hold a constant zero value, the ID of an physical coverage
7373
/// counter, or the ID of a coverage-counter expression.
74-
///
75-
/// This was originally only used for expression operands (and named `Operand`),
76-
/// but the zero/counter/expression distinction is also useful for representing
77-
/// the value of code/gap mappings, and the true/false arms of branch mappings.
78-
#[derive(Copy, Clone, PartialEq, Eq)]
74+
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
7975
#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)]
8076
pub enum CovTerm {
8177
Zero,
@@ -171,7 +167,7 @@ impl Op {
171167
}
172168
}
173169

174-
#[derive(Clone, Debug)]
170+
#[derive(Clone, Debug, PartialEq, Eq)]
175171
#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)]
176172
pub struct Expression {
177173
pub lhs: CovTerm,

compiler/rustc_middle/src/ty/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ pub use self::predicate::{
7979
PolyExistentialPredicate, PolyExistentialProjection, PolyExistentialTraitRef,
8080
PolyProjectionPredicate, PolyRegionOutlivesPredicate, PolySubtypePredicate, PolyTraitPredicate,
8181
PolyTraitRef, PolyTypeOutlivesPredicate, Predicate, PredicateKind, ProjectionPredicate,
82-
RegionOutlivesPredicate, SubtypePredicate, ToPolyTraitRef, TraitPredicate, TraitRef,
83-
TypeOutlivesPredicate,
82+
RegionOutlivesPredicate, SubtypePredicate, TraitPredicate, TraitRef, TypeOutlivesPredicate,
8483
};
8584
pub use self::region::{
8685
BoundRegion, BoundRegionKind, EarlyParamRegion, LateParamRegion, LateParamRegionKind, Region,

compiler/rustc_middle/src/ty/predicate.rs

-10
Original file line numberDiff line numberDiff line change
@@ -476,16 +476,6 @@ impl<'tcx> Clause<'tcx> {
476476
}
477477
}
478478

479-
pub trait ToPolyTraitRef<'tcx> {
480-
fn to_poly_trait_ref(&self) -> PolyTraitRef<'tcx>;
481-
}
482-
483-
impl<'tcx> ToPolyTraitRef<'tcx> for PolyTraitPredicate<'tcx> {
484-
fn to_poly_trait_ref(&self) -> PolyTraitRef<'tcx> {
485-
self.map_bound_ref(|trait_pred| trait_pred.trait_ref)
486-
}
487-
}
488-
489479
impl<'tcx> UpcastFrom<TyCtxt<'tcx>, PredicateKind<'tcx>> for Predicate<'tcx> {
490480
fn upcast_from(from: PredicateKind<'tcx>, tcx: TyCtxt<'tcx>) -> Self {
491481
ty::Binder::dummy(from).upcast(tcx)

0 commit comments

Comments
 (0)