jiebi/CodeConvo huggingface dataset:
Change:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --I updated some benchmark code using portable simd to a current nightly (which included the llvm version bump from 15 to 16) and ran into the compiler getting killed with SIGILL, or when trying to simplify the code, an LLVM error about an invalid bitcast. It is likely that the problem is inside llvm itself, but so far I was not able to reduce the code to a minimal LLVM IR example. The initial problematic code involved : I could later reproduce it also with casting masks between bitmask, and : In compiler explorer, with arguments the output is the following: Compiling the same function, with an function in the rust playground (in release mode) leads to the compiler receiving a SIGILL <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --:
Duplicate of
Not sure if this should be a separate issue, but I've also encountered the error with the trait: Using instead works
Resolved on latest nightlies. Needs a regression test.

Discussion:
<ins> //@ build-pass //@ compile-flags: -Copt-level=3 // regression test for https://github.com/rust-lang/rust/issues/110722 // in --release we were optimizing to invalid bitcasts, due to a combination of MIR inlining and // mostly bad repr(simd) lowering which prevented even basic splats from working #![crate_type = "rlib"] #![feature(portable_simd)] use std::simd::*; use std::simd::num::*; pub unsafe fn mask_to_array(mask: u8) -> [i32; 8] { let mut output = [0; 8]; let m = masksizex8::from_bitmask(mask as _); output.copy_from_slice(&m.to_int().cast::<i32>().to_array()); output } </ins>

<ins> //@ build-pass //@ compile-flags: -Copt-level=3 //@ only-x86_64 // ignore-tidy-linelength // regression test for https://github.com/rust-lang/rust/issues/110707 // in --release we were optimizing to invalid bitcasts, due to a combination of MIR inlining and // mostly bad repr(simd) lowering which prevented even basic splats from working #![crate_type = "rlib"] #![feature(portable_simd)] use std::simd::*; use std::arch::x86_64::*; #[target_feature(enable = "sse4.1")] pub unsafe fn fast_round_sse(i: f32x8) -> f32x8 { let a = i.to_array(); let [low, high]: [[f32; 4]; 2] = unsafe { std::mem::transmute::<[f32; 8], [[f32; 4]; 2]>(a) }; let low = f32x4::from(_mm_round_ps::<{_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC}>(f32x4::from_array(low).into())); let high = f32x4::from(_mm_round_ps::<{_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC}>(f32x4::from_array(high).into())); let a: [f32; 8] = unsafe { std::mem::transmute::<[[f32; 4]; 2], [f32; 8]>([low.to_array(), high.to_array()]) }; f32x8::from_array(a) } </ins>
Change:
Before , this gave an error: But after , that no longer gives an error. Ideally it shouldn't give an error in any case, but that's . Inlining/flattening format_args shouldn't change what compiles and what doesn't compile, so, for now, this still shouldn't compile.
Luckily the fix is easy. We just need to make sure that any with arguments still results in an expansion that involves borrowing a temporary.
Fix here:

