summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
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
2023-11-14Depend on rustc_driverLaurențiu Nicola-0/+4
2023-11-13Add missing rustc_private featuresLaurențiu Nicola-1/+8
2023-11-08Merge commit '3b7c7f97e4a7bb253a8d398ee4f8346f6cf2817b' into sync-from-raLaurențiu Nicola-2056/+14887
2023-11-04Remove support for compiler plugins.Nicholas Nethercote-18/+0
They've been deprecated for four years. This commit includes the following changes. - It eliminates the `rustc_plugin_impl` crate. - It changes the language used for lints in `compiler/rustc_driver_impl/src/lib.rs` and `compiler/rustc_lint/src/context.rs`. External lints are now called "loaded" lints, rather than "plugins" to avoid confusion with the old plugins. This only has a tiny effect on the output of `-W help`. - E0457 and E0498 are no longer used. - E0463 is narrowed, now only relating to unfound crates, not plugins. - The `plugin` feature was moved from "active" to "removed". - It removes the entire plugins chapter from the unstable book. - It removes quite a few tests, mostly all of those in `tests/ui-fulldeps/plugin/`. Closes #29597.
2023-10-22use visibility to check unused imports and delete some stmtsbohan-3/+1
2023-09-18Merge commit '258b15c506a2d3ad862fd17ae24eaf272443f477' into sync-from-raLaurențiu Nicola-2740/+5763
2023-09-08Rework no_coverage to coverage(off)Andy Caldwell-6/+6
2023-08-22Rollup merge of #115011 - compiler-errors:warn-on-elided-assoc-ct-lt, r=cjgillotMichael Goulet-1/+1
Warn on elided lifetimes in associated constants (`ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT`) Elided lifetimes in associated constants (in impls) erroneously resolve to fresh lifetime parameters on the impl since #97313. This is not correct behavior (see #38831). I originally opened #114716 to fix this, but given the time that has passed, the crater results seem pretty bad: https://github.com/rust-lang/rust/pull/114716#issuecomment-1682091952 This PR alternatively implements a lint against this behavior, and I'm hoping to bump this to deny in a few versions.
2023-08-21Fix elided lifetimes in rust-lang/rustMichael Goulet-1/+1
2023-08-21Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-raLaurențiu Nicola-1448/+3862
2023-08-20fix RA buildRalf Jung-1/+1
2023-08-20give some unwind-related terminators a more clear nameRalf Jung-5/+5
2023-08-15update Cargo.lockdirreke-4/+4