Skip to content

Subtree update of rust-analyzer #136803

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

Merged
merged 118 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
a8f5471
fix: upmap ranges in convert_tuple_struct_to_named_struct assist
vishruth-thimmaiah Jan 16, 2025
1f45995
manual: Convert to mdbook
Wilfred Jan 23, 2025
b46775a
Combine `pat_hyigene` and `expr_hygiene`
Veykril Jan 25, 2025
8e7a338
BodyCollector
Veykril Jan 25, 2025
d9c58c8
Cleanup body ast ptr defs
Veykril Jan 25, 2025
c679d56
Split out `ExpressionStore` from `Body`
Veykril Jan 25, 2025
bdebd86
Add GenericDefId::StaticId
Veykril Jan 26, 2025
1360b4c
In completion's expand, consider recursion stop condition (when we're…
ChayimFriedman2 Jan 26, 2025
5de2cd4
Support RFC 2396
ChayimFriedman2 Jan 26, 2025
9051647
Merge pull request #19038 from ChayimFriedman2/unused-unsafe
Veykril Jan 27, 2025
6db1411
Merge pull request #19037 from ChayimFriedman2/fix-other-test
Veykril Jan 27, 2025
1711a19
Merge pull request #19036 from Veykril/push-nprltlwvryxw
Veykril Jan 27, 2025
d18afd3
feat: Implement `default-field-values`
ShoyuVanilla Jan 22, 2025
5ca9f52
Handle missing fields diagnostics
ShoyuVanilla Jan 23, 2025
2622160
Merge record lit's ellipsis into pre-existing spread's variant
ShoyuVanilla Jan 26, 2025
faeaf4a
Compute diagnostics of a field body iff it has one
ShoyuVanilla Jan 26, 2025
c7463fe
Implement `HasResolver` and `HasModule` for `FieldId`
ShoyuVanilla Jan 26, 2025
ec89b7d
Add a test for field default value body as defining usage of TAIT
ShoyuVanilla Jan 26, 2025
e4e7c95
Fix a mistake in condition
ShoyuVanilla Jan 26, 2025
c093db0
Remove `has_default` from `FieldId`
ShoyuVanilla Jan 27, 2025
ad0aea4
Merge pull request #19001 from ShoyuVanilla/default-field-values
Veykril Jan 27, 2025
9a0504b
Fix #[rustc_deprecated_safe_2024]
ChayimFriedman2 Jan 27, 2025
86d5e29
Fix a missing standard token in semantic highlighting
ChayimFriedman2 Jan 27, 2025
238d7bd
Merge pull request #19045 from ChayimFriedman2/missing-token
Veykril Jan 27, 2025
0fe9d77
Merge pull request #19044 from ChayimFriedman2/deprecated-safe
Veykril Jan 27, 2025
5f2072c
Fix syntactic highlighting for renames
lnicola Jan 27, 2025
d60afec
Merge pull request #19047 from lnicola/rename-highlight
lnicola Jan 27, 2025
78feee8
Remove duplicate method from `hir::Type`
ChayimFriedman2 Jan 27, 2025
b4508dc
Don't suggest `into_iter().method()` on iterators
ChayimFriedman2 Jan 27, 2025
1ba8943
Report calling unsafe fn pointer as unsafe
ChayimFriedman2 Jan 27, 2025
26c5708
Prioritize formatting thread tasks in main_loop
Veykril Jan 27, 2025
30b6063
Merge pull request #19052 from Veykril/push-yqwutllwwyyp
Veykril Jan 27, 2025
8ed9227
Merge pull request #19049 from ChayimFriedman2/add-reference-ty
Veykril Jan 27, 2025
da33e7c
Merge pull request #19050 from ChayimFriedman2/iter-self
Veykril Jan 27, 2025
cadc468
Merge pull request #19051 from ChayimFriedman2/fn-ptr-unsafe
Veykril Jan 27, 2025
3dd95e3
Add FreeBSD as a target OS for TestDir to avoid warnings
vkrivopalov Jan 27, 2025
7268b3d
fix: Properly handle CRLF line endings in the syntax tree view
Giga-Bowser Jan 27, 2025
165f276
Merge pull request #19055 from vkrivopalov/fix-testdir-unused-variabl…
ChayimFriedman2 Jan 27, 2025
a9cd21f
Show status bar in RA output
darichey Jan 27, 2025
a4e6556
Back out "Remove `has_default` from `FieldId`"
davidbarsky Jan 27, 2025
ff2656d
Back out "Fix a mistake in condition"
davidbarsky Jan 27, 2025
f22e331
Back out "Add a test for field default value body as defining usage o…
davidbarsky Jan 27, 2025
9c1a7ab
Back out "Implement `HasResolver` and `HasModule` for `FieldId`"
davidbarsky Jan 27, 2025
6f723ee
Back out "Compute diagnostics of a field body iff it has one"
davidbarsky Jan 27, 2025
10089c2
Back out "Merge record lit's ellipsis into pre-existing spread's vari…
davidbarsky Jan 27, 2025
d039b10
Back out "Handle missing fields diagnostics"
davidbarsky Jan 27, 2025
0f9cdeb
Back out "feat: Implement `default-field-values`"
davidbarsky Jan 27, 2025
1eb9f5e
Fix scip inherent impl overflow
darichey Jan 28, 2025
8e68c3f
Disable `Receiver` based autoderef temporarily
Veykril Jan 28, 2025
82efe0f
Merge pull request #19061 from Veykril/push-rwyqqtqmnput
Veykril Jan 28, 2025
0a2221d
Fix scip `crate` symbol name
darichey Jan 28, 2025
f70ac25
Merge pull request #19057 from darichey/status-bar-in-output
Veykril Jan 28, 2025
8ecb754
Merge pull request #19056 from Giga-Bowser/fix-syntax-tree-crlf
Veykril Jan 28, 2025
d417284
Fix scip symbols for implicit modules
darichey Jan 28, 2025
a355626
Merge pull request #19015 from Wilfred/mdbook
Veykril Jan 28, 2025
f10b622
feat: Implement `default-field-values` only in parser
ShoyuVanilla Jan 28, 2025
19afce0
Update lsif_contains_generated_constant
darichey Jan 28, 2025
2386e95
Merge pull request #19063 from davidbarsky/davidbarsky/backout-struct…
davidbarsky Jan 28, 2025
db07adf
try to infer array type from slice pattern
alibektas Jan 28, 2025
fc6c6b4
add test, bless tests
alibektas Jan 28, 2025
14ab466
Equip infer_pat_* with declaration origin
alibektas Jan 28, 2025
437921f
call infer_pats from infer::expr with context
alibektas Jan 28, 2025
22b8339
Update TentHash to version 1.0
cessen Jan 29, 2025
ce8bace
Merge pull request #19067 from cessen/update_tenthash
lnicola Jan 29, 2025
0d9355e
Remove mutable syntax tree shenanigans from adjustment hints
Veykril Jan 29, 2025
9c30fec
Merge pull request #19070 from Veykril/push-wpqzmznymtrn
Veykril Jan 29, 2025
0cf275b
Fix #19071: ensure `completion_item_hash` serializes items uniquely
cessen Jan 29, 2025
6151865
Fix typo
cessen Jan 29, 2025
7ffccb0
Use `to_ne_bytes` instead of `to_le_bytes`
cessen Jan 29, 2025
da96fff
Merge pull request #19072 from cessen/concat_uniquely
lnicola Jan 30, 2025
e70b589
Stop running some release workflows on forks and update old URLs
lnicola Feb 1, 2025
bec452f
Merge pull request #19078 from lnicola/no-ci-forks
lnicola Feb 1, 2025
acb9544
More rustfmt hang investigations
Veykril Feb 2, 2025
3288929
Merge pull request #19080 from Veykril/push-wlqsvqsksupr
Veykril Feb 2, 2025
4d9be70
Split cache priming into distinct phases
Veykril Feb 3, 2025
3c83458
Merge pull request #19062 from darichey/scip-fix-module-names
Veykril Feb 3, 2025
806ec88
Revert tests::patterns::infer_pattern
alibektas Jan 28, 2025
5acbff8
Do not use make use of `InferenceResult::has_errors` flag for mir bui…
Veykril Feb 3, 2025
9c981b7
Merge pull request #19085 from Veykril/push-sknwykqmlott
Veykril Feb 3, 2025
a118b18
Fix some mir eval/lowerings
Veykril Feb 3, 2025
08d4b03
Merge pull request #19086 from Veykril/push-ponvylutpnww
Veykril Feb 3, 2025
93b72ce
Merge pull request #19066 from alibektas/slice_pattern_type_inference
Veykril Feb 3, 2025
a373fb2
Expose symbol of `CrateName`
Veykril Feb 3, 2025
1ba7a38
Merge pull request #19084 from Veykril/push-muworpzpzqup
Veykril Feb 4, 2025
1ce2d7e
Prevent panics from tearing down worker threads
Veykril Feb 4, 2025
21ddcbb
Merge pull request #19093 from Veykril/push-lrvoookylnxp
Veykril Feb 4, 2025
9bf4fe4
line-index: don't try to use neon on big-endian aarch64.
he32 Feb 4, 2025
96f96a4
Merge pull request #19083 from he32/fix-arm64-be
lnicola Feb 4, 2025
5467091
Fix IDE resolution of `use` inside a body
ChayimFriedman2 Feb 4, 2025
9d81503
Fix a failing test
ChayimFriedman2 Feb 4, 2025
578ae16
Add a FIXME for feature(adt_const_params)
ChayimFriedman2 Feb 4, 2025
d958719
Merge pull request #19095 from ChayimFriedman2/fixme-adt_const_params
ChayimFriedman2 Feb 4, 2025
4b1d83d
Merge pull request #19094 from ChayimFriedman2/use-body
lnicola Feb 5, 2025
f57caa1
Bump proc-macro2 in xtask
Veykril Feb 5, 2025
9c0af74
Merge pull request #19097 from Veykril/push-xmkmkwplqnlr
Veykril Feb 5, 2025
a7e9739
Merge pull request #18912 from vishruth-thimmaiah/fix_named_struct_as…
Veykril Feb 5, 2025
9bcb2b0
Use interior mutability for loaded `ProcMacrorv::expanders`
Veykril Feb 5, 2025
d18dd4d
Merge pull request #19099 from Veykril/push-qxylslwltsqy
Veykril Feb 5, 2025
98b16ea
closure parameter inlay hints
jnyfah Feb 6, 2025
57b2415
collapsing if statement
jnyfah Feb 6, 2025
e8955a8
fix: Don't emit empty scip occurrence for builtins
darichey Feb 6, 2025
bacc9df
fix: Resolve projection types before checking casts
ShoyuVanilla Feb 7, 2025
b27a0f4
Merge pull request #19105 from darichey/fix-scip-builtin-occurrences
Veykril Feb 7, 2025
cde8d92
Merge pull request #19106 from ShoyuVanilla/issue-18682
Veykril Feb 7, 2025
d3b80e1
minor changes
jnyfah Feb 7, 2025
8151886
Merge pull request #19104 from jnyfah/some-branch
Veykril Feb 7, 2025
2c22ae3
Update PRIVACY.md
BenjaminBrienen Feb 7, 2025
e7d5d30
Update README.md links for mdbook manual
Wilfred Feb 7, 2025
b6fd709
Organise chapters in mdbook sidebar
Wilfred Feb 7, 2025
236000b
Merge pull request #19114 from Wilfred/update_readme_for_mdbook
lnicola Feb 8, 2025
cac45e1
Merge pull request #19115 from Wilfred/sidebar_structure
lnicola Feb 8, 2025
4ac07f2
Merge pull request #19113 from BenjaminBrienen/patch-1
lnicola Feb 8, 2025
82162a7
doc: error url
ahaoboy Feb 9, 2025
d4f7c76
Merge pull request #19120 from ahaoboy/patch-1
ChayimFriedman2 Feb 9, 2025
879dc38
Preparing for merge from rust-lang/rust
lnicola Feb 10, 2025
15cd1f0
Merge from rust-lang/rust
lnicola Feb 10, 2025
24d7a14
Bump rustc crates
lnicola Feb 10, 2025
8fd713b
Merge pull request #19126 from lnicola/sync-from-rust
lnicola Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ f247090558c9ba3c551566eae5882b7ca865225f
b2f6fd4f961fc7e4fbfdb80cae2e6065f8436f15
c48062fe2ab9a2d913d1985a6b0aec4bf936bfc1
f532576ac53ddcc666bc8d59e0b6437065e2f599
4704881b641884de50645637108b6b6f5b68aaf9
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/.github/workflows/autopublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
publish:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
publish-libs:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 7 additions & 4 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:

