jiebi/CodeConvo huggingface dataset:
Change:
<del> error[E0277]: can't compare `impl PartialEq + Destruct + Copy` with `impl PartialEq + Destruct + Copy` --> $DIR/const-impl-trait.rs:28:17 </del> <ins> error[E0277]: can't compare `()` with `()` --> $DIR/const-impl-trait.rs:35:17 </ins> | <del> LL |     fn huh() -> impl ~const PartialEq + ~const Destruct + Copy { |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `impl PartialEq + Destruct + Copy == impl PartialEq + Destruct + Copy` </del> <ins> LL |     assert!(cmp(&())); |             --- ^^^ no implementation for `() == ()` |             | |             required by a bound introduced by this call </ins> | <del> = help: the trait `~const PartialEq` is not implemented for `impl PartialEq + Destruct + Copy` note: required by a bound in `Foo::{opaque#0}` --> $DIR/const-impl-trait.rs:24:22 </del> <ins> = help: the trait `const PartialEq` is not implemented for `()` = help: the trait `PartialEq` is implemented for `()` note: required by a bound in `cmp` --> $DIR/const-impl-trait.rs:12:23 </ins> | <del> LL |     fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; |                      ^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}` </del> <ins> LL | const fn cmp(a: &impl ~const PartialEq) -> bool { |                       ^^^^^^^^^^^^^^^^ required by this bound in `cmp` </ins> <del> error[E0277]: can't drop `impl PartialEq + Destruct + Copy` --> $DIR/const-impl-trait.rs:28:17 </del> <ins> error[E0277]: can't compare `&impl ~const PartialEq` with `&impl ~const PartialEq` --> $DIR/const-impl-trait.rs:13:7 </ins> | <del> LL |     fn huh() -> impl ~const PartialEq + ~const Destruct + Copy { |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `impl PartialEq + Destruct + Copy` </del> <ins> LL |     a == a |       ^^ no implementation for `&impl ~const PartialEq == &impl ~const PartialEq` </ins> | <del> note: required by a bound in `Foo::{opaque#0}` --> $DIR/const-impl-trait.rs:24:41 </del> <ins> = help: the trait `~const PartialEq<&impl ~const PartialEq>` is not implemented for `&impl ~const PartialEq` help: consider dereferencing both sides of the expression </ins> | <del> LL |     fn huh() -> impl ~const PartialEq + ~const Destruct + Copy; |                                         ^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}` </del> <ins> LL |     *a == *a |     +     + </ins> error: aborting due to 2 previous errors

Discussion:
<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: no host param id for call in const yet no errors reported', 'error: internal compiler error: no host param id for call in const yet no errors reported' 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: --
Regression in nightly-2023-08-09
Change:
/// variable, the *rightmost* instance will determine the value. pub fn env_set_all<'a, T: ToCStr, U: ToCStr>(&'a mut self, env: &[(T,U)]) -> &'a mut Command { <del> self.env = Some(env.iter().map(|&(ref k, ref v)| (k.to_c_str(), v.to_c_str())) </del> <ins> self.env = Some(env.iter().map(|&(ref k, ref v)| (EnvKey(k.to_c_str()), v.to_c_str())) </ins> .collect()); self }

Discussion:
The following program demonstrates the problem: When compiled and executed on WIndows, it randomly displays either 'foo' or 'BAR'. This happens because process::Command represents environment block as a HasMap<CString, CString, so it treats "foo" and "FOO" as different variables, whereas Windows considers them to be the same one. When child process is spawned, both get into the environment block, however Windows keeps only the last one.
Change:
)?; } (Scalar::Ptr(ptr), ty::FnPtr(_)) => { <ins> // FIXME: this can ICE when the ptr is dangling or points to a non-function. // We should probably have a helper method to share code with the "Byte strings" // printing above (which also has to handle pointers to all sorts of things). </ins> let instance = self.tcx().global_alloc(ptr.alloc_id).unwrap_fn(); self = self.typed_value( |this| this.print_value_path(instance.def_id(), instance.substs),

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. --Command: This code is from <!-- 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 compiler is at revision <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
This , too. Cc
This happens on stable, too. Not very surprising imo since the original corresponding tickets ( , ) are only ~2 weeks old.
Those tickets report different ICEs, from what I can see. Same source code, but different assertion hit in the compiler.
Reduced: when I use an underscore binding instead of , the ICE no longer occurs:
The same ICE also triggers on this file in the miri submodule: (with --emit mir) I'm guessing it's so we need to match on the result of the and print different output depending on it
PR to fix this is up at
I'm getting a similar ice when checking with . I'm wondering if that's fixed as well.
That's a bit hard to tell based on a backtrace without line numbers. But with my patch, there is no more in that entire file, so I'd say -- probably. There's still an though, so I suspect there are still ICEs when a function pointer points to a non-function...
Btw it would be great if someone could review that PR. :) Looks like is pretty busy.
Can confirm this fixed the ICE :+1: :)
Change:
tt @ &TokenTree::Sequence(..) => { check_matcher(cx, Some(tt).into_iter(), &Eof); }, <del> _ => cx.span_err(sp, "Invalid macro matcher; matchers must be contained  </del> <ins> _ => cx.span_err(sp, "invalid macro matcher; matchers must be contained  </ins> in balanced delimiters or a repetition indicator") }; // we don't abort on errors on rejection, the driver will do that for us

Discussion:
This compiles: I expected this to be rejected, simply because doesn't parse as a type.

afaik, it's because the context where you're using the macro (expr, item, etc.) stopped parsing before that token. We should mention that context.
Is this fixed? I think this was fixed the referenced pull request.
I'd prefer a message like
Change:
#![feature(dropck_eyepatch)] #![feature(exhaustive_patterns)] #![feature(intra_doc_pointers)] <ins> #![feature(label_break_value)] </ins> #![feature(lang_items)] #![feature(let_chains)] #![feature(linkage)]

Discussion:
polls to the standard file descriptors on startup; if they are closed, it attempts to reopen them to . If  is too low, the polling (or opening) will cause an abort. The could be checked ahead of time. I tried this Docker configuration I expected to see this happen: Successful execution Instead, this happened: Process aborted It most recently worked on: Rust 1.47 Rust 1.48 and forward. modify labels: +regression-from-stable-to-stable -regression-untriaged
Are file descriptors 0-2 open at the time of the abort? Edit, ah, I see this is a limitation of , not of the process being incorrectly spawned. This could be solved by a fallback to calling on individual fds if poll doesn't work.
We're happy to review a patch for this. (E.g. falling back to fstat if poll returns EINVAL.)
Change:
/// Parses input according to platform conventions for the `PATH` /// environment variable. /// <del> /// Returns an iterator over the paths contained in `unparsed`. </del> <ins> /// Returns an iterator over the paths contained in `unparsed`. The iterator /// element type is [`PathBuf`]. </ins> /// /// # Examples ///

Discussion:
Reading both and there's no specification that the type for the iterator is . To me it seemed ambiguous what an "iterator that splits an environment variable into paths" or "an iterator over the paths" returns since it could be the string representing the paths -- which is -- or an actual object. I'm happy to submit a PR if this is makes sense enough to fix (since according it used to specify this detail and now it doesn't with a quick perusal of not turning up anything obvious as to why the change).
If you unfold at the Trait Implementation section in you can see that . Did you mean that this should be more clearly mentioned in the description of (or maybe as well)? I do think it would be nice if some extra text on would be that clarifies the item type of the iterator!
since I didn't even think of expanding for the info (which in hindsight makes sense), my answer is "yes" , mentioning it explicitly as part of the main summary would be handy". As I said, if this is deemed reasonable I'm happy to do the PR to add the change.
That would be great! Let us know what you come up with!
Looks like someone snagged fixing this before I had a chance to get to it, so I'll let and its author handle fixing this.
Nice :) Let's wait for that then :)
Change:
<ins> // check-pass #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash trait T<const A: usize> { fn f(); } struct S; impl T<0usize> for S { fn f() {} } fn main() { let _err = <S as T<0usize>>::f(); } </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<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --This issue has been assigned to via . <!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
managed to reduce the test case a bit.
Also happens for this code using a function instead of an associated type:
claim
initial example fixed by , associated function fixed by instead
Change:
<ins> fn main() { String::from::utf8; //~^ ERROR ambiguous associated type [E0223] //~| HELP there is an associated function with a similar name: `from_utf8` String::from::utf8(); //~^ ERROR ambiguous associated type [E0223] //~| HELP there is an associated function with a similar name: `from_utf8` String::from::utf16(); //~^ ERROR ambiguous associated type [E0223] //~| HELP there is an associated function with a similar name: `from_utf16` String::from::method_that_doesnt_exist(); //~^ ERROR ambiguous associated type [E0223] //~| HELP if there were a trait named `Example` with associated type `from` str::from::utf8(); //~^ ERROR ambiguous associated type [E0223] //~| HELP if there were a trait named `Example` with associated type `from` str::from::utf8_mut(); //~^ ERROR ambiguous associated type [E0223] //~| HELP if there were a trait named `Example` with associated type `from` } </ins>

Discussion:
` " ); } This had me VERY confused as I was certain I would try to get a String here, where does Example come from?? And associated types wut?? The problem is I used which should have been :D Maybe rustc could improve its suggestion somehow in that case? No response No response <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
For reference, here is a MRE:
claim
Change:
<ins> // check-pass // edition:2018 use {}; use {{}}; use ::{}; use {::{}}; fn main() {} </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
Regression from
Fixed in
Change:
use rustc_lint::LateContext; use rustc_middle::ty::{cast::CastKind, Ty}; use rustc_span::DUMMY_SP; <ins> use rustc_hir as hir; </ins> // check if the component types of the transmuted collection and the result have different ABI, // size or alignment

Discussion:
Compiles in stable rust (1.64) as well as in beta. But in nightly, we get this compilation error: playground link: 64, and beta current nightly
searched nightlies: from nightly-2022-08-01 to nightly-2022-10-24 regressed nightly: nightly-2022-09-23 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.4</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </details
Seems like closures pick the constness of their parent when they should always be notconst
Change:
real_trait_pred = parent_trait_pred; } <del> let real_ty = real_trait_pred.self_ty(); </del> // We `erase_late_bound_regions` here because `make_subregion` does not handle // `ReLateBound`, and we don't particularly care about the regions. <del> if !self.can_eq( obligation.param_env, self.tcx.erase_late_bound_regions(real_ty), arg_ty, ) { </del> <ins> let real_ty = self.tcx.erase_late_bound_regions(real_trait_pred.self_ty()); if !self.can_eq(obligation.param_env, real_ty, arg_ty) { </ins> continue; } <del> if let ty::Ref(region, base_ty, mutbl) = *real_ty.skip_binder().kind() { </del> <ins> if let ty::Ref(region, base_ty, mutbl) = *real_ty.kind() { </ins> let autoderef = (self.autoderef_steps)(base_ty); if let Some(steps) = autoderef.into_iter().enumerate().find_map(|(steps, (ty, obligations))| {

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
Started crashing with Regression in nightly-2022-05-19 commit[0] 2022-05-17: Auto merge of - jsha:rustdoc-search-refactor, r=GuillaumeGomez commit[1] 2022-05-18: Auto merge of - JohnTitor:rollup-7gdt2aw, r=JohnTitor commit[2] 2022-05-18: Auto merge of - Dylan-DPC:rollup-06u9pqn, r=Dylan-DPC commit[3] 2022-05-18: Auto merge of - Kobzol:pgo-pid-in-profile, r=lqd commit[4] 2022-05-18: Auto merge of - michaelwoerister:path-prefix-fixes-2, r=davidtwco commit[5] 2022-05-18: Auto merge of - nbdd0121:const, r=nagisa commit[6] 2022-05-18: Auto merge of - SparrowLii:let, r=michaelwoerister commit[7] 2022-05-18: Auto merge of - b-naber:transition-to-valtrees-pt1, r=oli-obk
WG-prioritization assigning priority (). label -I-prioritize +P-medium -needs-triage
Change:
} true } <ins> fn parse_target_feature(slot: &mut String, v: Option<&str>) -> bool { match v { Some(s) => { if !slot.is_empty() { slot.push_str(","); } slot.push_str(s); true } None => false, } } </ins> } ) }

Discussion:
I'm trying to pass multiple conditionally downstream. However, despite +/- for adding/removing a feature it appears only the last value takes effect.
FWIW, you can check for values without any test program like: $ rustc --print cfg -C target-feature=+avx2 -C target-feature=+fma $ rustc --print cfg -C target-feature=+avx2,+fma
I agree that it's a bug and will try to fix it.
Fixed in
Change:
<ins> // check-pass use std::sync::Mutex; use std::cell::RefCell; use std::rc::Rc; use std::ops::*; //eefriedman example struct S<'a, T:FnMut() + 'static + ?Sized>(&'a mut T); impl<'a, T:?Sized + FnMut() + 'static> DerefMut for S<'a, T> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } impl<'a, T:?Sized + FnMut() + 'static> Deref for S<'a, T> { type Target = dyn FnMut() + 'a; fn deref(&self) -> &Self::Target { &self.0 } } //Ossipal example struct FunctionIcon { get_icon: Mutex<Box<dyn FnMut() -> u32>>, } impl FunctionIcon { fn get_icon(&self) -> impl '_ + std::ops::DerefMut<Target=Box<dyn FnMut() -> u32>> { self.get_icon.lock().unwrap() } fn load_icon(&self)  { let mut get_icon = self.get_icon(); let _rgba_icon = (*get_icon)(); } } //shepmaster example struct Foo; impl Deref for Foo { type Target = dyn FnMut() + 'static; fn deref(&self) -> &Self::Target { unimplemented!() } } impl DerefMut for Foo { fn deref_mut(&mut self) -> &mut Self::Target { unimplemented!() } } fn main() { //eefriedman example let mut f = ||{}; let mut s = S(&mut f); s(); //Diggsey/Mark-Simulacrum example let a: Rc<RefCell<dyn FnMut()>> = Rc::new(RefCell::new(||{})); a.borrow_mut()(); //shepmaster example let mut t = Foo; t(); } </ins>

Discussion:
Testcase: Yields: Auto-deref should be picking DerefMut here, not Deref.
I just ran into this problem too, here's a shorter example: And playpen link:
Further reduced:
:
And again
Just got this today, with what is almost identical to Mark-Simulacrum's reduced version.
I've also run into this issue, with this example: and this error:
This error seems resolved. Examples above all work on stable.
Change:
<ins> error[E0283]: type annotations needed --> $DIR/const_generic_type.rs:7:1 | LL | async fn test<const N: crate::Bar>() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type | = note: cannot satisfy `_: std::fmt::Display` error: `Bar` is forbidden as the type of a const generic parameter --> $DIR/const_generic_type.rs:7:24 | LL | async fn test<const N: crate::Bar>() { |                        ^^^^^^^^^^ | = note: the only supported types are integers, `bool` and `char` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0283`. </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. --(hand-reduced) <details<summary<strong(original)</strong</summary<p</p</details<!-- 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. --: Command: option is to avoid error message (there exists another error at the end of the backtrace) <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details- ICE location: Might be related to unsolved ICE Issue- (issue fixed by adding test-case), where the issue points to
Change:
use rustc_span::symbol::{kw, Symbol}; use rustc_span::Span; <ins> #[instrument(level = "debug", skip(tcx))] </ins> pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics { use rustc_hir::*;

Discussion:
<!-- [31mICE[0m: Rustc '-Zcrate-attr=feature(effects) -ooutputfile -Zdump-mir-dir=dir' 'thread 'rustc' panicked at 'called on a value'', 'thread 'rustc' panicked at 'called on a value'' File: --auto-reduced (treereduce-rust): &lt;details&lt;summary&lt;strongoriginal code&lt;/strong&lt;/summary&lt;poriginal: </p</detailsVersion information Command: &lt;!-- Include a backtrace in the code block by setting in your environment. E.g. . --&lt;details&lt;summary&lt;strongProgram output&lt;/strong&lt;/summary&lt;p&lt;/p&lt;/details&lt;!-- query stack: [adtdestructor] computing impl for [checkwellformed] checking that is well-formed -- label +F-constmutrefs +F-consttrait_impl +F-effects
Regression in of
doesn't require any features actually, rip
Removed irrelevant errors:
Minimized: or
Change:
assert_eq!(self.metas.len(), self.stable_crate_ids.len()); let num = CrateNum::new(self.stable_crate_ids.len()); if let Some(&existing) = self.stable_crate_ids.get(&root.stable_crate_id()) { <del> let crate_name0 = root.name(); if let Some(crate_name1) = self.metas[existing].as_ref().map(|data| data.name()) { </del> <ins> // Check for (potential) conflicts with the local crate if existing == LOCAL_CRATE { Err(CrateError::SymbolConflictsCurrent(root.name())) } else if let Some(crate_name1) = self.metas[existing].as_ref().map(|data| data.name()) { let crate_name0 = root.name(); </ins> Err(CrateError::StableCrateIdCollision(crate_name0, crate_name1)) } else { <del> Err(CrateError::SymbolConflictsCurrent(crate_name0)) </del> <ins> Err(CrateError::NotFound(root.name())) </ins> } } else { self.metas.push(None);

Discussion:
I decided to try address sanitizer on WSL Ubuntu today, but ran into 2 errors. These errors are only present when using the sanitizer, so my crate compiles normally. To give context there are 2 crates: and . On there is a procedural macro called , which is named the same as my crate which I am re-exporting it to. I don't really know if this a bug or a problem on my end, but I thought I'd mention it just in case. : I included the full error output in a file below
If you use sanitizers you need to pass the flag, but I guess you missed it. See also :
Oh I did miss it and that fixed it. The documentation made it sound optional though, so I didn't realize that was the issue. Thanks for the quick reply!
Re-opening because the error is very confusing. See also
On the error is: which isn't great, but at least suggests some issue related to asan. On the error is: Which is very confusing. was merged between those two versions and changes in which cases E0519 is emitted. ping who wrote that PR.
Change:
// This is the "trait" (meaning, the predicate "proved" by this `impl`) which provides the `Self` type we care about. // For the purposes of this function, we hope that it is a `struct` type, and that our current `expr` is a literal of // that struct type. <del> let impl_trait_self_ref: Option<ty::TraitRef<'tcx>> = self.tcx.impl_trait_ref(obligation.impl_def_id).map(|impl_def| impl_def.skip_binder()); let Some(impl_trait_self_ref) = impl_trait_self_ref else { // It is possible that this is absent. In this case, we make no progress. return Err(expr); </del> <ins> let impl_trait_self_ref = if self.tcx.is_trait_alias(obligation.impl_def_id) { self.tcx.mk_trait_ref( obligation.impl_def_id, ty::InternalSubsts::identity_for_item(self.tcx, obligation.impl_def_id), ) } else { self.tcx .impl_trait_ref(obligation.impl_def_id) .map(|impl_def| impl_def.skip_binder()) // It is possible that this is absent. In this case, we make no progress. .ok_or(expr)? </ins> }; // We only really care about the `Self` type itself, which we extract from the ref.

Discussion:
: <details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
searched nightlies: from nightly-2023-01-01 to nightly-2023-02-15 regressed nightly: nightly-2023-02-07 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: </detailsOf that rollup, looks most likely responsible to me. cc
claim
Ah, I had assumed that was infallible (at least in this context), but apparently not. So prior to calling this, the function should verify that it has the right kind, and if not, bail out (). Ideally it would resolve the trait alias too, but there's enough existing corner-cases which aren't handled that it isn't a big deal.
Actually, I think the problem arises earlier, when building derived obligations for trait aliases: they shouldn't be s at all. I have a fix, about to push.