jiebi/CodeConvo huggingface dataset:
Change:
Found by mutating with a <details<summary<strongFull output including backtrace</strong</summary<p</p</detailsnightly-2022-05-28: changed from no ICE to ICE "index out of bounds" Most likely for the same reason as nightly-2022-07-13: changed from ICE "index out of bounds" to ICE "assertion failed: self.istaintedbyerrors()" From something in , most likely label +A-inline-assembly <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
That assertion is probably unnecessarily strict, since doesn't check that errors are emitted from other items anyways. Instead, it can probably be turned into a delayed bug or just removed altogether, since already delays a bug.
claim

Discussion:
let ty = self.typeck_results.borrow().expr_ty_adjusted(expr); let ty = self.resolve_vars_if_possible(ty); if ty.has_non_region_infer() { <del> assert!(self.is_tainted_by_errors()); </del> self.tcx.ty_error() } else { self.tcx.erase_regions(ty)

<ins> // needs-asm-support // only-x86_64 struct W<T: ?Sized>(Oops); //~^ ERROR cannot find type `Oops` in this scope unsafe fn test() { let j = W(()); let pointer = &j as *const _; core::arch::asm!( "nop", in("eax") pointer, ); } fn main() {} </ins>

<ins> error[E0412]: cannot find type `Oops` in this scope --> $DIR/issue-104510-ice.rs:4:21 | LL | struct W<T: ?Sized>(Oops); |                     ^^^^ not found in this scope error: aborting due to previous error For more information about this error, try `rustc --explain E0412`. </ins>
Change:
Found with a <details<summaryBacktrace</summary</details<details<summaryBacktrace</summary</detailsRegression in nightly-2022-05-28, perhaps from () nightly: 2022-11-18 on playground with debug assertions: slightly newer, built locally from <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Might be a duplicate of
Should be an easy fix, just need to delay a bug if the transmute source/target has (non-region) infer vars and bail from the fn.
claim

Discussion:
use rustc_hir as hir; use rustc_index::vec::Idx; use rustc_middle::ty::layout::{LayoutError, SizeSkeleton}; <del> use rustc_middle::ty::{self, Ty, TyCtxt}; </del> <ins> use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitable}; </ins> use rustc_target::abi::{Pointer, VariantIdx}; use super::FnCtxt;

let from = normalize(from); let to = normalize(to); trace!(?from, ?to); <ins> if from.has_non_region_infer() || to.has_non_region_infer() { tcx.sess.delay_span_bug(span, "argument to transmute has inference variables"); return; } </ins> // Transmutes that are only changing lifetimes are always ok. if from == to { return;

