about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-10-21fix: classify `safe` as a contextual kwroife-11/+11
2024-10-20Store patterns desugared from destructuring assignments in source mapChayim Refael Friedman-174/+280
And few more fixups. I was worried this will lead to more memory usage since `ExprOrPatId` is double the size of `ExprId`, but this does not regress `analysis-stats .`. If this turns out to be a problem, we can easily use the high bit to encode this information.
2024-10-20Handle destructuring assignments uniformlyChayim Refael Friedman-707/+886
Instead of lowering them to `<expr> = <expr>`, then hacking on-demand to resolve them, we lower them to `<pat> = <expr>`, and use the pattern infrastructure to handle them. It turns out, destructuring assignments are surprisingly similar to pattern bindings, and so only minor modifications are needed. This fixes few bugs that arose because of the non-uniform handling (for example, MIR lowering not handling slice and record patterns, and closure capture calculation not handling destructuring assignments at all), and furthermore, guarantees we won't have such bugs in the future, since the programmer will always have to explicitly handle `Expr::Assignment`. Tests don't pass yet; that's because the generated patterns do not exist in the source map. The next commit will fix that.
2024-10-20Remove now-incorrect codeChayim Refael Friedman-8/+0
Because our lint infra *can* handle allows from within macro expansions! (Also, what did this reason have to do with something that is a hard error and not a lint? I'm puzzled). I wonder how many such diagnostics we have... Maybe that also mean we can change `unused_mut` to no-longer-experimental? But this is a change I'm afraid to do without checking.
2024-10-20Update Cargo.lockChayim Refael Friedman-5/+5
2024-10-20Rollup merge of #131961 - jieyouxu:dirty, r=ZalatharMatthias Krüger-9/+7
compiletest: tidy up how `tidy` and `tidy` (html version) are disambiguated Rename `has_tidy` -> `has_html_tidy` (`tidy` is also a bootstrap tool, but rustdoc uses a html tidy that has the same binary name). Follow-up to #131941. Also apparently `runtest.rs` is short enough now, we can delete the `tidy` (bootstrap version) ignore for file length.
2024-10-20Rollup merge of #131647 - jieyouxu:unicode-table-generator, r=Mark-SimulacrumMatthias Krüger-5/+3
Register `src/tools/unicode-table-generator` as a runnable tool It seems like `src/tools/unicode-table-generator` is not currently managed by bootstrap. This PR wires it up with bootstrap as a runnable tool. This tool seems to take two possible args: 1. (Mandatory) path to `library/core/src/unicode/unicode_data.rs`, and 2. (Optional) path to generate a test file. I only passed the mandatory path to `unicode_data.rs` in bootstrap and didn't do anything about (2). I'm not sure about how this tool is supposed to be run. `Cargo.lock` is modified because I renamed `unicode-table-generator`'s bin name to match the tool name, as bootstrap's tool running logic expects the bin name to be derived from the tool name. I also added a triagebot message to remind to not manually edit the library source file and edit the tool then regenerate instead, but this should probably be a tidy check (if that's desirable then that can be in a follow-up PR, though may be overkill). Helps with #131640 but does not close it because still no docs. r? `@Mark-Simulacrum` (since I think you authored this tool?)
2024-10-20Rollup merge of #121560 - Noratrieb:stop-lint-macro-nonsense, r=jieyouxuMatthias Krüger-1/+0
Allow `#[deny]` inside `#[forbid]` as a no-op Forbid cannot be overriden. When someome tries to do this anyways, it results in a hard error. That makes sense. Except it doesn't, because macros. Macros may reasonably use `#[deny]` (or `#[warn]` for an allow-by-default lint) in their expansion to assert that their expanded code follows the lint. This is doesn't work when the output gets expanded into a `forbid()` context. This is pretty silly, since both the macros and the code agree on the lint! By making it a warning instead, we remove the problem with the macro, which is now nothing as warnings are suppressed in macro expanded code, while still telling users that something is up. fixes #121483
2024-10-20Rip out old effects var handling code from traitsMichael Goulet-23/+1
2024-10-20make unsupported_calling_conventions a hard errorRalf Jung-14/+14
2024-10-20fix: do not emit unsafe diagnositcs for safe statics in extern blocksroife-3/+62
2024-10-20feat: initial support for safe_kw in extern blocksroife-9/+264
2024-10-20Update rustc-hash to version 2Noratrieb-2/+2
This brings in the new algorithm.
2024-10-20compiletest: disambiguate between `tidy` and `tidy` (html version)许杰友 Jieyou Xu (Joe)-9/+7
2024-10-20fmtThe Miri Cronjob Bot-2/+7
2024-10-20Merge from rustcThe Miri Cronjob Bot-2999/+6458
2024-10-20Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-10-20Rollup merge of #131942 - workingjubilee:reduce-haruspicy, r=lukas-code,lnicolaStuart Cook-5/+4
compiler: Adopt rust-analyzer impls for `LayoutCalculatorError` We're about to massively churn the internals of `rustc_abi`. To minimize the immediate and future impact on rust-analyzer, as a subtree that depends on this crate, grow some API on `LayoutCalculatorError` that reflects their uses of it. This way we can nest the type in theirs, and they can just call functions on it without having to inspect and flatten-out its innards.
2024-10-20Rollup merge of #131941 - lolbinarycat:compiletest-need-html-tidy, r=clubby789Stuart Cook-1/+1
compiletest: disambiguate html-tidy from rust tidy tool when i first saw this error message i was very confused, i thought it was talking about `src/tools/tidy`. now it should be much more clear what tool should be installed.
2024-10-19Rollup merge of #131925 - clubby789:redundant-revision-cfg, r=jieyouxuMatthias Krüger-1/+13
Warn on redundant `--cfg` directive when revisions are used r? ``@jieyouxu`` Fixes #131390 Not sure of the best way to test this
2024-10-19compiletest: disambiguate html-tidy from rust tidy toolbinarycat-1/+1
2024-10-19rust-analyzer: Nest `LayoutCalculatorError` in `hir_ty::LayoutError`Jubilee Young-5/+4
2024-10-19Fix testsMichael Goulet-32/+27
2024-10-19Combine entry points for wrapping/unwrapping return typesGiga Bowser-426/+592
2024-10-19Apply review comments + use `shallow_lint_levels_on`blyxyas-2/+2
2024-10-19Remove module passes filteringblyxyas-36/+22
2024-10-19Follow review comments (optimize the filtering)blyxyas-29/+97
2024-10-19Do not run lints that cannot emitblyxyas-5/+14
Before this change, adding a lint was a difficult matter because it always had some overhead involved. This was because all lints would run, no matter their default level, or if the user had #![allow]ed them. This PR changes that
2024-10-19Emit error on `skip-filecheck` test containing filecheck directivesclubby789-0/+3
2024-10-19Warn on redundant `--cfg` directive when revisions are usedclubby789-1/+13
2024-10-19interpret errors: add map_err_kind, rename InterpError -> InterpErrorKindRalf Jung-16/+15
2024-10-19Auto merge of #18336 - xuwaters:patch-1, r=lnicolabors-1/+1
Fix: Increase TOKEN_LIMIT in hir-expand Due to the `TOKEN_LIMIT`, rust-analyzer failed to expand macro for `web-sys::WebGl2RenderingContext` https://github.com/rustwasm/wasm-bindgen/blob/main/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs <img width="780" alt="image" src="https://github.com/user-attachments/assets/3a39f18e-656e-43df-9994-0a0179fa42ac"> <img width="403" alt="image" src="https://github.com/user-attachments/assets/7ae8dcf9-a40a-4070-8623-dd3a953bbf45"> After increasing the `TOKEN_LIMIT`, the `web-sys::WebGl2RenderingContext` can be expanded successfully: <img width="459" alt="image" src="https://github.com/user-attachments/assets/76a71763-05a5-4f14-a5c9-61fc190c668f">
2024-10-19Auto merge of #18335 - SomeoneToIgnore:editorconfig-glob, r=lnicolabors-1/+1
internal: Fix editorconfig glob Had been testing Zed's editorconfig branch on r-a and noticed that something was odd with yaml files. https://spec.editorconfig.org/#glob-expressions > {s1,s2,s3} > any of the strings given (separated by commas, can be nested) (But {s1} only matches {s1} literally.)
2024-10-19Auto merge of #131910 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 7 commits in 8c30ce53688e25f7e9d860b33cc914fb2957ca9a..cf53cc54bb593b5ec3dc2be4b1702f50c36d24d5 2024-10-15 16:43:16 +0000 to 2024-10-18 13:56:15 +0000 - feat: Stabilize MSRV-aware resolver config (rust-lang/cargo#14639) - Help with `[patch.crates.io]` (rust-lang/cargo#14700) - test: Migrate publish snapshotting to snapbox (rust-lang/cargo#14642) - Bump to 0.85.0; update changelog (rust-lang/cargo#14695) - Fix typo in faq.md (rust-lang/cargo#14696) - fix(registry): `HttpRegistry` `block_until_ready` returns early when work is still pending (rust-lang/cargo#14694) - fix(resolver): avoid cloning when iterating using RcVecIter (rust-lang/cargo#14690)
2024-10-18Increase TOKEN_LIMIT for hir-expandWei Xu-1/+1
2024-10-19Fix editorconfig globKirill Bulatov-1/+1
2024-10-18Update cargoWeihang Lo-0/+0
2024-10-18style: fix typosDavid Kurilla-3/+3
2024-10-18docs: create setup documentationDavid Kurilla-0/+63
2024-10-18Auto merge of #131892 - flip1995:clippy-subtree-update, r=Manishearthbors-1744/+4025
Clippy subtree update One day late with the sync, as I was sick yesterday. Cargo.lock update includes Clippy version bump and some deps cleanup we did in Clippy to match more versions used in the Rust repo. r? `@Manishearth`
2024-10-18Allow `#[deny(..)]` inside `#[forbid(..)]` as a no-op with a warningNoratrieb-1/+0
Forbid cannot be overriden. When someome tries to do this anyways, it results in a hard error. That makes sense. Except it doesn't, because macros. Macros may reasonably use `#[deny]` in their expansion to assert that their expanded code follows the lint. This is doesn't work when the output gets expanded into a `forbid()` context. This is pretty silly, since both the macros and the code agree on the lint! Therefore, we allow `#[deny(..)]`ing a lint that's already forbidden, keeping the level at forbid.
2024-10-18tail_calls: add test ensuring local vars are indeed goneRalf Jung-0/+46
2024-10-18Rollup merge of #131870 - Zalathar:test-collector, r=jieyouxu许杰友 Jieyou Xu (Joe)-104/+98
compiletest: Store test collection context/state in two structs This is another incremental cleanup that untangles some of the parameter passing during test collection, making it easier to see which pieces of context information are read-only, and making it easier to find where each field is used.
2024-10-18Clamp Position::character to line lengthJohannes Altmanninger-3/+11
LSP says about Position::character > If the character value is greater than the line length it defaults back to the line length. but from_proto::offset() doesn't implement this. A client might for example request code actions for a whole line by sending Position::character=99999. I don't think there is ever a reason (besides laziness) why the client can't specify the line length instead but I guess we should not crash but follow protocol. Technically it should be a warning, not an error but warning is not shown by default so keep it at error I guess. Fixes #18240
2024-10-18Hotfix TRAIT_METHODS static->constPhilipp Krones-1/+2
2024-10-18vscode: update some dependenciesDavid Barsky-138/+1401
2024-10-18pthread-threadname: ensure we can see the name set via the Rust APIRalf Jung-0/+17
2024-10-18Merge commit 'a109190d7060236e655fc75533373fa274ec5343' into ↵Philipp Krones-1745/+4025
clippy-subtree-update
2024-10-18Auto merge of #18320 - davidbarsky:davidbarsky/fix-lldb-dap-calling-rustc, ↵bors-16/+27
r=Veykril internal: fix lldb-dap unconditionally calling rustc Fixes https://github.com/rust-lang/rust-analyzer/issues/18318. I also took the opportunity to refactor how `discoverSourceFileMap` worked—it now returns a type instead of mutating a map in place. I tested this change using the LLDB DAP extension. I needed to set `"lldb-dap.executable-path": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap"` for everything to work, however, but once I did, was able to successfully debug a test.
2024-10-18Auto merge of #18243 - krobelus:clamp-position-character, r=Veykrilbors-1/+32
Clamp Position::character to line length LSP says about Position::character > If the character value is greater than the line length it defaults back to the line length. but from_proto::offset() doesn't implement this. A client might for example request code actions for a whole line by sending Position::character=99999. I don't think there is ever a reason (besides laziness) why the client can't specify the line length instead but I guess we should not crash but follow protocol. Not sure how to update Cargo.lock (lib/README.md doesn't say how). Fixes #18240