Discussion:
&& argmap.iter().enumerate().all(|(i, (&(j, _), _))| i == j) && arguments.iter().skip(1).all(|arg| !may_contain_yield_point(&arg.expr)); <del> let args = if use_simple_array { </del> <ins> let args = if arguments.is_empty() { // Generate: //    &<core::fmt::Argument>::none() // // Note: //     `none()` just returns `[]`. We use `none()` rather than `[]` to limit the lifetime. // //     This makes sure that this still fails to compile, even when the argument is inlined: // //     ``` //     let f = format_args!("{}", "a"); //     println!("{f}"); // error E0716 //     ``` // //     Cases where keeping the object around is allowed, such as `format_args!("a")`, //     are handled above by the `allow_const` case. let none_fn = ctx.arena.alloc(ctx.expr_lang_item_type_relative( macsp, hir::LangItem::FormatArgument, sym::none, )); let none = ctx.expr_call(macsp, none_fn, &[]); ctx.expr(macsp, hir::ExprKind::AddrOf(hir::BorrowKind::Ref, hir::Mutability::Not, none)) } else if use_simple_array { </ins> // Generate: //     &[ //         <core::fmt::Argument>::new_display(&arg0),

non_exhaustive_omitted_patterns_lint, non_lifetime_binders, non_modrs_mods, <ins> none, </ins> nontemporal_store, noop_method_borrow, noop_method_clone,

None } } <ins> /// Used by `format_args` when all arguments are gone after inlining, /// when using `&[]` would incorrectly allow for a bigger lifetime. /// /// This fails without format argument inlining, and that shouldn't be different /// when the argument is inlined: /// /// ```compile_fail,E0716 /// let f = format_args!("{}", "a"); /// println!("{f}"); /// ``` #[inline(always)] pub fn none() -> [Self; 0] { [] } </ins> } /// This struct represents the unsafety of constructing an `Arguments`.
Change:
I tried : I expected to see this happen: an error about not being able to move out of a slice Instead, this happened: the error and a bunch of Fails on , works fine on
It also applies to way simpler code like:
searched nightlies: from nightly-2023-04-01 to nightly-2023-04-26 regressed nightly: nightly-2023-04-22 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.6</summaryHost triple: x8664-unknown-linux-gnu Reproduce with: </detailsHost triple: x8664-unknown-linux-gnu Reproduce with: </details Intestingly, the same day also contained two PRs but I have bisected this twice (with manual promt) and const prop lint really does seem to be the cause: commit[0] 2023-04-20: Auto merge of - m-ou-se:fmt-lang-items, r=jyn514 commit[1] 2023-04-20: Auto merge of - m-ou-se:flatten-format-args, r=oli-obk
WG-prioritization assigning priority (). label -I-prioritize +P-medium

Discussion:
return tcx.arena.alloc(IndexVec::new()); } <del> let tainted_by_errors = tcx.mir_borrowck(def).tainted_by_errors; </del> <ins> tcx.ensure_with_value().mir_borrowck(def); </ins> let mut promoted = tcx.mir_promoted(def).1.steal(); for body in &mut promoted { <del> if let Some(error_reported) = tainted_by_errors { body.tainted_by_errors = Some(error_reported); } </del> run_analysis_to_runtime_passes(tcx, body); }

<ins> // Regression test for issue #110856, where a borrowck error for a MIR tainted // all promoteds within. This in turn generated a spurious "erroneous constant // used" note when trying to evaluate a promoted. pub fn f() -> u32 { let a = 0; a = &0 * &1 * &2 * &3; //~^ ERROR: cannot assign twice to immutable variable a } fn main() {} </ins>

<ins> error[E0384]: cannot assign twice to immutable variable `a` --> $DIR/tainted-promoteds.rs:7:5 | LL |     let a = 0; |         - |         | |         first assignment to `a` |         help: consider making this binding mutable: `mut a` LL |     a = &0 * &1 * &2 * &3; |     ^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable error: aborting due to previous error For more information about this error, try `rustc --explain E0384`. </ins>
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
cc
searched toolchains nightly-2023-04-20 through nightly-2023-04-28 Regression in nightly-2023-04-22 searched toolchains through Regression in

