jiebi/CodeConvo huggingface dataset:
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
Regression in
I think it's enough to change to be without .

Discussion:
.iter() .enumerate() .filter(|x| x.1.hir_id == *hir_id) <del> .map(|(i, _)| init_tup.get(i).unwrap()) .next() </del> <ins> .find_map(|(i, _)| init_tup.get(i)) </ins> { self.note_type_is_not_clone_inner_expr(init) } else {

<ins> struct RGB { g: f64, b: f64, } fn main() { let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); //~^ ERROR cannot find value `e` in this scope //~| ERROR cannot find value `e` in this scope //~| ERROR mismatched types let _ = RGB { r, g, b }; //~^ ERROR cannot find value `g` in this scope //~| ERROR struct `RGB` has no field named `r` //~| ERROR mismatched types } </ins>

<ins> error[E0425]: cannot find value `e` in this scope --> $DIR/issue-114423.rs:7:51 | LL |     let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); |                                                   ^ not found in this scope error[E0425]: cannot find value `e` in this scope --> $DIR/issue-114423.rs:7:62 | LL |     let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); |                                                              ^ not found in this scope error[E0425]: cannot find value `g` in this scope --> $DIR/issue-114423.rs:11:22 | LL |     let _ = RGB { r, g, b }; |                      ^ help: a local variable with a similar name exists: `b` error[E0308]: mismatched types --> $DIR/issue-114423.rs:7:50 | LL |     let (r, alone_in_path, b): (f32, f32, f32) = (e.clone(), e.clone()); |                                ---------------   ^^^^^^^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 2 elements |                                | |                                expected due to this | = note: expected tuple `(f32, f32, f32)` found tuple `(f32, f32)` error[E0560]: struct `RGB` has no field named `r` --> $DIR/issue-114423.rs:11:19 | LL |     let _ = RGB { r, g, b }; |                   ^ `RGB` does not have this field | = note: all struct fields are already assigned error[E0308]: mismatched types --> $DIR/issue-114423.rs:11:25 | LL |     let _ = RGB { r, g, b }; |                         ^ expected `f64`, found `f32` | help: you can convert an `f32` to an `f64` | LL |     let _ = RGB { r, g, b: b.into() }; |                         ++  +++++++ error: aborting due to 6 previous errors Some errors have detailed explanations: E0308, E0425, E0560. For more information about an error, try `rustc --explain E0308`. </ins>
Change:
is supposed to work like , and which can appear multiple times.
I believe this was broken in . Tagging and
The change was meant to improve usability, since there was no hint that "-W help" exists. It should be reverted then.
If passing it more than once becomes possible, the ability to pass comma-separated warnings should probably be removed. It's strange to have that for lints but not for .
How do you pass comma separated warnings?
Ah, it was removed...

Discussion:
for details)", "FEATURE"), optopt("", "android-cross-path", "The path to the Android NDK", "PATH"), <del> optflagopt("W", "warn", </del> <ins> optmulti("W", "warn", </ins> "Set lint warnings", "OPT"), optmulti("A", "allow", "Set lint allowed", "OPT"),

return; } <del> // Display the available lint options if "-W help" or only "-W" is given. </del> let lint_flags = vec::append(matches.opt_strs("W"), matches.opt_strs("warn")); <del> let show_lint_options = lint_flags.iter().any(|x| x == &~"help") || (matches.opt_present("W") && lint_flags.is_empty()); if show_lint_options { </del> <ins> if lint_flags.iter().any(|x| x == &~"help") { </ins> describe_warnings(); return; }
Change:
<!-- 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 label +requires-nightly +F-inlineconstpat +requires-incomplete-features

Discussion:
// `PartialEq::eq` on it. return Err(FallbackToConstRef); } <ins> ty::FnDef(..) => { self.saw_const_match_error.set(true); tcx.sess.emit_err(InvalidPattern { span, non_sm_ty: ty }); PatKind::Wild } </ins> ty::Adt(adt_def, _) if !self.type_marked_structural(ty) => { debug!("adt_def {:?} has !type_marked_structural for cv.ty: {:?}", adt_def, ty,); self.saw_const_match_error.set(true);

} } }, <del> ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::FnDef(..) => PatKind::Constant { </del> <ins> ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) => PatKind::Constant { </ins> value: mir::ConstantKind::Ty(ty::Const::new_value(tcx, cv, ty)), }, ty::FnPtr(..) | ty::RawPtr(..) => unreachable!(),

