diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2024-03-15 11:37:42 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2024-03-15 11:37:42 +0000 |
| commit | 75d940f6379572631209a64791cdb317a0279dac (patch) | |
| tree | ea6be7eb754b33d9d50af1ae33a0ffcdb25e3e85 | |
| parent | defcc44238d9d79b7bcf5dfae2ec33001f568dd0 (diff) | |
| download | rust-75d940f6379572631209a64791cdb317a0279dac.tar.gz rust-75d940f6379572631209a64791cdb317a0279dac.zip | |
Use `do yeet ()` and `do yeet _` instead of `None?` and `Err(_)?` in compiler
This prevents breakage when `?` no longer skews inference.
| -rw-r--r-- | compiler/rustc_expand/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_expand/src/module.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/lib.rs | 1 |
4 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs index e550f7242c3..94852884d6b 100644 --- a/compiler/rustc_expand/src/lib.rs +++ b/compiler/rustc_expand/src/lib.rs @@ -12,6 +12,7 @@ #![feature(proc_macro_internals)] #![feature(proc_macro_span)] #![feature(try_blocks)] +#![feature(yeet_expr)] #![allow(rustc::diagnostic_outside_of_impl)] #![allow(internal_features)] diff --git a/compiler/rustc_expand/src/module.rs b/compiler/rustc_expand/src/module.rs index 8a68b39e496..c8983619e70 100644 --- a/compiler/rustc_expand/src/module.rs +++ b/compiler/rustc_expand/src/module.rs @@ -62,7 +62,7 @@ pub(crate) fn parse_external_mod( // Ensure file paths are acyclic. 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. diff --git a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs index 13e2152e45e..0686994b037 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs @@ -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()); diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index 029bddda1e1..97e3dfe8d07 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -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] |
