1
Fork 0

Rollup merge of #122540 - WaffleLapkin:ununexpected, r=estebank

Do not use `?`-induced skewing of type inference in the compiler

This prevents breakage from #122412 and is generally a good idea.

r? `@estebank`
This commit is contained in:
Matthias Krüger 2024-03-20 05:51:22 +01:00 committed by GitHub
commit 9fb40efa6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 30 additions and 18 deletions

View file

@ -990,7 +990,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
let generics_def_id = tcx.res_generics_def_id(path.res)?;
let generics = tcx.generics_of(generics_def_id);
if generics.has_impl_trait() {
None?;
do yeet ();
}
let insert_span =
path.segments.last().unwrap().ident.span.shrink_to_hi().with_hi(path.span.hi());
@ -1044,7 +1044,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
let generics = tcx.generics_of(def_id);
let segment: Option<_> = try {
if !segment.infer_args || generics.has_impl_trait() {
None?;
do yeet ();
}
let span = tcx.hir().span(segment.hir_id);
let insert_span = segment.ident.span.shrink_to_hi().with_hi(span.hi());

View file

@ -27,6 +27,7 @@
#![feature(iterator_try_collect)]
#![cfg_attr(bootstrap, feature(min_specialization))]
#![feature(try_blocks)]
#![feature(yeet_expr)]
#![recursion_limit = "512"] // For rustdoc
#[macro_use]