jiebi/CodeConvo huggingface dataset:
Change:
<ins> warning: irrefutable `if let` pattern --> $DIR/issue-78720.rs:6:5 | LL | /     if let a = "" { LL | | LL | |         drop(|_: ()| drop(a)); LL | |     } | |_____^ | = note: `#[warn(irrefutable_let_patterns)]` on by default = note: this pattern will always match, so the `if let` is useless = help: consider replacing the `if let` with a `let` warning: 1 warning emitted </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. --Removing allows the code to compile successfully. <!-- 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 --<!-- TRIAGEBOT_END --
cc
I dont have too much context on how type folding works, but my guess is we are calling fold sooner that we should. I have this to the for RFC 2229, I'll bring it up during our sync tomorrow.
We want to use .
assign
Error: Parsing assign command in failed: ...'bot assign' ''... Please let know if you're having trouble with this bot.
claim
Thanks
Change:
BREAK_WITH_LABEL_AND_LOOP, UNUSED_ATTRIBUTES, NON_EXHAUSTIVE_OMITTED_PATTERNS, <ins> DEREF_INTO_DYN_SUPERTRAIT, </ins> ] }

Discussion:
<!-- 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: This should probably continue to compile as before, unless proven to be equivalent. Instead, this happened: The detection for seems to be a little too aggressive, so it's flagging the coercion as feature-gated in beta even though a deref coercion is available: Playground: <!-- Provide the most recent version this worked on, for example: It most recently worked on: Rust 1.47 --It most recently worked on: 1.55.0 : <!-- Provide the version you are using that has the regression. --: <!-- Did the compiler crash? If so, please provide a backtrace. --<!-- Include a backtrace in the code block by setting in your environment. E.g. . --<!--<details<summaryBacktrace</summary<p</p</details--(not applicable) <!-- 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 -- modify labels: +regression-from-stable-to-beta -regression-untriaged
Assigning priority as discussed in the of the Prioritization Working Group. label -I-prioritize +P-high
Bisection: searched nightlies: from nightly-2020-01-01 to nightly-2021-09-23 regressed nightly: nightly-2021-08-01 searched commits: from to regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.0</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </details
There is a that discusses this issue. Tagging this with T-lang since this is a change in semantics.

label +A-traits +F-trait_upcasting +T-lang +T-compiler
I'm not sure what the proper procedure is in this case, but I just noticed this hit stable in 1.56.0 (without the lint appearing beforehand) and broke my crate I'll work around it on my end, since I need this to continue work on a downstream crate.
Hmm, it seems that the fix didn't get backported to 1.56. Does 1.57-beta work?
It does indeed: The playground uses as of writing this.
Change:
<del> //@ known-bug: rust-lang/rust#128621 trait Trait { type Associated; } impl Trait for i32 { type Associated = i64; } trait Generic<T> {} type TraitObject = dyn Generic<<i32 as Trait>::Associated>; struct Wrap(TraitObject); fn cast(x: *mut TraitObject) { x as *mut Wrap; } </del>