jobs:
dist:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -138,6 +139,7 @@ jobs:
path: ./dist

dist-x86_64-unknown-linux-musl:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: dist (x86_64-unknown-linux-musl)
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -183,6 +185,7 @@ jobs:
path: ./dist

publish:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
needs: ["dist", "dist-x86_64-unknown-linux-musl"]
Expand Down Expand Up @@ -257,24 +260,24 @@ jobs:
working-directory: ./editors/code

- name: Publish Extension (Code Marketplace, release)
if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
# token from https://dev.azure.com/rust-analyzer/
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix

- name: Publish Extension (OpenVSX, release)
if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
timeout-minutes: 2

- name: Publish Extension (Code Marketplace, nightly)
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release

- name: Publish Extension (OpenVSX, nightly)
if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
working-directory: ./editors/code
run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
timeout-minutes: 2
7 changes: 4 additions & 3 deletions src/tools/rust-analyzer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ target/
*.log
*.iml
.vscode/settings.json
generated_assists.adoc
generated_features.adoc
generated_diagnostic.adoc
.DS_Store
/out/
/dump.lsif
.envrc
docs/book/book
docs/book/src/assists_generated.md
docs/book/src/diagnostics_generated.md
docs/book/src/features_generated.md
33 changes: 17 additions & 16 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1408,9 +1408,9 @@ dependencies = [

[[package]]
name = "proc-macro2"
version = "1.0.86"
version = "1.0.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
dependencies = [
"unicode-ident",
]
Expand Down Expand Up @@ -1514,9 +1514,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_abi"
version = "0.91.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5246e9e1f450333a990877eabbc36fe0567e7cedd56d5365db319e14079cf2a"
checksum = "2fa4333df7b71217edb44a36702cafd2bcfc9850677bdf78b32c9f2c98e5df40"
dependencies = [
"bitflags 2.7.0",
"ra-ap-rustc_index",
Expand All @@ -1525,19 +1525,19 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_index"
version = "0.91.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59fd8e4f5b34c434ec111efb0e0614954db048b9307d3b2e4cc3c915da9d2160"
checksum = "d200275ff3d952cc11108f4dc6a692473659758623d63f2bdcea6104a7f1cec8"
dependencies = [
"ra-ap-rustc_index_macros",
"smallvec",
]

[[package]]
name = "ra-ap-rustc_index_macros"
version = "0.91.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d34973fe081392bd1edb022e865e9952fcaa093f9cdae183edce64472e5e889"
checksum = "06eb63df8c1ce2dcb07647305bed811c9c5ebd157def01a81c1b9479b8592b3b"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -1546,29 +1546,30 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_lexer"
version = "0.91.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52fa42c582e21b35e8f61a5afe3c63a9c722d995826762eb19b18beeccf5157f"
checksum = "b7a4d402b2f85650e8c1f78e2e2defc241b03948d6e30d9f5254c9b82755cc4d"
dependencies = [
"memchr",
"unicode-properties",
"unicode-xid",
]

[[package]]
name = "ra-ap-rustc_parse_format"
version = "0.91.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "740383328d7033393e5385f4a6073b880d5811b0fc0fd2559e481f905940f2f8"
checksum = "a23a382dbe392beb26360c1a8ce9193155ef74eeac59bcda0fa0a233e047323a"
dependencies = [
"ra-ap-rustc_index",
"ra-ap-rustc_lexer",
]

[[package]]
name = "ra-ap-rustc_pattern_analysis"
version = "0.91.0"
version = "0.94.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c39f544728f32cebffb1a8b92ba3c1f3dcb4144081438d192137ed197d479a9d"
checksum = "d746955d67f315ab79767f1d0bbc17fee4f0970d4a00b9ad76bf09cc7d3cd17e"
dependencies = [
"ra-ap-rustc_index",
"rustc-hash 2.0.0",
Expand Down Expand Up @@ -2001,9 +2002,9 @@ dependencies = [

[[package]]
name = "tenthash"
version = "0.4.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d67f9f3cf70e0852941d7bc3cb884b49b24b8ee956baf91ad0abae31f5ef11fb"
checksum = "2d092d622df8bb64e5de8dc86a3667702d5f1e0fe2f0604c6035540703c8cd1e"

[[package]]
name = "test-fixture"
Expand Down
10 changes: 5 additions & 5 deletions src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", version = "0.0.0" }
edition = { path = "./crates/edition", version = "0.0.0" }

ra-ap-rustc_lexer = { version = "0.91", default-features = false }
ra-ap-rustc_parse_format = { version = "0.91", default-features = false }
ra-ap-rustc_index = { version = "0.91", default-features = false }
ra-ap-rustc_abi = { version = "0.91", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.91", default-features = false }
ra-ap-rustc_lexer = { version = "0.94", default-features = false }
ra-ap-rustc_parse_format = { version = "0.94", default-features = false }
ra-ap-rustc_index = { version = "0.94", default-features = false }
ra-ap-rustc_abi = { version = "0.94", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.94", default-features = false }

# local crates that aren't published to crates.io. These should not have versions.

Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
See the [Privacy](https://rust-analyzer.github.io/manual.html#privacy) section of the user manual.
See the [Privacy](https://rust-analyzer.github.io/book/privacy.html) section of the user manual.
9 changes: 5 additions & 4 deletions src/tools/rust-analyzer/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<img
src="https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/master/assets/logo-wide.svg"
src="https://raw.githubusercontent.com/rust-lang/rust-analyzer/master/assets/logo-wide.svg"
alt="rust-analyzer logo">
</p>

Expand All @@ -9,7 +9,7 @@ It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust

## Quick Start

https://rust-analyzer.github.io/manual.html#installation
https://rust-analyzer.github.io/book/installation.html

## Documentation

Expand All @@ -18,12 +18,13 @@ if you are just curious about how things work under the hood, check the [./docs/
folder.

If you want to **use** rust-analyzer's language server with your editor of
choice, check [the manual](https://rust-analyzer.github.io/manual.html) folder.
choice, check [the manual](https://rust-analyzer.github.io/book/).
It also contains some tips & tricks to help you be more productive when using rust-analyzer.

## Security and Privacy

See the corresponding sections of [the manual](https://rust-analyzer.github.io/manual.html#security).
See the [security](https://rust-analyzer.github.io/book/security.html) and
[privacy](https://rust-analyzer.github.io/book/privacy.html) sections of the manual.

## Communication

Expand Down
10 changes: 5 additions & 5 deletions src/tools/rust-analyzer/crates/base-db/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ impl fmt::Display for CrateName {
}

impl ops::Deref for CrateName {
type Target = str;
fn deref(&self) -> &str {
self.0.as_str()
type Target = Symbol;
fn deref(&self) -> &Symbol {
&self.0
}
}

Expand Down Expand Up @@ -230,8 +230,8 @@ impl fmt::Display for CrateDisplayName {
}

impl ops::Deref for CrateDisplayName {
type Target = str;
fn deref(&self) -> &str {
type Target = Symbol;
fn deref(&self) -> &Symbol {
&self.crate_name
}
}
Expand Down
14 changes: 13 additions & 1 deletion src/tools/rust-analyzer/crates/hir-def/src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ impl FunctionData {
.map(Box::new);
let rustc_allow_incoherent_impl = attrs.by_key(&sym::rustc_allow_incoherent_impl).exists();
if flags.contains(FnFlags::HAS_UNSAFE_KW)
&& !crate_graph[krate].edition.at_least_2024()
&& attrs.by_key(&sym::rustc_deprecated_safe_2024).exists()
{
flags.remove(FnFlags::HAS_UNSAFE_KW);
flags.insert(FnFlags::DEPRECATED_SAFE_2024);
}

if attrs.by_key(&sym::target_feature).exists() {
flags.insert(FnFlags::HAS_TARGET_FEATURE);
}

Arc::new(FunctionData {
Expand Down Expand Up @@ -148,13 +152,21 @@ impl FunctionData {
self.flags.contains(FnFlags::HAS_UNSAFE_KW)
}

pub fn is_deprecated_safe_2024(&self) -> bool {
self.flags.contains(FnFlags::DEPRECATED_SAFE_2024)
}

pub fn is_safe(&self) -> bool {
self.flags.contains(FnFlags::HAS_SAFE_KW)
}

pub fn is_varargs(&self) -> bool {
self.flags.contains(FnFlags::IS_VARARGS)
}

pub fn has_target_feature(&self) -> bool {
self.flags.contains(FnFlags::HAS_TARGET_FEATURE)
}
}

fn parse_rustc_legacy_const_generics(tt: &crate::tt::TopSubtree) -> Box<[u32]> {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/hir-def/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use triomphe::Arc;

use crate::{
attr::{Attrs, AttrsWithOwner},
body::{scope::ExprScopes, Body, BodySourceMap},
data::{
adt::{EnumData, EnumVariantData, StructData, VariantData},
ConstData, ExternCrateDeclData, FunctionData, ImplData, Macro2Data, MacroRulesData,
ProcMacroData, StaticData, TraitAliasData, TraitData, TypeAliasData,
},
expr_store::{scope::ExprScopes, Body, BodySourceMap},
generics::GenericParams,
import_map::ImportMap,
item_tree::{AttrOwner, ItemTree, ItemTreeSourceMaps},
Expand Down
Loading
Loading