Skip to content
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

ANN: check #[deprecated] attr syntax: E0538, E0551, E0541 #10140

Merged
merged 1 commit into from May 1, 2023

Conversation

kuksag
Copy link
Contributor

@kuksag kuksag commented Feb 18, 2023

changelog:

  • Add support for E0538, multiple items used in #[deprecated] attribute, e.g.:
#[deprecated(
    since = "a",
    since = "b", // error
    note = "c"
)]
fn f1() { }

Error code reference: https://doc.rust-lang.org/error_codes/E0538.html
Compiler reference: https://github.com/rust-lang/rust/blob/904dd2c3987028f0270db306b9964bc465689de8/compiler/rustc_attr/src/builtin.rs#L834

  • Add support for E0541, unknown item used inside #[deprecated]:
#[deprecated(
    since="1.0.0",
    // error: unknown meta item
    reason="Example invalid meta item. Should be 'note'")
]
fn deprecated_function() {}

Error code reference: https://doc.rust-lang.org/error_codes/E0541.html
Compiler reference: https://github.com/rust-lang/rust/blob/904dd2c3987028f0270db306b9964bc465689de8/compiler/rustc_attr/src/builtin.rs#L891

  • Add support for E0551, invalid item was used (key-value param expected):
#[deprecated(note)] // error!
fn i_am_deprecated() {}

Error code reference: https://doc.rust-lang.org/error_codes/E0551.html
Compiler reference:
https://github.com/rust-lang/rust/blob/904dd2c3987028f0270db306b9964bc465689de8/compiler/rustc_attr/src/builtin.rs#L852

  • Add tests for quick-fixes

@vlad20012 vlad20012 self-assigned this Feb 19, 2023
@vlad20012 vlad20012 assigned kuksag and unassigned vlad20012 Apr 5, 2023
@vlad20012 vlad20012 changed the title ANN: Add support for E0538 ANN: check #[deprecated] attr syntax: E0538, E0551, E0541 Apr 23, 2023
@kuksag kuksag force-pushed the kuksag/e0538 branch 3 times, most recently from 242c642 to 02bb640 Compare April 24, 2023 11:13
Copy link
Member

@Undin Undin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kuksag let's avoid merging master branch into feature branch. Use rebase, please

Copy link
Member

@vlad20012 vlad20012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented May 1, 2023

Build succeeded:

@bors bors bot merged commit d768ba2 into intellij-rust:master May 1, 2023
42 checks passed
To test automation moved this from In Progress to Test May 1, 2023
@github-actions github-actions bot added this to the v195 milestone May 1, 2023
@mili-l mili-l moved this from Test to Done in To test May 16, 2023
@mili-l mili-l self-assigned this May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants