about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
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-20Auto merge of #140079 - ChrisDenton:rollup-2h5cg94, r=ChrisDentonbors-154/+544
Rollup of 5 pull requests Successful merges: - #137953 (simd intrinsics with mask: accept unsigned integer masks, and fix some of the errors) - #139990 (transmutability: remove NFA intermediate representation) - #140044 (rustc-dev-guide subtree update) - #140051 (Switch exploit mitigations to mdbook footnotes) - #140054 (docs: fix typo change from inconstants to invariants) r? `@ghost` `@rustbot` modify labels: rollup
2025-04-21Remove `token::{Open,Close}Delim`.Nicholas Nethercote-9/+13
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 #140068 - detrina:master, r=NoratriebChris Denton-2/+2
replace broken links armv7-rtems-eabihf.md Hi team , i found broken link in `src/doc/rustc/src/platform-support/armv7-rtems-eabihf.md` and replace thanks
2025-04-20Rollup merge of #140063 - Kobzol:ci-report-fix-newline, r=jieyouxuChris Denton-1/+1
Remove stray newline from post-merge report [Oops](https://github.com/rust-lang/rust/pull/140043#issuecomment-2816999352) :) r? jieyouxu
2025-04-20Make target maintainers more easily pingableNoratrieb-165/+176
Put them all on the same line with just their GitHub handles to make it very easy to copy and paste (with ctrl-shift-v!!!) the names. We have no use for email, so I removed all the emails, we don't care about people's full names either. Co-authored-by: Thalia Archibald <thalia@archibald.dev>
2025-04-20Rollup merge of #140051 - ehuss:exploit-footnotes, r=jieyouxuChris Denton-43/+22
Switch exploit mitigations to mdbook footnotes This updates the exploit mitigations chapter in the rustc book to use the footnote feature of mdbook instead of manually implementing footnotes with HTML.
2025-04-20Rollup merge of #140044 - tshepang:rdg-push, r=jieyouxuChris Denton-111/+517
rustc-dev-guide subtree update r? ``@ghost``
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-2/+2
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-20Update links armv7-rtems-eabihf.mdDevkuni-2/+2
2025-04-20stabilize `naked_functions`Folkert de Vries-2/+0
2025-04-20Use `--author-date-order` when looking up upstream commits to support ↵Jakub Beránek-27/+143
subtree synces
2025-04-20Clarify commentJakub Beránek-2/+3
2025-04-20Make `git_dir` required in several git functionsJakub Beránek-23/+11
It was always called with `Some`, so no need to complicate it with `Option`.
2025-04-20Return `PathFreshness::MissingUpstream` from `detect_[gcc|llvm]_freshness` ↵Jakub Beránek-12/+10
functions
2025-04-20Extend `ci_rustc_if_unchanged` testsJakub Beránek-32/+77
2025-04-20Move freshness test to bootstrapJakub Beránek-316/+396
2025-04-20Remove the `add_dummy_commit.sh` hackJakub Beránek-27/+2
The new git tests should be enough to check this scenario. We should ideally not be creating dummy commits on CI.
2025-04-20Remove `setup-upstream-remote.sh` and upstream handling.Jakub Beránek-103/+2
It shouldn't be needed anymore.
2025-04-20Cache result of `check_path_modifications`Jakub Beránek-5/+25
2025-04-20Unify usages of path modifications and log them in verbose modeJakub Beránek-69/+53
2025-04-20Explicitly model missing upstreamJakub Beránek-18/+70
It shouldn't really happen, but if it does, at least we will have an explicit record of it.
2025-04-20Use `check_path_modifications` for detecting local rustc changesJakub Beránek-157/+26
And get rid of `get_closest_merge_commit`.
2025-04-20Use `check_path_modifications` for detecting local LLVM changesJakub Beránek-20/+50
2025-04-20Use `check_path_modifications` for detecting local GCC changesJakub Beránek-26/+46
2025-04-20Implement a new unified function for figuring out how if a set of paths have ↵Jakub Beránek-7/+465
been modified locally Also adds several git tests to make sure that the behavior works in common cases (PR CI, auto CI, local usage).
2025-04-20Remove stray newline from post-merge reportJakub Beránek-1/+1
2025-04-20Merge from rustcThe Miri Cronjob Bot-85/+205
2025-04-20Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-04-20Auto merge of #140043 - ChrisDenton:rollup-vwf0s9j, r=ChrisDentonbors-68/+895
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 #140008 - GuillaumeGomez:cleanup-clean_maybe_renamed_item, ↵Chris Denton-14/+33
r=nnethercote Improve `clean_maybe_renamed_item` function code a bit Follow-up of #139846. This is what I tried to say in there: the `name` variable can be unwrapped in most cases so better do it directly once and for all if possible and move the cases where it's not possible above. r? `@nnethercote`
2025-04-19Rollup merge of #140000 - EnzymeAD:autodiff-check-builds, r=onur-ozkanChris Denton-2/+1
skip llvm-config in autodiff check builds, when its unavailable As you suggested, this indeed fixes `./x.py check` builds when autodiff is enabled. r? ```@onur-ozkan``` closes #139936 Tracking: - https://github.com/rust-lang/rust/issues/124509
2025-04-19Rollup merge of #139843 - thaliaarchi:editor-file-associations, ↵Chris Denton-11/+23
r=Mark-Simulacrum Setup editor file associations for non-rs extensions .gitattributes lists `*.fixed`, `*.pp`, and `*.mir` as file extensions which should be treated as Rust source code. Do the same for VS Code and Zed. This only does syntax highlighting, which is appropriate, as MIR isn't really Rust code. At the same time, consistently order `rust-analyzer.linkedProjects` between editors. For some reason, Eglot didn't include `library/Cargo.toml`. I have tested this with VS Code and Zed. I have not implemented it for Emacs/Eglot or Helix.
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-19Switch exploit mitigations to mdbook footnotesEric Huss-43/+22
This updates the exploit mitigations chapter in the rustc book to use the footnote feature of mdbook instead of manually implementing footnotes with HTML.
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-19Fix error when an intra doc link is trying to resolve an empty associated itemGuillaume Gomez-1/+6