jiebi/CodeConvo huggingface dataset:
Change:
They used to be blue and are now black. I don't think this change was intentional, although we have been thinking about migrating more headers to be black recently. I think this regressed very recently, since I probably would have noticed it otherwise. !
I wonder if this was caused by or ? Those were both merged recently, though the second one doesn't seem like it could have changed colors. cc
This regressed in , which as one of the rules for an anchor to be styled black. The goal with that change was to make the section headings on module pages black (e.g. ). Those have . However, headings generated from Markdown in a docblock also have . I think the right short-term fix is: Section headings on module pages get , like their peers on other pages. Remove the CSS rule for to be black. It's not really clear to me why Markdown gets , and Rustdoc-generated headings get , particularly given that the Rustdoc headings are almost always bigger. Probably we should rename these to and .
Since you figured out a way to fix this regression, do you want to assign yourself and open a PR with the fix?
Will do.

Discussion:
let (short, name) = item_ty_to_strs(myty.unwrap()); write!( w, <del> "<h2 id="{id}" class="section-header"> </del> <ins> "<h2 id="{id}" class="small-section-header"> </ins> <a href="#{id}">{name}</a> </h2>n{}", ITEM_TABLE_OPEN,

a.srclink, a#toggle-all-docs, a.anchor, <del> .section-header a, </del> <ins> .small-section-header a, </ins> #source-sidebar a, pre.rust a, .sidebar a,

assert-css: ("#method.must_use", {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"}, ALL) goto: file://|DOC_PATH|/test_docs/index.html <del> assert-css: (".section-header a", {"color": "rgb(197, 197, 197)"}, ALL) </del> <ins> assert-css: (".small-section-header a", {"color": "rgb(197, 197, 197)"}, ALL) goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html assert-css: (".section-header a", {"color": "rgb(57, 175, 215)"}, ALL) </ins> // Dark theme local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}

assert-css: ("#method.must_use", {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"}, ALL) goto: file://|DOC_PATH|/test_docs/index.html <del> assert-css: (".section-header a", {"color": "rgb(221, 221, 221)"}, ALL) </del> <ins> assert-css: (".small-section-header a", {"color": "rgb(221, 221, 221)"}, ALL) goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html assert-css: (".section-header a", {"color": "rgb(210, 153, 29)"}, ALL) </ins> // Light theme local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}

assert-css: ("#method.must_use", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"}, ALL) goto: file://|DOC_PATH|/test_docs/index.html <del> assert-css: (".section-header a", {"color": "rgb(0, 0, 0)"}, ALL) </del> <ins> assert-css: (".small-section-header a", {"color": "rgb(0, 0, 0)"}, ALL) goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html assert-css: (".section-header a", {"color": "rgb(56, 115, 173)"}, ALL) </ins>
Change:
This debugassert: Is triggered by the following input, found by : <details<summary<strongBacktrace</strong</summary<p</p</details
Reduced (in terms of unrelated errors):
label +requires-nightly +A-generators +F-generators

Discussion:
} has_emitted } <del> ty::Tuple(ref tys) => { </del> <ins> ty::Tuple(_) => { </ins> let mut has_emitted = false; <del> let spans = if let Some(hir::ExprKind::Tup(comps)) = data.expr.map(|e| &e.kind) { debug_assert_eq!(comps.len(), tys.len()); comps.iter().map(|e| e.span).collect() } else { vec![] </del> <ins> let comps = match data.expr.map(|e| &e.kind) { Some(hir::ExprKind::Tup(comps)) => { debug_assert_eq!(comps.len(), ty.tuple_fields().count()); Some(comps) } _ => None, </ins> }; <del> for (i, ty) in tys.iter().map(|k| k.expect_ty()).enumerate() { </del> <ins> for (i, ty) in ty.tuple_fields().enumerate() { </ins> let descr_post = &format!(" in tuple element {}", i); <del> let span = *spans.get(i).unwrap_or(&data.source_span); </del> <ins> let span = comps.and_then(|c| c.get(i)).map(|e| e.span).unwrap_or(data.source_span); </ins> if check_must_not_suspend_ty( fcx, ty, hir_id, <del> SuspendCheckData { descr_post, source_span: span, ..data }, </del> <ins> SuspendCheckData { descr_post, expr: comps.and_then(|comps| comps.get(i)), source_span: span, ..data }, </ins> ) { has_emitted = true; }

<ins> // Regression test for the ICE described in issue #91334. // error-pattern: this file contains an unclosed delimiter // error-pattern: expected one of // error-pattern: mismatched closing delimiter // error-pattern: mismatched types #![feature(generators)] fn f(){||yield(((){), </ins>

<ins> error: this file contains an unclosed delimiter --> $DIR/issue-91334.rs:10:23 | LL | fn f(){||yield(((){), |       -       -       ^ |       |       | |       |       unclosed delimiter |       unclosed delimiter error: this file contains an unclosed delimiter --> $DIR/issue-91334.rs:10:23 | LL | fn f(){||yield(((){), |       -       -       ^ |       |       | |       |       unclosed delimiter |       unclosed delimiter error: expected one of `)`, `,`, `.`, `?`, or an operator, found `{` --> $DIR/issue-91334.rs:10:19 | LL | fn f(){||yield(((){), |                   ^ |                   | |                   expected one of `)`, `,`, `.`, `?`, or an operator |                   help: missing `,` error: mismatched closing delimiter: `)` --> $DIR/issue-91334.rs:10:19 | LL | fn f(){||yield(((){), |                -  ^^ mismatched closing delimiter |                |  | |                |  unclosed delimiter |                closing delimiter possibly meant for this error[E0308]: mismatched types --> $DIR/issue-91334.rs:10:8 | LL | fn f(){||yield(((){), |       -^^^^^^^^^^^^^^^ expected `()`, found generator |       | |       help: try adding a return type: `-> [generator@$DIR/issue-91334.rs:10:8: 10:23]` | = note: expected unit type `()` found generator `[generator@$DIR/issue-91334.rs:10:8: 10:23]` error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0308`. </ins>
Change:
I'm seeing an internal compiler error on the following input, found by : Affected versions: I tried nightly 2021-11-28 and stable 1.56.1 and they both ICE. In stable 1.56.1 the error message is different though, I would say it's better: <details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
In one of the recent nightlies the error message has changed to <details<summary<strongBacktrace</strong</summary<p</p</details

Discussion:
} fn visit_fn(&mut self, fn_kind: FnKind<'ast>, sp: Span, _: NodeId) { let rib_kind = match fn_kind { <del> // Bail if there's no body. FnKind::Fn(.., None) => return visit::walk_fn(self, fn_kind, sp), FnKind::Fn(FnCtxt::Free | FnCtxt::Foreign, ..) => FnItemRibKind, </del> <ins> // Bail if the function is foreign, and thus cannot validly have // a body, or if there's no body for some other reason. FnKind::Fn(FnCtxt::Foreign, _, sig, ..) | FnKind::Fn(_, _, sig, .., None) => { // We don't need to deal with patterns in parameters, because // they are not possible for foreign or bodiless functions. self.visit_fn_header(&sig.header); visit::walk_fn_decl(self, &sig.decl); return; } FnKind::Fn(FnCtxt::Free, ..) => FnItemRibKind, </ins> FnKind::Fn(FnCtxt::Assoc(_), ..) => NormalRibKind, FnKind::Closure(..) => ClosureOrAsyncRibKind, };

<ins> // Regression test for issue #91370. extern { //~^ `extern` blocks define existing foreign functions fn f() { //~^ incorrect function inside `extern` block //~| cannot have a body impl Copy for u8 {} } } fn main() {} </ins>

<ins> error: incorrect function inside `extern` block --> $DIR/issue-91370-foreign-fn-block-impl.rs:5:8 | LL |   extern { |   ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body LL | LL |       fn f() { |  ________^___- | |        | | |        cannot have a body LL | | LL | | LL | |         impl Copy for u8 {} LL | |     } | |_____- help: remove the invalid body: `;` | = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html error: aborting due to previous error </ins>
Change:
Reproducer: Playground link: <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I'd love to take a look at this. Seems to be ICEing in code that displays the diagnostic to fixup the actual compiler error here. claim

Discussion:
e.note(&note); } if let Some((label, span)) = err.secondary_label { <del> let sp = fmt_span.from_inner(span); e.span_label(sp, label); </del> <ins> if efmt_kind_is_lit { e.span_label(fmt_span.from_inner(span), label); } </ins> } e.emit(); return DummyResult::raw_expr(sp, true);

<ins> fn main() { let _ = format!(concat!("{0}𝖳𝖾𝗌𝗍{"), i); //~^ ERROR: invalid format string: expected `'}'` but string was terminated //~| NOTE: if you intended to print `{`, you can escape it using `{{` //~| NOTE: in this expansion of concat! //~| NOTE: in this expansion of concat! //~| NOTE: expected `'}'` in format string } </ins>

<ins> error: invalid format string: expected `'}'` but string was terminated --> $DIR/issue-91556.rs:2:19 | LL |   let _ = format!(concat!("{0}𝖳𝖾𝗌𝗍{"), i); |                   ^^^^^^^^^^^^^^^^^^^ expected `'}'` in format string | = note: if you intended to print `{`, you can escape it using `{{` = note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error </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. --I was experimenting with Bevy, and suddenly found has stopped me to show errors. It turned out that paniced on this function: I a commit with exact state of my project (it's pretty small ATM) where the compiler pianics <!-- 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
Thanks for the code. Would be great if someone could take a stab at minimizing it. label +E-needs-mcve I may come back and attempt to myself
I've managed to get it to this point.
Here's a version with the bevy calls minimized as well
epic! label -E-needs-mcve glacier ""
Error: Parsing glacier command in failed: ...'cier https' ''... Please let know if you're having trouble with this bot.
Error: Parsing glacier command in failed: ...' glacier :' ''... Please let know if you're having trouble with this bot.
Oh, can the glacier command only be used by repository members?

Discussion:
let predicate = predicate.fold_with(&mut BottomUpFolder { tcx, ty_op: |ty| match ty.kind() { <del> ty::Projection(projection_ty) => infcx.infer_projection( self.param_env, *projection_ty, traits::ObligationCause::misc(self.value_span, self.body_id), 0, &mut self.obligations, ), </del> <ins> ty::Projection(projection_ty) if !projection_ty.has_escaping_bound_vars() => { infcx.infer_projection( self.param_env, *projection_ty, traits::ObligationCause::misc(self.value_span, self.body_id), 0, &mut self.obligations, ) } </ins> _ => ty, }, lt_op: |lt| lt,

<ins> // check-pass #![feature(generic_associated_types)] pub trait Scalar: 'static { type RefType<'a>: ScalarRef<'a>; } pub trait ScalarRef<'a>: 'a {} fn cmp_eq<'a, 'b, A: Scalar, B: Scalar, O: Scalar>(a: A::RefType<'a>, b: B::RefType<'b>) -> O { todo!() } fn build_expression<A: Scalar, B: Scalar, O: Scalar>( ) -> impl Fn(A::RefType<'_>, B::RefType<'_>) -> O { cmp_eq } 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 rendering docs for a crate with: That puts this in the sidebar: ! In this case, and are dependencies (which I don't want to document). And is the name of one of the examples, this is a dead link.
cc - running on dependencies seems like a cargo bug, but showing them in the sidebar seems like it's an issue in rustdoc.
Thanks for the report I will take a look this week.
Ok, I have fixed the issue where examples show up in the crates list. However, I wasn't able to reproduce the issue with non-examples appearing in the crates list. Specifically, my setup was: I could not get to appear in the sidebar when using .
Thanks I tried some more things, and I think what happened is that I used it without at first, and then without clearing the folder, did it with , which apparently doesn't remove the dependencies from the sidebar. So I guess that part of the issue is about not working quite right when these artefacts already exist, and unrelated to .

Discussion:
crate emit: Vec<EmitType>, /// If `true`, HTML source pages will generate links for items to their definition. crate generate_link_to_definition: bool, <ins> /// Set of function-call locations to include as examples </ins> crate call_locations: AllCallLocations, <ins> /// If `true`, Context::init will not emit shared files. crate no_emit_shared: bool, </ins> } #[derive(Copy, Clone, Debug, PartialEq, Eq)]

emit, generate_link_to_definition, call_locations, <ins> no_emit_shared: false, </ins> }, crate_name, output_format,

show_type_layout, generate_link_to_definition, call_locations, <ins> no_emit_shared, </ins> .. } = options;

sources::render(&mut cx, &krate)?; } <del> // Build our search index let index = build_index(&krate, &mut Rc::get_mut(&mut cx.shared).unwrap().cache, tcx); </del> <ins> if !no_emit_shared { // Build our search index let index = build_index(&krate, &mut Rc::get_mut(&mut cx.shared).unwrap().cache, tcx); // Write shared runs within a flock; disable thread dispatching of IO temporarily. Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(true); write_shared(&cx, &krate, index, &md_opts)?; Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(false); } </ins> <del> // Write shared runs within a flock; disable thread dispatching of IO temporarily. Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(true); write_shared(&cx, &krate, index, &md_opts)?; Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(false); </del> Ok((cx, krate)) }

crate fn run( krate: clean::Crate, <del> renderopts: config::RenderOptions, </del> <ins> mut renderopts: config::RenderOptions, </ins> cache: formats::cache::Cache, tcx: TyCtxt<'_>, options: ScrapeExamplesOptions, ) -> interface::Result<()> { let inner = move || -> Result<(), String> { // Generates source files for examples <ins> renderopts.no_emit_shared = true; </ins> let (cx, _) = Context::init(krate, renderopts, cache, tcx).map_err(|e| e.to_string())?; // Collect CrateIds corresponding to provided target crates
Change:
Hello, this is your friendly neighborhood mergebot. After merging PR rust-lang/rust, I observed that the tool miri has failing tests. A follow-up PR to the repository is needed to fix the fallout. cc do you think you would have time to do the follow-up work? If so, that would be great!
Ah, I see now. That PR removes splats (hopefully temporarily), and unfortunately, because of how natural it is, a few tests for Miri already use the splatting syntax. Yes, I can clean this up.
Yeah I just tried and was happy to see it work. :)
Fix happening on the Miri side in (it was so easy I just quickly did it)

Discussion:
<del> Subproject commit 81e59e6b92cf1729aabbbbf09b81a81a03775d64 </del> <ins> Subproject commit dadcbebfbd017aac2358cf652a4bd71a91694edc </ins>
Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --code from cc <!-- 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. --: Note that is required to reproduce the ICE <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
cc maybe you have an idea why this still crashes with ?
No, I don't unfortunately. The version of version I worked on is meant to be called before typecheck has finished and where normalization could still fail. This call seems to occur during codegen, where normalization should (in theory) always succeed (or rather errors should have been caught earlier), but I'm not that familiar with the later stages of the compiler, so I might be missing something.
This normalization is happening in an optimization pass () which can run on MIR that can never be codegenned. In this case, the method impl has an impossible-to-satisfy clause, so it can never actually be called or codegenned. The optimization pass should be changed to use - it can just do nothing if it fails.
Thanks for pointing out the problem. Would you like to open a PR for this or are you ok with me trying to fix this?
Feel free to open a PR

Discussion:
#[inline] fn visit_ty(&mut self, ty: &mut Ty<'tcx>, _: TyContext) { <del> *ty = self.tcx.normalize_erasing_regions(self.param_env, ty); </del> <ins> // We have to use `try_normalize_erasing_regions` here, since it's // possible that we visit impossible-to-satisfy where clauses here, // see #91745 *ty = self.tcx.try_normalize_erasing_regions(self.param_env, *ty).unwrap_or(ty); </ins> } }

<ins> // check-pass pub trait Foo { type Bar; } pub trait Broken { type Assoc; fn broken(&self) where Self::Assoc: Foo; } impl<T> Broken for T { type Assoc = (); fn broken(&self) where Self::Assoc: Foo { let _x: <Self::Assoc as Foo>::Bar; } } fn main() { let _m: &dyn Broken<Assoc=()> = &(); } </ins>
Change:
MCVE (could be reduced further): Originally found by miri-test-libstd. See for more. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I suspect this is a regression from (, cc but I have not yet bisected.
claim
I have debug printing for the slice length to and the test prints that the iterator is zero-length, which means a zero-length slice is created. refers to regarding safety requirements, which in turn states Which I interpret as any aligned, non-null pointer is valid for zero-length slices, which includes recently freed allocations. So this seems to be a false positive caused by miri not taking the slice length into account.
That is not the case, unfortunately. Quoting from I am not happy with this rule, but currently, LLVM does not really let us a choice here ().
Added 1.59.0 milestone since that's my understanding of when the regression occurred.
Removing prioritization label as per label -I-prioritize

Discussion:
let iter = mem::replace(&mut self.iter, (&mut []).iter()); let drop_len = iter.len(); <del> let drop_ptr = iter.as_slice().as_ptr(); // forget iter so there's no aliasing reference drop(iter); </del> let mut vec = self.vec;

return; } <ins> // as_slice() must only be called when iter.len() is > 0 because // vec::Splice modifies vec::Drain fields and may grow the vec which would invalidate // the iterator's internal pointers. Creating a reference to deallocated memory // is invalid even when it is zero-length let drop_ptr = iter.as_slice().as_ptr(); </ins> unsafe { // drop_ptr comes from a slice::Iter which only gives us a &[T] but for drop_in_place // a pointer with mutable provenance is necessary. Therefore we must reconstruct
Change:
Given the following code: The current output is: Error is fixed by adding a where clause to associated type in impl, which is not immediately clear:
GATs issue triage: not blocking. Poor diagnostic, but not a miscompile.
label +D-papercut +D-terse
Current output is I think that's pretty helpful. Going to mark as needs-test

Discussion:
<ins> #![feature(generic_associated_types)] use std::fmt::Debug; use std::marker::PhantomData; #[derive(Debug)] pub struct TransactionImpl<'db> { _marker: PhantomData<&'db ()>, } #[derive(Debug)] pub struct CursorImpl<'txn> { _marker: PhantomData<&'txn ()>, } pub trait Cursor<'txn> {} pub trait Transaction<'db>: Send + Sync + Debug + Sized { type Cursor<'tx>: Cursor<'tx> where 'db: 'tx, Self: 'tx; fn cursor<'tx>(&'tx self) -> Result<Self::Cursor<'tx>, ()> where 'db: 'tx; } impl<'tx> Cursor<'tx> for CursorImpl<'tx> {} impl<'db> Transaction<'db> for TransactionImpl<'db> { type Cursor<'tx> = CursorImpl<'tx>; //~ ERROR lifetime bound not satisfied fn cursor<'tx>(&'tx self) -> Result<Self::Cursor<'tx>, ()> where 'db: 'tx, { loop {} } } fn main() {} </ins>

<ins> error[E0478]: lifetime bound not satisfied --> $DIR/issue-91883.rs:32:24 | LL | /     type Cursor<'tx>: Cursor<'tx> LL | |     where LL | |         'db: 'tx, LL | |         Self: 'tx; | |__________________- definition of `Cursor` from trait ... LL |       type Cursor<'tx> = CursorImpl<'tx>; |                          ^^^^^^^^^^^^^^^- help: try copying these clauses from the trait: `where 'db: 'tx, Self: 'tx` | note: lifetime parameter instantiated with the lifetime `'db` as defined here --> $DIR/issue-91883.rs:31:6 | LL | impl<'db> Transaction<'db> for TransactionImpl<'db> { |      ^^^ note: but lifetime parameter must outlive the lifetime `'tx` as defined here --> $DIR/issue-91883.rs:32:17 | LL |     type Cursor<'tx> = CursorImpl<'tx>; |                 ^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0478`. </ins>