Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a475551

Browse files
committedNov 22, 2024
Auto merge of rust-lang#133339 - jieyouxu:rollup-gav0nvr, r=jieyouxu
Rollup of 8 pull requests Successful merges: - rust-lang#133238 (re-export `is_loongarch_feature_detected`) - rust-lang#133288 (Support `each_ref` and `each_mut` in `[T; N]` in constant expressions.) - rust-lang#133311 (Miri subtree update) - rust-lang#133313 (Use arc4random of libc for RTEMS target) - rust-lang#133319 (Simplify `fulfill_implication`) - rust-lang#133323 (Bail in effects in old solver if self ty is ty var) - rust-lang#133330 (library: update comment around close()) - rust-lang#133337 (Fix typo in `std::thread::Scope::spawn` documentation.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents a7d9ebd + 874cf85 commit a475551

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1701
-921
lines changed
 

‎compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ use rustc_hir as hir;
7070
use rustc_hir::def_id::{DefId, LocalDefId};
7171
use rustc_infer::infer::TyCtxtInferExt;
7272
use rustc_infer::infer::outlives::env::OutlivesEnvironment;
73+
use rustc_infer::traits::ObligationCause;
7374
use rustc_infer::traits::specialization_graph::Node;
7475
use rustc_middle::ty::trait_def::TraitSpecializationKind;
7576
use rustc_middle::ty::{
@@ -210,13 +211,7 @@ fn get_impl_args(
210211
impl1_def_id.to_def_id(),
211212
impl1_args,
212213
impl2_node,
213-
|_, span| {
214-
traits::ObligationCause::new(
215-
impl1_span,
216-
impl1_def_id,
217-
traits::ObligationCauseCode::WhereClause(impl2_node.def_id(), span),
218-
)
219-
},
214+
&ObligationCause::misc(impl1_span, impl1_def_id),
220215
);
221216

222217
let errors = ocx.select_all_or_error();

‎compiler/rustc_trait_selection/src/traits/effects.rs

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ pub fn evaluate_host_effect_obligation<'tcx>(
2727
);
2828
}
2929

30+
// Force ambiguity for infer self ty.
31+
if obligation.predicate.self_ty().is_ty_var() {
32+
return Err(EvaluationFailure::Ambiguous);
33+
}
34+
3035
match evaluate_host_effect_from_bounds(selcx, obligation) {
3136
Ok(result) => return Ok(result),
3237
Err(EvaluationFailure::Ambiguous) => return Err(EvaluationFailure::Ambiguous),

0 commit comments

Comments
 (0)
Please sign in to comment.