about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-03-21add syntax validation test for ambiguous +bit-aloo-0/+39
2025-03-21validate_impl_object_ty: Add diagnostics for and ambiguous .bit-aloo-1/+30
2025-03-21Rollup merge of #138706 - Kobzol:bootstrap-git-refactor-1, r=onur-ozkanMatthias Krüger-7/+2
Improve bootstrap git modified path handling Drive-by improvements extracted out of https://github.com/rust-lang/rust/pull/138591. r? ``@onur-ozkan``
2025-03-21Merge pull request #4236 from RalfJung/rustupRalf Jung-1171/+4648
Rustup
2025-03-21Merge pull request #19348 from jnyfah/some-branchLukas Wirth-6/+34
Add text edit support for return type hints on non-block body closures
2025-03-21Merge pull request #19397 from gvozdvmozgu/postfix-const-blockLukas Wirth-20/+86
add postfix completion for const block
2025-03-21Merge from rustcRalf Jung-1170/+4647
2025-03-21Preparing for merge from rustcRalf Jung-1/+1
2025-03-21Merge pull request #19408 from Veykril/push-wtnxzulsovxyLukas Wirth-464/+2844
refactor: Reduce codegen burden for generated syntax
2025-03-21fix: Fix incorrect expansion of builtin `PartialOrd` deriveLukas Wirth-2/+3
2025-03-21refactor: Reduce codegen burden for `SyntaxNode` and `SyntaxToken`Lukas Wirth-426/+2767
2025-03-21refactor: Reduce codegen burden for `SyntaxKind`Lukas Wirth-38/+76
2025-03-21minor: Don't query the database in workspace switchingLukas Wirth-35/+42
2025-03-21catch_unwind: do not permit catch function to unwindRalf Jung-1/+2
2025-03-21minor: Trigger LRU eviction after cache priming finishesLukas Wirth-1/+2
2025-03-21update rustfmt testlcnr-2/+2
2025-03-21remove `feature(inline_const_pat)`lcnr-2/+0
2025-03-21Auto merge of #138768 - matthiaskrgr:rollup-nfu3cm3, r=matthiaskrgrbors-0/+3
Rollup of 8 pull requests Successful merges: - #137357 (Document results of non-positive logarithms) - #138650 (Optimize `io::Write::write_fmt` for constant strings) - #138694 (Fix: add ohos target notes) - #138713 (interpret memory access hooks: also pass through the Pointer used for the access) - #138724 (Check attrs: Don't try to retrieve the name of list stems) - #138743 (bootstrap: add `--ci` flag) - #138751 (Fix the "used_with_archive" test on Fuchsia) - #138754 (Handle spans of `~const`, `const` and `async` trait bounds in macro expansion) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-21Rollup merge of #138713 - RalfJung:memory-hook-pointers, r=oli-obkMatthias Krüger-0/+3
interpret memory access hooks: also pass through the Pointer used for the access In some ongoing work on the Miri side, we need the absolute address that the memory access occurred at. That is non-trivial to obtain since we don't have an `ecx`. So pass through the `Pointer` used for the access, which contains the address, and which is available everywhere we are calling these hooks. r? `@oli-obk`
2025-03-21Merge pull request #19405 from ChayimFriedman2/no-expandLukas Wirth-68/+31
minor: Remove unnecessary expansions
2025-03-21Auto merge of #138761 - flip1995:clippy-subtree-update, r=Manishearthbors-1143/+4610
Clippy subtree update r? `@Manishearth` Cargo.lock update is because of the `ui_test` dependency bump in Clippy.
2025-03-21jsondocck: Replace `jsonpath_lib` with `jsonpath-rust`Alona Enraght-Moony-2/+2
2025-03-20Auto merge of #138747 - matthiaskrgr:rollup-68x44rw, r=matthiaskrgrbors-34/+66
Rollup of 8 pull requests Successful merges: - #138435 (Add support for postfix yield expressions) - #138685 (Use `Option<Ident>` for lowered param names.) - #138700 (Suggest `-Whelp` when pass `--print lints` to rustc) - #138727 (Do not rely on `type_var_origin` in `OrphanCheckErr::NonLocalInputType`) - #138729 (Clean up `FnCtxt::resolve_coroutine_interiors`) - #138731 (coverage: Add LLVM plumbing for expansion regions) - #138732 (Use `def_path_str` for def id arg in `UnsupportedOpInfo`) - #138735 (Remove `llvm` and `llvms` triagebot ping aliases for `icebreakers-llvm` ping group) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-20Merge commit '1e5237f4a56ae958af7e5824343eacf737b67083' into ↵Philipp Krones-1144/+4611
clippy-subtree-update
2025-03-20Remove unnecessary expansionsChayim Refael Friedman-68/+31
In the body source map, we record each macro call with the `ExprOrPatId` it resolved to, so to lookup the `ExprId` of some node, we don't need to expand it!
2025-03-20Auto merge of #138515 - petrochenkov:cfgtrace, r=nnethercotebors-1/+5
expand: Leave traces when expanding `cfg_attr` attributes Currently `cfg_trace` just disappears during expansion, but after this PR `#[cfg_attr(some tokens)]` will leave a `#[cfg_attr_trace(some tokens)]` attribute instead of itself in AST after expansion (the new attribute is built-in and inert, its inner tokens are the same as in the original attribute). This trace attribute can then be used by lints or other diagnostics, #133823 has some examples. Tokens in these trace attributes are set to an empty token stream, so the traces are non-existent for proc macros and cannot affect any user-observable behavior. This is also a weakness, because if a proc macro processes some code with the trace attributes, they will be lost, so the traces are best effort rather than precise. The next step is to do the same thing with `cfg` attributes (`#[cfg(TRUE)]` currently remains in both AST and tokens after expanding, it should be replaced with a trace instead). The idea belongs to `@estebank.`
2025-03-20interpret memory access hooks: also pass through the Pointer used for the accessRalf Jung-0/+3
2025-03-20Rollup merge of #138685 - ↵Matthias Krüger-26/+29
nnethercote:use-Option-Ident-for-lowered-param-names, r=compiler-errors Use `Option<Ident>` for lowered param names. Parameter patterns are lowered to an `Ident` by `lower_fn_params_to_names`, which is used when lowering bare function types, trait methods, and foreign functions. Currently, there are two exceptional cases where the lowered param can become an empty `Ident`. - If the incoming pattern is an empty `Ident`. This occurs if the parameter is anonymous, e.g. in a bare function type. - If the incoming pattern is neither an ident nor an underscore. Any such parameter will have triggered a compile error (hence the `span_delayed_bug`), but lowering still occurs. This commit replaces these empty `Ident` results with `None`, which eliminates a number of `kw::Empty` uses, and makes it impossible to fail to check for these exceptional cases. Note: the `FIXME` comment in `is_unwrap_or_empty_symbol` is removed. It actually should have been removed in #138482, the precursor to this PR. That PR changed the lowering of wild patterns to `_` symbols instead of empty symbols, which made the mentioned underscore check load-bearing. r? ``@compiler-errors``
2025-03-20Rollup merge of #138435 - eholk:prefix-yield, r=oli-obkMatthias Krüger-8/+37
Add support for postfix yield expressions We've been having a discussion about whether we want postfix yield, or want to stick with prefix yield, or have both. I figured it's easy enough to support both for now and let us play around with them while the feature is still experimental. This PR treats `yield x` and `x.yield` as semantically equivalent. There was a suggestion to make `yield x` have a `()` type (so it only works in coroutines with `Resume = ()`. I think that'd be worth trying, either in a later PR, or before this one merges, depending on people's opinions. #43122
2025-03-20Merge from rustcThe Miri Cronjob Bot-213/+260
2025-03-20Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-03-19add postfix completion for const blockgvozdvmozgu-20/+86
2025-03-19Rollup merge of #138001 - meithecatte:privately-uninhabited, r=NadrierilMatthias Krüger-4/+5
mir_build: consider privacy when checking for irrefutable patterns This PR fixes #137999. Note that, since this makes the compiler reject code that was previously accepted, it will probably need a crater run. I include a commit that factors out a common code pattern into a helper function, purely because the fact that this was repeated all over the place was bothering me. Let me know if I should split that into a separate PR instead.
2025-03-19Simplify `get_git_modified_files`Jakub Beránek-7/+2
It only ever returned `Some`, so `Option` was useless in its return type.
2025-03-19Use `Option<Ident>` for lowered param names.Nicholas Nethercote-26/+29
Parameter patterns are lowered to an `Ident` by `lower_fn_params_to_names`, which is used when lowering bare function types, trait methods, and foreign functions. Currently, there are two exceptional cases where the lowered param can become an empty `Ident`. - If the incoming pattern is an empty `Ident`. This occurs if the parameter is anonymous, e.g. in a bare function type. - If the incoming pattern is neither an ident nor an underscore. Any such parameter will have triggered a compile error (hence the `span_delayed_bug`), but lowering still occurs. This commit replaces these empty `Ident` results with `None`, which eliminates a number of `kw::Empty` uses, and makes it impossible to fail to check for these exceptional cases. Note: the `FIXME` comment in `is_unwrap_or_empty_symbol` is removed. It actually should have been removed in #138482, the precursor to this PR. That PR changed the lowering of wild patterns to `_` symbols instead of empty symbols, which made the mentioned underscore check load-bearing.
2025-03-19Reject `{true,false}` as revision namesJieyou Xu-8/+35
Because they would imply `--cfg={true,false}` otherwise, and the test writer has to use `cfg(r#true)` and `cfg(r#false)` in the test.
2025-03-19change test name to sth meaningfulAli Bektas-3/+2
2025-03-19Fix span info for mir::OperandAli Bektas-82/+147
Fixes #19172
2025-03-18Refactor YieldKind so postfix yield must have an expressionEric Holk-8/+8
2025-03-18Revert "Rollup merge of #136355 - ↵Ralf Jung-2/+0
GuillaumeGomez:proc-macro_add_value_retrieval_methods, r=Amanieu" This reverts commit 08dfbf49e30d917c89e49eb14cb3f1e8b8a1c9ef, reversing changes made to 10bcdad7df0de3cfb95c7bdb7b16908e73cafc09.
2025-03-18Merge pull request #19391 from Veykril/push-rnrskpqoltplLukas Wirth-30/+17
chore: Clean up proc-macro-srv CI job
2025-03-18chore: Clean up proc-macro-srv CI jobLukas Wirth-30/+17
2025-03-18refactor: Do not use `Expander` in assoc item loweringLukas Wirth-125/+106
`Expander` is a macro expansion solution for body lowering, there is no need to use it here
2025-03-18reintroduce remote-test support in run-make testsPietro Albini-1/+14
The old Makefile-based infrastructure included support for executing binaries with remote-test-client if configured, but that didn't get ported to run_make_support as part of the rmake migration. This PR re-introduces back that support, with the same implementation (and limitations) of the original Makefile-based support.
2025-03-18Auto merge of #138630 - matthiaskrgr:rollup-kk1gogr, r=matthiaskrgrbors-145/+139
Rollup of 7 pull requests Successful merges: - #138384 (Move `hir::Item::ident` into `hir::ItemKind`.) - #138508 (Clarify "owned data" in E0515.md) - #138531 (Store test diffs in job summaries and improve analysis formatting) - #138533 (Only use `DIST_TRY_BUILD` for try jobs that were not selected explicitly) - #138556 (Fix ICE: attempted to remap an already remapped filename) - #138608 (rustc_target: Add target feature constraints for LoongArch) - #138619 (Flatten `if`s in `rustc_codegen_ssa`) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-17Teach rustfmt to handle postfix yieldEric Holk-21/+21
This involved fixing the span when parsing .yield
2025-03-17Auto merge of #127173 - bjorn3:mangle_rustc_std_internal_symbol, ↵bors-19/+64
r=wesleywiser,jieyouxu Mangle rustc_std_internal_symbols functions This reduces the risk of issues when using a staticlib or rust dylib compiled with a different rustc version in a rust program. Currently this will either (in the case of staticlib) cause a linker error due to duplicate symbol definitions, or (in the case of rust dylibs) cause rustc_std_internal_symbols functions to be silently overridden. As rust gets more commonly used inside the implementation of libraries consumed with a C interface (like Spidermonkey, Ruby YJIT (curently has to do partial linking of all rust code to hide all symbols not part of the C api), the Rusticl OpenCL implementation in mesa) this is becoming much more of an issue. With this PR the only symbols remaining with an unmangled name are rust_eh_personality (LLVM doesn't allow renaming it) and `__rust_no_alloc_shim_is_unstable`. Helps mitigate https://github.com/rust-lang/rust/issues/104707 try-job: aarch64-gnu-debug try-job: aarch64-apple try-job: x86_64-apple-1 try-job: x86_64-mingw-1 try-job: i686-mingw-1 try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: test-various try-job: armhf-gnu
2025-03-17Rollup merge of #138384 - nnethercote:hir-ItemKind-idents, r=fmeaseMatthias Krüger-145/+139
Move `hir::Item::ident` into `hir::ItemKind`. `hir::Item` has an `ident` field. - It's always non-empty for these item kinds: `ExternCrate`, `Static`, `Const`, `Fn`, `Macro`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`, Trait`, TraitAalis`. - It's always empty for these item kinds: `ForeignMod`, `GlobalAsm`, `Impl`. - For `Use`, it is non-empty for `UseKind::Single` and empty for `UseKind::{Glob,ListStem}`. All of this is quite non-obvious; the only documentation is a single comment saying "The name might be a dummy name in case of anonymous items". Some sites that handle items check for an empty ident, some don't. This is a very C-like way of doing things, but this is Rust, we have sum types, we can do this properly and never forget to check for the exceptional case and never YOLO possibly empty identifiers (or possibly dummy spans) around and hope that things will work out. This is step towards `kw::Empty` elimination (#137978). r? `@fmease`
2025-03-17Test unsafeness is respected when manual impling derivesAli Bektas-5/+45
2025-03-17Observe unsafeness only for replace_derive_with_manual_implAli Bektas-34/+6