<ins> #![feature(inline_const_pat)] //~^ WARN the feature `inline_const_pat` is incomplete fn uwu() {} fn main() { let x = []; match x[123] { const { uwu } => {} //~^ ERROR `fn() {uwu}` cannot be used in patterns _ => {} } } </ins>

<ins> warning: the feature `inline_const_pat` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/pat-match-fndef.rs:1:12 | LL | #![feature(inline_const_pat)] |            ^^^^^^^^^^^^^^^^ | = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information = note: `#[warn(incomplete_features)]` on by default error: `fn() {uwu}` cannot be used in patterns --> $DIR/pat-match-fndef.rs:9:9 | LL |         const { uwu } => {} |         ^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted </ins>
Change:
(note: this is very similar to but it does appear to be a different ICE) : <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
label +requires-nightly +F-inlineconstpat +requires-incomplete-features

Discussion:
// `PartialEq::eq` on it. return Err(FallbackToConstRef); } <ins> ty::FnDef(..) => { self.saw_const_match_error.set(true); tcx.sess.emit_err(InvalidPattern { span, non_sm_ty: ty }); PatKind::Wild } </ins> ty::Adt(adt_def, _) if !self.type_marked_structural(ty) => { debug!("adt_def {:?} has !type_marked_structural for cv.ty: {:?}", adt_def, ty,); self.saw_const_match_error.set(true);

} } }, <del> ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::FnDef(..) => PatKind::Constant { </del> <ins> ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) => PatKind::Constant { </ins> value: mir::ConstantKind::Ty(ty::Const::new_value(tcx, cv, ty)), }, ty::FnPtr(..) | ty::RawPtr(..) => unreachable!(),

<ins> #![feature(inline_const_pat)] //~^ WARN the feature `inline_const_pat` is incomplete fn uwu() {} fn main() { let x = []; match x[123] { const { uwu } => {} //~^ ERROR `fn() {uwu}` cannot be used in patterns _ => {} } } </ins>

<ins> warning: the feature `inline_const_pat` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/pat-match-fndef.rs:1:12 | LL | #![feature(inline_const_pat)] |            ^^^^^^^^^^^^^^^^ | = note: see issue #76001 <https://github.com/rust-lang/rust/issues/76001> for more information = note: `#[warn(incomplete_features)]` on by default error: `fn() {uwu}` cannot be used in patterns --> $DIR/pat-match-fndef.rs:9:9 | LL |         const { uwu } => {} |         ^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted </ins>
Change:
This line looks like a typo to me, should it be ? Originally posted by in Currently, it affects line 1684. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
Yeah, this could be fixed.
Ideally a test should also be crafted that shows that this missing affects an error message or something.
claim

Discussion:
|| found_assoc(tcx.types.u64) || found_assoc(tcx.types.u128) || found_assoc(tcx.types.f32) <del> || found_assoc(tcx.types.f32); </del> <ins> || found_assoc(tcx.types.f64); </ins> if found_candidate && actual.is_numeric() && !actual.has_concrete_skeleton()
Change:
I tried this code: The assertion shouldn't fail, because is and so the parameter to the function should be , but the assertion still fails. : It seems that the bug only occurs when using or and after updating to LLVM 17.
Results in: This makes use of the on the second load in a way that is not legal (note the absence of -- and the memory is indeed uninitialized).
WG-prioritization assigning priority (). label -I-prioritize +P-critical +T-compiler
Upstream issue:

Discussion:
<del> Subproject commit 7c612e1732f3976fcfe29526ad796cbb6174b829 </del> <ins> Subproject commit 1833c2be108aefcb5d25f6280cf9763b1feb8005 </ins>