<ins> fn foo() { oops; //~^ ERROR: cannot find value `oops` in this scope } unsafe fn bar() { std::mem::transmute::<_, *mut _>(1_u8); } fn main() {} </ins>

<ins> error[E0425]: cannot find value `oops` in this scope --> $DIR/issue-104609.rs:2:5 | LL |     oops; |     ^^^^ not found in this scope error: aborting due to previous error For more information about this error, try `rustc --explain E0425`. </ins>
Change:
<details<summary<strongBacktrace</strong</summary<p</p</detailsRegression in nightly-2022-11-18 from ()
This makes me wonder if we could just create a superset of a set of chars and feed these into rustc, hmm.
Can we just here?
cc
I'll take a look, thanks for the heads up.
I changed the test input to the following, to avoid an "expected item after attributes" error: With rust 1.64.0 I get these errors: If I change to return if fails, then I get these errors: Do you think that is reasonable behaviour?
Both seem fine, I'd do whatever is simpler to implement.

Discussion:
}) => MetaItemKind::list_from_tokens(tokens.clone()), AttrArgs::Delimited(..) => None, AttrArgs::Eq(_, AttrArgsEq::Ast(expr)) => match expr.kind { <del> ast::ExprKind::Lit(token_lit) => Some(MetaItemKind::NameValue( Lit::from_token_lit(token_lit, expr.span).expect("token_lit in from_attr_args"), )), </del> <ins> ast::ExprKind::Lit(token_lit) => { // Turn failures to `None`, we'll get parse errors elsewhere. Lit::from_token_lit(token_lit, expr.span) .ok() .map(|lit| MetaItemKind::NameValue(lit)) } </ins> _ => None, }, AttrArgs::Eq(_, AttrArgsEq::Hir(lit)) => Some(MetaItemKind::NameValue(lit.clone())),

<ins> #![feature(rustc_attrs)] #![rustc_dummy=5z] //~ ERROR unexpected expression: `5z` fn main() {} </ins>

<ins> error: unexpected expression: `5z` --> $DIR/issue-104620.rs:3:16 | LL | #![rustc_dummy=5z] |                ^^ error: aborting due to previous error </ins>
Change:
The following code should pass regardless of the declaration order of lifetimes: This is related to but it's different in that we do have a lower bound region, , but we fail to recognize that because , which is responsible for calculating from , assumes that the outlive relation is a total order, which is not true. Here is the graph of : ! So we need an efficient algorithm that works for partial order relations, but the one that comes to mind is . The perf may not be really important here but I'm curious to see the alternatives. label C-bug T-compiler A-borrow-checker E-mentor E-help-wanted <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
Here is the code of concern The code should calculate the from a set of universal regions (). The relations are encoded in and are guaranteed to be transitive and reflexive. The relation graph may have cycles and can be sparse. The goal here is to find a unique minimum choice that is known to be outlived by all other regions. If none can be found, the function returns . Regions that have cycles between them are considered equivalent so we can pick either one of them as a unique choice. e.g. , we can pick either one of as a minimum choice.

Discussion:
// Otherwise, we need to find the minimum remaining choice, if // any, and take that. debug!("choice_regions remaining are {:#?}", choice_regions); <del> let min = |r1: ty::RegionVid, r2: ty::RegionVid| -> Option<ty::RegionVid> { let r1_outlives_r2 = self.universal_region_relations.outlives(r1, r2); let r2_outlives_r1 = self.universal_region_relations.outlives(r2, r1); match (r1_outlives_r2, r2_outlives_r1) { (true, true) => Some(r1.min(r2)), (true, false) => Some(r2), (false, true) => Some(r1), (false, false) => None, } </del> <ins> let Some(&min_choice) = choice_regions.iter().find(|&r1| { choice_regions.iter().all(|&r2| { self.universal_region_relations.outlives(r2, *r1) }) }) else { debug!("no choice region outlived by all others"); return false; </ins> }; <del> let mut min_choice = choice_regions[0]; for &other_option in &choice_regions[1..] { debug!(?min_choice, ?other_option,); match min(min_choice, other_option) { Some(m) => min_choice = m, None => { debug!(?min_choice, ?other_option, "incomparable; no min choice",); return false; } } } </del> let min_choice_scc = self.constraint_sccs.scc(min_choice); debug!(?min_choice, ?min_choice_scc);

<ins> // edition:2018 // check-pass #![allow(dead_code)] async fn fail<'a, 'b, 'c>(_: &'static str) where 'a: 'c, 'b: 'c, {} async fn pass<'a, 'c, 'b>(_: &'static str) where 'a: 'c, 'b: 'c, {} async fn pass2<'a, 'b, 'c>(_: &'static str) where 'a: 'c, 'b: 'c, 'c: 'a, {} async fn pass3<'a, 'b, 'c>(_: &'static str) where 'a: 'b, 'b: 'c, 'c: 'a, {} fn main() { } </ins>
Change:
When the error should mention bindings that are outside of the scope but within the same item <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
Do you think we should suggest in this scenario? My local dev branch will suggest:
I removed it.

Discussion:
/// FIXME #4948: Reuse ribs to avoid allocation. ribs: PerNS<Vec<Rib<'a>>>, <ins> /// Previous poped `rib`, only used for diagnostic. last_block_rib: Option<Rib<'a>>, </ins> /// The current set of local scopes, for labels. label_ribs: Vec<Rib<'a, NodeId>>,

// Ignore errors in function bodies if this is rustdoc // Be sure not to set this until the function signature has been resolved. let previous_state = replace(&mut this.in_func_body, true); <ins> // We only care block in the same function this.last_block_rib = None; </ins> // Resolve the function body, potentially inside the body of an async closure this.with_lifetime_rib( LifetimeRibKind::Elided(LifetimeRes::Infer),

type_ns: vec![Rib::new(start_rib_kind)], macro_ns: vec![Rib::new(start_rib_kind)], }, <ins> last_block_rib: None, </ins> label_ribs: Vec::new(), lifetime_ribs: Vec::new(), lifetime_elision_candidates: None,

self.ribs[ValueNS].pop(); self.label_ribs.pop(); } <del> self.ribs[ValueNS].pop(); </del> <ins> self.last_block_rib = self.ribs[ValueNS].pop(); </ins> if anonymous_module.is_some() { self.ribs[TypeNS].pop(); }

return (true, candidates); } } <ins> // Try to find in last block rib if let Some(rib) = &self.last_block_rib && let RibKind::NormalRibKind = rib.kind { for (ident, &res) in &rib.bindings { if let Res::Local(_) = res && path.len() == 1 && ident.span.eq_ctxt(path[0].ident.span) && ident.name == path[0].ident.name { err.span_help( ident.span, &format!("the binding `{}` is available in a different scope in the same function", path_str), ); return (true, candidates); } } } </ins> return (false, candidates); }

<ins> fn main() { let foo = 1; { let bar = 2; let test_func = |x| x > 3; } if bar == 2 { //~ ERROR cannot find value println!("yes"); } test_func(1); //~ ERROR cannot find function } </ins>

<ins> error[E0425]: cannot find value `bar` in this scope --> $DIR/issue-104700-inner_scope.rs:7:8 | LL |     if bar == 2 { |        ^^^ | help: the binding `bar` is available in a different scope in the same function --> $DIR/issue-104700-inner_scope.rs:4:13 | LL |         let bar = 2; |             ^^^ error[E0425]: cannot find function `test_func` in this scope --> $DIR/issue-104700-inner_scope.rs:10:5 | LL |     test_func(1); |     ^^^^^^^^^ not found in this scope error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0425`. </ins>
Change:
! label A-rustdoc-ui T-rustdoc C-bug regression-from-stable-to-nightly
Regressed in . Out of these it's probably cc

Discussion:
} .small-section-header { <ins> /* fields use <span> tags, but should get their own lines */ display: block; </ins> position: relative; }

p: P, } <ins> pub struct StructWithPublicUndocumentedFields { pub first: u32, pub second: u32, } </ins> pub const CONST: u8 = 0; pub trait TraitWithoutGenerics {

<ins> goto: "file://" + |DOC_PATH| + "/test_docs/struct.StructWithPublicUndocumentedFields.html" // Both fields must be on their own line. In other words, they have display: block. store-property: (first_top, "//*[@id='structfield.first']", "offsetTop") assert-property-false: ("//*[@id='structfield.second']", { "offsetTop": |first_top| }) </ins>
Change:
Produces json (abridged) which is correct, but fails for this modify labels: +A-rustdoc-json +A-testsuite +T-rustdoc <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
claim
This was found while working on , as it causes jsondoclint to fail for core (in addition to it catching the linked issue)

Discussion:
<ins> // Regression test for <https://github.com/rust-lang/rust/issues/104851> /// @set foo = "$.index[*][?(@.name=='Foo')].id" pub type Foo = i32; // @is "$.index[*][?(@.name=='demo')].inner.decl.output.kind" '"resolved_path"' // @is "$.index[*][?(@.name=='demo')].inner.decl.output.inner.id" $foo pub fn demo() -> Foo { 42 } </ins>

pub fn is_trait(self) -> bool { matches!(self, Kind::Trait) } <del> pub fn is_struct_enum_union(self) -> bool { matches!(self, Kind::Struct | Kind::Enum | Kind::Union) </del> <ins> pub fn is_type(self) -> bool { matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::Typedef) </ins> } pub fn from_item(i: &Item) -> Self {

enum PathKind { Trait, <del> StructEnumUnion, </del> <ins> /// Structs, Enums, Unions and Typedefs. /// /// This doesn't include trait's because traits are not types. Type, </ins> } impl<'a> Validator<'a> {

fn check_type(&mut self, x: &'a Type) { match x { <del> Type::ResolvedPath(path) => self.check_path(path, PathKind::StructEnumUnion), </del> <ins> Type::ResolvedPath(path) => self.check_path(path, PathKind::Type), </ins> Type::DynTrait(dyn_trait) => self.check_dyn_trait(dyn_trait), Type::Generic(_) => {} Type::Primitive(_) => {}

fn check_path(&mut self, x: &'a Path, kind: PathKind) { match kind { PathKind::Trait => self.add_trait_id(&x.id), <del> PathKind::StructEnumUnion => self.add_struct_enum_union_id(&x.id), </del> <ins> PathKind::Type => self.add_type_id(&x.id), </ins> } if let Some(args) = &x.args { self.check_generic_args(&**args);

self.add_id_checked(id, Kind::is_trait, "Trait"); } <del> fn add_struct_enum_union_id(&mut self, id: &'a Id) { self.add_id_checked(id, Kind::is_struct_enum_union, "Struct or Enum or Union"); </del> <ins> fn add_type_id(&mut self, id: &'a Id) { self.add_id_checked(id, Kind::is_type, "Type (Struct, Enum, Union or Typedef)"); </ins> } /// Add an Id that appeared in a trait
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: This currently fails, even though no symlinks are involved. This is because on Unix are currently compared on the totality of their contained unix , which are bitflags of the form (in octal) where is a Unix permission mode and the actual file type. As of now, depending on how the is built, may be either (from ) or set to the actual file permission mode (if built from ). (This bug was co-investigated with <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
claim
label: +T-libs-api + Libs-Small
Error: Parsing relabel command in failed: ...'libs-api +' ' Libs-Smal'... Please file an issue on GitHub at if there's a problem with this bot, or reach out on on Zulip.
label: +T-libs-api +Libs-Small
Error: Label Libs-Small can only be set by Rust team members Please file an issue on GitHub at if there's a problem with this bot, or reach out on on Zulip.
label: +T-libs-api

Discussion:
fs::metadata(hiberfil).unwrap(); assert_eq!(true, hiberfil.exists()); } <ins> /// Test that two different ways of obtaining the FileType give the same result. /// Cf. https://github.com/rust-lang/rust/issues/104900 #[test] fn test_eq_direntry_metadata() { let tmpdir = tmpdir(); let file_path = tmpdir.join("file"); File::create(file_path).unwrap(); for e in fs::read_dir(tmpdir.path()).unwrap() { let e = e.unwrap(); let p = e.path(); let ft1 = e.file_type().unwrap(); let ft2 = p.metadata().unwrap().file_type(); assert_eq!(ft1, ft2); } } </ins>

modified: Option<SystemTime>, } <del> #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] </del> <ins> #[derive(Copy, Clone, Eq, Debug)] </ins> pub struct FileType { mode: mode_t, } <ins> impl PartialEq for FileType { fn eq(&self, other: &Self) -> bool { self.masked() == other.masked() } } impl core::hash::Hash for FileType { fn hash<H: core::hash::Hasher>(&self, state: &mut H) { self.masked().hash(state); } } </ins> #[derive(Debug)] pub struct DirBuilder { mode: mode_t,

} pub fn is(&self, mode: mode_t) -> bool { <del> self.mode & libc::S_IFMT == mode </del> <ins> self.masked() == mode } fn masked(&self) -> mode_t { self.mode & libc::S_IFMT </ins> } }
Change:
It should not be possible that clippy component is missing since we are gating on it in CI..? cc
I think this is a rustup bug somehow, it's looking specifically for : I can back this out to give rustup time to fix it in a new release, this wasn't an urgent fix. I want to spend another few minutes investigating first though.
I don't think rustup's rename system is designed to allow changing the name of a component. contains more information about how and why this was done.
says I need at a minimum to keep the key for clippy-preview. I will try to test that out today but I don't have permissions for a dist-static build and it might take me a bit so I'll put up a revert in the meantime.
I'm happy to run dev-static builds as needed, but I agree that a revert is appropriate for the time being. Please feel free to poke on Zulip if you need a quick review, etc. I'm a little surprised our testing in didn't catch this -- let's make sure we understand how to test it in the future.
what went wrong in is that worked before and after, but running before and after did not. I'll make sure to test that in any future PR.

Discussion:
let mut tarball = Tarball::new(builder, "clippy", &target.triple); tarball.set_overlay(OverlayKind::Clippy); <ins> tarball.is_preview(true); </ins> tarball.add_file(clippy, "bin", 0o755); tarball.add_file(cargoclippy, "bin", 0o755); tarball.add_legal_and_readme_to("share/doc/clippy");

.expect("cargo fmt expected to build - essential tool"); let mut tarball = Tarball::new(builder, "rustfmt", &target.triple); tarball.set_overlay(OverlayKind::Rustfmt); <ins> tarball.is_preview(true); </ins> tarball.add_file(rustfmt, "bin", 0o755); tarball.add_file(cargofmt, "bin", 0o755); tarball.add_legal_and_readme_to("share/doc/rustfmt");

format!("{}-{}", name, target.triple) } else if name == "rust-analyzer" { "rust-analyzer-preview".to_string() <ins> } else if name == "clippy" { "clippy-preview".to_string() </ins> } else if name == "rust-demangler" { "rust-demangler-preview".to_string() } else if name == "miri" {

} let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple); <del> // cfg(bootstrap): will need to be changed from `rustfmt-preview` to `rustfmt` the next time you run `bump-stage0`. // See <https://github.com/rust-lang/rust/pull/103648> </del> self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0"); self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt"));

Cargo = "cargo", HtmlDocs = "rust-docs", RustAnalysis = "rust-analysis", <del> Clippy = "clippy", Rustfmt = "rustfmt", </del> Rls = "rls"; preview = true, RustAnalyzer = "rust-analyzer"; preview = true, <ins> Clippy = "clippy"; preview = true, Rustfmt = "rustfmt"; preview = true, </ins> LlvmTools = "llvm-tools"; preview = true, Miri = "miri"; preview = true, JsonDocs = "rust-docs-json"; preview = true,

const PATH: &str = "src/stage0.json"; const COMPILER_COMPONENTS: &[&str] = &["rustc", "rust-std", "cargo"]; <del> const RUSTFMT_COMPONENTS: &[&str] = &["rustfmt"]; </del> <ins> const RUSTFMT_COMPONENTS: &[&str] = &["rustfmt-preview"]; </ins> struct Tool { config: Config,
Change:
thread 'rustc' panicked at ': inconsistent resolution for an import', <details<summaryBacktrace</summary</detailsRegression in nightly-2018-12-30 <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
Same error message as , but this one is self-contained and might be a separate bug.
claim
how about make this to an error with diagonostic? Seems we don't have a chance to insert , because the is before the later . If we change code to this: It will be:
Could we register an exactly in the place we ICE?
Yes, this is also a solution, and then we can report error in the same function .

Discussion:
use crate::Determinacy::{self, *}; use crate::Namespace::*; use crate::{module_to_string, names_to_string, ImportSuggestion}; <del> use crate::{AmbiguityKind, BindingKey, ModuleKind, ResolutionError, Resolver, Segment}; </del> <ins> use crate::{ AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, BindingKey, ModuleKind, ResolutionError, Resolver, Segment, }; </ins> use crate::{Finalize, Module, ModuleOrUniformRoot, ParentScope, PerNS, ScopeSet}; use crate::{NameBinding, NameBindingKind, PathResult};

match binding { Ok(binding) => { // Consistency checks, analogous to `finalize_macro_resolutions`. <del> let initial_res = source_bindings[ns].get().map(|initial_binding| { </del> <ins> let initial_binding = source_bindings[ns].get().map(|initial_binding| { </ins> all_ns_err = false; if let Some(target_binding) = target_bindings[ns].get() { if target.name == kw::Underscore

); } } <del> initial_binding.res() </del> <ins> initial_binding </ins> }); let res = binding.res(); <del> if let Ok(initial_res) = initial_res { </del> <ins> if let Ok(initial_binding) = initial_binding { let initial_res = initial_binding.res(); </ins> if res != initial_res && this.ambiguity_errors.is_empty() { <del> span_bug!(import.span, "inconsistent resolution for an import"); </del> <ins> this.ambiguity_errors.push(AmbiguityError { kind: AmbiguityKind::Import, ident, b1: initial_binding, b2: binding, misc1: AmbiguityErrorMisc::None, misc2: AmbiguityErrorMisc::None, }); </ins> } } else if res != Res::Err && this.ambiguity_errors.is_empty()

<ins> use self::A::*; use V; //~ ERROR `V` is ambiguous use self::B::*; enum A { V } enum B { V } fn main() {} </ins>

<ins> error[E0659]: `V` is ambiguous --> $DIR/issue-105069.rs:2:5 | LL | use V; |     ^ ambiguous name | = note: ambiguous because of multiple potential import sources note: `V` could refer to the variant imported here --> $DIR/issue-105069.rs:1:5 | LL | use self::A::*; |     ^^^^^^^^^^ note: `V` could also refer to the variant imported here --> $DIR/issue-105069.rs:3:5 | LL | use self::B::*; |     ^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0659`. </ins>
Change:
Found with a thread 'rustc' panicked at 'assertion failed: !suggestion.isempty()', <details<summaryBacktrace</summary</detailsFirst ICEd in nightly-2021-07-29, likely from ( which support for enums. <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOT_END --
claim
PR is up at

Discussion:
let suggestion = default_variants .iter() .filter_map(|v| { <del> if v.ident == variant.ident { </del> <ins> if v.span == variant.span { </ins> None } else { Some((cx.sess.find_by_name(&v.attrs, kw::Default)?.span, String::new()))

<ins> // compile-flags: --crate-type=lib #[derive(Default)] //~ ERROR multiple declared defaults enum E { #[default] A, #[default] A, //~ ERROR defined multiple times } </ins>

<ins> error: multiple declared defaults --> $DIR/issue-105101.rs:3:10 | LL | #[derive(Default)] |          ^^^^^^^ ... LL |     A, |     - first default LL |     #[default] LL |     A, |     - additional default | = note: only one variant can be default = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0428]: the name `A` is defined multiple times --> $DIR/issue-105101.rs:8:5 | LL |     A, |     - previous definition of the type `A` here LL |     #[default] LL |     A, |     ^ `A` redefined here | = note: `A` must be defined only once in the type namespace of this enum error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0428`. </ins>