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
|
@ -12,6 +12,7 @@
|
||||||
#![feature(proc_macro_internals)]
|
#![feature(proc_macro_internals)]
|
||||||
#![feature(proc_macro_span)]
|
#![feature(proc_macro_span)]
|
||||||
#![feature(try_blocks)]
|
#![feature(try_blocks)]
|
||||||
|
#![feature(yeet_expr)]
|
||||||
#![allow(rustc::diagnostic_outside_of_impl)]
|
#![allow(rustc::diagnostic_outside_of_impl)]
|
||||||
#![allow(internal_features)]
|
#![allow(internal_features)]
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ pub(crate) fn parse_external_mod(
|
||||||
|
|
||||||
// Ensure file paths are acyclic.
|
// Ensure file paths are acyclic.
|
||||||
if let Some(pos) = module.file_path_stack.iter().position(|p| p == &mp.file_path) {
|
if let Some(pos) = module.file_path_stack.iter().position(|p| p == &mp.file_path) {
|
||||||
Err(ModError::CircularInclusion(module.file_path_stack[pos..].to_vec()))?;
|
do yeet ModError::CircularInclusion(module.file_path_stack[pos..].to_vec());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually parse the external file as a module.
|
// Actually parse the external file as a module.
|
||||||
|
|
|
@ -990,7 +990,7 @@ impl<'a, 'tcx> FindInferSourceVisitor<'a, 'tcx> {
|
||||||
let generics_def_id = tcx.res_generics_def_id(path.res)?;
|
let generics_def_id = tcx.res_generics_def_id(path.res)?;
|
||||||
let generics = tcx.generics_of(generics_def_id);
|
let generics = tcx.generics_of(generics_def_id);
|
||||||
if generics.has_impl_trait() {
|
if generics.has_impl_trait() {
|
||||||
None?;
|
do yeet ();
|
||||||
}
|
}
|
||||||
let insert_span =
|
let insert_span =
|
||||||
path.segments.last().unwrap().ident.span.shrink_to_hi().with_hi(path.span.hi());
|
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 generics = tcx.generics_of(def_id);
|
||||||
let segment: Option<_> = try {
|
let segment: Option<_> = try {
|
||||||
if !segment.infer_args || generics.has_impl_trait() {
|
if !segment.infer_args || generics.has_impl_trait() {
|
||||||
None?;
|
do yeet ();
|
||||||
}
|
}
|
||||||
let span = tcx.hir().span(segment.hir_id);
|
let span = tcx.hir().span(segment.hir_id);
|
||||||
let insert_span = segment.ident.span.shrink_to_hi().with_hi(span.hi());
|
let insert_span = segment.ident.span.shrink_to_hi().with_hi(span.hi());
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#![feature(iterator_try_collect)]
|
#![feature(iterator_try_collect)]
|
||||||
#![cfg_attr(bootstrap, feature(min_specialization))]
|
#![cfg_attr(bootstrap, feature(min_specialization))]
|
||||||
#![feature(try_blocks)]
|
#![feature(try_blocks)]
|
||||||
|
#![feature(yeet_expr)]
|
||||||
#![recursion_limit = "512"] // For rustdoc
|
#![recursion_limit = "512"] // For rustdoc
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue