jiebi/CodeConvo huggingface dataset:
Change:
None, ); if !fcx.tcx.features().unsized_locals { <del> let id = fcx.tcx.hir().parent_id(id); unsized_return = self.is_return_ty_unsized(fcx, id); </del> <ins> unsized_return = self.is_return_ty_definitely_unsized(fcx); </ins> } } _ => {

Discussion:
<!-- 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
bisected to cc
This can be made to ICE on stable as well:
duplicate of

<!-- 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
almost exactly 3 years old :cake: :partying_face: :pinata: searched toolchains nightly-2020-04-17 through nightly-2023-04-22 Regression in nightly-2020-04-23 found 7 bors merge commits in the specified range commit[0] 2020-04-21: Auto merge of - spastorino:dyn-fnonce-alignment, r=nikomatsakis commit[1] 2020-04-22: Auto merge of - ehuss:update-cargo, r=ehuss commit[2] 2020-04-22: Auto merge of - JohnTitor:rollup-vh6dut5, r=JohnTitor commit[3] 2020-04-22: Auto merge of - nnethercote:bitcode-in-rlib, r=alexcrichton commit[4] 2020-04-22: Auto merge of - Dylan-DPC:rollup-iunh61a, r=Dylan-DPC commit[5] 2020-04-22: Auto merge of - nnethercote:alphabetize-C-and-Z-options, r=petrochenkov commit[6] 2020-04-22: Auto merge of - Dylan-DPC:rollup-rvm6tfy, r=Dylan-DPC probably ? cc
I feel like i've seen this before -- probably a dupe? Or at least I think I've chatted with about this.
Could be :D probably 90% of the ICEs I am seeing are already reported in some way or another and sometimes one might slip through
different stacktrace with debug assertions: `
Change:
} /// Returns an iterator of `u16` over the string encoded as UTF-16. <ins> /// /// # Examples /// /// Basic usage: /// /// ``` /// let text = "Zażółć gęślą jaźń"; /// /// let utf8_len = text.len(); /// let utf16_len = text.encode_utf16().count(); /// /// assert!(utf16_len <= utf8_len); /// ``` </ins> #[stable(feature = "encode_utf16", since = "1.8.0")] pub fn encode_utf16(&self) -> EncodeUtf16 { EncodeUtf16 { encoder: Utf16Encoder::new(self[..].chars()) }

Discussion:
If anyone anyone wants to work on this, just mention it in a comment to prevent duplicate work. If you need any help or have any questions, don't hesitate to ping me :)
This seems easy, I'd like to give it a shot.
Will something like this be okay? I assumed the most obvious difference between utf8 and utf16 is the length of a non-Ascii string (hence the assertion). Technically I could assert for exact values, but that sounds like an overkill to me.
Agreed! Same, this sounds good to me!
Change:
expected: Ty<'tcx>, found: Ty<'tcx>, id: hir::HirId, <ins> fn_id: hir::HirId, </ins> ) { if !expected.is_unit() { return; } let found = self.resolve_vars_with_obligations(found); <ins> let in_loop = self.is_loop(id) || self.tcx.hir().parent_iter(id).any(|(parent_id, _)| self.is_loop(parent_id)); let in_local_statement = self.is_local_statement(id) || self .tcx .hir() .parent_iter(id) .any(|(parent_id, _)| self.is_local_statement(parent_id)); if in_loop && in_local_statement { err.multipart_suggestion( "you might have meant to break the loop with this value", vec![ (expr.span.shrink_to_lo(), "break ".to_string()), (expr.span.shrink_to_hi(), ";".to_string()), ], Applicability::MaybeIncorrect, ); return; } </ins> if let hir::FnRetTy::Return(ty) = fn_decl.output { let ty = <dyn AstConv<'_>>::ast_ty_to_ty(self, ty); <del> let bound_vars = self.tcx.late_bound_vars(id); </del> <ins> let bound_vars = self.tcx.late_bound_vars(fn_id); </ins> let ty = self.tcx.erase_late_bound_regions(Binder::bind_with_vars(ty, bound_vars)); let ty = self.normalize_associated_types_in(expr.span, ty); if self.can_coerce(found, ty) {

Discussion:
<!-- 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. If you cannot produce a minimal reproduction case (something that would work in isolation), please provide the steps or even link to a repository that causes the problematic output to occur. --Given the following code: The current output is: Ideally the output should look like: <!-- If the problem is not self-explanatory, please provide a rationale for the change. --It may not be immediately clear to a user why implicit-return/break style works for expressions, but not for . Adding a hint to explicitly break with would be helpful. <!-- If dramatically different output is caused by small changes, consider also adding them here. 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. The output might also be different depending on the Edition. --<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
label +A-suggestion-diagnostics
claim
Change:
let second_input_ty = self.resolve_vars_if_possible(expected_input_tys[second_idx]); let third_input_ty = <del> self.resolve_vars_if_possible(expected_input_tys[second_idx]); </del> <ins> self.resolve_vars_if_possible(expected_input_tys[third_idx]); </ins> let span = if third_idx < provided_arg_count { let first_arg_span = provided_args[first_idx].span; let third_arg_span = provided_args[third_idx].span;

Discussion:
: <!-- 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 --
Also ICEs on beta. Output on stable: label regression-from-stable-to-beta
searched nightlies: from nightly-2022-04-16 to nightly-2022-04-17 regressed nightly: nightly-2022-04-17 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.3</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailscc
claim
Assigning priority as discussed in the of the Prioritization Working Group. label -I-prioritize +P-medium
Change:
/// /// This can result in formatting thousands of files instead of a dozen, /// so we should warn the user something is wrong. <del> pub fn warn_old_master_branch( config: &GitConfig<'_>, git_dir: &Path, ) -> Result<(), Box<dyn std::error::Error>> { use std::time::Duration; const WARN_AFTER: Duration = Duration::from_secs(60 * 60 * 24 * 10); let updated_master = updated_master_branch(config, Some(git_dir))?; let branch_path = git_dir.join(".git/refs/remotes").join(&updated_master); match std::fs::metadata(branch_path) { Ok(meta) => { if meta.modified()?.elapsed()? > WARN_AFTER { eprintln!("warning: {updated_master} has not been updated in 10 days"); } else { return Ok(()); </del> <ins> pub fn warn_old_master_branch(config: &GitConfig<'_>, git_dir: &Path) { if crate::ci::CiEnv::is_ci() { // this warning is useless in CI, // and CI probably won't have the right branches anyway. return; } // this will be overwritten by the actual name, if possible let mut updated_master = "the upstream master branch".to_string(); match warn_old_master_branch_(config, git_dir, &mut updated_master) { Ok(branch_is_old) => { if !branch_is_old { return; </ins> } <ins> // otherwise fall through and print the rest of the warning </ins> } Err(err) => { eprintln!("warning: unable to check if {updated_master} is old due to error: {err}")

Discussion:
When running any bootstrap command, it complains that it can't figure out whether my master branch is outdated. Of course it does, as it just YOLOs into , which is just a file and not a directory for worktrees: it should probably not do that (i don't have a suggestion on what to do instead) regressed by
i would say adding a bit of error handling that checks if it's in a worktree doesn't sound too hard. there's two options from there: emit the warning in a worktree. this is basically trivial, but if someone does 100% of their work in a worktree, they may end up with an outdated upstream and not know it back to a more reliable method when in a worktree
Change:
{ if let Some(where_pred) = where_pred.as_trait_clause() && let Some(failed_pred) = failed_pred.as_trait_clause() <ins> && where_pred.def_id() == failed_pred.def_id() </ins> { self.enter_forall(where_pred, |where_pred| { let failed_pred = self.instantiate_binder_with_fresh_vars(

Discussion:
<!-- 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<strongICE location label +F-unboxedclosures
Regression in nightly-2024-03-22
Minimized: <details<summaryError output</summary</details labels -F-unboxed_closures
duplicate of ?
it would be nice if you could check the bugtracker before posting something, as right now about 30-50% of your bugreports are just re-reports of ices we already know about it seems :upsidedownface:

<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: relating different kinds: (Alias(Projection, AliasTy { args: [?3t, !101.Named(DefId(0:16 ~ C20C3EF57DBBF6727FABBD162A0D132F6096AD3675C924B540DA66E336EE31F0[a82c]::{impl}::dosomethingwrapper::'), "'"), i32], defid: DefId(0:6 ~ C20C3EF57DBBF6727FABBD162A0D132F6096AD3675C924B540DA66E336EE31F0[a82c]::Output::Type), usealiastynewinstead: () }),) !71.Named(DefId(0:16 ~ C20C3EF57DBBF6727FABBD162A0D132F6096AD3675C924B540DA66E336EE31F0[a82c]::{impl}::dosomethingwrapper::'), "'")', 'error: internal compiler error: relating different kinds: (Alias(Projection, AliasTy { args: [?3t, !101.Named(DefId(0:16 ~ C20C3EF57DBBF6727FABBD162A0D132F6096AD3675C924B540DA66E336EE31F0[a82c]::{impl}::dosomethingwrapper::'), "'"), i32], defid: DefId(0:6 ~ C20C3EF57DBBF6727FABBD162A0D132F6096AD3675C924B540DA66E336EE31F0[a82c]::Output::Type), usealiastynewinstead: () }),) !71.Named(DefId(0:16 ~ C20C3EF57DBBF6727FABBD162A0D132F6096AD3675C924B540DA66E336EE31F0[a82c]::{impl}::dosomethingwrapper::'), "'")' File: --auto-reduced (treereduce-rust): original: Version information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. .

--<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [typeck] type-checking [analysis] running analysis passes on this crate -- label +F-unboxedclosures <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
Regression in nightly-2024-02-15 cc :sweat_smile:
an ICE in the middle of constructing an error, these can usually be solved with some tainting, I'll investigate
I can take a look at this since it's been a month hehe claim
Change:
<ins> error: constant pattern depends on a generic parameter --> $DIR/issue-79137-toogeneric.rs:12:43 | LL |     matches!(GetVariantCount::<T>::VALUE, GetVariantCount::<T>::VALUE) |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: constant pattern depends on a generic parameter --> $DIR/issue-79137-toogeneric.rs:12:43 | LL |     matches!(GetVariantCount::<T>::VALUE, GetVariantCount::<T>::VALUE) |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors </ins>

Discussion:
For example: Similar to , but with a different intrinsic. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
We can probably just put call in front of that if statement. A more precise way to implement this would be to exhaustively match on and forbid , , , , and here. This way we the intrinsic can still be evaluated for which is probably desirable.
claim
Hello, I'm interested in taking the desirable approach. How is the arm for variants like should be handled? Which macro is more appropriate for this situation?
I quickly grepped for and ended up with here. That only works once you know what to search for though.
Change:
<ins> // Regression test for #70813 (this used to trigger a debug assertion) trait Trait {} struct S; impl<'a> Trait for &'a mut S {} fn foo<X>(_: X) where for<'b> &'b X: Trait, { } fn main() { let s = S; foo::<S>(s); //~ ERROR the trait bound `for<'b> &'b S: Trait` is not satisfied } </ins>

Discussion:
Using a built from commit with debug assertions enabled ( in ), I'm seeing an internal compiler error on the following input (found by ):
: The second error should probably not be emitted as I believe it is caused by a placeholder lifetime used during recovery. We should introduce (or use if it is already there) a lifetime equivalent to .
This only happens in builds with debug assertions. It's not fixed in master.
Assigning as and removing .
Change:
<ins> error: expected one of `.`, `;`, `?`, or an operator, found `,` --> $DIR/issue-72253.rs:4:9 | LL |         .arg("1") |                  - expected one of `.`, `;`, `?`, or an operator LL |         ,arg("2") |         ^ unexpected token error: aborting due to previous error </ins>

Discussion:
In an obscure situation with a typo (where there is a comma instead of a period), rustc will suggest replacing the comma with a semicolon, which will fail to compile. Produces the following error and suggestion: Some observations: This must be a let binding. The method calls must be on separate lines (all on one line gives a different error). I would expect this to provide the same error if it is all on one line ("expected one of , , , or an operator"), possibly with a "maybe incorrect" suggestion to replace it with a period (maybe only if the following character is not whitespace?). Note: Feel free to close this. This is really obscure, and I suspect it is not trivial to change, and it is fairly obvious what is wrong. I just thought it was strange, and I was doubly puzzled that the indentation mattered. rustc 1.45.0-nightly ( 2020-05-10) <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
This is because the error recovery tries to figure out if you typoed something when trying to write ; to end an expression. This is probably easy to fix.
claim
Thoughts about the better approach?: vs.
I would prefer something closer to what we already see in other syntax errors: We are not afraid of using vertical space to make errors clearer, but that vertical space still comes at a premium, as does verbosity. We try to lean towards the tersest possible output that can still convey the concept to the broadest set of people.
Merged. Thanks for a good learning issue And thanks for mentoring it I really appreciate your time!
Change:
LL |     let _ = Box::new(|x| (x as u8)): Box<dyn Fn(i32) -> _>; |             ^^^^^^^^^^^^^^^^^^^^^^^ expected trait object `dyn std::ops::Fn`, found closure | <del> = note: expected struct `std::boxed::Box<dyn std::ops::Fn(i32) -> _>` </del> <ins> = note: expected struct `std::boxed::Box<dyn std::ops::Fn(i32) -> u8>` </ins> found struct `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:26:22: 26:35]>` error: aborting due to 14 previous errors

Discussion:
IIUC currently a trait object is always covariant in its associated types, regardless of their positions. This makes it possible to pass a non-static reference to a function expecting a static reference:
With rustc 1.0.0 ..= 1.16.0, the following error was emitted:
-- this looks plausibly similar to , but I don't know enough to be certain.
Oh wow how are these not invariant? Cc
Assigning as and removing .
Just in case, in my last action I've removed by accident and it back :).
Wait, these are supposed to be invariant. This is definitely a bug. It would be great to figure out just which nightly regressed this, maybe somebody can run cargo bisect? cleanup
Er, I guess I meant this? ping cleanup
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good "Cleanup ICE-breaking candidate". In case it's useful, here are some [instructions] for tackling these sorts of bugs. Maybe take a look? Thanks! <3 [instructions]: https://rustc-dev- cc
searched toolchains nightly-2016-06-01 through nightly-2020-01-01 regression in nightly-2017-03-12 ... Previous error message: I used a slightly modified variant (just removed the IIRC): <details<summaryCode used</summary</details
Most likely candidate seems to be , cc
Thanks! Super useful.
After discussing a bit with this sounds more like than .
modify labels:-E-needs-bisection
Crater run from the fix (thanks to for the analysis). I was thinking about that and I realize that it's plausible that we could do variance inference on associated types and use that to inform the variance for types. It is sensible, for example, that a is covariant with respect to (that is the trait used in one of the affected examples). I'm a bit nervous about this though. For one thing, the core operations exposed by a type are clearly just its methods, but people can also project out from types (though that projection is generally considered invariant over the input types). But for another, it seems to give rise to some asymmetry and complexity around traits and variance that we have thus far avoided (and which I might prefer to continue to avoid).
Change:
<script src="{root_path}jquery.js"></script> <script src="{root_path}main.js"></script> {play_js} <del> <script async src="{root_path}search-index.js"></script> </del> <ins> <script defer src="{root_path}search-index.js"></script> </ins> </body> </html>"##, content   = *t,

Discussion:
Sections appearing on the sidebar seem to not have a deterministic order and can result in variations like the attached screenshot. The order probably should be deterministic and go either or . Reloading the page many times seems to successfully reproduce the issue here. ! !
Change:
Some(s) => *s, None => match info.payload().downcast_ref::<String>() { Some(s) => &s[..], <del> None => "Box<Any>", </del> <ins> None => "Box<dyn Any>", </ins> }, }; let thread = thread_info::current_thread();

Discussion:
() I would’ve expected it to say Relevant point in seems to be . label C-enhancement, T-libs <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
label +A-error-handling
claim
Wow, issues really do go fast. Best of luck, reaganmcf!
Change:
} clean::ImportItem(ref import) => { <ins> let (stab, stab_tags) = if let Some(import_def_id) = import.source.did { let import_attrs = Box::new(clean::Attributes::from_ast( cx.tcx().sess().diagnostic(), cx.tcx().get_attrs(import_def_id), None, )); // Just need an item with the correct def_id and attrs let import_item = clean::Item { def_id: import_def_id, attrs: import_attrs, ..myitem.clone() }; let stab = import_item.stability_class(cx.tcx()); let stab_tags = Some(extra_info_tags(&import_item, item, cx.tcx())); (stab, stab_tags) } else { (None, None) }; let add = if stab.is_some() { " " } else { "" }; </ins> write!( w, <del> "<tr><td><code>{}{}</code></td></tr>", myitem.visibility.print_with_space(myitem.def_id, cx), import.print(cx), </del> <ins> "<tr class="{stab}{add}import-item"> <td><code>{vis}{imp}</code></td> <td class="docblock-short">{stab_tags}</td> </tr>", stab = stab.unwrap_or_default(), add = add, vis = myitem.visibility.print_with_space(myitem.def_id, cx), imp = import.print(cx), stab_tags = stab_tags.unwrap_or_default(), </ins> ); }

Discussion:
See is unstable, however there is no unstable tag showing that, it would be nice if it would, just so it can be seen at a glance without going to their respective pages. cc <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Note that rustdoc already does something similar for : ! It could use a similar format for re-exports.
Really could just copy the existing tags (see -asm) and put em after the path.
claim
Change:
} r.super_visit_with(self) } <ins> #[instrument(level = "trace", skip(self), ret)] fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { match t.kind() { ty::Opaque(def_id, substs) => self.visit_opaque(*def_id, substs), ty::Projection(proj) if self.tcx.def_kind(proj.item_def_id) == DefKind::ImplTraitPlaceholder => { self.visit_opaque(proj.item_def_id, proj.substs) } _ => t.super_visit_with(self), } } </ins> } // By default, RPIT are invariant wrt type and const generics, but they are bivariant wrt

Discussion:
The following compiles on the current nightly (1.67.0-nightly (2022-12-03 )) although it shouldn't: It is correctly rejected by the current beta: 1.66.0-beta.2 (2022-11-20 ). This is most likely (I haven't bisected though!). Cc label C-bug T-compiler I-unsound regression-from-stable-to-nightly A-impl-trait
WG-prioritization assigning priority (). label -I-prioritize +P-high
Change:
if encode_opt { record!(self.tables.optimized_mir[def_id.to_def_id()] <- tcx.optimized_mir(def_id)); <del> if tcx.sess.opts.unstable_opts.drop_tracking_mir && let DefKind::Generator = self.tcx.def_kind(def_id) { record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- tcx.mir_generator_witnesses(def_id)); </del> <ins> if tcx.sess.opts.unstable_opts.drop_tracking_mir && let DefKind::Generator = self.tcx.def_kind(def_id) && let Some(witnesses) = tcx.mir_generator_witnesses(def_id) { record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- witnesses); </ins> } } if encode_const {

Discussion:
<!-- 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 cc
Hmm, I guess that before this function just received broken MIR and carried on, but exited due to the HIR errors without trying to dump it. Now that we return an error body for broken code we're getting a panic