Skip to content

Commit 6d078d7

Browse files
committed
fix: remove usage of sym! macro
It was removed in rust-lang/rust-clippy#14650. We can either call `Symbol::intern()` manually (which is what this commit does), or use the new preinterned symbol system (https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/struct.Config.html#structfield.extra_symbols).
1 parent e12d9ee commit 6d078d7

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

bevy_lint/src/lints/cargo.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
use super::nursery::duplicate_bevy_dependencies::DUPLICATE_BEVY_DEPENDENCIES;
44
use crate::declare_bevy_lint_pass;
55
use cargo_metadata::MetadataCommand;
6-
use clippy_utils::sym;
76
use rustc_lint::{LateContext, LateLintPass};
87
use rustc_session::{config::Input, utils::was_invoked_from_cargo};
98
use rustc_span::Symbol;
109

1110
declare_bevy_lint_pass! {
1211
pub(crate) Cargo => [DUPLICATE_BEVY_DEPENDENCIES],
1312
@default = {
14-
bevy: Symbol = sym!(bevy),
13+
bevy: Symbol = Symbol::intern("bevy"),
1514
},
1615
}
1716

bevy_lint/src/lints/pedantic/main_return_without_appexit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
3636
use crate::{declare_bevy_lint, declare_bevy_lint_pass, utils::hir_parse::MethodCall};
3737
use clippy_utils::{
38-
diagnostics::span_lint_hir_and_then, is_entrypoint_fn, is_expr_used_or_unified, sym,
38+
diagnostics::span_lint_hir_and_then, is_entrypoint_fn, is_expr_used_or_unified,
3939
ty::match_type, visitors::for_each_expr,
4040
};
4141
use rustc_errors::Applicability;
@@ -53,7 +53,7 @@ declare_bevy_lint! {
5353
declare_bevy_lint_pass! {
5454
pub(crate) MainReturnWithoutAppExit => [MAIN_RETURN_WITHOUT_APPEXIT],
5555
@default = {
56-
run: Symbol = sym!(run),
56+
run: Symbol = Symbol::intern("run"),
5757
},
5858
}
5959

bevy_lint/src/lints/suspicious/insert_event_resource.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ use crate::{
4646
use clippy_utils::{
4747
diagnostics::span_lint_and_sugg,
4848
source::{snippet, snippet_with_applicability},
49-
sym,
5049
ty::{match_type, ty_from_hir_ty},
5150
};
5251
use rustc_errors::Applicability;
@@ -65,8 +64,8 @@ declare_bevy_lint! {
6564
declare_bevy_lint_pass! {
6665
pub(crate) InsertEventResource => [INSERT_EVENT_RESOURCE],
6766
@default = {
68-
insert_resource: Symbol = sym!(insert_resource),
69-
init_resource: Symbol = sym!(init_resource),
67+
insert_resource: Symbol = Symbol::intern("insert_resource"),
68+
init_resource: Symbol = Symbol::intern("init_resource"),
7069
},
7170
}
7271

bevy_lint/src/lints/suspicious/insert_unit_bundle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
//! # bevy::ecs::system::assert_is_system(spawn);
5151
//! ```
5252
53-
use clippy_utils::{diagnostics::span_lint_hir_and_then, sym, ty::match_type};
53+
use clippy_utils::{diagnostics::span_lint_hir_and_then, ty::match_type};
5454
use rustc_errors::Applicability;
5555
use rustc_hir::{Expr, ExprKind};
5656
use rustc_lint::{LateContext, LateLintPass};
@@ -68,7 +68,7 @@ declare_bevy_lint! {
6868
declare_bevy_lint_pass! {
6969
pub(crate) InsertUnitBundle => [INSERT_UNIT_BUNDLE],
7070
@default = {
71-
spawn: Symbol = sym!(spawn),
71+
spawn: Symbol = Symbol::intern("spawn"),
7272
},
7373
}
7474

0 commit comments

Comments
 (0)