jiebi/CodeConvo huggingface dataset:
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. --nothing The original code didn't have the , which was because of the "never constructed" deadcode lint, which I guess would be . Adding a constructor does make the function never used errors go away, so it seems doesn't have enough power. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
WG-prioritization assigning priority (). label -I-prioritize +P-medium
bisected to </detailscc
like
is about the struct itself, and there's a allow(unused). This is about the side effects.
Oh, I see. claim

Discussion:
match tcx.def_kind(id) { DefKind::Impl { .. } => false, DefKind::AssocConst | DefKind::AssocFn => !matches!(tcx.associated_item(id).container, AssocItemContainer::ImplContainer), <del> DefKind::Struct => struct_all_fields_are_public(tcx, id.to_def_id()), </del> <ins> DefKind::Struct => struct_all_fields_are_public(tcx, id.to_def_id()) || has_allow_dead_code_or_lang_attr(tcx, id).is_some(), </ins> _ => true }) .map(|id| (id, ComesFromAllowExpect::No))

<ins> //@ check-pass mod ffi { use super::*; extern "C" { pub fn DomPromise_AddRef(promise: *const Promise); pub fn DomPromise_Release(promise: *const Promise); } } #[repr(C)] #[allow(unused)] pub struct Promise { private: [u8; 0], __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>, } pub unsafe trait RefCounted { unsafe fn addref(&self); unsafe fn release(&self); } unsafe impl RefCounted for Promise { unsafe fn addref(&self) { ffi::DomPromise_AddRef(self) } unsafe fn release(&self) { ffi::DomPromise_Release(self) } } fn main() {} </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 this code: I expected to see this happen: Instead, this happened: (Obviously, s can't contain .) <img width="1087" alt="1" src=""<!-- 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. --:
Nice catch!

Discussion:
/// Part of a hack to make PathBuf::push/pop more efficient. #[inline] pub(crate) fn as_mut_vec_for_path_buf(&mut self) -> &mut Vec<u8> { <ins> // FIXME: this function should not even exist, as it implies violating Wtf8Buf invariants // For now, simply assume that is about to happen. self.is_known_utf8 = false; </ins> &mut self.bytes } }

<ins> #![cfg(windows)] //! An external tests use std::{ffi::OsString, os::windows::ffi::OsStringExt, path::PathBuf}; #[test] #[should_panic] fn os_string_must_know_it_isnt_utf8_issue_126291() { let mut utf8 = PathBuf::from(OsString::from("utf8".to_owned())); let non_utf8: OsString = OsStringExt::from_wide(&[0x6e, 0x6f, 0x6e, 0xd800, 0x75, 0x74, 0x66, 0x38]); utf8.set_extension(&non_utf8); utf8.into_os_string().into_string().unwrap(); } </ins>
Change:
With the following code: We get this error: Making the block then gives: cc
:+1:, this should error in both cases but the diagnostics are misleading. Going to fix it. r?