Discussion:
<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'called on an value: NoSolution'', 'thread 'rustc' panicked at 'called on an value: NoSolution'' File: --auto-reduced (treereduce-rust): &lt;details&lt;summary&lt;strongoriginal code&lt;/strong&lt;/summary&lt;poriginal: </p</detailsVersion 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: [mirborrowck] borrow-checking [analysis] running analysis passes on this crate -- label +F-ptrmetadata
bisects to :thinking: cc
Minimized: This compiles on stable. ICEs on beta. <details<summaryError output on beta</summary</details label +regression-from-stable-to-beta Of note, the opposite pointer cast fails to compile on stable, beta, and nightly. This seems wrong to me. <details<summaryThe opposite cast</summaryError: </details
Just for context (unsure if relevant here) I see in that PR a question for T-lang about a breaking change at this and in the following FCP that was
So while the breaking change was approved, I believe this code should compile (and definitely not ICE). The issue seems to be that borrowck can't prove a bound (after typeck did). Seeing for you need a projection to trigger the issue () I think there is normalization missing somewhere.
WG-prioritization assigning priority (). label -I-prioritize +P-high
Change:
} } <ins> /// Returns whether this instance is instantiable - whether it has no unsatisfied /// predicates. /// /// In order to translate an item, all of its predicates must hold, because /// otherwise the item does not make sense. Type-checking ensures that /// the predicates of every item that is *used by* a valid item *do* /// hold, so we can rely on that. /// /// However, we translate collector roots (reachable items) and functions /// in vtables when they are seen, even if they are not used, and so they /// might not be instantiable. For example, a programmer can define this /// public function: /// ///     pub fn foo<'a>(s: &'a mut ()) where &'a mut (): Clone { ///         <&mut () as Clone>::clone(&s); ///     } /// /// That function can't be translated, because the method `<&mut () as Clone>::clone` /// does not exist. Luckily for us, that function can't ever be used, /// because that would require for `&'a mut (): Clone` to hold, so we /// can just not emit any code, or even a linker reference for it. /// /// Similarly, if a vtable method has such a signature, and therefore can't /// be used, we can just not emit it and have a placeholder (a null pointer, /// which will never be accessed) in its place. pub fn is_instantiable(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> bool { debug!("is_instantiable({:?})", self); let (def_id, substs) = match *self { TransItem::Fn(ref instance) => (instance.def_id(), instance.substs), TransItem::Static(node_id) => (tcx.hir.local_def_id(node_id), Substs::empty()), // global asm never has predicates TransItem::GlobalAsm(..) => return true }; let predicates = tcx.predicates_of(def_id).predicates.subst(tcx, substs); traits::normalize_and_test_predicates(tcx, predicates) } </ins> pub fn to_string(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>) -> String { let hir_map = &tcx.hir;

Discussion:
Compiler panicks instead of showing an appropriate error message in case boundaries are not satisfied. I tried this code: In the result compiler panicked with the following message:
Minimal repr:
Still panics on stable 1.15.1
Change:
Ub(PointerOutOfBounds { .. }) => DanglingPtrOutOfBounds { ptr_kind }, <del> // This cannot happen during const-eval (because interning already detects // dangling pointers), but it can happen in Miri. </del> Ub(PointerUseAfterFree(..)) => DanglingPtrUseAfterFree { ptr_kind, },

Discussion:
<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: could not find allocation for alloc3', 'error: internal compiler error: could not find allocation for alloc3' 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: [evalstaticinitializer] evaluating initializer of static [analysis] running analysis passes on this crate -- label +F-extern_types
Regression in nightly-2024-05-23 cc :thinking:
Anyway it doesn't seem to affect the test.
This is not a recent regression, here's a reproducer on stable:
But why?^^ lol XD its just side effect of the fuzzing I guess :D
Change:
<ins> // Copyright 2012 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. // // Testing that unsafe blocks in match arms are followed by a comma // pp-exact fn main() { match true { true if true => (), false => unsafe { }, true => { } false => (), } } </ins>

