mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 18:26:19 +00:00
Merge pull request #19644 from ChayimFriedman2/const-syms
internal: Make predefined symbols `const` instead of `static`
This commit is contained in:
commit
34e7d60e30
72 changed files with 432 additions and 473 deletions
|
|
@ -597,7 +597,7 @@ fn filename_and_frag_for_def(
|
|||
Definition::Module(m) => match m.name(db) {
|
||||
// `#[doc(keyword = "...")]` is internal used only by rust compiler
|
||||
Some(name) => {
|
||||
match m.attrs(db).by_key(&sym::doc).find_string_value_in_tt(&sym::keyword) {
|
||||
match m.attrs(db).by_key(sym::doc).find_string_value_in_tt(sym::keyword) {
|
||||
Some(kw) => {
|
||||
format!("keyword.{}.html", kw)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -797,7 +797,7 @@ fn hint_iterator(
|
|||
|
||||
if ty.impls_trait(db, iter_trait, &[]) {
|
||||
let assoc_type_item = iter_trait.items(db).into_iter().find_map(|item| match item {
|
||||
hir::AssocItem::TypeAlias(alias) if alias.name(db) == sym::Item.clone() => Some(alias),
|
||||
hir::AssocItem::TypeAlias(alias) if alias.name(db) == sym::Item => Some(alias),
|
||||
_ => None,
|
||||
})?;
|
||||
if let Some(ty) = ty.normalize_trait_assoc_type(db, &[], assoc_type_item) {
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ impl Analysis {
|
|||
TryFrom::try_from(&*std::env::current_dir().unwrap().as_path().to_string_lossy())
|
||||
.unwrap(),
|
||||
);
|
||||
cfg_options.insert_atom(sym::test.clone());
|
||||
cfg_options.insert_atom(sym::test);
|
||||
crate_graph.add_crate_root(
|
||||
file_id,
|
||||
Edition::CURRENT,
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ pub(super) fn doc_comment(
|
|||
let mut new_comments = Vec::new();
|
||||
let mut string;
|
||||
|
||||
for attr in attributes.by_key(&sym::doc).attrs() {
|
||||
for attr in attributes.by_key(sym::doc).attrs() {
|
||||
let InFile { file_id, value: src } = attrs_source_map.source_of(attr);
|
||||
if file_id != src_file_id {
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue