Skip to content

Commit 5b26dfb

Browse files
committed
god knows what i did but this elides most bounds i think
1 parent 62eeed0 commit 5b26dfb

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

compiler/rustc_middle/src/ty/context.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ impl<'tcx> rustc_type_ir::inherent::Features<TyCtxt<'tcx>> for &'tcx rustc_featu
115115
self.coroutine_clone()
116116
}
117117

118+
fn move_trait(self) -> bool {
119+
self.move_trait()
120+
}
121+
118122
fn feature_bound_holds_in_crate(self, symbol: Symbol) -> bool {
119123
// We don't consider feature bounds to hold in the crate when `staged_api` feature is
120124
// enabled, even if it is enabled through `#[feature]`.

compiler/rustc_type_ir/src/inherent.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,8 @@ pub trait Features<I: Interner>: Copy {
647647

648648
fn coroutine_clone(self) -> bool;
649649

650+
fn move_trait(self) -> bool;
651+
650652
fn feature_bound_holds_in_crate(self, symbol: I::Symbol) -> bool;
651653
}
652654

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/solver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,9 @@ impl<'db> SolverDelegate for SolverContext<'db> {
298298

299299
if trait_pred.polarity() == PredicatePolarity::Positive {
300300
match self.0.interner.as_trait_lang_item(trait_pred.def_id()) {
301-
Some(SolverTraitLangItem::Sized) | Some(SolverTraitLangItem::MetaSized) => {
301+
Some(SolverTraitLangItem::Sized)
302+
| Some(SolverTraitLangItem::MetaSized)
303+
| Some(SolverTraitLangItem::Move) => {
302304
let predicate = self.resolve_vars_if_possible(goal.predicate);
303305
if implicit_fast_path(self.interner, predicate, goal.param_env) {
304306
return Some(Certainty::Yes);

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ pub fn implicit_fast_path<'db>(
659659
Some(SolverTraitLangItem::MetaSized) => SizedTraitKind::MetaSized,
660660
// TODO(nia-e): do more comprehensive fast-pathing when the feature is on
661661
Some(SolverTraitLangItem::Move) => return trait_pred.self_ty().has_trivial_move(tcx),
662+
662663
_ => return false,
663664
};
664665

0 commit comments

Comments
 (0)