Discussion:
let (value_hash, old_hash): (Fingerprint, Fingerprint) = tcx.with_stable_hashing_context(|mut hcx| (hasher(&mut hcx, &value), hasher(&mut hcx, &old)) ); <del> assert_eq!( old_hash, value_hash, "Trying to feed an already recorded value for query {} key={key:?}:nold value: {old:?}nnew value: {value:?}", stringify!($name), ) </del> <ins> if old_hash != value_hash { // We have an inconsistency. This can happen if one of the two // results is tainted by errors. In this case, delay a bug to // ensure compilation is doomed, and keep the `old` value. tcx.sess.delay_span_bug(DUMMY_SP, format!( "Trying to feed an already recorded value for query {} key={key:?}:n old value: {old:?}nnew value: {value:?}", stringify!($name), )); } </ins> } else { <ins> // The query is `no_hash`, so we have no way to perform a sanity check. // If feeding the same value multiple times needs to be supported, // the query should not be marked `no_hash`. </ins> bug!( "Trying to feed an already recorded value for query {} key={key:?}:nold value: {old:?}nnew value: {value:?}", stringify!($name),

(hasher(&mut hcx, &cached_result), hasher(&mut hcx, &result)) }); let formatter = query.format_value(); <del> debug_assert_eq!( old_hash, new_hash, "Computed query value for {:?}({:?}) is inconsistent with fed value,n computed={:#?}nfed={:#?}", query.dep_kind(), key, formatter(&result), formatter(&cached_result), ); </del> <ins> if old_hash != new_hash { // We have an inconsistency. This can happen if one of the two // results is tainted by errors. In this case, delay a bug to // ensure compilation is doomed. qcx.dep_context().sess().delay_span_bug( DUMMY_SP, format!( "Computed query value for {:?}({:?}) is inconsistent with fed value,n computed={:#?}nfed={:#?}", query.dep_kind(), key, formatter(&result), formatter(&cached_result), ), ); } </ins> } } job_owner.complete(cache, result, dep_node_index);

<ins> // Verify that we do not ICE when we try to overwrite an anon-const's type because of a trait // cycle. // // compile-flags: -Zincremental-ignore-spans // revisions: cpass cfail // error-pattern: cycle detected when computing type of `Bar::N` #![feature(trait_alias)] #![crate_type="lib"] #[cfg(cpass)] trait Bar<const N: usize> {} #[cfg(cfail)] trait Bar<const N: dyn BB> {} trait BB = Bar<{ 2 + 1 }>; </ins>
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
searched toolchains nightly-2023-04-20 through nightly-2023-04-28 Regression in nightly-2023-04-21 searched toolchains through Regression in :thinking: cc
Well, it is not unreachable it turns out huh
I believe this is a MRE:

Discussion:
} // Get closure's arguments <del> let ty::Closure(_, substs) = typeck_results.expr_ty(closure_expr).kind() else { unreachable!() }; </del> <ins> let ty::Closure(_, substs) = typeck_results.expr_ty(closure_expr).kind() else { /* hir::Closure can be a generator too */ return }; </ins> let sig = substs.as_closure().sig(); let tupled_params = tcx.erase_late_bound_regions(sig.inputs().iter().next().unwrap().map_bound(|&b| b));

<ins> // edition:2021 // compile-flags: -Zdrop-tracking-mir=yes #![feature(generators)] fn main() { let x = &mut (); || { let _c = || yield *&mut *x; || _ = &mut *x; //~^ cannot borrow `*x` as mutable more than once at a time }; } </ins>

<ins> error[E0499]: cannot borrow `*x` as mutable more than once at a time --> $DIR/issue-110929-generator-conflict-error-ice.rs:9:9 | LL |         let _c = || yield *&mut *x; |                  --             -- first borrow occurs due to use of `*x` in generator |                  | |                  first mutable borrow occurs here LL |         || _ = &mut *x; |         ^^          -- second borrow occurs due to use of `*x` in closure |         | |         second mutable borrow occurs here LL | LL |     }; |     - first borrow might be used here, when `_c` is dropped and runs the destructor for generator error: aborting due to previous error For more information about this error, try `rustc --explain E0499`. </ins>
Change:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. --I tried this code: I expected to see this happen: It compile Instead, this happened: It errored <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: </p</details
this is also present with repeat exprs:
cc and
const generic defaults also are buggy around

