Skip to content
/ rust Public
forked from rust-lang/rust

Commit b3df56a

Browse files
committed
Auto merge of rust-lang#114294 - matthiaskrgr:rollup-yk78pvd, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang#114111 (Improve test case for experimental API remove_matches) - rust-lang#114169 (refactor builtin unsize handling, extend comments) - rust-lang#114182 (clean up after 113312) - rust-lang#114193 (Update lexer emoji diagnostics to Unicode 15.0) - rust-lang#114200 (Detect trait upcasting through struct tail unsizing in new solver select) - rust-lang#114228 (Check lazy type aliases for well-formedness) - rust-lang#114267 (Map RPITIT's opaque type bounds back from projections to opaques) - rust-lang#114269 (Migrate GUI colors test to original CSS color format) - rust-lang#114286 (Add missing feature gate in multiple_supertrait_upcastable doc) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3114eb1 + f59a560 commit b3df56a

File tree

27 files changed

+390
-310
lines changed

27 files changed

+390
-310
lines changed

Diff for: compiler/rustc_hir_analysis/src/check/check.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ fn find_and_apply_rpit_args<'tcx>(
576576
struct Visitor<'tcx> {
577577
tcx: TyCtxt<'tcx>,
578578
opaque: DefId,
579-
function: DefId,
580579
seen: FxHashSet<DefId>,
581580
}
582581
impl<'tcx> ty::TypeVisitor<TyCtxt<'tcx>> for Visitor<'tcx> {
@@ -601,19 +600,6 @@ fn find_and_apply_rpit_args<'tcx>(
601600
}
602601
}
603602
}
604-
ty::Alias(ty::Projection, alias) => {
605-
if self.tcx.is_impl_trait_in_trait(alias.def_id)
606-
&& self.tcx.impl_trait_in_trait_parent_fn(alias.def_id) == self.function
607-
{
608-
// If we're lowering to associated item, install the opaque type which is just
609-
// the `type_of` of the trait's associated item. If we're using the old lowering
610-
// strategy, then just reinterpret the associated type like an opaque :^)
611-
self.tcx
612-
.type_of(alias.def_id)
613-
.instantiate(self.tcx, alias.args)
614-
.visit_with(self)?;
615-
}
616-
}
617603
ty::Alias(ty::Weak, alias) => {
618604
self.tcx
619605
.type_of(alias.def_id)
@@ -627,7 +613,7 @@ fn find_and_apply_rpit_args<'tcx>(
627613
}
628614
}
629615
if let ControlFlow::Break(args) =
630-
ret.visit_with(&mut Visitor { tcx, function, opaque, seen: Default::default() })
616+
ret.visit_with(&mut Visitor { tcx, opaque, seen: Default::default() })
631617
{
632618
trace!(?args);
633619
trace!("expected: {hidden_ty:#?}");

Diff for: compiler/rustc_hir_analysis/src/check/wfcheck.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,11 @@ fn check_item<'tcx>(tcx: TyCtxt<'tcx>, item: &'tcx hir::Item<'tcx>) {
246246
// `ForeignItem`s are handled separately.
247247
hir::ItemKind::ForeignMod { .. } => {}
248248
hir::ItemKind::TyAlias(hir_ty, ..) => {
249-
if tcx.type_of(item.owner_id.def_id).skip_binder().has_opaque_types() {
250-
// Bounds are respected for `type X = impl Trait` and `type X = (impl Trait, Y);`
249+
if tcx.features().lazy_type_alias
250+
|| tcx.type_of(item.owner_id).skip_binder().has_opaque_types()
251+
{
252+
// Bounds of lazy type aliases and of eager ones that contain opaque types are respected.
253+
// E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`.
251254
check_item_type(tcx, def_id, hir_ty.span, UnsizedHandling::Allow);
252255
}
253256
}

Diff for: compiler/rustc_hir_analysis/src/collect/item_bounds.rs

+46-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::astconv::{AstConv, PredicateFilter};
33
use rustc_hir as hir;
44
use rustc_infer::traits::util;
55
use rustc_middle::ty::GenericArgs;
6-
use rustc_middle::ty::{self, Ty, TyCtxt};
6+
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, TypeFolder};
77
use rustc_span::def_id::{DefId, LocalDefId};
88
use rustc_span::Span;
99

@@ -113,14 +113,35 @@ pub(super) fn explicit_item_bounds(
113113
..
114114
}) => associated_type_bounds(tcx, def_id, bounds, *span),
115115
hir::Node::Item(hir::Item {
116-
kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds, .. }),
116+
kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds, in_trait: false, .. }),
117117
span,
118118
..
119119
}) => {
120120
let args = GenericArgs::identity_for_item(tcx, def_id);
121121
let item_ty = Ty::new_opaque(tcx, def_id.to_def_id(), args);
122122
opaque_type_bounds(tcx, def_id, bounds, item_ty, *span)
123123
}
124+
// Since RPITITs are astconv'd as projections in `ast_ty_to_ty`, when we're asking
125+
// for the item bounds of the *opaques* in a trait's default method signature, we
126+
// need to map these projections back to opaques.
127+
hir::Node::Item(hir::Item {
128+
kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { bounds, in_trait: true, origin, .. }),
129+
span,
130+
..
131+
}) => {
132+
let (hir::OpaqueTyOrigin::FnReturn(fn_def_id)
133+
| hir::OpaqueTyOrigin::AsyncFn(fn_def_id)) = *origin
134+
else {
135+
bug!()
136+
};
137+
let args = GenericArgs::identity_for_item(tcx, def_id);
138+
let item_ty = Ty::new_opaque(tcx, def_id.to_def_id(), args);
139+
tcx.arena.alloc_slice(
140+
&opaque_type_bounds(tcx, def_id, bounds, item_ty, *span)
141+
.to_vec()
142+
.fold_with(&mut AssocTyToOpaque { tcx, fn_def_id: fn_def_id.to_def_id() }),
143+
)
144+
}
124145
hir::Node::Item(hir::Item { kind: hir::ItemKind::TyAlias(..), .. }) => &[],
125146
_ => bug!("item_bounds called on {:?}", def_id),
126147
};
@@ -135,3 +156,26 @@ pub(super) fn item_bounds(
135156
tcx.mk_clauses_from_iter(util::elaborate(tcx, bounds.iter().map(|&(bound, _span)| bound)))
136157
})
137158
}
159+
160+
struct AssocTyToOpaque<'tcx> {
161+
tcx: TyCtxt<'tcx>,
162+
fn_def_id: DefId,
163+
}
164+
165+
impl<'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTyToOpaque<'tcx> {
166+
fn interner(&self) -> TyCtxt<'tcx> {
167+
self.tcx
168+
}
169+
170+
fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
171+
if let ty::Alias(ty::Projection, projection_ty) = ty.kind()
172+
&& let Some(ty::ImplTraitInTraitData::Trait { fn_def_id, .. })
173+
= self.tcx.opt_rpitit_info(projection_ty.def_id)
174+
&& fn_def_id == self.fn_def_id
175+
{
176+
self.tcx.type_of(projection_ty.def_id).instantiate(self.tcx, projection_ty.args)
177+
} else {
178+
ty
179+
}
180+
}
181+
}