<ins> // compile-flags: -O // min-llvm-version: 17 // only-x86_64-unknown-linux-gnu // We want to check that this function does not mis-optimize to loop jumping. #![crate_type = "lib"] #[repr(C)] pub enum Expr { Sum, // must have more than usize data Sub(usize, u8), } #[no_mangle] pub extern "C" fn issue_114312(expr: Expr) { // CHECK-LABEL: @issue_114312( // CHECK-NOT: readonly // CHECK-SAME: byval // CHECK-NEXT: start: // CHECK-NEXT: ret void match expr { Expr::Sum => {} Expr::Sub(_, _) => issue_114312(Expr::Sum), } } </ins>

<ins> // run-pass // This test used to be miscompiled by LLVM 17. #![allow(dead_code)] enum Pass { Opaque { clear_color: [f32; 4], with_depth_pre_pass: bool, }, Transparent, } enum LoadOp { Clear, Load, } #[inline(never)] fn check(x: Option<LoadOp>) { assert!(x.is_none()); } #[inline(never)] fn test(mode: Pass) { check(match mode { Pass::Opaque { with_depth_pre_pass: true, .. } | Pass::Transparent => None, _ => Some(LoadOp::Clear), }); } fn main() { println!("Hello, world!"); test(Pass::Transparent); } </ins>
Change:
The code below leads to the following compiler panic <details<summaryfull stderr</summary</details<details<summary<coderustc -Vv</code</summary</details label -needs-triage C-bug I-ICE T-compiler F-genericconstitems requires-incomplete-features claim <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Minimized:

Discussion:
// version new_ty of its type where the anonymous region is replaced // with the named one. let (named, anon, anon_param_info, region_info) = if sub.has_name() <del> && self.tcx().is_suitable_region(sup).is_some() && self.find_param_with_region(sup, sub).is_some() </del> <ins> && let Some(region_info) = self.tcx().is_suitable_region(sup) && let Some(anon_param_info) = self.find_param_with_region(sup, sub) </ins> { <del> ( sub, sup, self.find_param_with_region(sup, sub).unwrap(), self.tcx().is_suitable_region(sup).unwrap(), ) </del> <ins> (sub, sup, anon_param_info, region_info) </ins> } else if sup.has_name() <del> && self.tcx().is_suitable_region(sub).is_some() && self.find_param_with_region(sub, sup).is_some() </del> <ins> && let Some(region_info) = self.tcx().is_suitable_region(sub) && let Some(anon_param_info) = self.find_param_with_region(sub, sup) </ins> { <del> ( sup, sub, self.find_param_with_region(sub, sup).unwrap(), self.tcx().is_suitable_region(sub).unwrap(), ) </del> <ins> (sup, sub, anon_param_info, region_info) </ins> } else { return None; // inapplicable };

let body_id = hir.maybe_body_owned_by(def_id)?; let owner_id = hir.body_owner(body_id); <del> let fn_decl = hir.fn_decl_by_hir_id(owner_id).unwrap(); </del> <ins> let fn_decl = hir.fn_decl_by_hir_id(owner_id)?; </ins> let poly_fn_sig = tcx.fn_sig(id).instantiate_identity(); let fn_sig = tcx.liberate_late_bound_regions(id, poly_fn_sig);

<ins> // Test that we catch that the reference outlives the referent and we // successfully emit a diagnostic. Regression test for issue #114714. #![feature(generic_const_items)] #![allow(incomplete_features)] const Q<'a, 'b>: &'a &'b () = &&(); //~ ERROR reference has a longer lifetime than the data it references fn main() {} </ins>

