jiebi/CodeConvo huggingface dataset:
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
cc I suspect this might be related to
I did not know where to add this is the template but this may be useful: Build works in debug mode, but not in release mode.
Regression in nightly-2023-12-31 (...)

Discussion:
let (prov, offset) = pointer.into_parts(); let alloc_id = prov.alloc_id(); intern_const_alloc_for_constprop(ecx, alloc_id).ok()?; <del> if matches!(ecx.tcx.global_alloc(alloc_id), GlobalAlloc::Memory(_)) { // `alloc_id` may point to a static. Codegen will choke on an `Indirect` with anything // by `GlobalAlloc::Memory`, so do fall through to copying if needed. // FIXME: find a way to treat this more uniformly // (probably by fixing codegen) </del> <ins> // `alloc_id` may point to a static. Codegen will choke on an `Indirect` with anything // by `GlobalAlloc::Memory`, so do fall through to copying if needed. // FIXME: find a way to treat this more uniformly (probably by fixing codegen) if let GlobalAlloc::Memory(alloc) = ecx.tcx.global_alloc(alloc_id) // Transmuting a constant is just an offset in the allocation. If the alignment of the // allocation is not enough, fallback to copying into a properly aligned value. && alloc.inner().align >= op.layout.align.abi { </ins> return Some(ConstValue::Indirect { alloc_id, offset }); } }

<ins> //@ build-pass //@ compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+GVN fn main() { let variant: Option<u32> = None; let transmuted: u64 = unsafe { std::mem::transmute(variant) }; println!("{transmuted}"); } </ins>
Change:
version: nightly-2023-11-22 os: centos-7 panic: thread '' panicked at called on an value: Utf8Error { validupto: 4, errorlen: Some(1) } note: run with environment variable to display a backtrace thread '' panicked at called on an value: Utf8Error { validupto: 4, errorlen: Some(1) } thread '' panicked at called on an value: Utf8Error { validupto: 4, errorlen: Some(1) } thread '' panicked at called on an value: Utf8Error { validupto: 4, error_len: Some(1) }
You are using a nightly that is over half a year old. Try using the latest nightly to see if it reproduces. If it does, please set and report back the printed backtrace as well as the project on which you get this panic.
Based on my testing, the latest version also has this issue.
It would appear that your libc's  function is not returning a UTF-8 encoded string (the fourth byte is invalid).
Can you share some of your system config, especially your locale? gai_strerror returning invalid UTF-8 is certainly not something expected by std.
<img width="955" alt="image" src=""
Which Chinese locale exactly? Could you show the values of the environment variables?
Sorry, the environment is no longer available, but it seems that using unwrap in is too risky.
It's probably not a UTF-8 locale. I would really recommend changing your locale to a UTF-8 one if possible, then this should work again. But you're right, this unwrap shouldn't be there, normal uses from lossy, which will give a bad error but at least won't crash. I'll send a PR.

Discussion:
use crate::mem; use crate::net::{Shutdown, SocketAddr}; use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd}; <del> use crate::str; </del> use crate::sys::fd::FileDesc; use crate::sys::pal::unix::IsMinusOne; use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};

