jiebi/CodeConvo huggingface dataset:
<ins> error: this operation will panic at runtime --> $DIR/index-bounds.rs:4:14 | LL |     let _n = [64][200]; |              ^^^^^^^^^ index out of bounds: the length is 1 but the index is 200 | = note: `#[deny(unconditional_panic)]` on by default error: this operation will panic at runtime --> $DIR/index-bounds.rs:8:14 | LL |     let _n = [64][u32::MAX as usize - 1]; |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4294967294 error: aborting due to 2 previous errors </ins>
fn parse_crate_mod(&mut self) -> Result<ast::Crate, ParserError> { let mut parser = AssertUnwindSafe(&mut self.parser); <del> match catch_unwind(move || parser.parse_crate_mod()) { Ok(Ok(k)) => Ok(k), Ok(Err(db)) => { </del> <ins> // rustfmt doesn't use `run_compiler` like other tools, so it must emit // any stashed diagnostics itself, otherwise the `DiagCtxt` will assert // when dropped. The final result here combines the parsing result and // the `emit_stashed_diagnostics` result. let parse_res = catch_unwind(move || parser.parse_crate_mod()); let stashed_res = self.parser.dcx().emit_stashed_diagnostics(); let err = Err(ParserError::ParsePanicError); match (parse_res, stashed_res) { (Ok(Ok(k)), None) => Ok(k), (Ok(Ok(_)), Some(_guar)) => err, (Ok(Err(db)), _) => { </ins> db.emit(); <del> Err(ParserError::ParseError) </del> <ins> err </ins> } <del> Err(_) => Err(ParserError::ParsePanicError), </del> <ins> (Err(_), _) => err, </ins> } } }
margin: 0 auto; padding: 0 15px; font-size: 18px; <del> color: #333; </del> <ins> color: #000; </ins> line-height: 1.428571429; -webkit-box-sizing: unset; -moz-box-sizing: unset; box-sizing: unset; <ins> background: #fff; </ins> } @media (min-width: 768px) { body {
use rustc_middle::query::on_disk_cache::AbsoluteBytePos; use rustc_middle::query::on_disk_cache::{CacheDecoder, CacheEncoder, EncodedDepNodeIndex}; use rustc_middle::query::Key; <ins> use rustc_middle::ty::print::with_reduced_queries; </ins> use rustc_middle::ty::tls::{self, ImplicitCtxt}; use rustc_middle::ty::{self, TyCtxt}; use rustc_query_system::dep_graph::{DepNodeParams, HasDepContext};
kind: DepKind, name: &'static str, ) -> QueryStackFrame { <ins> // If reduced queries are requested, we may be printing a query stack due // to a panic. Avoid using `default_span` and `def_kind` in that case. let reduce_queries = with_reduced_queries(); </ins> // Avoid calling queries while formatting the description let description = ty::print::with_no_queries!(do_describe(tcx, key)); let description = if tcx.sess.verbose_internals() {
#[unstable(feature = "slice_index_methods", issue = "none")] fn get_mut(self, slice: &mut T) -> Option<&mut Self::Output>; <del> /// Returns a shared reference to the output at this location, without </del> <ins> /// Returns a pointer to the output at this location, without </ins> /// performing any bounds checking. /// Calling this method with an out-of-bounds index or a dangling `slice` pointer <del> /// is *[undefined behavior]* even if the resulting reference is not used. </del> <ins> /// is *[undefined behavior]* even if the resulting pointer is not used. </ins> /// /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[unstable(feature = "slice_index_methods", issue = "none")] unsafe fn get_unchecked(self, slice: *const T) -> *const Self::Output; <del> /// Returns a mutable reference to the output at this location, without </del> <ins> /// Returns a mutable pointer to the output at this location, without </ins> /// performing any bounds checking. /// Calling this method with an out-of-bounds index or a dangling `slice` pointer <del> /// is *[undefined behavior]* even if the resulting reference is not used. </del> <ins> /// is *[undefined behavior]* even if the resulting pointer is not used. </ins> /// /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html #[unstable(feature = "slice_index_methods", issue = "none")]
trait_selection_closure_kind_requirement = the requirement to implement `{$trait_prefix}{$expected}` derives from here <ins> trait_selection_disallowed_positional_argument = positional format arguments are not allowed here .help = only named format arguments with the name of one of the generic types are allowed in this context </ins> trait_selection_dump_vtable_entries = vtable entries for `{$trait_ref}`: {$entries} trait_selection_empty_on_clause_in_rustc_on_unimplemented = empty `on`-clause in `#[rustc_on_unimplemented]`
trait_selection_inherent_projection_normalization_overflow = overflow evaluating associated type `{$ty}` <ins> trait_selection_invalid_format_specifier = invalid format specifier .help = no format specifier are supported in this position </ins> trait_selection_invalid_on_clause_in_rustc_on_unimplemented = invalid `on`-clause in `#[rustc_on_unimplemented]` .label = invalid on-clause here
trait_name: Symbol, } <ins> #[derive(LintDiagnostic)] #[diag(trait_selection_disallowed_positional_argument)] #[help] pub struct DisallowedPositionalArgument; #[derive(LintDiagnostic)] #[diag(trait_selection_invalid_format_specifier)] #[help] pub struct InvalidFormatSpecifier; #[derive(LintDiagnostic)] #[diag(trait_selection_wrapped_parser_error)] pub struct WrappedParserError { description: String, label: String, } </ins> impl<'tcx> OnUnimplementedDirective { fn parse( tcx: TyCtxt<'tcx>,
let empty_string = String::new(); let s = self.symbol.as_str(); <del> let parser = Parser::new(s, None, None, false, ParseMode::Format); </del> <ins> let mut parser = Parser::new(s, None, None, false, ParseMode::Format); </ins> let item_context = (options.get(&sym::ItemContext)).unwrap_or(&empty_string); <del> parser </del> <ins> let constructed_message = (&mut parser) </ins> .map(|p| match p { Piece::String(s) => s.to_owned(), Piece::NextArgument(a) => match a.position {
} } } <ins> Position::ArgumentImplicitlyIs(_) if self.is_diagnostic_namespace_variant => { String::from("{}") } Position::ArgumentIs(idx) if self.is_diagnostic_namespace_variant => { format!("{{{idx}}}") } </ins> _ => bug!("broken on_unimplemented {:?} - bad format arg", self.symbol), }, }) <del> .collect() </del> <ins> .collect(); // we cannot return errors from processing the format string as hard error here // as the diagnostic namespace gurantees that malformed input cannot cause an error // // if we encounter any error while processing the format string // we don't want to show the potentially half assembled formated string, // therefore we fall back to just showing the input string in this case // // The actual parser errors are emitted earlier // as lint warnings in OnUnimplementedFormatString::verify if self.is_diagnostic_namespace_variant && !parser.errors.is_empty() { String::from(s) } else { constructed_message } </ins> } }
<ins> #[diagnostic::on_unimplemented(message = "{{Test } thing")] //~^WARN unmatched `}` found //~|WARN unmatched `}` found trait ImportantTrait1 {} #[diagnostic::on_unimplemented(message = "Test {}")] //~^WARN positional format arguments are not allowed here //~|WARN positional format arguments are not allowed here trait ImportantTrait2 {} #[diagnostic::on_unimplemented(message = "Test {1:}")] //~^WARN positional format arguments are not allowed here //~|WARN positional format arguments are not allowed here trait ImportantTrait3 {} #[diagnostic::on_unimplemented(message = "Test {Self:123}")] //~^WARN invalid format specifier //~|WARN invalid format specifier trait ImportantTrait4 {} #[diagnostic::on_unimplemented(message = "Test {Self:!}")] //~^WARN expected `'}'`, found `'!'` //~|WARN expected `'}'`, found `'!'` //~|WARN unmatched `}` found //~|WARN unmatched `}` found trait ImportantTrait5 {} fn check_1(_: impl ImportantTrait1) {} fn check_2(_: impl ImportantTrait2) {} fn check_3(_: impl ImportantTrait3) {} fn check_4(_: impl ImportantTrait4) {} fn check_5(_: impl ImportantTrait5) {} fn main() { check_1(()); //~^ERROR {{Test } thing check_2(()); //~^ERROR Test {} check_3(()); //~^ERROR Test {1} check_4(()); //~^ERROR Test () check_5(()); //~^ERROR Test {Self:!} } </ins>
// FIXME: We should investigate the perf implications of not uniquifying // `ReErased`. We may be able to short-circuit registering region // obligations if we encounter a `ReErased` on one side, for example. <del> ty::ReStatic | ty::ReErased => match self.canonicalize_mode { </del> <ins> ty::ReStatic | ty::ReErased | ty::ReError(_) => match self.canonicalize_mode { </ins> CanonicalizeMode::Input => CanonicalVarKind::Region(ty::UniverseIndex::ROOT), CanonicalizeMode::Response { .. } => return r, },
<ins> //@ compile-flags: -Znext-solver trait Tr<'a> {} // Fulfillment in the new solver relies on an invariant to hold: Either // `has_changed` is true, or computing a goal's certainty is idempotent. // This isn't true for `ReError`, which we used to pass through in the // canonicalizer even on input mode, which can cause a goal to go from // ambig => pass, but we don't consider `has_changed` when the response // only contains region constraints (since we usually uniquify regions). // //   In this test: // Implicit negative coherence tries to prove `W<?0>: Constrain<'?1>`, // which will then match with the impl below. This constrains `'?1` to // `ReError`, but still bails w/ ambiguity bc we can't prove `?0: Sized`. // Then, when we recompute the goal `W<?0>: Constrain<'error>`, when // collecting ambiguities and overflows, we end up assembling a default // error candidate w/o ambiguity, which causes the goal to pass, and ICE. impl<'a, A: ?Sized> Tr<'a> for W<A> {} struct W<A: ?Sized>(A); impl<'a, A: ?Sized> Tr<'a> for A where A: Constrain<'a> {} //~^ ERROR conflicting implementations of trait `Tr<'_>` for type `W<_>` trait Constrain<'a> {} impl<A: Sized> Constrain<'missing> for W<A> {} //~^ ERROR use of undeclared lifetime name `'missing` fn main() {} </ins>
<ins> error[E0261]: use of undeclared lifetime name `'missing` --> $DIR/dont-canonicalize-re-error.rs:25:26 | LL | impl<A: Sized> Constrain<'missing> for W<A> {} |      -                   ^^^^^^^^ undeclared lifetime |      | |      help: consider introducing lifetime `'missing` here: `'missing,` error[E0119]: conflicting implementations of trait `Tr<'_>` for type `W<_>` --> $DIR/dont-canonicalize-re-error.rs:21:1 | LL | impl<'a, A: ?Sized> Tr<'a> for W<A> {} | ----------------------------------- first implementation here LL | struct W<A: ?Sized>(A); LL | impl<'a, A: ?Sized> Tr<'a> for A where A: Constrain<'a> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `W<_>` error: aborting due to 2 previous errors Some errors have detailed explanations: E0119, E0261. For more information about an error, try `rustc --explain E0119`. </ins>
tcx: TyCtxt<'tcx>, predicates: &List<ty::PolyExistentialPredicate<'tcx>>, ) -> &'tcx List<ty::PolyExistentialPredicate<'tcx>> { <del> let predicates: Vec<ty::PolyExistentialPredicate<'tcx>> = predicates .iter() .filter_map(|predicate| match predicate.skip_binder() { </del> <ins> tcx.mk_poly_existential_predicates_from_iter(predicates.iter().filter_map(|predicate| { match predicate.skip_binder() { </ins> ty::ExistentialPredicate::Trait(trait_ref) => { let trait_ref = ty::TraitRef::identity(tcx, trait_ref.def_id); Some(ty::Binder::dummy(ty::ExistentialPredicate::Trait(
let ty::Dynamic(preds, lifetime, kind) = ty.kind() else { bug!("Tried to strip auto traits from non-dynamic type {ty}"); }; <del> let filtered_preds = if preds.principal().is_some() { </del> <ins> let new_rcvr = if preds.principal().is_some() { let filtered_preds = </ins> tcx.mk_poly_existential_predicates_from_iter(preds.into_iter().filter(|pred| { !matches!(pred.skip_binder(), ty::ExistentialPredicate::AutoTrait(..)) <del> })) } else { ty::List::empty() }; let new_rcvr = Ty::new_dynamic(tcx, filtered_preds, *lifetime, *kind); </del> <ins> })); Ty::new_dynamic(tcx, filtered_preds, *lifetime, *kind) } else { // If there's no principal type, re-encode it as a unit, since we don't know anything // about it. This technically discards the knowledge that it was a type that was made // into a trait object at some point, but that's not a lot. tcx.types.unit }; </ins> tcx.mk_args_trait(new_rcvr, args.into_iter().skip(1)) }
<ins> // Check that dropping a trait object without a principal trait succeeds //@ needs-sanitizer-cfi // FIXME(#122848) Remove only-linux once OSX CFI binaries works //@ only-linux //@ compile-flags: --crate-type=bin -Cprefer-dynamic=off -Clto -Zsanitizer=cfi //@ compile-flags: -C target-feature=-crt-static -C codegen-units=1 -C opt-level=0 // FIXME(#118761) Should be run-pass once the labels on drop are compatible. // This test is being landed ahead of that to test that the compiler doesn't ICE while labeling the // callsite for a drop, but the vtable doesn't have the correct label yet. //@ build-pass struct CustomDrop; impl Drop for CustomDrop { fn drop(&mut self) {} } fn main() { let _ = Box::new(CustomDrop) as Box<dyn Send>; } </ins>
n => { let m = cmp::min(n, self.steals); self.steals -= m; <del> self.cnt.fetch_add(n - m, atomics::SeqCst); </del> <ins> self.bump(n - m); </ins> } } assert!(self.steals >= 0); } <ins> self.steals += 1; </ins> match data { Data(t) => Ok(t), GoUp(up) => Err(Upgraded(up)),
binder: EarlyBinder<TraitRef<'tcx>>, mut did_has_local_parent: impl FnMut(DefId) -> bool, ) -> bool { <del> let infcx = tcx.infer_ctxt().build(); </del> <ins> let infcx = tcx .infer_ctxt() // We use the new trait solver since the obligation we are trying to // prove here may overflow and those are fatal in the old trait solver. // Which is unacceptable for a lint. // // Thanksfully the part we use here are very similar to the // new-trait-solver-as-coherence, which is in stabilization. // // https://github.com/rust-lang/rust/issues/123573 .with_next_trait_solver(true) .build(); </ins> let trait_ref = binder.instantiate(tcx, infcx.fresh_args_for_item(infer_span, trait_def_id)); let trait_ref = trait_ref.fold_with(&mut ReplaceLocalTypesWithInfer {
<ins> warning: non-local `impl` definition, they should be avoided as they go against expectation --> $DIR/trait-solver-overflow-123573.rs:12:5 | LL |     impl Test for &Local {} |     ^^^^^^^^^^^^^^^^^^^^^^^ | = help: move this `impl` block outside the of the current function `main` = note: an `impl` definition is non-local if it is nested inside an item and may impact type checking outside of that item. This can be the case if neither the trait or the self type are at the same nesting level as the `impl` = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module and anon-const at the same nesting as the trait or type = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363> = note: `#[warn(non_local_definitions)]` on by default warning: 1 warning emitted </ins>
use rustc_middle::mir::FakeReadCause; use rustc_middle::traits::ObligationCauseCode; use rustc_middle::ty::{ <del> self, ClosureSizeProfileData, Ty, TyCtxt, TypeckResults, UpvarArgs, UpvarCapture, </del> <ins> self, ClosureSizeProfileData, Ty, TyCtxt, TypeVisitableExt as _, TypeckResults, UpvarArgs, UpvarCapture, </ins> }; use rustc_session::lint; use rustc_span::sym;
// For coroutine-closures, we additionally must compute the // `coroutine_captures_by_ref_ty` type, which is used to generate the by-ref // version of the coroutine-closure's output coroutine. <del> if let UpvarArgs::CoroutineClosure(args) = args { </del> <ins> if let UpvarArgs::CoroutineClosure(args) = args && !args.references_error() { </ins> let closure_env_region: ty::Region<'_> = ty::Region::new_bound( self.tcx, ty::INNERMOST,
<ins> //@ edition: 2021 #![feature(async_closure)] struct DropMe; trait Impossible {} fn trait_error<T: Impossible>() {} pub fn main() { let b = DropMe; let async_closure = async move || { // Type error here taints the environment. This causes us to fallback all // variables to `Error`. This means that when we compute the upvars for the // *outer* coroutine-closure, we don't actually see any upvars since `MemCategorization` // and `ExprUseVisitor`` will bail early when it sees error. This means // that our underlying assumption that the parent and child captures are // compatible ends up being broken, previously leading to an ICE. trait_error::<()>(); //~^ ERROR the trait bound `(): Impossible` is not satisfied let _b = b; }; } </ins>
<ins> error[E0277]: the trait bound `(): Impossible` is not satisfied --> $DIR/dont-ice-when-body-tainted-by-errors.rs:19:23 | LL |         trait_error::<()>(); |                       ^^ the trait `Impossible` is not implemented for `()` | help: this trait has no implementations, consider adding one --> $DIR/dont-ice-when-body-tainted-by-errors.rs:7:1 | LL | trait Impossible {} | ^^^^^^^^^^^^^^^^ note: required by a bound in `trait_error` --> $DIR/dont-ice-when-body-tainted-by-errors.rs:8:19 | LL | fn trait_error<T: Impossible>() {} |                   ^^^^^^^^^^ required by this bound in `trait_error` error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0277`. </ins>
passes_both_ffi_const_and_pure = `#[ffi_const]` function cannot be `#[ffi_pure]` <del> passes_break_inside_async_block = `{$name}` inside of an `async` block .label = cannot `{$name}` inside of an `async` block .async_block_label = enclosing `async` block </del> passes_break_inside_closure = `{$name}` inside of a closure .label = cannot `{$name}` inside of a closure .closure_label = enclosing closure <ins> passes_break_inside_coroutine = `{$name}` inside `{$kind}` {$source} .label = cannot `{$name}` inside `{$kind}` {$source} .coroutine_label = enclosing `{$kind}` {$source} </ins> passes_break_non_loop = `break` with value from a `{$kind}` loop .label = can only break with a value inside `loop` or breakable block
} #[derive(Diagnostic)] <del> #[diag(passes_break_inside_async_block, code = E0267)] pub struct BreakInsideAsyncBlock<'a> { </del> <ins> #[diag(passes_break_inside_coroutine, code = E0267)] pub struct BreakInsideCoroutine<'a> { </ins> #[primary_span] #[label] pub span: Span, <del> #[label(passes_async_block_label)] pub closure_span: Span, </del> <ins> #[label(passes_coroutine_label)] pub coroutine_span: Span, </ins> pub name: &'a str, <ins> pub kind: &'a str, pub source: &'a str, </ins> } #[derive(Diagnostic)]
use rustc_span::{BytePos, Span}; use crate::errors::{ <del> BreakInsideAsyncBlock, BreakInsideClosure, BreakNonLoop, ContinueLabeledBlock, OutsideLoop, </del> <ins> BreakInsideClosure, BreakInsideCoroutine, BreakNonLoop, ContinueLabeledBlock, OutsideLoop, </ins> OutsideLoopSuggestion, UnlabeledCfInWhileCondition, UnlabeledInLabeledBlock, };
hir::ExprKind::Closure(&hir::Closure { ref fn_decl, body, fn_decl_span, kind, .. }) => { <del> // FIXME(coroutines): This doesn't handle coroutines correctly </del> let cx = match kind { <del> hir::ClosureKind::Coroutine(hir::CoroutineKind::Desugared( hir::CoroutineDesugaring::Async, hir::CoroutineSource::Block, )) => AsyncClosure(fn_decl_span), </del> <ins> hir::ClosureKind::Coroutine(hir::CoroutineKind::Desugared(kind, source)) => { Coroutine { coroutine_span: fn_decl_span, kind, source } } </ins> _ => Closure(fn_decl_span), }; self.visit_fn_decl(fn_decl);
Closure(closure_span) => { self.sess.dcx().emit_err(BreakInsideClosure { span, closure_span, name }); } <del> AsyncClosure(closure_span) => { self.sess.dcx().emit_err(BreakInsideAsyncBlock { span, closure_span, name }); </del> <ins> Coroutine { coroutine_span, kind, source } => { let kind = match kind { hir::CoroutineDesugaring::Async => "async", hir::CoroutineDesugaring::Gen => "gen", hir::CoroutineDesugaring::AsyncGen => "async gen", }; let source = match source { hir::CoroutineSource::Block => "block", hir::CoroutineSource::Closure => "closure", hir::CoroutineSource::Fn => "function", }; self.sess.dcx().emit_err(BreakInsideCoroutine { span, coroutine_span, name, kind, source, }); </ins> } UnlabeledBlock(block_span) if is_break && block_span.eq_ctxt(break_span) => { let suggestion = Some(OutsideLoopSuggestion { block_span, break_span });
fn no_break_in_async_block() { async { <del> break 0u8; //~ ERROR `break` inside of an `async` block </del> <ins> break 0u8; //~ ERROR `break` inside `async` block </ins> }; } fn no_break_in_async_block_even_with_outer_loop() { loop { async { <del> break 0u8; //~ ERROR `break` inside of an `async` block </del> <ins> break 0u8; //~ ERROR `break` inside `async` block </ins> }; } }
<del> error[E0267]: `break` inside of an `async` block </del> <ins> error[E0267]: `break` inside `async` block </ins> --> $DIR/async-block-control-flow-static-semantics.rs:32:9 | LL | /     async { LL | |         break 0u8; <del> | |         ^^^^^^^^^ cannot `break` inside of an `async` block </del> <ins> | |         ^^^^^^^^^ cannot `break` inside `async` block </ins> LL | |     }; | |_____- enclosing `async` block <del> error[E0267]: `break` inside of an `async` block </del> <ins> error[E0267]: `break` inside `async` block </ins> --> $DIR/async-block-control-flow-static-semantics.rs:39:13 | LL | /         async { LL | |             break 0u8; <del> | |             ^^^^^^^^^ cannot `break` inside of an `async` block </del> <ins> | |             ^^^^^^^^^ cannot `break` inside `async` block </ins> LL | |         }; | |_________- enclosing `async` block
<ins> //@ edition: 2024 //@ compile-flags: -Z unstable-options #![feature(gen_blocks)] #![feature(async_closure)] async fn async_fn() { break; //~ ERROR `break` inside `async` function } gen fn gen_fn() { break; //~ ERROR `break` inside `gen` function } async gen fn async_gen_fn() { break; //~ ERROR `break` inside `async gen` function } fn main() { let _ = async { break; }; //~ ERROR `break` inside `async` block let _ = async || { break; }; //~ ERROR `break` inside `async` closure let _ = gen { break; }; //~ ERROR `break` inside `gen` block let _ = async gen { break; }; //~ ERROR `break` inside `async gen` block } </ins>
<ins> error[E0267]: `break` inside `async` function --> $DIR/break-inside-coroutine-issue-124495.rs:8:5 | LL |   async fn async_fn() { |  _____________________- LL | |     break; | |     ^^^^^ cannot `break` inside `async` function LL | | } | |_- enclosing `async` function error[E0267]: `break` inside `gen` function --> $DIR/break-inside-coroutine-issue-124495.rs:12:5 | LL |   gen fn gen_fn() { |  _________________- LL | |     break; | |     ^^^^^ cannot `break` inside `gen` function LL | | } | |_- enclosing `gen` function error[E0267]: `break` inside `async gen` function --> $DIR/break-inside-coroutine-issue-124495.rs:16:5 | LL |   async gen fn async_gen_fn() { |  _____________________________- LL | |     break; | |     ^^^^^ cannot `break` inside `async gen` function LL | | } | |_- enclosing `async gen` function error[E0267]: `break` inside `async` block --> $DIR/break-inside-coroutine-issue-124495.rs:20:21 | LL |     let _ = async { break; }; |             --------^^^^^--- |             |       | |             |       cannot `break` inside `async` block |             enclosing `async` block error[E0267]: `break` inside `async` closure --> $DIR/break-inside-coroutine-issue-124495.rs:21:24 | LL |     let _ = async || { break; }; |                      --^^^^^--- |                      | | |                      | cannot `break` inside `async` closure |                      enclosing `async` closure error[E0267]: `break` inside `gen` block --> $DIR/break-inside-coroutine-issue-124495.rs:23:19 | LL |     let _ = gen { break; }; |             ------^^^^^--- |             |     | |             |     cannot `break` inside `gen` block |             enclosing `gen` block error[E0267]: `break` inside `async gen` block --> $DIR/break-inside-coroutine-issue-124495.rs:25:25 | LL |     let _ = async gen { break; }; |             ------------^^^^^--- |             |           | |             |           cannot `break` inside `async gen` block |             enclosing `async gen` block error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0267`. </ins>