Skip to content

Commit

Permalink
Auto merge of rust-lang#135713 - matthiaskrgr:rollup-c04uupz, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 6 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#135680 (coverage: Clean up a few things after the counters overhaul)
 - rust-lang#135697 (Get rid of `ToPolyTraitRef`)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jan 19, 2025
2 parents 1d55f72 + d810c13 commit 01706e1
Show file tree
Hide file tree
Showing 32 changed files with 386 additions and 458 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_infer/src/traits/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rustc_data_structures::fx::FxHashSet;
use rustc_middle::ty::{self, ToPolyTraitRef, TyCtxt};
use rustc_middle::ty::{self, TyCtxt};
use rustc_span::{Ident, Span};
pub use rustc_type_ir::elaborate::*;

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

return Some(trait_ref);
Expand Down
8 changes: 2 additions & 6 deletions compiler/rustc_middle/src/mir/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ impl ConditionId {

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

#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(TyEncodable, TyDecodable, Hash, HashStable, TypeFoldable, TypeVisitable)]
pub struct Expression {
pub lhs: CovTerm,
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ pub use self::predicate::{
PolyExistentialPredicate, PolyExistentialProjection, PolyExistentialTraitRef,
PolyProjectionPredicate, PolyRegionOutlivesPredicate, PolySubtypePredicate, PolyTraitPredicate,
PolyTraitRef, PolyTypeOutlivesPredicate, Predicate, PredicateKind, ProjectionPredicate,
RegionOutlivesPredicate, SubtypePredicate, ToPolyTraitRef, TraitPredicate, TraitRef,
TypeOutlivesPredicate,
RegionOutlivesPredicate, SubtypePredicate, TraitPredicate, TraitRef, TypeOutlivesPredicate,
};
pub use self::region::{
BoundRegion, BoundRegionKind, EarlyParamRegion, LateParamRegion, LateParamRegionKind, Region,
Expand Down
10 changes: 0 additions & 10 deletions compiler/rustc_middle/src/ty/predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,16 +476,6 @@ impl<'tcx> Clause<'tcx> {
}
}

pub trait ToPolyTraitRef<'tcx> {
fn to_poly_trait_ref(&self) -> PolyTraitRef<'tcx>;
}

impl<'tcx> ToPolyTraitRef<'tcx> for PolyTraitPredicate<'tcx> {
fn to_poly_trait_ref(&self) -> PolyTraitRef<'tcx> {
self.map_bound_ref(|trait_pred| trait_pred.trait_ref)
}
}

impl<'tcx> UpcastFrom<TyCtxt<'tcx>, PredicateKind<'tcx>> for Predicate<'tcx> {
fn upcast_from(from: PredicateKind<'tcx>, tcx: TyCtxt<'tcx>) -> Self {
ty::Binder::dummy(from).upcast(tcx)
Expand Down
Loading

0 comments on commit 01706e1

Please sign in to comment.