<ins> error[E0491]: in type `&'a &'b ()`, reference has a longer lifetime than the data it references --> $DIR/reference-outlives-referent.rs:7:18 | LL | const Q<'a, 'b>: &'a &'b () = &&(); |                  ^^^^^^^^^^ | note: the pointer is valid for the lifetime `'a` as defined here --> $DIR/reference-outlives-referent.rs:7:9 | LL | const Q<'a, 'b>: &'a &'b () = &&(); |         ^^ note: but the referenced data is only valid for the lifetime `'b` as defined here --> $DIR/reference-outlives-referent.rs:7:13 | LL | const Q<'a, 'b>: &'a &'b () = &&(); |             ^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0491`. </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. --This code compiles on the and channels, but crashes with an ICE on the channel. : (Backtrace omitted) .. And so on for , , etc. <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Minimized (from the chumsky crate) to: or (from the above) to: Bisected with v0.6.6 to , which is and that PR does look like it's in the right area to have caused this.

Discussion:
} if check_implied_wf == CheckImpliedWfMode::Check && !(impl_sig, trait_sig).references_error() { <ins> // Select obligations to make progress on inference before processing // the wf obligation below. // FIXME(-Ztrait-solver=next): Not needed when the hack below is removed. let errors = ocx.select_where_possible(); if !errors.is_empty() { let reported = infcx.err_ctxt().report_fulfillment_errors(&errors); return Err(reported); } </ins> // See #108544. Annoying, we can end up in cases where, because of winnowing, // we pick param env candidates over a more general impl, leading to more // stricter lifetime requirements than we would otherwise need. This can

// lifetime parameters. let outlives_env = OutlivesEnvironment::with_bounds( param_env, <del> infcx.implied_bounds_tys(param_env, impl_m_def_id, wf_tys.clone()), </del> <ins> infcx.implied_bounds_tys(param_env, impl_m_def_id, wf_tys), </ins> ); let errors = infcx.resolve_regions(&outlives_env); if !errors.is_empty() {

<ins> // check-pass pub trait Foo { type Error: Error; fn foo(&self, stream: &<Self::Error as Error>::Span); } pub struct Wrapper<Inner>(Inner); impl<E: Error, Inner> Foo for Wrapper<Inner> where Inner: Foo<Error = E>, { type Error = E; fn foo(&self, stream: &<Self::Error as Error>::Span) { todo!() } } pub trait Error { type Span; } fn main() {} </ins>

<ins> // check-pass trait AsBufferView { type Device; } trait Error { type Span; } trait Foo { type Error: Error; fn foo(&self) -> &<Self::Error as Error>::Span; } impl<D: Error, VBuf0> Foo for VBuf0 where VBuf0: AsBufferView<Device = D>, { type Error = D; fn foo(&self) -> &<Self::Error as Error>::Span { todo!() } } fn main() {} </ins>
Change:
Error message says it all: This is probably related to It goes away when I . Looks like the thiserror build script is caching its output too aggressively, so it doesn't notice that it needs to be rerun? Cc
As far as I understand, this is a bootstrap bug, not caching. See 1st paragraph of
Although, sounds like I'm wrong because I wouldn't have expected to help. ¯()/¯ I don't know of anything the thiserror build script is doing wrong with regard to caching.
I think you mean , which I'd say is a cargo limitation. But indeed then clearing my build cache wouldn't have helped... Here we don't have a proc macro dependency I think, so I don't think it is that problem.
I think what happens is that usually, when the rustc version changes, cargo will rerun build scripts automatically. But here the rustc version is always and so even though the output of running on a particular file can change, cargo keeps using the old cache. thiserror would have to say "rerun if the output of running might change", but it doesn't have a way to do that. (The rustc binary didn't even change, the sysroot did.) Maybe bootstrap should delete the cached build script output when the stage0 library artifacts change? Not sure if it even knows that this is the case though. Cc
Will check what we can do on the bootstrap side by the coming weekend. Thanks for the ping.
Hm, we usually rely on Cargo doing the rebuild as a result of depinfo containing references to the sysroot when it uses it (via -Zbinary-dep-depinfo), but in this case that doesn't get passed since we don't control the rustc invocation. I'm not sure we have a good way of recognizing when we need the rebuild and when we don't; we wouldn't want to always clear build scripts because that would cause many more spurious rebuilds...
Hm yeah, maybe the right solution is for cargo to provide a native way of doing "probe builds", that integrates with its caching...
Fixing this on bootstrap will most likely require implementing hacky tricks(like creating/moving some values as files between outputs and comparing them each time on the compilations) and that could make our complex flow even more confusing. And there's a good chance these things could cause unexpected problems that are hard to detect. +1
FWIW for now thiserror is working around this via

Discussion:
[[package]] name = "thiserror" <del> version = "1.0.40" </del> <ins> version = "1.0.47" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" <del> checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" </del> <ins> checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" </ins> dependencies = [ "thiserror-impl", ]

[[package]] name = "thiserror-impl" <del> version = "1.0.40" </del> <ins> version = "1.0.47" </ins> source = "registry+https://github.com/rust-lang/crates.io-index" <del> checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" </del> <ins> checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" </ins> dependencies = [ "proc-macro2", "quote",
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
Regression in nightly-2023-02-18 commit[0] 2023-02-16: Auto merge of - matthiaskrgr:rollup-kpzfc6j, r=matthiaskrgr commit[1] 2023-02-16: Auto merge of - Zoxc:arena-query-clean, r=cjgillot commit[2] 2023-02-17: Auto merge of - matthiaskrgr:rollup-bgadak1, r=matthiaskrgr commit[3] 2023-02-17: Auto merge of - kylematsuda:type-of, r=BoxyUwU commit[4] 2023-02-17: Auto merge of - Zoxc:query-ctxtx-byval, r=cjgillot commit[5] 2023-02-17: Auto merge of - BoxyUwU:addconstarghastype_predicate, r=compiler-errors commit[6] 2023-02-17: Auto merge of - matthiaskrgr:rollup-5k2j7cx, r=matthiaskrgr commit[7] 2023-02-17: Auto merge of - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstrieb
It's just the non-lifetime binders pr:

Discussion:
ty::Adt(def, _args) => def.sized_constraint(tcx).skip_binder().is_empty(), <del> ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => false, </del> <ins> ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) | ty::Bound(..) => false, </ins> ty::Infer(ty::TyVar(_)) => false, <del> ty::Bound(..) | ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => { </del> <ins> ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => { </ins> bug!("`is_trivially_sized` applied to unexpected type: {:?}", self) } }

<ins> // check-pass #![feature(non_lifetime_binders)] //~^ WARN is incomplete and may not be safe pub fn foo() where for<V> V: Sized, { bar(); } pub fn bar() where for<V> V: Sized, { } pub fn main() {} </ins>

<ins> warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/sized-late-bound-issue-114872.rs:3:12 | LL | #![feature(non_lifetime_binders)] |            ^^^^^^^^^^^^^^^^^^^^ | = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information = note: `#[warn(incomplete_features)]` on by default warning: 1 warning emitted </ins>
Change:
I tried this code: It failed with a confusing error message. (error: concrete type differs from previous defining opaque type use, at the same location) I'm trying to minimize , and found the problem. compiles, but fails. Although not 100% sure, I think it's caused by the same problem as (regression caused by )
cc
I can work on this, and then I can test if it fixes the other issue too.