Discussion:
fn check_item_safety(&self, span: Span, safety: Safety) { match self.extern_mod_safety { Some(extern_safety) => { <del> if matches!(safety, Safety::Unsafe(_) | Safety::Safe(_)) && (extern_safety == Safety::Default || !self.features.unsafe_extern_blocks) { self.dcx().emit_err(errors::InvalidSafetyOnExtern { item_span: span, block: self.current_extern_span().shrink_to_lo(), }); </del> <ins> if matches!(safety, Safety::Unsafe(_) | Safety::Safe(_)) { if extern_safety == Safety::Default { self.dcx().emit_err(errors::InvalidSafetyOnExtern { item_span: span, block: Some(self.current_extern_span().shrink_to_lo()), }); } else if !self.features.unsafe_extern_blocks { self.dcx().emit_err(errors::InvalidSafetyOnExtern { item_span: span, block: None, }); } </ins> } } None => {

} } } else if let &Safety::Unsafe(span) = safety { <del> this.dcx().emit_err(errors::UnsafeItem { span, kind: "extern block" }); </del> <ins> let mut diag = this .dcx() .create_err(errors::UnsafeItem { span, kind: "extern block" }); rustc_session::parse::add_feature_diagnostics( &mut diag, self.session, sym::unsafe_extern_blocks, ); diag.emit(); </ins> } if abi.is_none() {

#[primary_span] pub item_span: Span, #[suggestion(code = "unsafe ", applicability = "machine-applicable", style = "verbose")] <del> pub block: Span, </del> <ins> pub block: Option<Span>, </ins> } #[derive(Diagnostic)]

| LL | unsafe extern "C" { | ^^^^^^ <ins> | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date </ins> error[E0658]: `unsafe extern {}` blocks and `safe` keyword are experimental --> $DIR/feature-gate-unsafe-extern-blocks.rs:9:5

| LL | extern "C" unsafe { |            ^^^^^^ <ins> | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date </ins> error: items in unadorned `extern` blocks cannot have safety qualifiers --> $DIR/unsafe-foreign-mod-2.rs:4:5 | LL |     unsafe fn foo(); |     ^^^^^^^^^^^^^^^^ <del> | help: add unsafe to this `extern` block | LL | unsafe extern "C" unsafe { | ++++++ </del> error: aborting due to 3 previous errors

| LL | unsafe extern "C" { | ^^^^^^ <ins> | = note: see issue #123743 <https://github.com/rust-lang/rust/issues/123743> for more information = help: add `#![feature(unsafe_extern_blocks)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date </ins> error: aborting due to 1 previous error
Change:
When a process unexpectedly fails/succeeds, compiletest will often print a full dump of its stdout and stderr for diagnostic purposes. When this happens, calls into , which has special handling for lines starting with . It tries to parse the line as JSON in one of a few known compiler-specific formats, in order to replace it with a more human-friendly message. If the line doesn't match any of those formats (or isn't valid JSON), the extractor code will panic, instead of just printing the line as-is. This is awkward in cases where we actually wanted to print the line as-is anyway, because now the error messages are less helpful. label +A-compiletest
The obvious solution (just make it not panic) is complicated by the fact that is called in multiple places, so it's harder to know whether the error is load-bearing in one of those cases.

Discussion:
//! These structs are a subset of the ones found in `rustc_errors::json`. <del> //! They are only used for deserialization of JSON output provided by libtest. </del> use std::path::{Path, PathBuf}; use std::str::FromStr;

// Ignore the notification. None } else { <del> print!( "failed to decode compiler output as json: line: {}noutput: {}", line, output ); panic!() </del> <ins> // This function is called for both compiler and non-compiler output, // so if the line isn't recognized as JSON from the compiler then // just print it as-is. Some(format!("{line}n")) </ins> } } else { // preserve non-JSON lines, such as ICEs
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
bisects to cc
That's a revert, the issue probably exists much longer
ah :+1: when I start the bisection at a later point, this goes down to Regression in nightly-2023-11-29 probably ?
Jup, that looks like it

Discussion:
self.create_def(expr.id, kw::Empty, DefKind::Closure, expr.span) } ExprKind::ConstBlock(ref constant) => { <ins> for attr in &expr.attrs { visit::walk_attribute(self, attr); } </ins> let def = self.create_def( constant.id, kw::Empty,

<ins> // issue#126516 // issue#126647 fn main() { const { #![path = foo!()] //~^ ERROR: cannot find macro `foo` in this scope } } </ins>

<ins> error: cannot find macro `foo` in this scope --> $DIR/path-attr-in-const-block.rs:6:19 | LL |         #![path = foo!()] |                   ^^^ error: aborting due to 1 previous error </ins>
Change:
The following code: Generates two subsequent labels and an unnecessary instruction: When compiled with using rustc . Godbolt: P.S. For context, I am not too familiar with asm. I did not find any similar results while searching through the rustc and llvm issue trackers for "double jump". Please let me know how I can improve the quality of my issue reporting. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
label -needs-triage +C-optimization +T-compiler +A-codegen +A-LLVM
Here are multiple solutions to this problem. It can be resolved by directly optimizing in IR () or during the code generation phase (). I believe the code generation phase is the key point, and we can use to eliminate this branch. However, I am more familiar with IR-related aspects, so let me resolve it here now.
Fixed by label +llvm-fixed-upstream claim
Confirmed fixed by , needs codegen test.
I just stumbled past this and am confused by the comment I would expect this to overflow if and ()
You're right, I made a logical error.

Discussion:
<ins> //@ compile-flags: -O //@ min-llvm-version: 19 // Test for #107681. // Make sure we don't create `br` or `select` instructions. #![crate_type = "lib"] use std::iter::Copied; use std::slice::Iter; #[no_mangle] pub unsafe fn foo(x: &mut Copied<Iter<'_, u32>>) -> u32 { // CHECK-LABEL: @foo( // CHECK-NOT: br // CHECK-NOT: select // CHECK: [[RET:%.*]] = load i32, ptr // CHECK-NEXT: ret i32 [[RET]] x.next().unwrap_unchecked() } </ins>

<ins> //@ compile-flags: -O //@ min-llvm-version: 19 //@ only-x86_64 // Test for #118306. // Make sure we don't create `br` or `select` instructions. #![crate_type = "lib"] #[no_mangle] pub fn branchy(input: u64) -> u64 { // CHECK-LABEL: @branchy( // CHECK-NEXT:  start: // CHECK-NEXT:    [[_2:%.*]] = and i64 [[INPUT:%.*]], 3 // CHECK-NEXT:    [[SWITCH_GEP:%.*]] = getelementptr inbounds [4 x i64], ptr @switch.table.branchy, i64 0, i64 [[_2]] // CHECK-NEXT:    [[SWITCH_LOAD:%.*]] = load i64, ptr [[SWITCH_GEP]] // CHECK-NEXT:    ret i64 [[SWITCH_LOAD]] match input % 4 { 1 | 2 => 1, 3 => 2, _ => 0, } } </ins>

<ins> //@ compile-flags: -Copt-level=s //@ min-llvm-version: 19 //@ only-x86_64 // Test for #126585. // Ensure that this IR doesn't have extra undef phi input, which also guarantees that this asm // doesn't have subsequent labels and unnecessary `jmp` instructions. #![crate_type = "lib"] #[no_mangle] fn checked_div_round(a: u64, b: u64) -> Option<u64> { // CHECK-LABEL: @checked_div_round // CHECK: phi // CHECK-NOT: undef // CHECK: phi // CHECK-NOT: undef match b { 0 => None, 1 => Some(a), // `a / b` is computable and `(a % b) * 2` can not overflow since `b >= 2`. b => Some(a / b + if (a % b) * 2 >= b { 1 } else { 0 }), } } </ins>
Change:
<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'internal error: entered unreachable code'', 'thread 'rustc' panicked at 'internal error: entered unreachable code'' 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: [resolverforloweringraw] getting the resolver for lowering -- label +F-fndelegation
^_^
Fixed in

Discussion:
expand_glob_delegation_outside_impls = glob delegation is only supported in impls <ins> expand_glob_delegation_traitless_qpath = qualified path without a trait in glob delegation </ins> expand_helper_attribute_name_invalid = `{$name}` cannot be a name of derive helper attribute

pub span: Span, } <ins> #[derive(Diagnostic)] #[diag(expand_glob_delegation_traitless_qpath)] pub(crate) struct GlobDelegationTraitlessQpath { #[primary_span] pub span: Span, } </ins> // This used to be the `proc_macro_back_compat` lint (#83125). It was later // turned into a hard error. #[derive(Diagnostic)]

use crate::base::*; use crate::config::StripUnconfigured; use crate::errors::{ <del> EmptyDelegationMac, GlobDelegationOutsideImpls, IncompleteParse, RecursionLimitReached, RemoveExprNotSupported, RemoveNodeNotSupported, UnsupportedKeyValue, WrongFragmentKind, </del> <ins> EmptyDelegationMac, GlobDelegationOutsideImpls, GlobDelegationTraitlessQpath, IncompleteParse, RecursionLimitReached, RemoveExprNotSupported, RemoveNodeNotSupported, UnsupportedKeyValue, WrongFragmentKind, </ins> }; use crate::mbe::diagnostics::annotate_err_with_kind; use crate::module::{mod_dir_path, parse_external_mod, DirOwnership, ParsedExternalMod};

} None if let Some((deleg, item)) = node.delegation() => { let Some(suffixes) = &deleg.suffixes else { <ins> let traitless_qself = matches!(&deleg.qself, Some(qself) if qself.position == 0); </ins> let item = match node.to_annotatable() { Annotatable::ImplItem(item) => item, ann @ (Annotatable::Item(_)

} _ => unreachable!(), }; <ins> if traitless_qself { let span = item.span; self.cx.dcx().emit_err(GlobDelegationTraitlessQpath { span }); return Default::default(); } </ins> return self.collect_glob_delegation(item, Node::KIND).make_ast::<Node>(); };

<ins> #![feature(fn_delegation)] #![allow(incomplete_features)] struct S; impl S { reuse <u8>::*; //~ ERROR qualified path without a trait in glob delegation reuse <()>::*; //~ ERROR qualified path without a trait in glob delegation } fn main() {} </ins>

<ins> error: qualified path without a trait in glob delegation --> $DIR/glob-traitless-qpath.rs:7:5 | LL |     reuse <u8>::*; |     ^^^^^^^^^^^^^^ error: qualified path without a trait in glob delegation --> $DIR/glob-traitless-qpath.rs:8:5 | LL |     reuse <()>::*; |     ^^^^^^^^^^^^^^ error: aborting due to 2 previous errors </ins>
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: rustc -Cdebuginfo=2 --crate-type lib <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
I guess this is now reachable without debug assertions cc
not entirely sure why that assertion fails but: good?

Discussion:
return Ok(constant); } <del> let constant = constant.try_super_fold_with(self)?; debug!(?constant, ?self.param_env); Ok(crate::traits::with_replaced_escaping_bound_vars( </del> <ins> let constant = crate::traits::with_replaced_escaping_bound_vars( </ins> self.infcx, &mut self.universes, constant, |constant| constant.normalize(self.infcx.tcx, self.param_env), <del> )) </del> <ins> ); debug!(?constant, ?self.param_env); constant.try_super_fold_with(self) </ins> } #[inline]

<ins> //@ compile-flags: -Cdebuginfo=2 --crate-type=lib //@ build-pass #![feature(adt_const_params)] const N_ISLANDS: usize = 4; pub type Matrix = [[usize; N_ISLANDS]; N_ISLANDS]; const EMPTY_MATRIX: Matrix = [[0; N_ISLANDS]; N_ISLANDS]; const fn to_matrix() -> Matrix { EMPTY_MATRIX } const BRIDGE_MATRIX: [[usize; N_ISLANDS]; N_ISLANDS] = to_matrix(); pub struct Walk<const CURRENT: usize, const REMAINING: Matrix> { _p: (), } impl Walk<0, BRIDGE_MATRIX> { pub const fn new() -> Self { Self { _p: () } } } </ins>
Change:
Many crates that use bindgen are now failing. For example: The bindgen output looks like normal, except that it also has several lines mixed in. For example: It most recently worked on: rustc 1.81.0-nightly from about 2024-06-21 I believe the bug was introduced by commit . modify labels: +regression-from-stable-to-nightly-regression-untriaged
should fix this

Discussion:
static_parts: &StaticParts<'_>, offset: Indent, ) -> Option<String> { <del> println!("rewriting static"); </del> let colon = colon_spaces(context.config); let mut prefix = format!( "{}{}{}{} {}{}{}",
Change:
The documentation of and functions. In actual behaviour and , selects elements from when the mask bit is set and from otherwise. The Rust standard library documentation describes the other way around.
I believe I see the problem. Working on a PR now.

Discussion:
ret; } let new = fs::list_dir(buildpath); <del> let exec_suffix = os::exec_suffix(); </del> for ct: str in new { <del> if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) || (exec_suffix == "" && !str::starts_with(ct, "./lib")) { run::run_program(ct, []); } </del> <ins> run::run_program(ct, []); </ins> } }

