Repository navigation
1.99 beta crater regression: panic when formatting bitflags #162124
Copy link
Copy link
Closed
Labels
A-fmtArea: `core::fmt`Area: `core::fmt`A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.P-highHigh priorityHigh priorityS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
log: https://crater-reports.s3.amazonaws.com/beta-1.99-5/1.99.0-beta.1/reg/extended-notify-0.1.3/log.txt
partial reduction:
use enumflags2::bitflags;
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[bitflags]
#[repr(u64)]
pub(crate) enum Interest {
Established,
Any,
Access,
AccessOpen,
AccessClose,
AccessRead,
AccessOther,
Create,
CreateFile,
CreateFolder,
CreateOther,
Modify,
ModifyData,
ModifyDataSize,
ModifyDataContent,
ModifyDataOther,
ModifyMetadata,
ModifyMetadataAccessTime,
ModifyMetadataWriteTime,
ModifyMetadataPermissions,
ModifyMetadataOwnership,
ModifyMetadataExtended,
ModifyMetadataOther,
ModifyRename,
ModifyRenameTo,
ModifyRenameFrom,
ModifyRenameBoth,
ModifyRenameOther,
ModifyOther,
Delete,
DeleteFile,
DeleteFolder,
DeleteOther,
Other,
}
fn main() {
let flags = Interest::Established | Interest::Create;
eprintln!("run step {flags:?}");
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-fmtArea: `core::fmt`Area: `core::fmt`A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-proc-macrosArea: Procedural macrosArea: Procedural macrosC-bugCategory: This is a bug.Category: This is a bug.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.P-highHigh priorityHigh priorityS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Activity
cyrgani commentedon Sep 1, 2026
slightly smaller:
The problem is that #155452 added a new optimization to
derive(Debug)for fieldless enums. But applying#[bitflags]rewrites the enum and gives it discriminants, making the generatedDebugcode incorrect.Essentially this is yet another instance of #148423.
13 remaining items
nia-e commentedon Sep 1, 2026
We discussed this in the libs meeting - we'd like to revert this and backport the revert, yeah. If there's a way to do this opt without breaking bitflags, we could try to re-land a version of this on nightly. Thanks for bringing this up!
Revert "Implement Debug for C-like enums with a concatenated string"
Rollup merge of rust-lang#162164 - nnethercote:revert-concat-Debug, r…
Rollup merge of rust-lang#162164 - nnethercote:revert-concat-Debug, r…
traviscross commentedon Sep 2, 2026
We discussed this in the lang call today. We're happy with the revert here.
Rollup merge of rust-lang#162164 - nnethercote:revert-concat-Debug, r…
Rollup merge of rust-lang#162164 - nnethercote:revert-concat-Debug, r…
Unrolled build for #162164 in rollup 162229
Revert "Implement Debug for C-like enums with a concatenated string"
panstromek commentedon Sep 4, 2026
I think we could do a version with a match that maps variant to a variant index, instead of reading
discriminant_value. This wouldn't avoid the match statement overhead, but it would avoid the MIR and binary size overhead from string constant in each arm (which I think was more significant part of the overhead motivating this optimization).