Diff for: compiler/rustc_hir_typeck/src/_match.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -558,18 +558,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
558558
{
559559
let pred = clause.kind().rebind(match clause.kind().skip_binder() {
560560
ty::ClauseKind::Trait(trait_pred) => {
561-
// FIXME(rpitit): This will need to be fixed when we move to associated types
562561
assert!(matches!(
563562
*trait_pred.trait_ref.self_ty().kind(),
564-
ty::Alias(_, ty::AliasTy { def_id, args: alias_args, .. })
563+
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args: alias_args, .. })
565564
if def_id == rpit_def_id && args == alias_args
566565
));
567566
ty::ClauseKind::Trait(trait_pred.with_self_ty(self.tcx, ty))
568567
}
569568
ty::ClauseKind::Projection(mut proj_pred) => {
570569
assert!(matches!(
571570
*proj_pred.projection_ty.self_ty().kind(),
572-
ty::Alias(_, ty::AliasTy { def_id, args: alias_args, .. })
571+
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args: alias_args, .. })
573572
if def_id == rpit_def_id && args == alias_args
574573
));
575574
proj_pred = proj_pred.with_self_ty(self.tcx, ty);

Diff for: compiler/rustc_hir_typeck/src/closure.rs

-5
Original file line numberDiff line numberDiff line change
@@ -723,11 +723,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
723723
.iter_instantiated_copied(self.tcx, args)
724724
.find_map(|(p, s)| get_future_output(p.as_predicate(), s))?,
725725
ty::Error(_) => return None,
726-
ty::Alias(ty::Projection, proj) if self.tcx.is_impl_trait_in_trait(proj.def_id) => self
727-
.tcx
728-
.explicit_item_bounds(proj.def_id)
729-
.iter_instantiated_copied(self.tcx, proj.args)
730-
.find_map(|(p, s)| get_future_output(p.as_predicate(), s))?,
731726
_ => span_bug!(
732727
self.tcx.def_span(expr_def_id),
733728
"async fn generator return type not an inference variable: {ret_ty}"

Diff for: compiler/rustc_infer/src/infer/opaque_types.rs

-7
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,6 @@ impl<'tcx> InferCtxt<'tcx> {
619619
{
620620
hidden_ty
621621
}
622-
// FIXME(RPITIT): This can go away when we move to associated types
623-
// FIXME(inherent_associated_types): Extend this to support `ty::Inherent`, too.
624-
ty::Alias(ty::Projection, ty::AliasTy { def_id: def_id2, args: args2, .. })
625-
if def_id == def_id2 && args == args2 =>
626-
{
627-
hidden_ty
628-
}
629622
_ => ty,
630623
},
631624
lt_op: |lt| lt,

Diff for: compiler/rustc_lint/src/builtin.rs

+12-7
Original file line numberDiff line numberDiff line change
@@ -1458,15 +1458,20 @@ impl TypeAliasBounds {
14581458

14591459
impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
14601460
fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
1461-
let hir::ItemKind::TyAlias(ty, type_alias_generics) = &item.kind else { return };
1462-
if cx.tcx.type_of(item.owner_id.def_id).skip_binder().has_opaque_types() {
1463-
// Bounds are respected for `type X = impl Trait` and `type X = (impl Trait, Y);`
1461+
let hir::ItemKind::TyAlias(hir_ty, type_alias_generics) = &item.kind else { return };
1462+
1463+
if cx.tcx.features().lazy_type_alias {
1464+
// Bounds of lazy type aliases are respected.
14641465
return;
14651466
}
1466-
if cx.tcx.type_of(item.owner_id).skip_binder().has_inherent_projections() {
1467-
// Bounds are respected for `type X = … Type::Inherent …`
1467+
1468+
let ty = cx.tcx.type_of(item.owner_id).skip_binder();
1469+
if ty.has_opaque_types() || ty.has_inherent_projections() {
1470+
// Bounds of type aliases that contain opaque types or inherent projections are respected.
1471+
// E.g: `type X = impl Trait;`, `type X = (impl Trait, Y);`, `type X = Type::Inherent;`.
14681472
return;
14691473
}
1474+
14701475
// There must not be a where clause
14711476
if type_alias_generics.predicates.is_empty() {
14721477
return;
@@ -1491,7 +1496,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
14911496
if !where_spans.is_empty() {
14921497
let sub = (!suggested_changing_assoc_types).then(|| {
14931498
suggested_changing_assoc_types = true;
1494-
SuggestChangingAssocTypes { ty }
1499+
SuggestChangingAssocTypes { ty: hir_ty }
14951500
});
14961501
cx.emit_spanned_lint(
14971502
TYPE_ALIAS_BOUNDS,
@@ -1507,7 +1512,7 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds {
15071512
let suggestion = BuiltinTypeAliasGenericBoundsSuggestion { suggestions: inline_sugg };
15081513
let sub = (!suggested_changing_assoc_types).then(|| {
15091514
suggested_changing_assoc_types = true;
1510-
SuggestChangingAssocTypes { ty }
1515+
SuggestChangingAssocTypes { ty: hir_ty }
15111516
});
15121517
cx.emit_spanned_lint(
15131518
TYPE_ALIAS_BOUNDS,

Diff for: compiler/rustc_lint/src/multiple_supertrait_upcastable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ declare_lint! {
1010
/// ### Example
1111
///
1212
/// ```rust
13+
/// #![feature(multiple_supertrait_upcastable)]
1314
/// trait A {}
1415
/// trait B {}
1516
///

Diff for: compiler/rustc_middle/src/traits/solve.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub enum Certainty {
5757

5858
impl Certainty {
5959
pub const AMBIGUOUS: Certainty = Certainty::Maybe(MaybeCause::Ambiguity);
60+
pub const OVERFLOW: Certainty = Certainty::Maybe(MaybeCause::Overflow);
6061

6162
/// Use this function to merge the certainty of multiple nested subgoals.
6263
///
@@ -66,7 +67,7 @@ impl Certainty {
6667
/// success, we merge these two responses. This results in ambiguity.
6768
///
6869
/// If we unify ambiguity with overflow, we return overflow. This doesn't matter
69-
/// inside of the solver as we distinguish ambiguity from overflow. It does
70+
/// inside of the solver as we do not distinguish ambiguity from overflow. It does
7071
/// however matter for diagnostics. If `T: Foo` resulted in overflow and `T: Bar`
7172
/// in ambiguity without changing the inference state, we still want to tell the
7273
/// user that `T: Baz` results in overflow.

Diff for: compiler/rustc_middle/src/ty/mod.rs

+12-13
Original file line numberDiff line numberDiff line change
@@ -1359,12 +1359,24 @@ impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for PolyTraitPredicate<'tcx> {
13591359
}
13601360
}
13611361

1362+
impl<'tcx> ToPredicate<'tcx> for OutlivesPredicate<ty::Region<'tcx>, ty::Region<'tcx>> {
1363+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1364+
ty::Binder::dummy(PredicateKind::Clause(ClauseKind::RegionOutlives(self))).to_predicate(tcx)
1365+
}
1366+
}
1367+
13621368
impl<'tcx> ToPredicate<'tcx> for PolyRegionOutlivesPredicate<'tcx> {
13631369
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13641370
self.map_bound(|p| PredicateKind::Clause(ClauseKind::RegionOutlives(p))).to_predicate(tcx)
13651371
}
13661372
}
13671373

1374+
impl<'tcx> ToPredicate<'tcx> for OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>> {
1375+
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
1376+
ty::Binder::dummy(PredicateKind::Clause(ClauseKind::TypeOutlives(self))).to_predicate(tcx)
1377+
}
1378+
}
1379+
13681380
impl<'tcx> ToPredicate<'tcx> for PolyTypeOutlivesPredicate<'tcx> {
13691381
fn to_predicate(self, tcx: TyCtxt<'tcx>) -> Predicate<'tcx> {
13701382
self.map_bound(|p| PredicateKind::Clause(ClauseKind::TypeOutlives(p))).to_predicate(tcx)
@@ -2613,19 +2625,6 @@ impl<'tcx> TyCtxt<'tcx> {
26132625
matches!(self.trait_of_item(def_id), Some(trait_id) if self.has_attr(trait_id, sym::const_trait))
26142626
}
26152627

2616-
pub fn impl_trait_in_trait_parent_fn(self, mut def_id: DefId) -> DefId {
2617-
match self.opt_rpitit_info(def_id) {
2618-
Some(ImplTraitInTraitData::Trait { fn_def_id, .. })
2619-
| Some(ImplTraitInTraitData::Impl { fn_def_id, .. }) => fn_def_id,
2620-
None => {
2621-
while let def_kind = self.def_kind(def_id) && def_kind != DefKind::AssocFn {
2622-
def_id = self.parent(def_id);
2623-
}
2624-
def_id
2625-
}
2626-
}
2627-
}
2628-
26292628
/// Returns the `DefId` of the item within which the `impl Trait` is declared.
26302629
/// For type-alias-impl-trait this is the `type` alias.
26312630
/// For impl-trait-in-assoc-type this is the assoc type.

Diff for: compiler/rustc_trait_selection/src/solve/assembly/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_hir::def_id::DefId;
77
use rustc_infer::traits::query::NoSolution;
88
use rustc_infer::traits::Reveal;
99
use rustc_middle::traits::solve::inspect::CandidateKind;
10-
use rustc_middle::traits::solve::{CanonicalResponse, Certainty, Goal, MaybeCause, QueryResult};
10+
use rustc_middle::traits::solve::{CanonicalResponse, Certainty, Goal, QueryResult};
1111
use rustc_middle::traits::BuiltinImplSource;
1212
use rustc_middle::ty::fast_reject::{SimplifiedType, TreatParams};
1313
use rustc_middle::ty::{self, Ty, TyCtxt};
@@ -299,7 +299,7 @@ pub(super) trait GoalKind<'tcx>:
299299
/// for unsize coercion in hir typeck and because it is difficult to
300300
/// otherwise recompute this for codegen. This is a bit of a mess but the
301301
/// easiest way to maintain the existing behavior for now.
302-
fn consider_builtin_unsize_and_upcast_candidates(
302+
fn consider_builtin_unsize_candidates(
303303
ecx: &mut EvalCtxt<'_, 'tcx>,
304304
goal: Goal<'tcx, Self>,
305305
) -> Vec<(CanonicalResponse<'tcx>, BuiltinImplSource)>;
@@ -402,7 +402,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
402402
ecx.with_incremented_depth(
403403
|ecx| {
404404
let result = ecx.evaluate_added_goals_and_make_canonical_response(
405-
Certainty::Maybe(MaybeCause::Overflow),
405+
Certainty::OVERFLOW,
406406
)?;
407407
Ok(vec![Candidate {
408408
source: CandidateSource::BuiltinImpl(BuiltinImplSource::Misc),
@@ -624,7 +624,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
624624
// There may be multiple unsize candidates for a trait with several supertraits:
625625
// `trait Foo: Bar<A> + Bar<B>` and `dyn Foo: Unsize<dyn Bar<_>>`
626626
if lang_items.unsize_trait() == Some(trait_def_id) {
627-
for (result, source) in G::consider_builtin_unsize_and_upcast_candidates(self, goal) {
627+
for (result, source) in G::consider_builtin_unsize_candidates(self, goal) {
628628
candidates.push(Candidate { source: CandidateSource::BuiltinImpl(source), result });
629629
}
630630
}

Diff for: compiler/rustc_trait_selection/src/solve/eval_ctxt.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use rustc_infer::traits::ObligationCause;
1111
use rustc_middle::infer::unify_key::{ConstVariableOrigin, ConstVariableOriginKind};
1212
use rustc_middle::traits::solve::inspect;
1313
use rustc_middle::traits::solve::{
14-
CanonicalInput, CanonicalResponse, Certainty, IsNormalizesToHack, MaybeCause,
15-
PredefinedOpaques, PredefinedOpaquesData, QueryResult,
14+
CanonicalInput, CanonicalResponse, Certainty, IsNormalizesToHack, PredefinedOpaques,
15+
PredefinedOpaquesData, QueryResult,
1616
};
1717
use rustc_middle::traits::DefiningAnchor;
1818
use rustc_middle::ty::{
@@ -475,7 +475,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
475475
let mut new_goals = NestedGoals::new();
476476

477477
let response = self.repeat_while_none(
478-
|_| Ok(Certainty::Maybe(MaybeCause::Overflow)),
478+
|_| Ok(Certainty::OVERFLOW),
479479
|this| {
480480
this.inspect.evaluate_added_goals_loop_start();
481481

Diff for: compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ fn rematch_unsize<'tcx>(
338338
.into_obligations(),
339339
);
340340

341-
// Similar to ADTs, require that the rest of the fields are equal.
341+
// Similar to ADTs, require that we can unsize the tail.
342342
nested.push(Obligation::new(
343343
tcx,
344344
ObligationCause::dummy(),

Diff for: compiler/rustc_trait_selection/src/solve/project_goals.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ impl<'tcx> assembly::GoalKind<'tcx> for ProjectionPredicate<'tcx> {
503503
)
504504
}
505505

506-
fn consider_builtin_unsize_and_upcast_candidates(
506+
fn consider_builtin_unsize_candidates(
507507
_ecx: &mut EvalCtxt<'_, 'tcx>,
508508
goal: Goal<'tcx, Self>,
509509
) -> Vec<(CanonicalResponse<'tcx>, BuiltinImplSource)> {

Diff for: compiler/rustc_trait_selection/src/solve/search_graph/mod.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ use cache::ProvisionalCache;
99
use overflow::OverflowData;
1010
use rustc_index::IndexVec;
1111
use rustc_middle::dep_graph::DepKind;
12-
use rustc_middle::traits::solve::{
13-
CanonicalInput, Certainty, EvaluationCache, MaybeCause, QueryResult,
14-
};
12+
use rustc_middle::traits::solve::{CanonicalInput, Certainty, EvaluationCache, QueryResult};
1513
use rustc_middle::ty::TyCtxt;
1614
use std::{collections::hash_map::Entry, mem};
1715

@@ -146,11 +144,7 @@ impl<'tcx> SearchGraph<'tcx> {
146144
{
147145
Err(cache.provisional_result(entry_index))
148146
} else {
149-
Err(super::response_no_constraints(
150-
tcx,
151-
input,
152-
Certainty::Maybe(MaybeCause::Overflow),
153-
))
147+
Err(super::response_no_constraints(tcx, input, Certainty::OVERFLOW))
154148
}
155149
}
156150
}

Diff for: compiler/rustc_trait_selection/src/solve/search_graph/overflow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc_infer::infer::canonical::Canonical;
22
use rustc_infer::traits::query::NoSolution;
3-
use rustc_middle::traits::solve::{Certainty, MaybeCause, QueryResult};
3+
use rustc_middle::traits::solve::{Certainty, QueryResult};
44
use rustc_middle::ty::TyCtxt;
55
use rustc_session::Limit;
66

@@ -115,6 +115,6 @@ impl<'tcx> SearchGraph<'tcx> {
115115
goal: Canonical<'tcx, impl Sized>,
116116
) -> QueryResult<'tcx> {
117117
self.overflow_data.deal_with_overflow();
118-
response_no_constraints(tcx, goal, Certainty::Maybe(MaybeCause::Overflow))
118+
response_no_constraints(tcx, goal, Certainty::OVERFLOW)
119119
}
120120
}

0 commit comments

Comments
 (0)