about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-03-03Merge commit '4ef6a49b44e8aa380da7522442234bfd7a52c55e' into sync-from-raLaurențiu Nicola-1267/+3264
2024-02-25Avoid using cfg(FALSE)Laurențiu Nicola-2/+1
2024-02-25Add missing importsLaurențiu Nicola-1/+1
2024-02-25Merge commit '4a8d0f7f565b6df45da5522dd7366a4df3460cd7' into sync-from-raLaurențiu Nicola-703/+1828
2024-02-19Remove suspicious auto trait lintSantiago Pastorino-5/+0
2024-02-18Auto merge of #117772 - surechen:for_117448, r=petrochenkovbors-34/+20
Tracking import use types for more accurate redundant import checking fixes #117448 By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-18By tracking import use types to check whether it is scope uses or the other ↵surechen-34/+20
situations like module-relative uses, we can do more accurate redundant import checking. fixes #117448 For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-18Merge commit 'ac998a74b3c8ff4b81c3eeb9a18811d4cc76226d' into sync-from-raLaurențiu Nicola-1959/+7095
2024-02-15Add `ErrorGuaranteed` to `ast::LitKind::Err`, `token::LitKind::Err`.Nicholas Nethercote-4/+4
This mostly works well, and eliminates a couple of delayed bugs. One annoying thing is that we should really also add an `ErrorGuaranteed` to `proc_macro::bridge::LitKind::Err`. But that's difficult because `proc_macro` doesn't have access to `ErrorGuaranteed`, so we have to fake it.
2024-02-12Tweak delayed bug mentions.Nicholas Nethercote-1/+1
Now that we have both `delayed_bug` and `span_delayed_bug`, it makes sense to use the generic term "delayed bug" more.
2024-02-11Merge commit 'ddf105b646c6749a2de2451c9a499a354eec79c2' into sync-from-raLaurențiu Nicola-3027/+14636
2024-02-04Try to fix in-tree buildLaurențiu Nicola-3/+3
2024-02-04Merge commit '0113bc9388b480fa42c632f57f4f0f7af5813ec1' into sync-from-raLaurențiu Nicola-2004/+3103
2024-01-28Merge commit '7219414e81810fd4d967136c4a0650523892c157' into sync-from-raLaurențiu Nicola-2796/+1390
2024-01-25Rename the unescaping functions.Nicholas Nethercote-14/+14
`unescape_literal` becomes `unescape_unicode`, and `unescape_c_string` becomes `unescape_mixed`. Because rfc3349 will mean that C string literals will no longer be the only mixed utf8 literals.
2024-01-25Rework `CStrUnit`.Nicholas Nethercote-5/+4
- Rename it as `MixedUnit`, because it will soon be used in more than just C string literals. - Change the `Byte` variant to `HighByte` and use it only for `\x80`..`\xff` cases. This fixes the old inexactness where ASCII chars could be encoded with either `Byte` or `Char`. - Add useful comments. - Remove `is_ascii`, in favour of `u8::is_ascii`.
2024-01-25Fix copy/paste error.Nicholas Nethercote-2/+2
The `CString` handling code is erroneously identical to the `ByteString` handling code.
2024-01-21Merge commit 'a9116523604c998e7781f60d3b5a6f586e0414a9' into sync-from-raLaurențiu Nicola-4396/+7069
2024-01-21Rollup merge of #120084 - weihanglo:pkgid-spec, r=Mark-SimulacrumNadrieril-2/+14
fix(rust-analyzer): use new pkgid spec to compare Starting from rust-lang/cargo#13311, Cargo's compiler artifact message uses Package ID specification as package's identifier format. Zulip topic: https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/proc-macro-test.20bootstrap.20and.20pkgid.20JSON cc `@ehuss`
2024-01-18Rollup merge of #119172 - nnethercote:earlier-NulInCStr, r=petrochenkovMatthias Krüger-0/+4
Detect `NulInCStr` error earlier. By making it an `EscapeError` instead of a `LitError`. This makes it like the other errors produced when checking string literals contents, e.g. for invalid escape sequences or bare CR chars. NOTE: this means these errors are issued earlier, before expansion, which changes behaviour. It will be possible to move the check back to the later point if desired. If that happens, it's likely that all the string literal contents checks will be delayed together. One nice thing about this: the old approach had some code in `report_lit_error` to calculate the span of the nul char from a range. This code used a hardwired `+2` to account for the `c"` at the start of a C string literal, but this should have changed to a `+3` for raw C string literals to account for the `cr"`, which meant that the caret in `cr"` nul error messages was one short of where it should have been. The new approach doesn't need any of this and avoids the off-by-one error. r? ```@fee1-dead```
2024-01-18fix(rust-analyzer): use new pkgid spec to compareWeihang Lo-2/+14
Starting from cargo#13311, Cargo's compiler artifact message uses Package ID specification as package's identifier format.
2024-01-15Merge commit '9d8889cdfcc3aa0302353fc988ed21ff9bc9925c' into sync-from-raLaurențiu Nicola-1024/+1650
2024-01-12Detect `NulInCStr` error earlier.Nicholas Nethercote-0/+4
By making it an `EscapeError` instead of a `LitError`. This makes it like the other errors produced when checking string literals contents, e.g. for invalid escape sequences or bare CR chars. NOTE: this means these errors are issued earlier, before expansion, which changes behaviour. It will be possible to move the check back to the later point if desired. If that happens, it's likely that all the string literal contents checks will be delayed together. One nice thing about this: the old approach had some code in `report_lit_error` to calculate the span of the nul char from a range. This code used a hardwired `+2` to account for the `c"` at the start of a C string literal, but this should have changed to a `+3` for raw C string literals to account for the `cr"`, which meant that the caret in `cr"` nul error messages was one short of where it should have been. The new approach doesn't need any of this and avoids the off-by-one error.
2024-01-08Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-raLaurențiu Nicola-3605/+3088
2024-01-04Set proc-macro-test/sysroot-abi with proc-macro-srv/sysroot-abiLukas Wirth-1/+1
2024-01-04Set sysroot-abi flag for proc-macro-cli when in-rust-tree is setLukas Wirth-1/+1
2024-01-04Add extern crate rustc_driver to proc-macro-srv-cliLukas Wirth-3/+6
2024-01-04Imply sysroot-abi feature when in-rust-tree is setLukas Wirth-1/+1
2024-01-04Set the `in-rust-tree`` feature for all rust-analyzer{-proc-macro-srv} stepsLukas Wirth-4/+11
2024-01-03Allow unexpected_cfgs in proc-macro-test impLaurențiu Nicola-0/+2
2024-01-03Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-ra2Laurențiu Nicola-3073/+6912
2023-12-18Merge commit '21b06c1beb9bb59369ffd652f5d617bcf6952e05' into sync-from-raLaurențiu Nicola-476/+1079
2023-12-17Auto merge of #118830 - GuillaumeGomez:env-tracked_env, r=Nilstriebbors-0/+4
Add support for `--env` on `tracked_env::var` Follow-up of https://github.com/rust-lang/rust/pull/118368. Part of Part of https://github.com/rust-lang/rust/issues/80792. It adds support of the `--env` option for proc-macros through `tracked_env::var`. r? `@Nilstrieb`
2023-12-12Auto merge of #118817 - lnicola:sync-from-ra, r=lnicolabors-6213/+9743
Subtree update of `rust-analyzer` r? `@ghost`
2023-12-12Rollup merge of #118445 - ferrocene:jp-support-reuse-in-submodules, ↵Matthias Krüger-1/+2
r=Mark-Simulacrum Let `reuse` look inside git submodules Changes `collect-license-metadata` and `generate-copyright` so they can now look at the git submodules. Unfortunately `reuse` chokes on the LLVM submodule - it finds the word "Copyright" or the unicode copyright symbol in all kinds of places, including UTF-8 test cases. The `reuse` tool expressly won't let you ignore folders, so we let it scan everything and then strip out the LLVM sub-folder in post. Instead, we add in a hand-curated list of copyright information gleaned by reading the LLVM codebase carefully, which is stored in `.reuse/dep5` in Debian format where `reuse` can find and use it. The `.reuse/dep5` continues to track copyright info for files in the tree that do not have SPDX metadata in them (i.e. all of them)
2023-12-11Auto merge of #118344 - saethlin:rmeta-header-pos, r=WaffleLapkinbors-13/+18
Use a u64 for the rmeta root position Waffle noticed this in https://github.com/rust-lang/rust/pull/117301#discussion_r1405410174 We've upgraded the other file offsets to u64, and this one only costs 4 bytes per file. Also the way the truncation was being done before was extremely easy to miss, I sure missed it! It's not clear to me if not having this change effectively made the other upgrades from u32 to u64 ineffective, but we can have it now. r? `@WaffleLapkin`
2023-12-11Update rust-analyzer to support new `injected_env_var` functionGuillaume Gomez-0/+4
2023-12-11Fix typo in cfgLaurențiu Nicola-1/+1
2023-12-11Merge commit '457b966b171b09a7e57acb710fbca29a4b3526f0' into sync-from-raLaurențiu Nicola-6213/+9743
2023-12-10Apply suggestions from code reviewBen Kimock-7/+7
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2023-12-10remove redundant importssurechen-1/+0
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-05Rollup merge of #118123 - RalfJung:internal-lib-features, r=compiler-errorsMichael Goulet-1/+1
Add support for making lib features internal We have the notion of an "internal" lang feature: a feature that is never intended to be stabilized, and using which can cause ICEs and other issues without that being considered a bug. This extends that idea to lib features as well. It is an alternative to https://github.com/rust-lang/rust/pull/115623: instead of using an attribute to declare lib features internal, we simply do this based on the name. Everything ending in `_internals` or `_internal` is considered internal. Then we rename `core_intrinsics` to `core_intrinsics_internal`, which fixes https://github.com/rust-lang/rust/issues/115597.
2023-12-04Merge commit 'e402c494b7c7d94a37c6d789a216187aaf9ccd3e' into sync-from-raLaurențiu Nicola-170/+821
2023-12-02Rename `LayoutCalculator::delay_bug` as `LayoutCalculator::delayed_bug`.Nicholas Nethercote-1/+1
To match with the previous commits.
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-1/+1
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-28Use a u64 for the rmeta root positionBen Kimock-8/+13
2023-11-27Merge commit '237712fa314237e428e7ef2ab83b979f928a43a1' into sync-from-raLaurențiu Nicola-308/+1150
2023-11-22also make 'core_intrinsics' internalRalf Jung-1/+1
2023-11-22Put copyright on a line by itself.Jonathan Pallant (Ferrous Systems)-1/+2
2023-11-16Merge commit '141fc695dca1df7cfc3c9803972ec19bb178dcbc' into sync-from-raLaurențiu Nicola-970/+2212