Discussion:
fn visit_anon_const(&mut self, constant: &'ast AnonConst) { // We deal with repeat expressions explicitly in `resolve_expr`. self.with_lifetime_rib(LifetimeRibKind::AnonConst, |this| { <del> this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Static), |this| { </del> <ins> this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| { </ins> this.resolve_anon_const(constant, IsRepeatExpr::No); }) })

ExprKind::Repeat(ref elem, ref ct) => { self.visit_expr(elem); self.with_lifetime_rib(LifetimeRibKind::AnonConst, |this| { <del> this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Static), |this| { </del> <ins> this.with_lifetime_rib(LifetimeRibKind::Elided(LifetimeRes::Infer), |this| { </ins> this.resolve_anon_const(ct, IsRepeatExpr::Yes) }) });

<ins> // Verify that elided lifetimes inside anonymous constants are not forced to be `'static`. // check-pass fn foo() -> [(); { let a = 10_usize; let b: &'_ usize = &a; *b }] { [(); 10] } fn bar() -> [(); 10] { [(); { let a = 10_usize; let b: &'_ usize = &a; *b }] } fn main() {} </ins>
Change:
The simplest reproduction would be something like this: the `note points at the operator A new user might get confused about needing a type, as the error points at the number instead of the comparator. No response No response <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim

Discussion:
} fn parse_expr_path_start(&mut self) -> PResult<'a, P<Expr>> { <ins> let maybe_eq_tok = self.prev_token.clone(); </ins> let (qself, path) = if self.eat_lt() { <del> let (qself, path) = self.parse_qpath(PathStyle::Expr)?; </del> <ins> let lt_span = self.prev_token.span; let (qself, path) = self.parse_qpath(PathStyle::Expr).map_err(|mut err| { // Suggests using '<=' if there is an error parsing qpath when the previous token // is an '=' token. Only emits suggestion if the '<' token and '=' token are // directly adjacent (i.e. '=<') if maybe_eq_tok.kind == TokenKind::Eq && maybe_eq_tok.span.hi() == lt_span.lo() { let eq_lt = maybe_eq_tok.span.to(lt_span); err.span_suggestion(eq_lt, "did you mean", "<=", Applicability::Unspecified); } err })?; </ins> (Some(qself), path) } else { (None, self.parse_path(PathStyle::Expr)?)

<ins> fn foo() { let a = 0; let b = 4; if a =< b { //~ERROR println!("yay!"); } } fn bar() { let a = 0; let b = 4; if a = <b { //~ERROR println!("yay!"); } } fn baz() { let a = 0; let b = 4; if a = < b { //~ERROR println!("yay!"); } } fn qux() { let a = 0; let b = 4; if a =< i32>::abs(-4) { //~ERROR: mismatched types println!("yay!"); } } fn main() {} </ins>

<ins> error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` --> $DIR/eq-less-to-less-eq.rs:4:15 | LL |     if a =< b { |          --   ^ expected one of 7 possible tokens |          | |          help: did you mean: `<=` error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` --> $DIR/eq-less-to-less-eq.rs:12:15 | LL |     if a = <b { |               ^ expected one of 7 possible tokens error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` --> $DIR/eq-less-to-less-eq.rs:20:16 | LL |     if a = < b { |                ^ expected one of 7 possible tokens error[E0308]: mismatched types --> $DIR/eq-less-to-less-eq.rs:28:8 | LL |     if a =< i32>::abs(-4) { |        ^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` | help: you might have meant to compare for equality | LL |     if a ==< i32>::abs(-4) { |           + error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0308`. </ins>
Change:
The  shell script does not return with an exit code if the build fails. The object doesn't appear to be an integer. cc This may be an important issue since something could potentially fail in CI without failing the build. Noticed in CI when something funky happened. Fortunately the metrics don't get created when a test fails (I think), but there may be other situations where it isn't working correctly. This looks like it was in .
This is weird. I do remember doing a fair bit of testing of that PR.
PowerShell is always the odd one, with it's 5+ streams and .NET integrations and structured pipelines. Honestly, it doesn't surprise me that much that PowerShell does not care about exit codes, since the way to declare an error in PowerShell is to print something to the Error stream (IIRC).
Oh it did work originally. But then I broke it. There's a defect when using instead of the parameter where ExitCode isn't set.

Discussion:
function Invoke-Application($application, $arguments) { $process = Start-Process -NoNewWindow -PassThru $application $arguments <ins> # WORKAROUND: Caching the handle is necessary to make ExitCode work. # See https://stackoverflow.com/a/23797762 $handle = $process.Handle </ins> $process.WaitForExit() <ins> if ($null -eq $process.ExitCode) { Write-Error "Unable to read the exit code" Exit 1 } </ins> Exit $process.ExitCode }
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim

Discussion:
} // Function types <del> ty::FnDef(def_id, substs) | ty::Closure(def_id, substs) | ty::Generator(def_id, substs, ..) => { </del> <ins> ty::FnDef(def_id, substs) | ty::Closure(def_id, substs) => { </ins> // u<length><name>[I<element-type1..element-typeN>E], where <element-type> is <subst>, // as vendor extended type. let mut s = String::new();

typeid.push_str(&s); } <ins> ty::Generator(def_id, substs, ..) => { // u<length><name>[I<element-type1..element-typeN>E], where <element-type> is <subst>, // as vendor extended type. let mut s = String::new(); let name = encode_ty_name(tcx, *def_id); let _ = write!(s, "u{}{}", name.len(), &name); // Encode parent substs only s.push_str(&encode_substs( tcx, tcx.mk_substs(substs.as_generator().parent_substs()), dict, options, )); compress(dict, DictKey::Ty(ty, TyQ::None), &mut s); typeid.push_str(&s); } </ins> // Pointer types ty::Ref(region, ty0, ..) => { // [U3mut]u3refI<element-type>E as vendor extended type qualifier and type

let mut ty = ty; match ty.kind() { <del> ty::Float(..) | ty::Char | ty::Str | ty::Never | ty::Foreign(..) => {} </del> <ins> ty::Float(..) | ty::Char | ty::Str | ty::Never | ty::Foreign(..) | ty::GeneratorWitness(..) => {} </ins> ty::Bool => { if options.contains(EncodeTyOptions::NORMALIZE_INTEGERS) {

ty::Bound(..) | ty::Error(..) <del> | ty::GeneratorWitness(..) </del> | ty::GeneratorWitnessMIR(..) | ty::Infer(..) | ty::Alias(..)

<ins> // Regression test for issue 111184, where ty::GeneratorWitness were not expected to occur in // encode_ty and caused the compiler to ICE. // // needs-sanitizer-cfi // compile-flags: -Clto -Ctarget-feature=-crt-static -Zsanitizer=cfi --edition=2021 // no-prefer-dynamic // only-x86_64-unknown-linux-gnu // run-pass use std::future::Future; async fn foo() {} fn bar<T>(_: impl Future<Output = T>) {} fn main() { bar(foo()); } </ins>
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I've seen this on a few ICE reports, but I'd recommend putting the first ICE in the title instead of any other subsequent ICE messages, since this: really is the root cause of this issue, and the second one (mentioning ) is just a side-effect of panicking during certain queries :smilecat:
searched toolchains nightly-2023-04-21 through nightly-2023-05-06 Regression in nightly-2023-04-27 Regression in Regression in cc
Oops claim

Discussion:
} if !segments.iter().all(|(name, args)| { let arg = match name.as_str() { <del> "struct_span_err" | "span_note" | "span_label" | "span_help" => &args[1], "note" | "help" => &args[0], </del> <ins> "struct_span_err" | "span_note" | "span_label" | "span_help" if args.len() == 2 => { &args[1] } "note" | "help" if args.len() == 1 => &args[0], </ins> _ => { return false; }

<ins> // compile-flags: -Zunstable-options pub fn issue_111280() { struct_span_err(msg).emit(); //~ ERROR cannot find value `msg` //~^ ERROR cannot find function `struct_span_err` } fn main() {} </ins>

<ins> error[E0425]: cannot find value `msg` in this scope --> $DIR/trivial-diagnostics.rs:4:21 | LL |     struct_span_err(msg).emit(); |                     ^^^ not found in this scope error[E0425]: cannot find function `struct_span_err` in this scope --> $DIR/trivial-diagnostics.rs:4:5 | LL |     struct_span_err(msg).emit(); |     ^^^^^^^^^^^^^^^ not found in this scope error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`. </ins>