jiebi/CodeConvo huggingface dataset:
Change:
The compiler hangs on: searched nightlies: from nightly-2022-06-16 to nightly-2022-10-28 regressed nightly: nightly-2022-06-30 searched commit range: regressed commit: () label +A-const-generics +F-genericconstexprs +I-hang +T-compiler

Discussion:
<ins> #![feature(generic_const_exprs)] #![feature(adt_const_params)] #![allow(incomplete_features)] #![allow(dead_code)] #[derive(PartialEq, Eq)] struct U; struct S<const N: U>() where S<{ U }>:; //~^ ERROR: overflow evaluating the requirement `S<{ U }> well-formed` fn main() {} </ins>

<ins> error[E0275]: overflow evaluating the requirement `S<{ U }> well-formed` --> $DIR/adt_wf_hang.rs:11:5 | LL |     S<{ U }>:; |     ^^^^^^^^ | note: required by a bound in `S` --> $DIR/adt_wf_hang.rs:11:5 | LL | struct S<const N: U>() |        - required by a bound in this struct LL | where LL |     S<{ U }>:; |     ^^^^^^^^ required by this bound in `S` error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0275`. </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 running benchmarks with current nightly rust: Running with the previous nightly works: Also, note the difference in the line . This happens for the benchmarks in both the and crates. looks to be related ( <!-- 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<summaryBacktrace</summary<p</p</details
Ouch. I guess libtest needs better tests. I might be able to get to this in 12 hours or so, if anyone else sees this please do take care of it.
Oof, missed that started as the full list of tests+benches before getting shadowed as only the tests. Not a fan of the way TestEvent is used to manage state (haven't ever been a fan of it, TBH), but I'll have to think a bit about how to fix it without undoing the perf wins we just got here.
Confirm the bug as well: started to fail after changing the toolset to the current nighly.
Yeah, should be fixed by . Hopefully will be in the next nightly, if we're lucky.

Discussion:
})); self.add_test(desc, testfn); } <ins> fn total_len(&self) -> usize { self.tests.len() + self.benchs.len() } </ins> } pub fn run_tests<F>(

}; } <del> let filtered_out = tests_len - filtered.tests.len(); </del> <ins> let filtered_out = tests_len - filtered.total_len(); </ins> let event = TestEvent::TeFilteredOut(filtered_out); notify_about_test_event(event)?; let shuffle_seed = get_shuffle_seed(opts); <del> let event = TestEvent::TeFiltered(filtered.tests.len(), shuffle_seed); </del> <ins> let event = TestEvent::TeFiltered(filtered.total_len(), shuffle_seed); </ins> notify_about_test_event(event)?; let concurrency = opts.test_threads.unwrap_or_else(get_concurrency);

<ins> include ../../run-make-fulldeps/tools.mk # ignore-cross-compile all: # Smoke-test that `#[bench]` isn't entirely broken. $(RUSTC) --test smokebench.rs -O $(call RUN,smokebench --bench) $(call RUN,smokebench --bench noiter) $(call RUN,smokebench --bench yesiter) $(call RUN,smokebench) </ins>

<ins> #![feature(test)] extern crate test; #[bench] fn smoke_yesiter(b: &mut test::Bencher) { let mut i = 0usize; b.iter(|| { i = i.wrapping_add(1); i }) } #[bench] fn smoke_noiter(_: &mut test::Bencher) {} </ins>
Change:
With this code Stable produces Whereas beta/nightly produces searched nightlies: from nightly-2022-07-02 to nightly-2022-07-03 regressed nightly: nightly-2022-07-03 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.4</summaryHost triple: x86_64-unknown-linux-gnu </details label +regression-from-stable-to-nightly +A-mir-opt-inlining
Godbolt: Result IR can be further optimized by GVN, so this might be addressable on the LLVM side.
Looks like this got a bit worse on LLVM main because an additional assume is being preserved: Anyway, there is a phase ordering problem here. MemCpyOpt runs after GVN, and only at that point do we convert the memcpy into a memset, which makes the following load from it easy to fold. An easy fix would probably be to support memset in InstCombine load store forwarding. But this is no longer going to fix this issue due to the aforementioned assume issue. Ugh.
Upstream patch for InstCombine: An alternative solution would be to move MemCpyOpt prior to GVN, but I'm not sure whether that would cause other issues.
WG-prioritization assigning priority (). label -I-prioritize +P-medium
Upstream patch for SimplifyCFG: Together these produce the following final IR: Ignoring the opportunity to form a , this is optimal.
Nightly now compiles to
Needs codegen test.
Would just work?
Sounds reasonable.
Reopening because it working on nightly is not really reliable behavior. and both change vec field order and in each case it breaks the test.
I'm no longer having issues with the codegen test, LLVM 16 upgrade seems to have made it more reliable.