Discussion:
} }; <ins> let span = self.tcx.def_span(expr_def_id); </ins> let output_ty = match *ret_ty.kind() { ty::Infer(ty::TyVar(ret_vid)) => { self.obligations_for_self_ty(ret_vid).find_map(|obligation| {

.find_map(|(p, s)| get_future_output(p.as_predicate(), s))?, ty::Error(_) => return None, _ => span_bug!( <del> self.tcx.def_span(expr_def_id), </del> <ins> span, </ins> "async fn generator return type not an inference variable: {ret_ty}" ), }; <ins> let output_ty = self.normalize(span, output_ty); </ins> // async fn that have opaque types in their return type need to redo the conversion to inference variables // as they fetch the still opaque version from the signature. let InferOk { value: output_ty, obligations } = self <del> .replace_opaque_types_with_inference_vars( output_ty, body_def_id, self.tcx.def_span(expr_def_id), self.param_env, ); </del> <ins> .replace_opaque_types_with_inference_vars(output_ty, body_def_id, span, self.param_env); </ins> self.register_predicates(obligations); Some(output_ty)

<ins> // edition:2021 // revisions: current next //[next] compile-flags: -Ztrait-solver=next // check-pass #![feature(type_alias_impl_trait)] struct Foo; impl Trait for Foo {} pub trait Trait {} pub type TAIT<T> = impl Trait; async fn foo<T>() -> TAIT<T> { Foo } fn main() {} </ins>