let exec_suffix = os::exec_suffix(); for ct: str in new { if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) || <del> (exec_suffix == "" && !str::starts_with(ct, "./lib")) { </del> <ins> (exec_suffix == "" && !str::starts_with(fs::basename(ct), "lib")) { </ins> #debug("  bin: %s", ct); // FIXME: need libstd fs::copy or something run::run_program("cp", [ct, c.bindir]);
Change:
I'm tracking a issue with connecttimeout function on rust for vxworks. The function is also accepting connections on a non responsive server port. I get errors on unreachable host, but with host that are reachable any connection to a non existent server port is not resulting in an error. example program: Results: #./exe 127.0.0.1:90 /// No server at this port Successfully connected to server #./exe 192.0.0.1:20 //// Host is unreachable so correct behaviour. Failed to connect to server #./exe 172.16.2.223:8002 //Host is reachable, but there's no server at this port Successfully connected to server This is not observed with the connect function. I don't see a specified folder in library/std/src/sys/pal for vxworks. I found only one file for vxworks files. Does vxworks fall back on unix implementations for these functionalities? Any leads on how to proceed would be really helpful.
I don't mean to quibble much but tracking issues are not for "tracking" bugs, they are for tracking long-term projects that need issues-that-connect-issues.
Yes, see for why: basically our support was previously a trivial copy of the Unix support. The result may be buggy, because we do not really run CI against VxWorks. We are happy to accept patches, and even happier to have maintainers who are interested in repairing the target on a regular basis.
Thank You. I'll be continuously working on vxworks rust. So I'll be able to check this on a regular basis. Since rust 1.6 we've been maintaining a custom patch for rust build for vxworks. I'll update it for nightly and create a PR. I would like to be a code maintainer for this.
All you have to do to be listed as a maintainer is to add a doc using this template in rustc/src/platform-support/

Discussion:
} 0 => {} _ => { <del> // linux returns POLLOUT|POLLERR|POLLHUP for refused connections (!), so look // for POLLHUP rather than read readiness if pollfd.revents & libc::POLLHUP != 0 { let e = self.take_error()?.unwrap_or_else(|| { io::const_io_error!( io::ErrorKind::Uncategorized, "no error set after POLLHUP", ) }); return Err(e); </del> <ins> if cfg!(target_os = "vxworks") { // VxWorks poll does not return  POLLHUP or POLLERR in revents. Check if the // connnection actually succeeded and return ok only when the socket is // ready and no errors were found. if let Some(e) = self.take_error()? { return Err(e); } } else { // linux returns POLLOUT|POLLERR|POLLHUP for refused connections (!), so look // for POLLHUP or POLLERR rather than read readiness if pollfd.revents & (libc::POLLHUP | libc::POLLERR) != 0 { let e = self.take_error()?.unwrap_or_else(|| { io::const_io_error!( io::ErrorKind::Uncategorized, "no error set after POLLHUP", ) }); return Err(e); } </ins> } return Ok(());
Change:
which is used to cast , or to two-element tuples with , , or types leads to incorrect code generation when located in unreachable code paths (and not supposed to be called). Replacing to fixes the issue. Making conditions more simple can also fix the issue. Building with debug profile fixes the issue. Regressed since 1.70.0 (see section below). This issue can lead to UB in creates which use with generics for runtime casting/specialization. Started with: Expected: no output Result: False conditions with which the issue is reproduced (failure): , , , (but generate less optimized assembly), False conditions with which the issue is NOT reproduced (ok): , , Сasts (actually unreachable) with which the issue is reproduced (failure): - Casts (actually unreachable) with which the issue is NOT reproduced (ok): - Cloned implementation of with removed will also lead to the error, i.e. it's the assert that helps to avoid the issue when using : 1.68.0 - not reproducible. 1.69.0 - not reproducible. 1.70.0 - reproducible. 1.71.0 - reproducible. Stable () - reproducible. Beta ()- reproducible. Nightly () - reproducible. Reproducible in Rust playground as well: Quick bisection between 1.69.0 and 1.70.0 with MRE: Casting some byte primitives to some two-element tuples unexpectedly succeeds on release builds and definitely leads to UB. These assertions will success on debug builds, but will fail on release builds: Castaway crate uses to transmute between types when type ids are matched. Unexpected cast success is reproduced for casts from to where is , or , is , , or , is , , or , or where is , , is , , or , is , , or but has different byte size than Check code:
From a brief glance, this looks like a SROA bug to me: We should not be folding to poison. (Alive2 doesn't flag this, but I believe that's a bug in alive2. Filed )
If this showed up in 1.70, it was probably exposed by since that changed from memcpy to a normal load. (EDIT: doh, you'd already bisected to the rollup with that PR.)
Upstream issue:
WG-prioritization assigning priority (). label -I-prioritize +P-high

Discussion:
<del> Subproject commit e6a6470d1eb4c88fee4b1ea98cd8e0ac4a181c16 </del> <ins> Subproject commit c54cff0e6e4d1a0d0a2df7c1ce3d96cdd554763e </ins>