Discussion:
<ins> // compile-flags: -O #![crate_type = "lib"] pub fn foo(t: &mut Vec<usize>) { // CHECK-NOT: __rust_dealloc let mut taken = std::mem::take(t); taken.pop(); *t = taken; } </ins>
Change:
gives Build using the Nightly version: 1.67.0-nightly (2022-10-31 ) label F-asyncfnin_traits C-bug requires-nightly
searched nightlies: from nightly-2022-10-22 to nightly-2022-11-01 regressed nightly: nightly-2022-10-29 searched commit range: regressed commit: ' likely
Another repro which I believe is the same bug:

Discussion:
let num_trait_substs = trait_to_impl_substs.len(); let num_impl_substs = tcx.generics_of(impl_m.container_id(tcx)).params.len(); let ty = tcx.fold_regions(ty, |region, _| { <del> let (ty::ReFree(_) | ty::ReEarlyBound(_)) = region.kind() else { return region; }; </del> <ins> match region.kind() { // Remap all free regions, which correspond to late-bound regions in the function. ty::ReFree(_) => {} // Remap early-bound regions as long as they don't come from the `impl` itself. ty::ReEarlyBound(ebr) if tcx.parent(ebr.def_id) != impl_m.container_id(tcx) => {} _ => return region, } </ins> let Some(ty::ReEarlyBound(e)) = map.get(&region.into()).map(|r| r.expect_region().kind()) else { tcx

<ins> // check-pass // edition:2021 #![feature(async_fn_in_trait)] #![allow(incomplete_features)] pub trait Foo { async fn foo(&mut self); } struct MyFoo<'a>(&'a mut ()); impl<'a> Foo for MyFoo<'a> { async fn foo(&mut self) {} } fn main() {} </ins>

<ins> // check-pass // edition:2021 #![feature(async_fn_in_trait)] #![allow(incomplete_features)] pub trait Foo { async fn foo(&mut self); } impl<T: Foo> Foo for &mut T { async fn foo(&mut self) {} } fn main() {} </ins>
Change:
Given the following code: The current output is: Ideally the output should look like: How do we remove other diagnostics in this scenario?
label +D-verbose

Discussion:
} self.suggest_bare_struct_literal(&mut err); <del> self.suggest_pattern_match_with_let(&mut err, source, span); </del> <ins> if self.suggest_pattern_match_with_let(&mut err, source, span) { // Fallback label. err.span_label(base_error.span, &base_error.fallback_label); return (err, Vec::new()); } </ins> self.suggest_self_or_self_ref(&mut err, path, span); self.detect_assoct_type_constraint_meant_as_path(&mut err, &base_error);

if !self.type_ascription_suggestion(&mut err, base_error.span) { let mut fallback = self.suggest_trait_and_bounds(&mut err, source, res, span, &base_error); <ins> // if we have suggested using pattern matching, then don't add needless suggestions // for typos. </ins> fallback |= self.suggest_typo(&mut err, source, path, span, &base_error); if fallback { // Fallback label. err.span_label(base_error.span, &base_error.fallback_label);

err: &mut Diagnostic, source: PathSource<'_>, span: Span, <del> ) { </del> <ins> ) -> bool { </ins> if let PathSource::Expr(_) = source && let Some(Expr { span: expr_span,

"let ", Applicability::MaybeIncorrect, ); <ins> return true; </ins> } } <ins> false </ins> } fn get_single_associated_item(

<ins> #![allow(unused_variables)] use std::fs::File; fn main() { if Err(err) = File::open("hello.txt") { //~^ ERROR: cannot find value `err` in this scope //~| ERROR: mismatched types } } </ins>

<ins> error[E0425]: cannot find value `err` in this scope --> $DIR/issue-103909.rs:5:12 | LL |     if Err(err) = File::open("hello.txt") { |            ^^^ not found in this scope | help: you might have meant to use pattern matching | LL |     if let Err(err) = File::open("hello.txt") { |        +++ error[E0308]: mismatched types --> $DIR/issue-103909.rs:5:8 | LL |     if Err(err) = File::open("hello.txt") { |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()` error: aborting due to 2 previous errors Some errors have detailed explanations: E0308, E0425. For more information about an error, try `rustc --explain E0308`. </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. --Nightly 2022-08-11 worked fine, trying to upgrade from it. : <details<summary<strongBacktrace</strong</summary<p</p</details
, same rustc version
label E-needs-mcve -T-compiler +T-rustdoc
Error: Label needs-mcve can only be set by Rust team members Please file an issue on GitHub at if there's a problem with this bot, or reach out on on Zulip.
I don't have a MCVE but the same problem on the same nightly version happens with a dependency of . Sounds awfully similar to also involving deps, but that one's definitely fixed.
Pinging since they're the last one who worked on this. Maybe you have an idea?
Somewhat minimal example: Removing the impl avoids the bug.
This happens with beta too:
Fixed in

Discussion:
} } <ins> /// For rustdoc. pub fn get_partial_res(&self, node_id: NodeId) -> Option<PartialRes> { self.partial_res_map.get(&node_id).copied() } </ins> /// Retrieves the span of the given `DefId` if `DefId` is in the local crate. #[inline] pub fn opt_span(&self, def_id: DefId) -> Option<Span> {

self.parent_scope.module = old_module; } else { match &item.kind { <del> ItemKind::Impl(box ast::Impl { of_trait: Some(..), .. }) => { </del> <ins> ItemKind::Impl(box ast::Impl { of_trait: Some(trait_ref), .. }) => { if let Some(partial_res) = self.resolver.get_partial_res(trait_ref.ref_id) && let Some(res) = partial_res.full_res() && let Some(trait_def_id) = res.opt_def_id() && !trait_def_id.is_local() && self.visited_mods.insert(trait_def_id) { self.resolve_doc_links_extern_impl(trait_def_id, false); } </ins> self.all_trait_impls.push(self.resolver.local_def_id(item.id).to_def_id()); } ItemKind::MacroDef(macro_def) if macro_def.macro_rules => {

<ins> // Doc links in `Trait`'s methods are resolved because it has a local impl. // aux-build:issue-103463-aux.rs extern crate issue_103463_aux; use issue_103463_aux::Trait; pub struct LocalType; impl Trait for LocalType { fn method() {} } fn main() {} </ins>
Change:
<!-- Thank you for filing a regression report! A regression is something that changed between versions of Rust but was not supposed to. Please provide a short summary of the regression, along with any information you feel is relevant to replicate it. --I tried this code: () I expected to see this happen: Successful compilation Instead, this happened: <!-- Provide the most recent version this worked on, for example: It most recently worked on: Rust 1.47 --It most recently worked on: 1.65.0 <!-- Provide the version you are using that has the regression. --: modify labels: +regression-from-stable-to-beta -regression-untriaged
This became an error due to ( <details<summaryBisect info</summarysearched nightlies: from nightly-2022-09-18 to nightly-2022-11-07 regressed nightly: nightly-2022-09-23 searched commit range: regressed commit: bisected with <a href=''cargo-bisect-rustc</av0.6.4 Host triple: I used on the following file </details
Assigning priority as by the Prioritization Working Group.
awaiting beta backport
Can this be closed now that beta backport () is complete?

Discussion:
} ty::FnDef(did, substs) => { <del> let obligations = self.nominal_obligations(did, substs); </del> <ins> let obligations = self.nominal_obligations_without_const(did, substs); </ins> self.out.extend(obligations); }

<ins> // check-pass const _: () = core::mem::forget(Box::<u32>::default); const _: () = core::mem::forget(|| Box::<u32>::default()); fn main() {} </ins>
Change:
Found with a <details<summaryFull output including backtrace</summary</detailsRegression in nightly-2021-04-26, possibly from ( label +A-const-generics
Here's a simpler case that ICEs in a similar way. It ICEd at least as far back as nightly-2018-01-01 (with the keyword removed for older versions). Output: <details<summaryFull output</summary</details
A similar thing was fixed a week ago in but maybe a more general fix is needed.
This fix probably needs to go into the resolver -- Using to distinguish the identifers in the example: I think the issue is that is resolving to , instead of , so when we do the partial substitution of default const params, we end up trying to look for while is being created.
Similar ICE with struct instead of impl trait:
This would be inconsistent with how lifetimes work. You can have . I suggest a check in astconv, replacing the self-referential type/const by error type/const.

Discussion:
if let GenericParamKind::Lifetime = param.kind { // Record lifetime res, so lowering knows there is something fishy. self.record_lifetime_param(param.id, LifetimeRes::Error); <del> continue; </del> } <ins> continue; </ins> } Entry::Vacant(entry) => { entry.insert(param.ident.span);

<ins> trait Foo<const M: u8, const M: u8 = M> {} //~^ ERROR the name `M` is already used for a generic parameter in this item's generic parameters impl Foo<2> for () {} fn main() {} </ins>

<ins> error[E0403]: the name `M` is already used for a generic parameter in this item's generic parameters --> $DIR/self-referential.rs:1:30 | LL | trait Foo<const M: u8, const M: u8 = M> {} |                 -            ^ already used |                 | |                 first use of `M` error: aborting due to previous error For more information about this error, try `rustc --explain E0403`. </ins>

|      first use of `T` error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates <del> --> $DIR/duplicate-type-parameter.rs:24:6 </del> <ins> --> $DIR/duplicate-type-parameter.rs:24:8 </ins> | LL | impl<T,T> Qux<T,T> for Option<T> {} <del> |      ^ unconstrained type parameter </del> <ins> |        ^ unconstrained type parameter </ins> error: aborting due to 8 previous errors
Change:
cc me.
Triage: Not relevant right now, but this issue should be tested if/when we restore int/float fallback.

Discussion:
<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn works<T>(x: T) -> Vec<T> { vec![x] } fn also_works<T: Clone>(x: T) -> Vec<T> { vec![x] } fn main() { let _: Vec<usize> = works(0); let _: Vec<usize> = also_works(0); let _ = works(0); let _ = also_works(0); } </ins>
Change:
<!-- Thank you for filing a regression report! A regression is something that changed between versions of Rust but was not supposed to. Please provide a short summary of the regression, along with any information you feel is relevant to replicate it. --I tried this code: I expected to see this happen: code compiles and execute Instead, this happened: compilation fails with It most recently worked on: and <!-- Provide the version you are using that has the regression. --: <!-- Did the compiler crash? If so, please provide a backtrace. --<!-- If you know when this regression occurred, please add a line like below, replacing with one of stable, beta, or nightly. modify labels: +regression-from-stable-to-{channel} -regression-untriaged --used by . I suspect (but did not confirm) might be the cause of the breakage as it is a recent change on that area. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
cc
The code posted has a missing delimiter.
oops, fixed
claim
WG-prioritization assigning priority (). label -I-prioritize +P-high

Discussion:
return Some(p); } if let Some(e) = self.expr { <del> if let ast::ExprKind::Lit(_) = e.kind { </del> <ins> if matches!(e.kind, ast::ExprKind::Lit(_) | ast::ExprKind::IncludedBytes(_)) { </ins> return Some(P(ast::Pat { id: ast::DUMMY_NODE_ID, span: e.span,

const _: u32 = recursive_expand!(); //~ ERROR: recursion limit reached while expanding `recursive_expand!` <del> fn main() {} </del> <ins> fn main() { // https://github.com/rust-lang/rust/issues/104414 match b"Included file contentsn" { include_bytes!("auxiliary/included-file.txt") => (), _ => panic!("include_bytes! in pattern"), } } </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. --code from requires debug assertions <!-- 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 --
lol, nightly emits this:D : another one from
any updates? :upsidedownface:
claim I think I got a fix :slightlysmilingface:
Error: Parsing assign command in failed: ...' claim' ' I think I'... Please file an issue on GitHub at if there's a problem with this bot, or reach out on on Zulip.
claim

Discussion:
} None => { debug!(?param.ident, ?param.ident.span); let deletion_span = deletion_span(); <del> self.r.lint_buffer.buffer_lint_with_diagnostic( lint::builtin::UNUSED_LIFETIMES, param.id, param.ident.span, &format!("lifetime parameter `{}` never used", param.ident), lint::BuiltinLintDiagnostics::SingleUseLifetime { param_span: param.ident.span, use_span: None, deletion_span, }, ); </del> <ins> // the give lifetime originates from expanded code so we won't be able to remove it #104432 let lifetime_only_in_expanded_code = deletion_span.map(|sp| sp.in_derive_expansion()).unwrap_or(true); if !lifetime_only_in_expanded_code { self.r.lint_buffer.buffer_lint_with_diagnostic( lint::builtin::UNUSED_LIFETIMES, param.id, param.ident.span, &format!("lifetime parameter `{}` never used", param.ident), lint::BuiltinLintDiagnostics::SingleUseLifetime { param_span: param.ident.span, use_span: None, deletion_span, }, ); } </ins> } } }

<ins> // check-pass #![deny(unused_lifetimes)] trait Trait2 { type As; } // we should not warn about an unused lifetime about code generated from this proc macro here #[derive(Clone)] struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As)); pub fn main() {} </ins>
Change:
url: function: asref() Examples: Perhaps I'm just confused, but shouldn't that say: <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
Transferring to the rust-lang/rust repository, as that is where the standard library documentation is. I think it is trying to illustrate the conversion from → → . The text is just eliding the middle step, and explaining where it is starting from and where it is finishing.
No, that seems fine; what confuses you (or leads you to the &str conclusion)? I could follow but not . Perhaps you're thinking the impl on would make the contain or such?
I guess I'm extremely confused then. If I have an , what good does an do me? If I have &Some( "fubar" ), how does that translate to a usize? Is it giving me the length of the string or it's pointer in memory? Neither seems useful nor relevant to the description of "Converts from &Option<Tto Option<&T.".
You can call . just describes the example code's functionality, not 's. It's showing one of the ways you could use .
Okay, sorry, I understand now that comment is talking about the upcoming example instead of discussing as_ref() in general. In order to help others not experience the same confusion I did, perhaps I could suggest a tweak to the wording, such as: ?
memory address
claim

Discussion:
/// /// # Examples /// <del> /// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, preserving /// the original. The [`map`] method takes the `self` argument by value, consuming the original, /// so this technique uses `as_ref` to first take an `Option` to a reference /// to the value inside the original. </del> <ins> /// Calculates the length of an <code>Option<[String]></code> as an <code>Option<[usize]></code> /// without moving the [`String`]. The [`map`] method takes the `self` argument by value, /// consuming the original, so this technique uses `as_ref` to first take an `Option` to a /// reference to the value inside the original. </ins> /// /// [`map`]: Option::map /// [String]: ../../std/string/struct.String.html "String" <ins> /// [`String`]: ../../std/string/struct.String.html "String" </ins> /// /// ``` /// let text: Option<String> = Some("Hello, world!".to_string());

/// /// # Examples /// <del> /// Converts an <code>Option<[String]></code> into an <code>Option<[usize]></code>, consuming /// the original: </del> <ins> /// Calculates the length of an <code>Option<[String]></code> as an /// <code>Option<[usize]></code>, consuming the original: </ins> /// /// [String]: ../../std/string/struct.String.html "String" /// ```
Change:
() This happens whether or not the returned type implements the trait in question. <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details modify labels +F-dyn_star

Discussion:
inherited.typeck_results.borrow_mut().liberated_fn_sigs_mut().insert(fn_id, fn_sig); <del> if let ty::Dynamic(..) = declared_ret_ty.kind() { </del> <ins> if let ty::Dynamic(_, _, ty::Dyn) = declared_ret_ty.kind() { </ins> // FIXME: We need to verify that the return type is `Sized` after the return expression has // been evaluated so that we have types available for all the nodes being returned, but that // requires the coerced evaluated type to be stored. Moving `check_return_expr` before this

<ins> // check-pass #![feature(dyn_star)] //~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes fn _foo() -> dyn* Unpin { 4usize } fn main() {} </ins>

<ins> warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/return.rs:3:12 | LL | #![feature(dyn_star)] |            ^^^^^^^^ | = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information = note: `#[warn(incomplete_features)]` on by default warning: 1 warning emitted </ins>