about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-09-20Rollup merge of #130567 - jieyouxu:tool-docs-compiletest, r=KobzolMatthias Krüger-6/+6
Register tool docs for compiletest This PR registers tool docs for `src/tools/compiletest`, meaning that ``` $ ./x doc src/tools/compiletest ``` or ``` $ ./x doc compiletest ``` will now generate docs, like for `run-make-support`. Fixes #130564.
2024-09-19Merge commit 'b23b69900eab1260be510b2bd8922f4b6de6cf1e' into sync-from-rustfmtYacin Tmimi-1556/+4708
2024-09-19bless issue-56762.rs as huge-static.rsJubilee Young-1/+0
2024-09-19Add tidy check for rustdoc templates to ensure the whitespace characters are ↵Guillaume Gomez-0/+60
all stripped
2024-09-19When checking for forbidden expr kind matches, account for rawnessChayim Refael Friedman-1/+25
An expression starting with `r#const` etc. should be accepted even in edition <=2021.
2024-09-19feat: Highlight exit points of async blocksChristopher Serr-71/+93
Async blocks act similar to async functions in that the await keywords are related, but also act like functions where the exit points are related.
2024-09-19Handle lint attributes that are under `#[cfg_attr]`Chayim Refael Friedman-16/+120
2024-09-19Support the `${concat(...)}` metavariable expressionChayim Refael Friedman-5/+304
I didn't follow rustc precisely, because I think it does some things wrongly (or they are FIXME), but I only allowed more code, not less. So we're all fine.
2024-09-19Fix compiletest doc comments许杰友 Jieyou Xu (Joe)-6/+6
2024-09-19Break up compiletest runtest.rs into smaller helper modules许杰友 Jieyou Xu (Joe)-2041/+2156
Previously compiletest's `runtest.rs` was a massive 4700 lines file that made reading and navigation very awkward. This commit intentionally does not neatly reorganize where all the methods on `TestCx` goes, that is intended for a follow-up PR.
2024-09-19Auto merge of #18146 - ChayimFriedman2:allow-comment, r=Veykrilbors-6/+24
fix: Remove check that text of `parse_expr_from_str()` matches the produced parsed tree This check is incorrect when we have comments and whitespace in the text. We can strip comments, but then we still have whitespace, which we cannot strip without changing meaning for the parser. So instead I opt to remove the check, and wrap the expression in parentheses (asserting what produced is a parenthesized expression) to strengthen verification. Fixes #18144.
2024-09-19Categorise paths in `clippy_utils::paths`GnomedDev-13/+20
2024-09-19[Clippy] Swap `open_options` to use diagnostic items instead of pathsGnomedDev-13/+12
2024-09-19[Clippy] Swap `iter_over_hash_type` to use diagnostic items instead of pathsGnomedDev-32/+14
2024-09-19[Clippy] Swap `non_octal_unix_permissions` to use diagnostic item instead of ↵GnomedDev-4/+1
path
2024-09-19[Clippy] Swap `unnecessary_owned_empty_strings` to use diagnostic item ↵GnomedDev-3/+1
instead of path
2024-09-19[Clippy] Swap `manual_strip` to use diagnostic items instead of pathsGnomedDev-8/+5
2024-09-19[Clippy] Swap `unnecessary_to_owned` to use diagnostic item instead of pathGnomedDev-3/+2
2024-09-19[Clippy] Swap `instant_subtraction` to use diagnostic item instead of pathGnomedDev-2/+1
2024-09-19[Clippy] Swap `waker_clone_wake` to use diagnostic item instead of pathGnomedDev-3/+2
2024-09-19[Clippy] Swap `filter_map_bool_then` to use diagnostic item instead of pathGnomedDev-4/+2
2024-09-19[Clippy] Swap `manual_while_let_some` to use diagnostic items instead of pathsGnomedDev-11/+7
2024-09-19[Clippy] Swap `repeat_vec_with_capacity` to use diagnostic item instead of pathGnomedDev-7/+6
2024-09-19[Clippy] Swap `VecArgs::hir` to use diagnostic items instead of pathsGnomedDev-8/+5
2024-09-19[Clippy] Swap `single_char_add_str`/`format_push_string` to use diagnostic ↵GnomedDev-7/+5
items instead of paths
2024-09-19[Clippy] Swap `manual_main_separator_str` to use diagnostic item instead of pathGnomedDev-3/+2
2024-09-19[Clippy] Swap `redundant_clone` to use diagnostic items instead of pathsGnomedDev-5/+3
2024-09-19[Clippy] Swap `float_equality_without_abs` to use diagnostic items instead ↵GnomedDev-5/+3
of paths
2024-09-19[Clippy] Swap `option_as_ref_deref` to use diagnostic items instead of pathsGnomedDev-19/+12
2024-09-19Remove check that text of `parse_expr_from_str()` matches the produced ↵Chayim Refael Friedman-6/+24
parsed tree This check is incorrect when we have comments and whitespace in the text. We can strip comments, but then we still have whitespace, which we cannot strip without changing meaning for the parser. So instead I opt to remove the check, and wrap the expression in parentheses (asserting what produced is a parenthesized expression) to strengthen verification.
2024-09-19Make the intention of the miri test more clearAdwin White-4/+5
2024-09-19[Clippy] Swap `lines_filter_map_ok` to use a diagnostic item instead of pathGnomedDev-3/+2
2024-09-19[Clippy] Swap `map_entry` to use diagnostic items instead of pathsGnomedDev-10/+6
2024-09-19Adapt test to new layoutAdwin White-2/+2
2024-09-18Auto merge of #18131 - ChayimFriedman2:macro-expand-dollar-crate, r=Veykrilbors-64/+396
fix: Get rid of `$crate` in expansions shown to the user Be it "Expand Macro Recursively", "Inline macro" or few other things. We replace it with the crate name, as should've always been. Probably fixes some issues, but I don't know what they are.
2024-09-18Auto merge of #18139 - ShoyuVanilla:issue-18109, r=Veykrilbors-4/+81
fix: Extend `type_variable_table` when modifying index is larger than the table size Fixes #18109 Whenever we create an inference variable in r-a, we extend `type_variable_table` to matching size here; https://github.com/rust-lang/rust-analyzer/blob/f4aca78c92e03354327c8f6c7fefaef9f45ab166/crates/hir-ty/src/infer/unify.rs#L378-L381 But sometimes, an inference variable is [created from chalk](https://github.com/rust-lang/chalk/blob/ab710e0c9b455403b138ef72a2fb90967a58eff3/chalk-solve/src/infer/unify.rs#L743) and passed to r-a as a type of an expression or a pattern. If r-a set diverging flag to this before the table is extended to a sufficient size, it panics here; https://github.com/rust-lang/rust-analyzer/blob/f4aca78c92e03354327c8f6c7fefaef9f45ab166/crates/hir-ty/src/infer/unify.rs#L275-L277 I think that extending table when setting diverging flag is reasonable becase we are already doing such extending to a size that covers the inference vars created from chalk and this change only covers the order-dependent random cases that this might fail
2024-09-18[Clippy] Swap `manual_retain` to use diagnostic items instead of pathsGnomedDev-26/+17
2024-09-18Get rid of `$crate` in expansions shown to the userChayim Refael Friedman-64/+396
Be it "Expand Macro Recursively", "Inline macro" or few other things. We replace it with the crate name, as should've always been.
2024-09-19fix: Extend `type_variable_table` when modifying index is larger than table sizeShoyu Vanilla-4/+81
2024-09-18Extract logic to decide how to complete semicolon for unit-returning ↵Chayim Refael Friedman-39/+73
function into `CompletionContext` So that we don't recompute it for every item.
2024-09-18Don't complete `;` when in closure return expressionChayim Refael Friedman-24/+58
Completing it will break syntax.
2024-09-18Auto merge of #18117 - ChayimFriedman2:issue-18089, r=Veykrilbors-48/+166
fix: Always cache macro expansions' root node in Semantics Previously some expansions were not cached, but were cached in the expansion cache, which caused panics when later queries tried to lookup the node from the expansion cache. Fixes #18089.
2024-09-18Auto merge of #18128 - ChayimFriedman2:external-macros-lint, r=Veykrilbors-1/+62
fix: Handle errors and lints from external macros Some lints should not be reported if they originate from an external macro, and quickfixes should be disabled (or they'll change library code). Fixes #18122. Closes #18124.
2024-09-18Auto merge of #18136 - valadaptive:no-mangle-lints, r=Veykrilbors-6/+73
Don't lint names of #[no_mangle] extern fns [Rust doesn't run the `non_snake_case_name` lint on `extern fn`s with the `#[no_mangle]` attribute](https://github.com/rust-lang/rust/pull/44966). The conditions are: - The function must be `extern` and have a `#[no_mangle]` attribute. - The function's ABI must not be explicitly set to "Rust". This PR replicates that logic here.
2024-09-18Auto merge of #18135 - ChayimFriedman2:unsafe-op-in-unsafe-fn, r=Veykrilbors-10/+55
feat: Add diagnostics for `unsafe_op_in_unsafe_fn` Turns out it's pretty easy, but I did have to add support for allowed-by-default lints.
2024-09-18Auto merge of #18137 - ShoyuVanilla:expr-2021, r=Veykrilbors-21/+192
feat: Implement `expr_2021` Resolves #18062
2024-09-18feat: Implement `expr_2021`Shoyu Vanilla-21/+192
2024-09-18Don't lint names of #[no_mangle] extern fnsvaladaptive-6/+73
2024-09-18Add diagnostics for `unsafe_op_in_unsafe_fn`Chayim Refael Friedman-10/+55
Turns out it's pretty easy, but I did have to add support for allowed-by-default lints.
2024-09-17Use `SyntaxEditor` in `extract_type_alias`DropDemBits-13/+15