jiebi/CodeConvo huggingface dataset:
impl<'mir, 'tcx, Tag, Extra> Frame<'mir, 'tcx, Tag, Extra> { /// Return the `SourceInfo` of the current instruction. <del> pub fn current_source_info(&self) -> Option<mir::SourceInfo> { self.loc.map(|loc| { let block = &self.body.basic_blocks()[loc.block]; if loc.statement_index < block.statements.len() { block.statements[loc.statement_index].source_info } else { block.terminator().source_info } }) </del> <ins> pub fn current_source_info(&self) -> Option<&mir::SourceInfo> { self.loc.map(|loc| self.body.source_info(loc)) </ins> } }
}) // Assert that there is always such a frame. .unwrap(); <ins> // Assert that the frame we look at is actually executing code currently // (`current_source_info` is None when we are unwinding and the frame does // not require cleanup). </ins> let loc = frame.loc.unwrap(); <ins> // If this is a `Call` terminator, use the `fn_span` instead. </ins> let block = &frame.body.basic_blocks()[loc.block]; <del> assert_eq!(block.statements.len(), loc.statement_index); debug!( "find_closest_untracked_caller_location:: got terminator {:?} ({:?})", block.terminator(), block.terminator().kind ); if let TerminatorKind::Call { fn_span, .. } = block.terminator().kind { return fn_span; </del> <ins> if loc.statement_index == block.statements.len() { debug!( "find_closest_untracked_caller_location:: got terminator {:?} ({:?})", block.terminator(), block.terminator().kind ); if let TerminatorKind::Call { fn_span, .. } = block.terminator().kind { return fn_span; } </ins> } <del> unreachable!(); </del> <ins> // This is a different terminator (such as `Drop`) or not a terminator at all // (such as `box`). Use the normal span. frame.body.source_info(loc).span </ins> } /// Allocate a `const core::panic::Location` with the provided filename and line/column numbers.
impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { fn visit_local(&mut self, local: &Local, context: PlaceContext, location: Location) { <ins> if self.body.local_decls.get(*local).is_none() { self.fail( location, format!("local {:?} has no corresponding declaration in `body.local_decls`", local), ); } </ins> if self.reachable_blocks.contains(location.block) && context.is_use() { // Uses of locals must occur while the local's storage is allocated. self.storage_liveness.seek_after_primary_effect(location);
/// Inline asm operand type must be `Sized`. InlineAsmSized, /// `[T, ..n]` implies that `T` must be `Copy`. <del> RepeatVec, </del> <ins> /// If the function in the array repeat expression is a `const fn`, /// display a help message suggesting to move the function call to a /// new `const` item while saying that `T` doesn't implement `Copy`. RepeatVec(bool), </ins> /// Types of fields (other than the last, except for packed structs) in a struct must be sized. FieldSized {
use crate::dataflow::impls::MaybeInitializedPlaces; use crate::dataflow::move_paths::MoveData; use crate::dataflow::ResultsCursor; <ins> use crate::transform::{ check_consts::ConstCx, promote_consts::is_const_fn_in_array_repeat_expression, }; </ins> use crate::borrow_check::{ borrow_set::BorrowSet,
Operand::Copy(..) | Operand::Constant(..) => { // These are always okay: direct use of a const, or a value that can evidently be copied. } <del> Operand::Move(_) => { </del> <ins> Operand::Move(place) => { </ins> // Make sure that repeated elements implement `Copy`. let span = body.source_info(location).span; let ty = operand.ty(body, tcx); if !self.infcx.type_is_copy_modulo_regions(self.param_env, ty, span) { <ins> let ccx = ConstCx::new_with_param_env(tcx, body, self.param_env); let is_const_fn = is_const_fn_in_array_repeat_expression(&ccx, &place, &body); debug!("check_rvalue: is_const_fn={:?}", is_const_fn); </ins> let def_id = body.source.def_id().expect_local(); self.infcx.report_selection_error( &traits::Obligation::new( ObligationCause::new( span, self.tcx().hir().local_def_id_to_hir_id(def_id), <del> traits::ObligationCauseCode::RepeatVec, </del> <ins> traits::ObligationCauseCode::RepeatVec(is_const_fn), </ins> ), self.param_env, ty::Binder::bind(ty::TraitRef::new(
promotions } <ins> /// This function returns `true` if the function being called in the array /// repeat expression is a `const` function. crate fn is_const_fn_in_array_repeat_expression<'tcx>( ccx: &ConstCx<'_, 'tcx>, place: &Place<'tcx>, body: &Body<'tcx>, ) -> bool { match place.as_local() { // rule out cases such as: `let my_var = some_fn(); [my_var; N]` Some(local) if body.local_decls[local].is_user_variable() => return false, None => return false, _ => {} } for block in body.basic_blocks() { if let Some(Terminator { kind: TerminatorKind::Call { func, destination, .. }, .. }) = &block.terminator { if let Operand::Constant(box Constant { literal: ty::Const { ty, .. }, .. }) = func { if let ty::FnDef(def_id, _) = *ty.kind() { if let Some((destination_place, _)) = destination { if destination_place == place { if is_const_fn(ccx.tcx, def_id) { return true; } } } } } } } false } </ins>
ObligationCauseCode::Coercion { source: _, target } => { err.note(&format!("required by cast to type `{}`", self.ty_to_string(target))); } <del> ObligationCauseCode::RepeatVec => { </del> <ins> ObligationCauseCode::RepeatVec(is_const_fn) => { </ins> err.note( "the `Copy` trait is required because the repeated element will be copied", ); <ins> if is_const_fn { err.help( "consider creating a new `const` item and initializing with the result  of the function call to be used in the repeat position, like  `const VAL: Type = const_fn();` and `let x = [VAL; 42];`", ); } if self.tcx.sess.is_nightly_build() && is_const_fn { err.help( "create an inline `const` block, see PR  #2920 <https://github.com/rust-lang/rfcs/pull/2920>  for more information", ); } </ins> } ObligationCauseCode::VariableType(hir_id) => { let parent_node = self.tcx.hir().get_parent_node(hir_id);
= help: the following implementations were found: <Option<T> as Copy> = note: the `Copy` trait is required because the repeated element will be copied <ins> = help: consider creating a new `const` item and initializing with the result of the function call to be used in the repeat position, like `const VAL: Type = const_fn();` and `let x = [VAL; 42];` = help: create an inline `const` block, see PR #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information </ins> error: aborting due to previous error
<ins> error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:4:32 | LL |     let strings: [String; 5] = [String::new(); 5]; |                                ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | = note: the `Copy` trait is required because the repeated element will be copied = help: consider creating a new `const` item and initializing with the result of the function call to be used in the repeat position, like `const VAL: Type = const_fn();` and `let x = [VAL; 42];` = help: create an inline `const` block, see PR #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
use rustc_infer::infer::{self, InferOk, TyCtxtInferExt}; use rustc_middle::ty; use rustc_middle::ty::error::{ExpectedFound, TypeError}; <del> use rustc_middle::ty::subst::{InternalSubsts, Subst, SubstsRef}; </del> <ins> use rustc_middle::ty::subst::{InternalSubsts, Subst}; </ins> use rustc_middle::ty::util::ExplicitSelf; <del> use rustc_middle::ty::{GenericParamDefKind, ToPredicate, TyCtxt, WithConstness}; </del> <ins> use rustc_middle::ty::{GenericParamDefKind, ToPredicate, TyCtxt}; </ins> use rustc_span::Span; use rustc_trait_selection::traits::error_reporting::InferCtxtExt; use rustc_trait_selection::traits::{self, ObligationCause, ObligationCauseCode, Reveal}; use super::{potentially_plural_count, FnCtxt, Inherited}; <del> use std::iter; </del> /// Checks that a method from an impl conforms to the signature of /// the same method as declared in the trait.
impl_ty_substs.rebase_onto(tcx, impl_ty.container.id(), impl_trait_ref.substs); let impl_ty_value = tcx.type_of(impl_ty.def_id); <del> // Map the predicate from the trait to the corresponding one for the impl. // For example: </del> <ins> let param_env = tcx.param_env(impl_ty.def_id); // When checking something like </ins> // <del> // trait X<A> { type Y<'a>: PartialEq<A> } impl X for T { type Y<'a> = &'a S; } // impl<'x> X<&'x u32> for () { type Y<'c> = &'c u32; } </del> <ins> // trait X { type Y: PartialEq<<Self as X>::Y> } // impl X for T { default type Y = S; } </ins> // <del> // For the `for<'a> <<Self as X<A>>::Y<'a>: PartialEq<A>` bound, this // function would translate and partially normalize // `[<Self as X<A>>::Y<'a>, A]` to `[&'a u32, &'x u32]`. let translate_predicate_substs = move |predicate_substs: SubstsRef<'tcx>| { tcx.mk_substs( iter::once(impl_ty_value.into()) .chain(predicate_substs[1..].iter().map(|s| s.subst(tcx, rebased_substs))), ) </del> <ins> // We will have to prove the bound S: PartialEq<<T as X>::Y>. In this case // we want <T as X>::Y to normalize to S. This is valid because we are // checking the default value specifically here. Add this equality to the // ParamEnv for normalization specifically. let normalize_param_env = { let mut predicates = param_env.caller_bounds().iter().collect::<Vec<_>>(); predicates.push( ty::Binder::dummy(ty::ProjectionPredicate { projection_ty: ty::ProjectionTy { item_def_id: trait_ty.def_id, substs: rebased_substs, }, ty: impl_ty_value, }) .to_predicate(tcx), ); ty::ParamEnv::new(tcx.intern_predicates(&predicates), Reveal::UserFacing, None) </ins> }; tcx.infer_ctxt().enter(move |infcx| {
); let predicates = tcx.projection_predicates(trait_ty.def_id); debug!("compare_projection_bounds: projection_predicates={:?}", predicates); for predicate in predicates { <del> let concrete_ty_predicate = match predicate.kind() { ty::PredicateKind::Trait(poly_tr, c) => poly_tr .map_bound(|tr| { let trait_substs = translate_predicate_substs(tr.trait_ref.substs); ty::TraitRef { def_id: tr.def_id(), substs: trait_substs } }) .with_constness(*c) .to_predicate(tcx), ty::PredicateKind::Projection(poly_projection) => poly_projection .map_bound(|projection| { let projection_substs = translate_predicate_substs(projection.projection_ty.substs); ty::ProjectionPredicate { projection_ty: ty::ProjectionTy { substs: projection_substs, item_def_id: projection.projection_ty.item_def_id, }, ty: projection.ty.subst(tcx, rebased_substs), } }) .to_predicate(tcx), ty::PredicateKind::TypeOutlives(poly_outlives) => poly_outlives .map_bound(|outlives| { ty::OutlivesPredicate(impl_ty_value, outlives.1.subst(tcx, rebased_substs)) }) .to_predicate(tcx), _ => bug!("unexepected projection predicate kind: `{:?}`", predicate), }; </del> <ins> let concrete_ty_predicate = predicate.subst(tcx, rebased_substs); debug!("compare_projection_bounds: concrete predicate = {:?}", concrete_ty_predicate); </ins> let traits::Normalized { value: normalized_predicate, obligations } = traits::normalize( &mut selcx, <del> param_env, </del> <ins> normalize_param_env, </ins> normalize_cause.clone(), &concrete_ty_predicate, ); debug!("compare_projection_bounds: normalized predicate = {:?}", normalized_predicate); inh.register_predicates(obligations);
<ins> // Test that associated type bounds are correctly normalized when checking // default associated type values. // check-pass #![allow(incomplete_features)] #![feature(specialization)] #[derive(PartialEq)] enum Never {} trait Foo { type Assoc: PartialEq; // PartialEq<<Self as Foo>::Assoc> } impl<T> Foo for T { default type Assoc = Never; } trait Trait1 { type Selection: PartialEq; } trait Trait2: PartialEq<Self> {} impl<T: Trait2> Trait1 for T { default type Selection = T; } fn main() {} </ins>
/// N.B., **No cleanup is scheduled for this temporary.** You should /// call `schedule_drop` once the temporary is initialized. crate fn temp(&mut self, ty: Ty<'tcx>, span: Span) -> Place<'tcx> { <del> let temp = self.local_decls.push(LocalDecl::new(ty, span)); </del> <ins> // Mark this local as internal to avoid temporaries with types not present in the // user's code resulting in ICEs from the generator transform. let temp = self.local_decls.push(LocalDecl::new(ty, span).internal()); </ins> let place = Place::from(temp); debug!("temp: created temp {:?} with type {:?}", place, self.local_decls[temp].ty); place
<ins> // build-pass // compile-flags:-Copt-level=0 // edition:2018 struct S<T>(std::marker::PhantomData<T>); impl<T> std::ops::Deref for S<T> { type Target = T; fn deref(&self) -> &Self::Target { todo!() } } impl<T> std::ops::DerefMut for S<T> { fn deref_mut(&mut self) -> &mut Self::Target { todo!() } } async fn new() -> S<u64> { todo!() } async fn crash() { *new().await = 1 + 1; } fn main() { let _ = crash(); } </ins>
<ins> #![feature(associated_type_defaults)] #![feature(generic_associated_types)] #![allow(incomplete_features)] trait Trait1 { fn foo(); } trait Trait2 { type Associated: Trait1 = Self; //~^ ERROR: the trait bound `Self: Trait1` is not satisfied //~| the size for values of type `Self` cannot be known } impl Trait2 for () {} fn call_foo<T: Trait2>() { T::Associated::foo() } fn main() { call_foo::<()>() } </ins>
<ins> error[E0277]: the trait bound `Self: Trait1` is not satisfied --> $DIR/issue-74816.rs:10:5 | LL |     type Associated: Trait1 = Self; |     ^^^^^^^^^^^^^^^^^------^^^^^^^^ |     |                | |     |                required by this bound in `Trait2::Associated` |     the trait `Trait1` is not implemented for `Self` | help: consider further restricting `Self` | LL | trait Trait2: Trait1 { |             ^^^^^^^^ error[E0277]: the size for values of type `Self` cannot be known at compilation time --> $DIR/issue-74816.rs:10:5 | LL |     type Associated: Trait1 = Self; |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |     | |     doesn't have a size known at compile-time |     required by this bound in `Trait2::Associated` | help: consider further restricting `Self` | LL | trait Trait2: Sized { |             ^^^^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. </ins>
<ins> #![feature(type_alias_impl_trait)] #![feature(impl_trait_in_bindings)] #![allow(incomplete_features)] type FooArg<'a> = &'a dyn ToString; type FooRet = impl std::fmt::Debug; type FooItem = Box<dyn Fn(FooArg) -> FooRet>; type Foo = impl Iterator<Item = FooItem>; //~ ERROR: type mismatch #[repr(C)] struct Bar(u8); impl Iterator for Bar { type Item = FooItem; fn next(&mut self) -> Option<Self::Item> { Some(Box::new(quux)) } } fn quux(st: FooArg) -> FooRet { Some(st.to_string()) } fn ham() -> Foo { Bar(1) } fn oof() -> impl std::fmt::Debug { let mut bar = ham(); let func = bar.next().unwrap(); return func(&"oof"); } fn main() { let _ = oof(); } </ins>
<ins> error[E0271]: type mismatch resolving `<Bar as Iterator>::Item == Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>` --> $DIR/issue-70877.rs:9:12 | LL | type FooRet = impl std::fmt::Debug; |               -------------------- the expected opaque type ... LL | type Foo = impl Iterator<Item = FooItem>; |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found enum `Option` | = note: expected struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> impl Debug + 'static)>` found struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option<String> + 'static)>` error: aborting due to previous error For more information about this error, try `rustc --explain E0271`. </ins>
<ins> // check-pass // Regression test of #70944, should compile fine. use std::ops::Index; pub struct KeyA; pub struct KeyB; pub struct KeyC; pub trait Foo: Index<KeyA> + Index<KeyB> + Index<KeyC> {} pub trait FooBuilder { type Inner: Foo; fn inner(&self) -> &Self::Inner; } pub fn do_stuff(foo: &impl FooBuilder) { let inner = foo.inner(); &inner[KeyA]; &inner[KeyB]; &inner[KeyC]; } fn main() {} </ins>
<ins> #![feature(unsize)] use std::marker::Unsize; pub trait CastTo<T: ?Sized>: Unsize<T> { fn cast_to(&self) -> &T; } impl<T: ?Sized, U: ?Sized + Unsize<T>> CastTo<T> for U { fn cast_to(&self) -> &T { self } } impl<T: ?Sized> Cast for T {} pub trait Cast { fn cast<T: ?Sized>(&self) -> &T where Self: CastTo<T>, { self } } pub trait Foo: CastTo<[i32]> {} impl Foo for [i32; 0] {} fn main() { let x: &dyn Foo = &[]; let x = x.cast::<[i32]>(); //~^ ERROR: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied } </ins>
<ins> error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied --> $DIR/issue-71659.rs:30:15 | LL |     let x = x.cast::<[i32]>(); |               ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
<ins> error[E0277]: the trait bound `MyCall: Callback` is not satisfied --> $DIR/issue-75707.rs:15:5 | LL | fn f<P: Processing + ?Sized>() { |         ---------- required by this bound in `f` ... LL |     f::<dyn Processing<Call = MyCall>>(); |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall` error: aborting due to previous error For more information about this error, try `rustc --explain E0277`. </ins>
use crate::infer::error_reporting::nice_region_error::NiceRegionError; use crate::infer::lexical_region_resolve::RegionResolutionError; <del> use crate::infer::{Subtype, TyCtxtInferExt, ValuePairs}; </del> <ins> use crate::infer::{Subtype, ValuePairs}; </ins> use crate::traits::ObligationCauseCode::CompareImplMethodObligation; use rustc_errors::ErrorReported; use rustc_hir as hir;
); } <del> if let Some((expected, found)) = tcx .infer_ctxt() .enter(|infcx| infcx.expected_found_str_ty(&ExpectedFound { expected, found })) </del> <ins> if let Some((expected, found)) = self.infcx.expected_found_str_ty(&ExpectedFound { expected, found }) </ins> { // Highlighted the differences when showing the "expected/found" note. err.note_expected_found(&"", expected, &"", found);
<ins> // Regression test for issue #74918 // Tests that we don't ICE after emitting an error struct ChunkingIterator<T, S: 'static + Iterator<Item = T>> { source: S, } impl<T, S: Iterator<Item = T>> Iterator for ChunkingIterator<T, S> { type Item = IteratorChunk<T, S>; //~ ERROR missing lifetime fn next(&mut self) -> Option<IteratorChunk<T, S>> { //~ ERROR `impl` todo!() } } struct IteratorChunk<'a, T, S: Iterator<Item = T>> { source: &'a mut S, } impl<T, S: Iterator<Item = T>> Iterator for IteratorChunk<'_, T, S> { type Item = T; fn next(&mut self) -> Option<T> { todo!() } } fn main() {} </ins>
<ins> error[E0106]: missing lifetime specifier --> $DIR/issue-74918-missing-lifetime.rs:9:31 | LL |     type Item = IteratorChunk<T, S>; |                               ^ expected named lifetime parameter | help: consider introducing a named lifetime parameter | LL |     type Item<'a> = IteratorChunk<<'a>T, S>; |              ^^^^                 ^^^^ error: `impl` item signature doesn't match `trait` item signature --> $DIR/issue-74918-missing-lifetime.rs:11:5 | LL |     fn next(&mut self) -> Option<IteratorChunk<T, S>> { |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, T, S>>` | ::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | LL |     fn next(&mut self) -> Option<Self::Item>; |     ----------------------------------------- expected `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'static, _, _>>` | = note: expected `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'static, _, _>>` found `fn(&mut ChunkingIterator<T, S>) -> std::option::Option<IteratorChunk<'_, _, _>>` = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0106`. </ins>
<ins> // Regresison test for issue #75361 // Tests that we don't ICE on mismatched types with inference variables trait MyTrait { type Item; } pub trait Graph { type EdgeType; fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>; } impl<T> Graph for T { type EdgeType = T; fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType> + '_> { //~ ERROR `impl` panic!() } } fn main() {} </ins>
<ins> error: `impl` item signature doesn't match `trait` item signature --> $DIR/issue-75361-mismatched-impl.rs:18:3 | LL |   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>; |   --------------------------------------------------------------------- expected `fn(&T) -> std::boxed::Box<(dyn MyTrait<Item = &_> + 'static)>` ... LL |   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType> + '_> { |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&T) -> std::boxed::Box<dyn MyTrait<Item = &_>>` | = note: expected `fn(&T) -> std::boxed::Box<(dyn MyTrait<Item = &T> + 'static)>` found `fn(&T) -> std::boxed::Box<dyn MyTrait<Item = &T>>` help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` --> $DIR/issue-75361-mismatched-impl.rs:12:55 | LL |   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>; |                                                       ^^^^^^^^^^^^^^ consider borrowing this type parameter in the trait error: aborting due to previous error </ins>
use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::util; use rustc_session::config::EntryFnType; <del> use rustc_span::{Span, DUMMY_SP}; </del> <ins> use rustc_span::{symbol::sym, Span, DUMMY_SP}; </ins> use rustc_target::spec::abi::Abi; use rustc_trait_selection::traits::error_reporting::InferCtxtExt as _; use rustc_trait_selection::traits::{
.emit(); error = true; } <ins> for attr in it.attrs { if attr.check_name(sym::track_caller) { tcx.sess .struct_span_err( attr.span, "`main` function is not allowed to be `#[track_caller]`", ) .span_label( main_span, "`main` function is not allowed to be `#[track_caller]`", ) .emit(); error = true; } } </ins> if error { return; }
tcx.sess, span, E0752, <del> "start is not allowed to be `async`" </del> <ins> "`start` is not allowed to be `async`" </ins> ) <del> .span_label(span, "start is not allowed to be `async`") </del> <ins> .span_label(span, "`start` is not allowed to be `async`") </ins> .emit(); error = true; } <ins> for attr in it.attrs { if attr.check_name(sym::track_caller) { tcx.sess .struct_span_err( attr.span, "`start` is not allowed to be `#[track_caller]`", ) .span_label( start_span, "`start` is not allowed to be `#[track_caller]`", ) .emit(); error = true; } } </ins> if error { return; }
<del> error[E0752]: start is not allowed to be `async` </del> <ins> error[E0752]: `start` is not allowed to be `async` </ins> --> $DIR/issue-68523-start.rs:6:1 | LL | pub async fn start(_: isize, _: *const *const u8) -> isize { <del> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ start is not allowed to be `async` </del> <ins> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `start` is not allowed to be `async` </ins> error: aborting due to previous error
<ins> error: `main` function is not allowed to be `#[track_caller]` --> $DIR/error-with-main.rs:1:1 | LL |   #[track_caller] |   ^^^^^^^^^^^^^^^ LL | / fn main() { LL | |     panic!("{}: oh no", std::panic::Location::caller()); LL | | } | |_- `main` function is not allowed to be `#[track_caller]` error: aborting due to previous error </ins>
<ins> error: `start` is not allowed to be `#[track_caller]` --> $DIR/error-with-start.rs:4:1 | LL |   #[track_caller] |   ^^^^^^^^^^^^^^^ LL | / fn start(_argc: isize, _argv: *const *const u8) -> isize { LL | |     panic!("{}: oh no", std::panic::Location::caller()); LL | | } | |_- `start` is not allowed to be `#[track_caller]` error: aborting due to previous error </ins>