#[cfg(not(target_os = "espidf"))] let detail = unsafe { <del> str::from_utf8(CStr::from_ptr(libc::gai_strerror(err)).to_bytes()).unwrap().to_owned() </del> <ins> // We can't always expect a UTF-8 environment. When we don't get that luxury, // it's better to give a low-quality error message than none at all. CStr::from_ptr(libc::gai_strerror(err)).to_string_lossy() </ins> }; #[cfg(target_os = "espidf")]
Change:
<!-- [31mICE[0m: Rustc '-Cinstrument-coverage -ooutputfile -Zdump-mir-dir=dir' 'error: internal compiler error: unexpected value of coverage attribute', 'error: internal compiler error: unexpected value of coverage attribute' 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: [coverageattron] checking for on [mirbuilt] building MIR for -- label +F-coverageattribute
Regression in

Discussion:
Some([item]) if item.has_name(sym::on) => return true, Some(_) | None => { // Other possibilities should have been rejected by `rustc_parse::validate_attr`. <del> tcx.dcx().span_bug(attr.span, "unexpected value of coverage attribute"); </del> <ins> // Use `span_delayed_bug` to avoid an ICE in failing builds (#127880). tcx.dcx().span_delayed_bug(attr.span, "unexpected value of coverage attribute"); </ins> } } }

<del> //@ known-bug: #127880 //@ compile-flags: -Cinstrument-coverage #[coverage] fn main() {} </del>

<ins> error: malformed `coverage` attribute input --> $DIR/bad-attr-ice.rs:10:1 | LL | #[coverage] | ^^^^^^^^^^^ | help: the following are the possible correct uses | LL | #[coverage(off)] | LL | #[coverage(on)] | error: aborting due to 1 previous error </ins>

<ins> error: malformed `coverage` attribute input --> $DIR/bad-attr-ice.rs:10:1 | LL | #[coverage] | ^^^^^^^^^^^ | help: the following are the possible correct uses | LL | #[coverage(off)] | LL | #[coverage(on)] | error[E0658]: the `#[coverage]` attribute is an experimental feature --> $DIR/bad-attr-ice.rs:10:1 | LL | #[coverage] | ^^^^^^^^^^^ | = note: see issue #84605 <https://github.com/rust-lang/rust/issues/84605> for more information = help: add `#![feature(coverage_attribute)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. </ins>

<ins> #![cfg_attr(feat, feature(coverage_attribute))] //@ revisions: feat nofeat //@ compile-flags: -Cinstrument-coverage //@ needs-profiler-support // Malformed `#[coverage(..)]` attributes should not cause an ICE when built // with `-Cinstrument-coverage`. // Regression test for <https://github.com/rust-lang/rust/issues/127880>. #[coverage] //~^ ERROR malformed `coverage` attribute input //[nofeat]~| the `#[coverage]` attribute is an experimental feature fn main() {} // FIXME(#130766): When the `#[coverage(..)]` attribute is stabilized, // get rid of the revisions and just make this a normal test. </ins>
Change:
<!-- [31mICE[0m: Rustc '' 'thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 5'', 'thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 5'' 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: [mirborrowck] borrow-checking [analysis] running analysis passes on this crate --<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
bisects to cc
Thank you. claim

Discussion:
if let Some(def_id) = def_id && self.infcx.tcx.def_kind(def_id).is_fn_like() && let Some(pos) = args.iter().position(|arg| arg.hir_id == expr.hir_id) <del> && let ty::Param(_) = self.infcx.tcx.fn_sig(def_id).skip_binder().skip_binder().inputs() [pos + offset] .kind() </del> <ins> && let Some(arg) = self .infcx .tcx .fn_sig(def_id) .skip_binder() .skip_binder() .inputs() .get(pos + offset) && let ty::Param(_) = arg.kind() </ins> { let place = &self.move_data.move_paths[mpi].place; let ty = place.ty(self.body, self.infcx.tcx).ty;

<ins> #![allow(dead_code)] extern "C" { fn rust_interesting_average(_: i64, ...) -> f64; } fn test<T, U>(a: i64, b: i64, c: i64, d: i64, e: i64, f: T, g: U) -> i64 { unsafe { rust_interesting_average( 6, a as f64, b, b as f64, f, c as f64, d, d as f64, e, e as f64, f, g, //~ ERROR use of moved value: `f` [E0382] ) as i64 } } fn main() {} </ins>

<ins> error[E0382]: use of moved value: `f` --> $DIR/move-error-suggest-clone-panic-issue-127915.rs:10:78 | LL | fn test<T, U>(a: i64, b: i64, c: i64, d: i64, e: i64, f: T, g: U) -> i64 { |                                                       - move occurs because `f` has type `T`, which does not implement the `Copy` trait ... LL |             6, a as f64, b, b as f64, f, c as f64, d, d as f64, e, e as f64, f, g, |                                       - value moved here                     ^ value used here after move | help: if `T` implemented `Clone`, you could clone the value --> $DIR/move-error-suggest-clone-panic-issue-127915.rs:7:9 | LL | fn test<T, U>(a: i64, b: i64, c: i64, d: i64, e: i64, f: T, g: U) -> i64 { |         ^ consider constraining this type parameter with `Clone` ... LL |             6, a as f64, b, b as f64, f, c as f64, d, d as f64, e, e as f64, f, g, |                                       - you could clone this value help: consider restricting type parameter `T` | LL | fn test<T: Copy, U>(a: i64, b: i64, c: i64, d: i64, e: i64, f: T, g: U) -> i64 { |          ++++++ error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0382`. </ins>
Change:
On current master: Same thing on the 1.80.0 release tag: This default value of "dev" used to be accurate prior to , i.e. with Rust 1.79 and older. The default value comes from this hardcoded value: But post-, the default value varies by how you got your source tarball, or what git branch you are on. It is not accurate for the Rust 1.80.0 release sources to say the default value for is "dev", as it's actually "stable" now. Mentioning since you worked on the PR (which I am otherwise happy with). The change in default also needs to be called out in

Discussion:
# The "channel" for the Rust build to produce. The stable/beta channels only # allow using stable features, whereas the nightly and dev channels allow using # nightly features <del> #channel = "dev" </del> <ins> # # If using tarball sources, default value for `channel` is taken from the `src/ci/channel` file; # otherwise, it's "dev". #channel = if "is a tarball source" { content of `src/ci/channel` file } else { "dev" } </ins> # A descriptive string to be appended to `rustc --version` output, which is # also used in places like debuginfo `DW_AT_producer`. This may be useful for

severity: ChangeSeverity::Info, summary: "Removed android-ndk r25b support in favor of android-ndk r26d.", }, <ins> ChangeInfo { change_id: 125181, severity: ChangeSeverity::Warning, summary: "For tarball sources, default value for `rust.channel` will be taken from `src/ci/channel` file.", }, </ins> ];
Change:
Sample at <img width="1066" alt="image" src=""Headings seem too close to the paragraphs around them, enough so that paragraph breaks stand out more than field breaks. Testing with , I think this makes sections stand out better: <img width="1023" alt="image" src=""
If somebody points me in the right direction then I can do this (unless somebody beats me to it, feel free).
I'm no rustdoc expert but this is the template that seems to be rendering the HTML in question: It might also help to just search for "structfield" under src/librustdoc in the repo.
Thanks for taking a look - aiui that is indeed where the HTML comes from, but I was less certain about the CSS. seems like a reasonable guess, but I just wanted to double check styles aren't applied in JS or something like that (I assume themes are but maybe not layout?).

Discussion:
padding: 0; white-space: pre-wrap; } <ins> .structfield { margin: 0.6em 0; } </ins> #crate-search, h1, h2, h3, h4, h5, h6,
Change:
I have pinned down the regression to a specific commit, thanks to recommending me . searched nightlies: from nightly-2024-07-28 to nightly-2024-07-30 regressed nightly: nightly-2024-07-30 searched commit range: regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.9</summaryHost triple: aarch64-apple-darwin Reproduce with: : </details
Based on the commits in that rollup, I feel like might be the culprit, but it isn't obvious to me why that might be the case (cc
Thanks for the ping, will fix this.

Discussion:
fn run(self, builder: &Builder<'_>) { let stage = self.stage; let target = self.target; <ins> let crates = if self.crates.is_empty() { builder .in_tree_crates("sysroot", Some(target)) .iter() .map(|c| c.name.to_string()) .collect() } else { self.crates }; </ins> let out = match self.format { DocumentationFormat::Html => builder.doc_out(target), DocumentationFormat::Json => builder.json_doc_out(target),

extra_args.push("--disable-minification"); } <del> doc_std(builder, self.format, stage, target, &out, &extra_args, &self.crates); </del> <ins> doc_std(builder, self.format, stage, target, &out, &extra_args, &crates); </ins> // Don't open if the format is json if let DocumentationFormat::Json = self.format {

let index = out.join("std").join("index.html"); builder.open_in_browser(index); } else { <del> for requested_crate in &*self.crates { </del> <ins> for requested_crate in crates { </ins> if STD_PUBLIC_CRATES.iter().any(|&k| k == requested_crate) { let index = out.join(requested_crate).join("index.html"); builder.open_in_browser(index);
Change:
<!-- [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

Discussion:
match (cast_ty_from, cast_ty_to) { (Some(CastTy::Ptr(src)), Some(CastTy::Ptr(dst))) => { let mut normalize = |t| self.normalize(t, location); <ins> // N.B. `struct_tail_with_normalize` only "structurally resolves" // the type. It is not fully normalized, so we have to normalize it // afterwards. </ins> let src_tail = tcx.struct_tail_with_normalize(src.ty, &mut normalize, || ()); <ins> let src_tail = normalize(src_tail); </ins> let dst_tail = tcx.struct_tail_with_normalize(dst.ty, &mut normalize, || ()); <ins> let dst_tail = normalize(dst_tail); </ins> // This checks (lifetime part of) vtable validity for pointer casts, // which is irrelevant when there are aren't principal traits on both sides (aka only auto traits).

<del> //@ known-bug: rust-lang/rust#128621 #![feature(ptr_metadata)] use std::{ops::FnMut, ptr::Pointee}; pub type EmplacerFn<'a, T> = dyn for<'b> FnMut(<T as Pointee>::Metadata) + 'a; pub struct Emplacer<'a, T>(EmplacerFn<'a, T>); impl<'a, T> Emplacer<'a, T> { pub unsafe fn from_fn<'b>(emplacer_fn: &'b mut EmplacerFn<'a, T>) -> &'b mut Self { unsafe { &mut *((emplacer_fn as *mut EmplacerFn<'a, T>) as *mut Self) } } } pub fn main() {} </del>

<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>

<ins> //@ check-pass 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; } fn main() {} </ins>
Change:
I spotted this in : the result links to ' which is not a valid link. Cc
cc -- I think these are supposed to be autoredirected in JS?
Okay... This happens because there's more than one and the one we want is currently named . The URL escaping is fine; the -35 is the problem.

Discussion:
if (splitAt !== -1) { const implId = savedHash.slice(0, splitAt); const assocId = savedHash.slice(splitAt + 1); <del> const implElem = document.getElementById(implId); if (implElem && implElem.parentElement.tagName === "SUMMARY" && implElem.parentElement.parentElement.tagName === "DETAILS") { onEachLazy(implElem.parentElement.parentElement.querySelectorAll( </del> <ins> const implElems = document.querySelectorAll( `details > summary > section[id^="${implId}"]`, ); onEachLazy(implElems, implElem => { const numbered = /^(.+?)-([0-9]+)$/.exec(implElem.id); if (implElem.id !== implId && (!numbered || numbered[1] !== implId)) { return false; } return onEachLazy(implElem.parentElement.parentElement.querySelectorAll( </ins> `[id^="${assocId}"]`), item => { <del> const numbered = /([^-]+)-([0-9]+)/.exec(item.id); </del> <ins> const numbered = /^(.+?)-([0-9]+)$/.exec(item.id); </ins> if (item.id === assocId || (numbered && numbered[1] === assocId)) { openParentDetails(item); item.scrollIntoView();

setTimeout(() => { window.location.replace("#" + item.id); }, 0); <ins> return true; </ins> } }, ); <del> } </del> <ins> }); </ins> } } }

"URL": "struct.ZyxwvutMethodDisambiguation.html#method.method_impl_disambiguation-1" }, ENDS_WITH) assert: "section:target" <ins> // Checks that, if a type has two methods with the same name, // and if it has multiple inherent impl blocks, that the numeric // impl block's disambiguator is also acted upon. go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=MultiImplBlockStruct->bool" wait-for: "#search-tabs" assert-count: ("a.result-method", 1) assert-attribute: ("a.result-method", { "href": "../lib2/another_mod/struct.MultiImplBlockStruct.html#impl-MultiImplBlockStruct/method.second_fn" }) click: "a.result-method" wait-for: "details:has(summary > #impl-MultiImplBlockStruct-1) > div section[id='method.second_fn']:target" go-to: "file://" + |DOC_PATH| + "/lib2/index.html?search=MultiImplBlockStruct->u32" wait-for: "#search-tabs" assert-count: ("a.result-method", 1) assert-attribute: ("a.result-method", { "href": "../lib2/another_mod/struct.MultiImplBlockStruct.html#impl-MultiImplBlockTrait-for-MultiImplBlockStruct/method.second_fn" }) click: "a.result-method" wait-for: "details:has(summary > #impl-MultiImplBlockTrait-for-MultiImplBlockStruct) > div section[id='method.second_fn-1']:target" </ins>

<del> pub fn tadam() {} </del> <ins> pub struct MultiImplBlockStruct; impl MultiImplBlockStruct { pub fn first_fn() {} } impl MultiImplBlockStruct { pub fn second_fn(self) -> bool { true } } pub trait MultiImplBlockTrait { fn first_fn(); fn second_fn(self) -> u32; } impl MultiImplBlockTrait for MultiImplBlockStruct { fn first_fn() {} fn second_fn(self) -> u32 { 1 } } </ins>
Change:
On a Windows machine, run: : Which is here: Specifically the panics. The device is pretty weird as it's a device in its own right that you can read/write to but also a kind of root directory (you can do ) and calling on should return . It doesn't quite fit with std's model of paths. <details<summary<strongBacktrace</strong</summary<p</p</details
To be clear, this is a strange thing to be doing so I wouldn't consider this a high priority or anything.

Discussion:
impl Input { pub fn filestem(&self) -> &str { <del> match *self { Input::File(ref ifile) => ifile.file_stem().unwrap().to_str().unwrap(), Input::Str { .. } => "rust_out", </del> <ins> if let Input::File(ifile) = self { // If for some reason getting the file stem as a UTF-8 string fails, // then fallback to a fixed name. if let Some(name) = ifile.file_stem().and_then(OsStr::to_str) { return name; } </ins> } <ins> "rust_out" </ins> } pub fn source_name(&self) -> FileName {

<ins> //@ only-windows // Reason: dos devices are a Windows thing use std::path::Path; use run_make_support::{rustc, static_lib_name}; fn main() { rustc().input(r".NUL").crate_type("staticlib").run(); rustc().input(r"?NUL").crate_type("staticlib").run(); assert!(Path::new(&static_lib_name("rust_out")).exists()); } </ins>
Change:
Debugging code from , if I set a breakpoint in gdb inside gc_callback in I see messages like . This correctly breaks on the line, but trying to advance continues to break on the line each time in inlined code like transmute and borrow.
Good catch! I think I had a patch once that would turn off emitting source locations for inlined functions but it will probably be bit-rotted by now. I'll look into it next!
Can we try to come up with some minimal code to reproduce this behavior reliably? As pointed out, it would be great to have an autotest before closing the issue.
Wow, that was quick Thanks a lot!
At least for this example the issue seems to be fixed after PR has landed. I'll add this to the autotests next week and then, I think, we can close this issue.

Discussion:
<ins> // Copyright 2013-2014 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. // ignore-android: FIXME(#10381) // compile-flags:-g // debugger:break issue12886.rs:29 // debugger:run // debugger:next // check:[...]30[...]s // debugger:continue // IF YOU MODIFY THIS FILE, BE CAREFUL TO ADAPT THE LINE NUMBERS IN THE DEBUGGER COMMANDS // This test makes sure that gdb does not set unwanted breakpoints in inlined functions. If a // breakpoint existed in unwrap(), then calling `next` would (when stopped at line 27) would stop // in unwrap() instead of stepping over the function invocation. By making sure that `s` is // contained in the output, after calling `next` just once, we can be sure that we did not stop in // unwrap(). (The testing framework doesn't allow for checking that some text is *not* contained in // the output, which is why we have to make the test in this kind of roundabout way) fn bar() -> int { let s = Some(5).unwrap(); s } fn main() { let _ = bar(); } </ins>
Change:
u32(1234) should be 1234u32, and handled in the lexer The former is chatty and confuses the issue with runtime calls / casts (the latter of which should be shifted to 'as' casts anyway).
Switch machine-type lexemes to use suffixes. Remove support for foo(bar) as a cast notation. Closed by .

Discussion:
rustup toolchain install --profile minimal nightly-${TOOLCHAIN} # Sanity check to see if the nightly exists echo nightly-${TOOLCHAIN} > rust-toolchain <del> echo "=> Uninstalling all old nighlies" </del> <ins> echo "=> Uninstalling all old nightlies" </ins> for nightly in $(rustup toolchain list | grep nightly | grep -v $TOOLCHAIN | grep -v nightly-x86_64); do rustup toolchain uninstall $nightly done