about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-04-22Merge pull request #19624 from jackh726/chalk-updateLukas Wirth-173/+166
Update chalk
2025-04-22TB: add missing interior_mutability test fileRalf Jung-0/+177
2025-04-22Merge from rustcThe Miri Cronjob Bot-46/+39
2025-04-22Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-22Auto merge of #139897 - nnethercote:rm-OpenDelim-CloseDelim, r=petrochenkovbors-7/+11
Remove `token::{Open,Close}Delim` By replacing them with `{Open,Close}{Param,Brace,Bracket,Invisible}`. PR #137902 made `ast::TokenKind` more like `lexer::TokenKind` by replacing the compound `BinOp{,Eq}(BinOpToken)` variants with fieldless variants `Plus`, `Minus`, `Star`, etc. This commit does a similar thing with delimiters. It also makes `ast::TokenKind` more similar to `parser::TokenType`. This requires a few new methods: - `TokenKind::is_{,open_,close_}delim()` replace various kinds of pattern matches. - `Delimiter::as_{open,close}_token_kind` are used to convert `Delimiter` values to `TokenKind`. Despite these additions, it's a net reduction in lines of code. This is because e.g. `token::OpenParen` is so much shorter than `token::OpenDelim(Delimiter::Parenthesis)` that many multi-line forms reduce to single line forms. And many places where the number of lines doesn't change are still easier to read, just because the names are shorter, e.g.: ``` - } else if self.token != token::CloseDelim(Delimiter::Brace) { + } else if self.token != token::CloseBrace { ``` r? `@petrochenkov`
2025-04-22Resolve `offset_of!()` in IDEChayim Refael Friedman-3/+169
2025-04-21Auto merge of #140127 - ChrisDenton:rollup-2kye32h, r=ChrisDentonbors-0/+1
Rollup of 11 pull requests Successful merges: - #134213 (Stabilize `naked_functions`) - #139711 (Hermit: Unify `std::env::args` with Unix) - #139795 (Clarify why SGX code specifies linkage/symbol names for certain statics) - #140036 (Advent of `tests/ui` (misc cleanups and improvements) [4/N]) - #140047 (remove a couple clones) - #140052 (Fix error when an intra doc link is trying to resolve an empty associated item) - #140074 (rustdoc-json: Improve test for auto-trait impls) - #140076 (jsondocck: Require command is at start of line) - #140107 (rustc-dev-guide subtree update) - #140111 (cleanup redundant pattern instances) - #140118 ({B,C}Str: minor cleanup) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-21Rollup merge of #140076 - aDotInTheVoid:jsondocline, r=GuillaumeGomezChris Denton-0/+1
jsondocck: Require command is at start of line In one place we use `///``@``` instead of `//``@`.`` The test-runner allowed it, but it probably shouldn't. Ran into by ``@lolbinarycat`` in https://github.com/rust-lang/rust/pull/132748#issuecomment-2816469322: ``` error: unknown disambiguator `?(` ##[error] --> /checkout/tests/rustdoc-json/fns/return_type_alias.rs:3:25 | 3 | ///@ set foo = "$.index[?(``@.name=='Foo')].id"`` | ^^ | ``` Maybe it's also worth erroring on this like we added in #137103 r? ``@GuillaumeGomez``
2025-04-21Rollup merge of #140120 - ChrisDenton:mir-opt-dump-rev, r=jieyouxuChris Denton-14/+3
Use `output_base_dir` for `mir_dump_dir` It just occurred to me that the problem might be due to multiple revisions using the same dump directory (and therefore deleting the other revision's dir). This fixes that by simply using the normal per-test output directory, which is revision safe.
2025-04-21Rollup merge of #140009 - ShE3py:tls-abort, r=thomccChris Denton-2/+2
docs(LocalKey<T>): clarify that T's Drop shouldn't panic Clarify that should a TLS destructor panics, the process will abort. Also, an abort may be obfuscated as the process can be terminated with `SIGSEGV` or [`STATUS_STACK_BUFFER_OVERRUN`](https://devblogs.microsoft.com/oldnewthing/20190108-00/?p=100655) (i.e., `SIGABRT` is not guaranteed), so explicitly prints that the process was aborted. Context: https://users.rust-lang.org/t/status-stack-buffer-overrun-on-windows-without-any-usage-of-unsafe/128417 ``@rustbot`` label -T-compiler
2025-04-21Use output dir for mir_dump_dirChris Denton-14/+3
2025-04-21refactor: Fold hygiene map into bindings themselvesLukas Wirth-34/+38
`HygieneId` fits into `Binding`'s padding.
2025-04-21Merge pull request #19644 from ChayimFriedman2/const-symsLukas Wirth-479/+438
internal: Make predefined symbols `const` instead of `static`
2025-04-21Merge pull request #19604 from WtzLAS/fix-issue-19601Lukas Wirth-1/+1
Add semicolon to use
2025-04-21Merge pull request #19629 from jyn514/unset-envLukas Wirth-91/+114
allow using `null` to unset an environment variable
2025-04-21Merge pull request #19643 from ChayimFriedman2/generic-const-itemsLukas Wirth-3/+305
feat: Parse generic consts
2025-04-21Auto merge of #139727 - rust-lang:cargo_update, r=Mark-Simulacrumbors-16/+16
Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. The following is the output from `cargo update`: ```txt compiler & tools dependencies: Locking 11 packages to latest compatible versions Updating bstr v1.11.3 -> v1.12.0 Updating clap v4.5.35 -> v4.5.36 Updating clap_builder v4.5.35 -> v4.5.36 Updating crossbeam-channel v0.5.14 -> v0.5.15 Updating jiff v0.2.5 -> v0.2.6 Updating jiff-static v0.2.5 -> v0.2.6 Updating jsonpath-rust v1.0.0 -> v1.0.1 Updating linux-raw-sys v0.9.3 -> v0.9.4 Updating miniz_oxide v0.8.7 -> v0.8.8 Updating self_cell v1.1.0 -> v1.2.0 Updating winnow v0.7.4 -> v0.7.6 note: pass `--verbose` to see 38 unchanged dependencies behind latest library dependencies: Locking 1 package to latest compatible version Updating miniz_oxide v0.8.7 -> v0.8.8 note: pass `--verbose` to see 4 unchanged dependencies behind latest rustbook dependencies: Locking 9 packages to latest compatible versions Updating bstr v1.11.3 -> v1.12.0 Updating cc v1.2.18 -> v1.2.19 Updating clap v4.5.35 -> v4.5.36 Updating clap_builder v4.5.35 -> v4.5.36 Updating jiff v0.2.5 -> v0.2.6 Updating jiff-static v0.2.5 -> v0.2.6 Updating linux-raw-sys v0.9.3 -> v0.9.4 Updating miniz_oxide v0.8.7 -> v0.8.8 Updating winnow v0.7.4 -> v0.7.6 ```
2025-04-21Merge pull request #19653 from Veykril/push-lmrprywtztztLukas Wirth-4/+30
feat: parse `super let`
2025-04-21Merge pull request #19651 from roife/enhance-notable-trait-renderLukas Wirth-36/+16
minor: simplify and enhance notable traits rendering
2025-04-21Merge pull request #19634 from Veykril/push-mnpmxxrprymoLukas Wirth-20/+38
feat: Allow unsetting env vars in `server.extraEnv` config
2025-04-21feat: parse `super let`Lukas Wirth-4/+30
2025-04-21minor: simplify and enhance notable traits renderingroifewu-36/+16
2025-04-21feat: Allow unsetting env vars in `server.extraEnv` configLukas Wirth-20/+38
2025-04-21fix: Support unstable `UnsafePinned` struct in type layout calcLukas Wirth-14/+16
2025-04-21fix: Fix completion_snippets_custom config always erroringLukas Wirth-10/+12
2025-04-21Back out "When changing the config, do not emit an error if a field is missing"Lukas Wirth-5/+4
This backs out commit 8497fc321cad420b923e15f600106f8e22324930.
2025-04-21Allow wrapping `builtin#offset_of` fields argument in parenthesesChayim Refael Friedman-0/+61
This is necessary to correctly handle nested fields (`foo.bar`), see the comments in the code for explanation.
2025-04-21Remove unnecessary predefined symbol clonesChayim Refael Friedman-367/+318
Now that they're const it's no longer needed. Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
2025-04-21Get rid of static predefined symbolsChayim Refael Friedman-112/+120
Make them all `const`.
2025-04-21Parse generic constsChayim Refael Friedman-3/+305
A lang team experiment, https://github.com/rust-lang/rust/issues/113521.
2025-04-21Remove `token::{Open,Close}Delim`.Nicholas Nethercote-7/+11
By replacing them with `{Open,Close}{Param,Brace,Bracket,Invisible}`. PR #137902 made `ast::TokenKind` more like `lexer::TokenKind` by replacing the compound `BinOp{,Eq}(BinOpToken)` variants with fieldless variants `Plus`, `Minus`, `Star`, etc. This commit does a similar thing with delimiters. It also makes `ast::TokenKind` more similar to `parser::TokenType`. This requires a few new methods: - `TokenKind::is_{,open_,close_}delim()` replace various kinds of pattern matches. - `Delimiter::as_{open,close}_token_kind` are used to convert `Delimiter` values to `TokenKind`. Despite these additions, it's a net reduction in lines of code. This is because e.g. `token::OpenParen` is so much shorter than `token::OpenDelim(Delimiter::Parenthesis)` that many multi-line forms reduce to single line forms. And many places where the number of lines doesn't change are still easier to read, just because the names are shorter, e.g.: ``` - } else if self.token != token::CloseDelim(Delimiter::Brace) { + } else if self.token != token::CloseBrace { ```
2025-04-20When changing the config, do not emit an error if a field is missingChayim Refael Friedman-4/+5
2025-04-20Remove unused macro armChayim Refael Friedman-10/+3
2025-04-20doc: Fix dead manual linksbbb651-26/+26
2025-04-20doc: Rework generated configuration to have anchorsbbb651-358/+690
Also first line of default code blocks being used as the language instead of json and fixes a missing `json` language in a doc comment code block.
2025-04-20Update chalkjackh726-173/+166
2025-04-20Rollup merge of #137953 - RalfJung:simd-intrinsic-masks, r=WaffleLapkinChris Denton-0/+5
simd intrinsics with mask: accept unsigned integer masks, and fix some of the errors It's not clear at all why the mask would have to be signed, it is anyway interpreted bitwise. The backend should just make sure that works no matter the surface-level type; our LLVM backend already does this correctly. The note of "the mask may be widened, which only has the correct behavior for signed integers" explains... nothing? Why can't the code do the widening correctly? If necessary, just cast to the signed type first... Also while we are at it, fix the errors. For simd_masked_load/store, the errors talked about the "third argument" but they meant the first argument (the mask is the first argument there). They also used the wrong type for `expected_element`. I have extremely low confidence in the GCC part of this PR. See [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/257879-project-portable-simd/topic/On.20the.20sign.20of.20masks)
2025-04-20jsondocck: Require command is at start of lineAlona Enraght-Moony-0/+1
2025-04-20Fix compiletest and doc commentJakub Beránek-1/+1
2025-04-20respect `repr(align(N))` on functions in miriFolkert de Vries-0/+21
2025-04-20simd intrinsics with mask: accept unsigned integer masksRalf Jung-0/+5
2025-04-20Allow `dangerous_implicit_autorefs` lint in some testsUrgau-0/+4
2025-04-20Remove `setup-upstream-remote.sh` and upstream handling.Jakub Beránek-1/+1
It shouldn't be needed anymore.
2025-04-20Merge from rustcThe Miri Cronjob Bot-51/+141
2025-04-20Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-20Auto merge of #140043 - ChrisDenton:rollup-vwf0s9j, r=ChrisDentonbors-7/+1
Rollup of 8 pull requests Successful merges: - #138934 (support config extensions) - #139091 (Rewrite on_unimplemented format string parser.) - #139753 (Make `#[naked]` an unsafe attribute) - #139762 (Don't assemble non-env/bound candidates if projection is rigid) - #139834 (Don't canonicalize crate paths) - #139868 (Move `pal::env` to `std::sys::env_consts`) - #139978 (Add citool command for generating a test dashboard) - #139995 (Clean UI tests 4 of n) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-19Rollup merge of #139042 - compiler-errors:do-not-optimize-switchint, r=saethlinChris Denton-1/+30
Do not remove trivial `SwitchInt` in analysis MIR This PR ensures that we don't prematurely remove trivial `SwitchInt` terminators which affects both the borrow-checking and runtime semantics (i.e. UB) of the code. Previously the `SimplifyCfg` optimization was removing `SwitchInt` terminators when they was "trivial", i.e. when all arms branched to the same basic block, even if that `SwitchInt` terminator had the side-effect of reading an operand which (for example) may not be initialized or may point to an invalid place in memory. This behavior is unlike all other optimizations, which are only applied after "analysis" (i.e. borrow-checking) is finished, and which Miri disables to make sure the compiler doesn't silently remove UB. Fixing this code "breaks" (i.e. unmasks) code that used to borrow-check but no longer does, like: ```rust fn foo() { let x; let (0 | _) = x; } ``` This match expression should perform a read because `_` does not shadow the `0` literal pattern, and the compiler should have to read the match scrutinee to compare it to 0. I've checked that this behavior does not actually manifest in practice via a crater run which came back clean: https://github.com/rust-lang/rust/pull/139042#issuecomment-2767436367 As a side-note, it may be tempting to suggest that this is actually a good thing or that we should preserve this behavior. If we wanted to make this work (i.e. trivially optimize out reads from matches that are redundant like `0 | _`), then we should be enabling this behavior *after* fixing this. However, I think it's kinda unprincipled, and for example other variations of the code don't even work today, e.g.: ```rust fn foo() { let x; let (0.. | _) = x; } ```
2025-04-19Merge pull request #19617 from ChayimFriedman2/more-actualChayim Refael Friedman-1523/+1471
internal: Make `HirFileId`, `EditionedFileId` and macro files Salsa struct
2025-04-19Make `HirFileId`, `EditionedFileId` and macro files Salsa structChayim Refael Friedman-1523/+1471
And make more queries non-interned. Also flip the default for queries, now the default is to not intern and to intern a query you need to say `invoke_interned`.
2025-04-19allow using `null` to unset an environment variablejyn-91/+114
this makes three changes: - all callsites of `toolchain::command` are changed to use `command(path, extra_env)`, instead of manually adding the env after the fact. - all `map<str, str>` are changed to `map<str, option<str>>`. - `command` checks for None and calls `env_remove` if so. this caught several places where environment variables weren't being propagated: - when running `rustc --print=target-libdir` - when running `cargo rustc -- --print=target-spec-json` - when running the custom DiscoverLinkedProjects config. I *think* this is for use with non-cargo build systems, so I didn't change it.