Discussion:
The pretty printer is removing trailing commas from match arms that contain an block expression: Running it with produces: Which when compiled errors with:
Actually, I'm not sure what the right tag is here...
Change:
impl Iterator for ReadDir { type Item = io::Result<DirEntry>; fn next(&mut self) -> Option<io::Result<DirEntry>> { <ins> if self.handle.0 == c::INVALID_HANDLE_VALUE { // This iterator was initialized with an `INVALID_HANDLE_VALUE` as its handle. // Simply return `None` because this is only the case when `FindFirstFileW` in // the construction of this iterator returns `ERROR_FILE_NOT_FOUND` which means // no matchhing files can be found. return None; } </ins> if let Some(first) = self.first.take() { if let Some(e) = DirEntry::new(&self.root, &first) { return Some(Ok(e));

Discussion:
This was reported on discord by who pointed out that the C++ STL has a similar issue. Example: prints: It should return success but the returned iterator will have no items. Basically if you use on a completely empty volume then it will return . Rust should interpret this as being an empty iteration and not return an error to the user. Note that empty directories do not return an error so this behaviour was overlooked. We need to add some extra logic to this : <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
claim
This is fixed in C++ STL after this PR:
Change:
<ins> // edition: 2021 #![feature(return_type_notation)] //~^ WARN the feature `return_type_notation` is incomplete trait HealthCheck { async fn check<const N: usize>() -> bool; } async fn do_health_check_par<HC>(hc: HC) where HC: HealthCheck<check(): Send> + Send + 'static, //~^ ERROR return type notation is not allowed for functions that have const parameters { } fn main() {} </ins>

Discussion:
<!-- [31mICE[0m: Rustc '--edition=2021 -ooutputfile -Zdump-mir-dir=dir' 'thread 'rustc' panicked at ', 'thread 'rustc' panicked at ' 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: [typeopnormalizeclause] normalizing [mirborrowck] borrow-checking [typeofopaque] computing type of opaque [typeof] computing type of [checkwellformed] checking that is well-formed [checkmodtype_wf] checking that types are well-formed in top-level module [analysis] running analysis passes on this crate --
Change:
/// This is fed into functions marked with `#[bench]` to allow for /// set-up & tear-down before running a piece of code repeatedly via a /// call to `iter`. <del> #[derive(Copy, Clone)] </del> <ins> #[derive(Clone)] </ins> pub struct Bencher { <del> iterations: u64, dur: Duration, </del> <ins> mode: BenchMode, summary: Option<stats::Summary>, </ins> pub bytes: u64, } <ins> #[derive(Clone, PartialEq, Eq)] pub enum BenchMode { Auto, Single, } </ins> #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub enum ShouldPanic { No,

Discussion:
functions are run multiple times. Some benchmark functions might depend on some runtime initialisation which may fail. For example: Will print “Benchmarks on even hours are forbidden!” a lot of times. If one opts to not report set-up failure, the benchmark function just keeps processor hot for a while without actually benchmarking anything (and reporting 0ns/iter anyway). Would it be sensible to (one of possible solutions): Not run the same function multiple times, since iteration is done by ; Not run the same again if is not called at least once; Provide a method on to cancel all subsequent runs of the function? Or maybe my approach is incorrect?
If one tries to keep benchmarks in separate files and opts for to cancel further runs of the function, the panic will abort the whole benchmark process (i.e. including the benchmarks in other executables).
For , we want to run on the CI infrastructure to ensure all the tests build. However, we don't want to actually benchmark on the CI infrastructure, because the CI infrastructure isn't reliable enough for benchmarking. Thus, doing more than one iteration on the CI infrastructure just wastes time. And, that time, in particular the wall time, negatively affects my other repos, because generally CI services like Travis CI and Appveyor only allow one project to build at a time, for their free open source tiers. Further, even out side of CI infrastructure, we want contributors to run the benchmarks before sending PRs. But, it's not reasonable to expect them to wait through many minutes of perf tests before asking for a PR. Here are two ideas: a that overrides the default targeted benchmark execution time so that we can write to run tests once. a so we can write . I prefer because that also might help with
Never mind. I just learned that will do exactly what I want: run the benchmarks once each.
This was bugging me, so I implemented the first proposed option: As this is my first real rust code, I imagine its pretty bad quality. A fist attempt is here: I'll clean it up a bit, give it some more testing, then send in a pull request unless anyone offers any opinions before I get that far.
Does anyone have an example on how to use this feature ? I'd like to run a benchmark only once.
:frowning_face:
Change:
/// /// - the loopback address /// - the link-local addresses <del> /// - the (deprecated) site-local addresses </del> /// - unique local addresses /// - the unspecified address /// - the address range reserved for documentation /// <ins> /// This method returns [`true`] for site-local addresses as per [RFC 4291 section 2.5.7] /// /// ```no_rust /// The special behavior of [the site-local unicast] prefix defined in [RFC3513] must no longer /// be supported in new implementations (i.e., new implementations must treat this prefix as /// Global Unicast). /// ``` /// </ins> /// [`true`]: ../../std/primitive.bool.html <ins> /// [RFC 4291 section 2.5.7]: https://tools.ietf.org/html/rfc4291#section-2.5.7 </ins> /// /// # Examples ///

Discussion:
This code should be correct, because according to document, all address in are not global reachable. But it panic on assertion failed in latest nightly (2019-01-11) (see )
Relevant thread:
Sorry, fixed
Change:
// @has async_fn/struct.Foo.html // @matches - '//code' 'pub async fn f()$' // @matches - '//code' 'pub async unsafe fn g()$' <ins> // @matches - '//code' 'pub async fn mut_self(self, first: usize)$' </ins> pub struct Foo; impl Foo { pub async fn f() {} pub async unsafe fn g() {} <ins> pub async fn mut_self(mut self, mut first: usize) {} </ins> } <ins> pub trait Trait<const N: usize> {} // @has async_fn/fn.const_generics.html // @has - '//pre[@class="rust fn"]' 'pub async fn const_generics<const N: usize>(_: impl Trait<N>)' pub async fn const_generics<const N: usize>(_: impl Trait<N>) {} </ins>

Discussion:
<img width="1016" alt="rustdoc output screenshot" src="https://user-"This example was tested on Rust 1.46.0, but it has been broken for quite a while. For example, see ).
Relevant code: Not sure what's going wrong.
Thanks for the helpful hint, However, I'm not convinced this is the root cause because it's happening to all mutable by-value function arguments, not just to functions with as the first argument. For example, this free function emits similar results: <img width="1004" alt="Screen Shot 2020-09-15 at 9 56 26 AM" src="https://user-"I think the actual root cause may be deeper than the interpretation of types, but I can't tell for sure.
This example confirms that the behavior appears to be per-argument instead of per-function. It's not like one bad argument ruins the formatting of the entire function. <img width="983" alt="Screen Shot 2020-09-15 at 10 04 39 AM" src="https://user-"Perhaps we could investigate where in the code the text is being generated and work our way backwards to see what is triggering it?
Hmm, the only relevant location I could find through GitHub search is in in : Is operating on a desugared form of the AST? I don't think this is the case, since is being successfully displayed here. Is there something else I'm missing?
Here's the issue: Looks like it should use  instead. Are you interested in making a PR? ;)
Yes, rustdoc works on a desugared version and has to reconstruct the by hand.
Sure, I will prepare one right away. Thanks for investigating with me.
Change:
(not os.path.exists(self.rustc()) or self.program_out_of_date(self.rustc_stamp(), key)): if os.path.exists(bin_root): <ins> # HACK: On Windows, we can't delete rust-analyzer-proc-macro-server while it's # running. Kill it. if platform_is_win32(): print("Killing rust-analyzer-proc-macro-srv before deleting stage0 toolchain") regex =  '{}(host|{})stage0libexec'.format( os.path.basename(self.build_dir), self.build ) script = ( # NOTE: can't use `taskkill` or `Get-Process -Name` because they error if # the server isn't running. 'Get-Process | ' + 'Where-Object {$_.Name -eq "rust-analyzer-proc-macro-srv"} |' + 'Where-Object {{$_.Path -match "{}"}} |'.format(regex) + 'Stop-Process' ) run_powershell([script]) </ins> shutil.rmtree(bin_root) tarball_suffix = '.tar.gz' if lzma is None else '.tar.xz' filename = "rust-std-{}-{}{}".format(

Discussion:
I tried this: I expected to see this happen: Bootstrap rebuilds the compiler. Instead, this happened: <!-- 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. --is
In particular, this happens when rust-analyzer is running in the background and you have this config set: We currently recommend that config in https://rustc-dev-
This would be fixed by having a "public" and "private" sysroot: https://rust-
This happens because Windows doesn't allow deleting a running executable/DLL. The way forward would be to special-case it as it is already the case with the file and ignore failures, or to make a double sysroot as you proposed.
You can usually rename a running executable so it may be possible to simulate a delete by moving it within the same filesystem. However, having a public and a private sysroot seems like a more generally useful solution.
I'm happy with both solutions. I think special casing proc-macro-server in the short term seems fine, but if we do that, we should open another issue for the public and private sysroot.
Change:
<ins> [package] name = "lld-wrapper" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" [dependencies] [features] ld = [] ld64 = [] </ins>  No newline at end of file

Discussion:
Checked that on target, found duplicates in versions: and <strikeno duplicates</strike2 duplicates (<strikeonly</strike, ) in stable , (bisecting is kinda slow on my connection) there 3 copies of that executable, that gives ~ 187mb label +regression-from-stable-to-beta
Can be found in:
I think they were in and . I believe is also a copy of .
Assigning priority as discussed in the of the Prioritization Working Group. label -I-prioritize +P-medium
claim
Sorry, I only came across this issue just now. The copies are there for a reason, see linked issues. Multiple things to consider: The files in the directory are only used with the unstable option. So they could be removed for beta and stable. They can be replaced with small Rust executables which just exec and respectively. I will be working on that for nightly.
Change:
<ins> error: expected parameter name, found `{` --> $DIR/issue-92481.rs:5:6 | LL | fn r({) { |      ^ expected parameter name error: expected one of `,`, `:`, or `}`, found `..` --> $DIR/issue-92481.rs:5:6 | LL | fn r({) { |      ^ unclosed delimiter LL |     Ok { LL |         d..||_=m |          -^ |          | |          help: `}` may belong here error[E0425]: cannot find value `d` in this scope --> $DIR/issue-92481.rs:7:9 | LL |         d..||_=m |         ^ not found in this scope error[E0425]: cannot find value `m` in this scope --> $DIR/issue-92481.rs:7:16 | LL |         d..||_=m |                ^ not found in this scope error[E0559]: variant `Result<_, _>::Ok` has no field named `d` --> $DIR/issue-92481.rs:7:9 | LL |         d..||_=m |         ^ field does not exist --> $SRC_DIR/core/src/result.rs:LL:COL | = note: `Result<_, _>::Ok` defined here | help: `Result<_, _>::Ok` is a tuple variant, use the appropriate syntax | LL |     Result<_, _>::Ok(/* fields */) | error[E0308]: mismatched types --> $DIR/issue-92481.rs:6:5 | LL |   fn r({) { |           - help: a return type might be missing here: `-> _` LL | /     Ok { LL | |         d..||_=m LL | |     } | |_____^ expected `()`, found enum `Result` | = note: expected unit type `()` found enum `Result<_, _>` error: aborting due to 6 previous errors Some errors have detailed explanations: E0308, E0425, E0559. For more information about an error, try `rustc --explain E0308`. </ins>

Discussion:
I'm seeing an internal compiler error on the following input, found by : The ICE happens after reporting some other errors, and the input is not syntactically correct (), so low priority. Affected versions: I tried nightly 2021-12-31 and stable 1.57 and they both show the same ICE. <details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
Triage: this has been fixed since nightly-2022-12-09, marking as .
Change:
= help: the following implementations were found: <Option<T> as Copy> = note: the `Copy` trait is required because the repeated element will be copied <ins> = help: consider creating a new `const` item and initializing with the result of the function call to be used in the repeat position, like `const VAL: Type = const_fn();` and `let x = [VAL; 42];` = help: create an inline `const` block, see PR #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information </ins> error: aborting due to previous error

Discussion:
The following code: gives the following error: However, is a , so this code can be made to compile by creating a new item: We should suggest this to user when a function is being called in the array initializer. <strikeAssuming that is accepted, we could eventually suggest an inline block.</strikeOn Nightly, we could suggest an inline block. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I think this would make a good first issue for someone looking to get started contributing. I'd be happy to mentor anyone who wants to work on this.
claim
Is this still an issue that I can work on?
Yes, assuming that is no longer working on this.
Should I claim it?
It looks like DavidHusicka hasn't had any activity this month, so I think it would be fine for you to take the issue. Feel free to reach out to me if you have any questions about how to get started implementing this.
claim