-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Allow to customize // TODO:
comment for deprecated safe autofix
#127857
Conversation
This comment has been minimized.
This comment has been minimized.
b2e98da
to
44d3664
Compare
This comment has been minimized.
This comment has been minimized.
44d3664
to
5502eec
Compare
This comment has been minimized.
This comment has been minimized.
5502eec
to
c719526
Compare
This comment has been minimized.
This comment has been minimized.
c719526
to
bf612e9
Compare
This comment was marked as resolved.
This comment was marked as resolved.
bf612e9
to
a253f11
Compare
We haven't heard from the reviewer in 2 weeks and this is edition-critical. r? compiler |
fn parse_rustc_deprecated_safe_2024_attr(attr: &Attribute) -> Option<Symbol> { | ||
for item in attr.meta_item_list().unwrap_or_default() { | ||
if item.has_name(sym::audit_that) { | ||
return Some(item.value_str().expect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Some(item.value_str().expect( | |
if let Some(msg) = item.value_str() { |
The current code will most likely ICE if the value is not actually string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds better to me than silently ignoring the attribute value in that case. It's an internal attribute after all. I've seen the pattern of abusing ICE instead of generating proper errors in other internal attributes as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a good practice, but not a blocker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified that this indeed ICEs. I'd still prefer the ICE over silently ignoring the attribute value. The compiler error says:
error: the compiler unexpectedly panicked. this is a bug.
note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly
445595b
to
9ad9819
Compare
@rustbot ready |
Relevant for the deprecation of `CommandExt::before_exit` in rust-lang#125970.
…er error This doesn't work for translated compiler error messages.
9ad9819
to
811d7dd
Compare
@rustbot ready |
@bors r+ |
…trochenkov Allow to customize `// TODO:` comment for deprecated safe autofix Relevant for the deprecation of `CommandExt::before_exit` in rust-lang#125970. Tracking: - rust-lang#124866
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#127857 (Allow to customize `// TODO:` comment for deprecated safe autofix) - rust-lang#128410 (Migrate `remap-path-prefix-dwarf` `run-make` test to rmake) - rust-lang#128828 (`-Znext-solver` caching) - rust-lang#128873 (Add windows-targets crate to std's sysroot) - rust-lang#129034 (Add `#[must_use]` attribute to `Coroutine` trait) - rust-lang#129049 (compiletest: Don't panic on unknown JSON-like output lines) - rust-lang#129050 (Emit a warning instead of an error if `--generate-link-to-definition` is used with other output formats than HTML) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#122884 (Optimize integer `pow` by removing the exit branch) - rust-lang#127857 (Allow to customize `// TODO:` comment for deprecated safe autofix) - rust-lang#129034 (Add `#[must_use]` attribute to `Coroutine` trait) - rust-lang#129049 (compiletest: Don't panic on unknown JSON-like output lines) - rust-lang#129050 (Emit a warning instead of an error if `--generate-link-to-definition` is used with other output formats than HTML) - rust-lang#129056 (Fix one usage of target triple in bootstrap) - rust-lang#129058 (Add mw back to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#122884 (Optimize integer `pow` by removing the exit branch) - rust-lang#127857 (Allow to customize `// TODO:` comment for deprecated safe autofix) - rust-lang#129034 (Add `#[must_use]` attribute to `Coroutine` trait) - rust-lang#129049 (compiletest: Don't panic on unknown JSON-like output lines) - rust-lang#129050 (Emit a warning instead of an error if `--generate-link-to-definition` is used with other output formats than HTML) - rust-lang#129056 (Fix one usage of target triple in bootstrap) - rust-lang#129058 (Add mw back to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#122884 (Optimize integer `pow` by removing the exit branch) - rust-lang#127857 (Allow to customize `// TODO:` comment for deprecated safe autofix) - rust-lang#129034 (Add `#[must_use]` attribute to `Coroutine` trait) - rust-lang#129049 (compiletest: Don't panic on unknown JSON-like output lines) - rust-lang#129050 (Emit a warning instead of an error if `--generate-link-to-definition` is used with other output formats than HTML) - rust-lang#129056 (Fix one usage of target triple in bootstrap) - rust-lang#129058 (Add mw back to review rotation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127857 - tbu-:pr_deprecated_safe_todo, r=petrochenkov Allow to customize `// TODO:` comment for deprecated safe autofix Relevant for the deprecation of `CommandExt::before_exit` in rust-lang#125970. Tracking: - rust-lang#124866
Relevant for the deprecation of
CommandExt::before_exit
in #125970.Tracking:
std::env::{set_var, remove_var}
unsafe #124866