-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE failed while formatting fluent string parse_help_set_edition_standalone
#122130
Comments
Slightly smaller: enum will {
s#[c"owned_box"]
} |
HelpUseLatestEdition::new().add_to_diagnostic(&mut err); Somehow this subdiag enum #[derive(Subdiagnostic)]
pub enum HelpUseLatestEdition {
#[help(parse_help_set_edition_cargo)]
#[note(parse_note_edition_guide)]
Cargo { edition: Edition },
#[help(parse_help_set_edition_standalone)]
#[note(parse_note_edition_guide)]
Standalone { edition: Edition },
}
impl HelpUseLatestEdition {
pub fn new() -> Self {
let edition = LATEST_STABLE_EDITION;
if rustc_session::utils::was_invoked_from_cargo() {
Self::Cargo { edition }
} else {
Self::Standalone { edition }
}
}
} being added to a diagnostic causes
but the |
Also suspicious:
|
Seems like for the subdiag |
…latest-edition, r=cjgillot Eagerly translate `HelpUseLatestEdition` in parser diagnostics Fixes rust-lang#122130. This makes me suspicious of these other two usage of `add_to_diagnostic()`. Would they *also* crash? I haven't attempted to construct test cases for them. ``` compiler/rustc_parse/src/parser/expr.rs 3453: errors::HelpUseLatestEdition::new().add_to_diagnostic(e); compiler/rustc_hir_typeck/src/expr.rs 2603: HelpUseLatestEdition::new().add_to_diagnostic(&mut err); ``` This also seems like a footgun?
…latest-edition, r=cjgillot Eagerly translate `HelpUseLatestEdition` in parser diagnostics Fixes rust-lang#122130. This makes me suspicious of these other two usage of `add_to_diagnostic()`. Would they *also* crash? I haven't attempted to construct test cases for them. ``` compiler/rustc_parse/src/parser/expr.rs 3453: errors::HelpUseLatestEdition::new().add_to_diagnostic(e); compiler/rustc_hir_typeck/src/expr.rs 2603: HelpUseLatestEdition::new().add_to_diagnostic(&mut err); ``` This also seems like a footgun?
Rollup merge of rust-lang#122160 - jieyouxu:eager-translate-help-use-latest-edition, r=cjgillot Eagerly translate `HelpUseLatestEdition` in parser diagnostics Fixes rust-lang#122130. This makes me suspicious of these other two usage of `add_to_diagnostic()`. Would they *also* crash? I haven't attempted to construct test cases for them. ``` compiler/rustc_parse/src/parser/expr.rs 3453: errors::HelpUseLatestEdition::new().add_to_diagnostic(e); compiler/rustc_hir_typeck/src/expr.rs 2603: HelpUseLatestEdition::new().add_to_diagnostic(&mut err); ``` This also seems like a footgun?
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: