Use do yeet ()
and do yeet _
instead of None?
and Err(_)?
in compiler
This prevents breakage when `?` no longer skews inference.
This commit is contained in:
parent
defcc44238
commit
75d940f637
4 changed files with 5 additions and 3 deletions
|
@ -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());
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue