Skip to content

Commit b2332a7

Browse files
committed
Change lint to use const sym
1 parent 22cc77a commit b2332a7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_lints/src/utils/internal_lints.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ declare_clippy_lint! {
225225
///
226226
/// Good:
227227
/// ```rust,ignore
228-
/// utils::is_type_diagnostic_item(cx, ty, sym!(vec_type))
228+
/// utils::is_type_diagnostic_item(cx, ty, sym::vec_type)
229229
/// ```
230230
pub MATCH_TYPE_ON_DIAGNOSTIC_ITEM,
231231
internal,
@@ -724,7 +724,7 @@ impl<'tcx> LateLintPass<'tcx> for MatchTypeOnDiagItem {
724724
expr.span,
725725
"usage of `utils::match_type()` on a type diagnostic item",
726726
"try",
727-
format!("utils::is_type_diagnostic_item({}, {}, sym!({}))", cx_snippet, ty_snippet, item_name),
727+
format!("utils::is_type_diagnostic_item({}, {}, sym::{})", cx_snippet, ty_snippet, item_name),
728728
Applicability::MaybeIncorrect,
729729
);
730730
}

tests/ui/match_type_on_diag_item.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: usage of `utils::match_type()` on a type diagnostic item
22
--> $DIR/match_type_on_diag_item.rs:41:17
33
|
44
LL | let _ = match_type(cx, ty, &paths::VEC);
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym!(vec_type))`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym::vec_type)`
66
|
77
note: the lint level is defined here
88
--> $DIR/match_type_on_diag_item.rs:1:9
@@ -15,19 +15,19 @@ error: usage of `utils::match_type()` on a type diagnostic item
1515
--> $DIR/match_type_on_diag_item.rs:42:17
1616
|
1717
LL | let _ = match_type(cx, ty, &OPTION);
18-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym!(option_type))`
18+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym::option_type)`
1919

2020
error: usage of `utils::match_type()` on a type diagnostic item
2121
--> $DIR/match_type_on_diag_item.rs:43:17
2222
|
2323
LL | let _ = match_type(cx, ty, &["core", "result", "Result"]);
24-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym!(result_type))`
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym::result_type)`
2525

2626
error: usage of `utils::match_type()` on a type diagnostic item
2727
--> $DIR/match_type_on_diag_item.rs:46:17
2828
|
2929
LL | let _ = utils::match_type(cx, ty, rc_path);
30-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym!(Rc))`
30+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `utils::is_type_diagnostic_item(cx, ty, sym::Rc)`
3131

3232
error: aborting due to 4 previous errors
3333

0 commit comments

Comments
 (0)