about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-03-17Observe unsafeness when generating manual impls of former derivesAli Bektas-2/+35
2025-03-17Merge pull request #19005 from ↵HKalbasi-143/+186
duncanawoods/18955---fix-running-tests-for-packages-with-multiple-targets fix testing packages with multiple targets
2025-03-18Move `hir::Item::ident` into `hir::ItemKind`.Nicholas Nethercote-144/+138
`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. The commit is large but it's mostly obvious plumbing work. Some notable things. - A similar transformation makes sense for `ast::Item`, but this is already a big change. That can be done later. - Lots of assertions are added to item lowering to ensure that identifiers are empty/non-empty as expected. These will be removable when `ast::Item` is done later. - `ItemKind::Use` doesn't get an `Ident`, but `UseKind::Single` does. - `lower_use_tree` is significantly simpler. No more confusing `&mut Ident` to deal with. - `ItemKind::ident` is a new method, it returns an `Option<Ident>`. It's used with `unwrap` in a few places; sometimes it's hard to tell exactly which item kinds might occur. None of these unwraps fail on the test suite. It's conceivable that some might fail on alternative input. We can deal with those if/when they happen. - In `trait_path` the `find_map`/`if let` is replaced with a loop, and things end up much clearer that way. - `named_span` no longer checks for an empty name; instead the call site now checks for a missing identifier if necessary. - `maybe_inline_local` doesn't need the `glob` argument, it can be computed in-function from the `renamed` argument. - `arbitrary_source_item_ordering::check_mod` had a big `if` statement that was just getting the ident from the item kinds that had one. It could be mostly replaced by a single call to the new `ItemKind::ident` method. - `ItemKind` grows from 56 to 64 bytes, but `Item` stays the same size, and that's what matters, because `ItemKind` only occurs within `Item`.
2025-03-17Auto merge of #138611 - matthiaskrgr:rollup-hmjbqva, r=matthiaskrgrbors-21/+21
Rollup of 7 pull requests Successful merges: - #133870 (Stabilize `asm_goto` feature gate) - #137449 (Denote `ControlFlow` as `#[must_use]`) - #137465 (mir_build: Avoid some useless work when visiting "primary" bindings) - #138349 (Emit function declarations for functions with `#[linkage="extern_weak"]`) - #138412 (Install licenses into `share/doc/rust/licenses`) - #138577 (rustdoc-json: Don't also include `#[deprecated]` in `Item::attrs`) - #138588 (Avoid double lowering of idents) Failed merges: - #138321 ([bootstrap] Distribute split debuginfo if present) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-17 No edit if no bodyjnyfah-1/+4
2025-03-17Auto merge of #137081 - ↵bors-9/+17
Shourya742:2025-02-15-change-config.toml-to-bootstrap.toml, r=onur-ozkan,jieyouxu,kobzol change config.toml to bootstrap.toml Currently, both Bootstrap and Cargo uses same name as their configuration file, which can be confusing. This PR is based on a discussion to rename `config.toml` to `bootstrap.toml` for Bootstrap. Closes: https://github.com/rust-lang/rust/issues/126875. I have split the PR into atomic commits to make it easier to review. Once the changes are finalized, I will squash them. I am particularly concerned about the changes made to modules that are not part of Bootstrap. How should we handle those changes? Should we ping the respective maintainers?
2025-03-17some changesjnyfah-3/+2
2025-03-17Rollup merge of #137449 - compiler-errors:control-flow, r=Amanieu,lnicolaMatthias Krüger-21/+21
Denote `ControlFlow` as `#[must_use]` I've repeatedly hit bugs in the compiler due to `ControlFlow` not being marked `#[must_use]`. There seems to be an accepted ACP to make the type `#[must_use]` (https://github.com/rust-lang/libs-team/issues/444), so this PR implements that part of it. Most of the usages in the compiler that trigger this new warning are "root" usages (calling into an API that uses control-flow internally, but for which the callee doesn't really care) and have been suppressed by `let _ = ...`, but I did legitimately find one instance of a missing `?` and one for a never-used `ControlFlow` value in #137448. Presumably this needs an FCP too, so I'm opening this and nominating it for T-libs-api. This PR also touches the tools (incl. rust-analyzer), but if this went into FCP, I'd split those out into separate PRs which can land before this one does. r? libs-api `@rustbot` label: T-libs-api I-libs-api-nominated
2025-03-17Merge pull request #19378 from ↵Lukas Wirth-2/+8
davidbarsky/davidbarsky/run-lru-at-end-of-analysis-stats analysis-stats: run Salsa's LRU at the end of analysis
2025-03-17analysis-stats: run Salsa's LRU at the end of analysisDavid Barsky-2/+8
2025-03-17Merge pull request #19379 from Veykril/push-nwmqsvtqpnkoLukas Wirth-244/+277
chore: Bump `Edition::CURRENT` to 2024
2025-03-17Fix miribjorn3-19/+64
2025-03-17expand: Leave traces when expanding `cfg_attr` attributesVadim Petrochenkov-1/+5
2025-03-17Merge pull request #19384 from Veykril/push-yppplzzpoymrLukas Wirth-5/+5
fix: Fix stale `Building CrateGraph` report
2025-03-17chore: Bump `Edition::CURRENT` to 2024Lukas Wirth-244/+277
2025-03-17fix: Fix stale `Building CrateGraph` reportLukas Wirth-5/+5
2025-03-17Rollup merge of #137793 - NobodyXu:stablise-annoymous-pipe, r=joshtriplettJacob Pratt-2/+0
Stablize anonymous pipe Since #135822 is staled, I create this PR to stablise anonymous pipe Closes #127154 try-job: test-various
2025-03-17Rollup merge of #136355 - ↵Jacob Pratt-0/+2
GuillaumeGomez:proc-macro_add_value_retrieval_methods, r=Amanieu Add `*_value` methods to proc_macro lib This is the implementation of https://github.com/rust-lang/libs-team/issues/459. It allows to get the actual value (unescaped) of the different string literals. Part of https://github.com/rust-lang/rust/issues/136652. r? libs-api
2025-03-17Merge pull request #19315 from snprajwal/ci-xtaskLukas Wirth-7/+18
fix(codegen): do not generate docs with `--check`
2025-03-17Merge pull request #19329 from Shourya742/2025-03-10-add-proc-macro-api-docLukas Wirth-1/+71
doc: add doc to proc-macro-api
2025-03-17fix(codegen): do not generate docs with `--check`Prajwal S N-7/+18
Running `cargo codegen --check` should not generate any mdbook files, since they are ignored in the repo and used only while releasing a new copy of the documentation. Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-03-17replace config.toml to bootstrap.toml in src:toolsbit-aloo-9/+17
2025-03-17Fix `is_relevant_impl`.Nicholas Nethercote-1/+1
It determines if a function should have any `inline` attributes checked. For `ItemKind::Fn` it returns true or false depending on the details of the function; for anything other item kind it returns *true*. This latter case should instead be *false*. (In the nearby and similar functions `is_relevant_impl` and `is_relevant_trait` the non-function cases return false.) The effect of this is that non-functions are no longer checked. But rustc already disallows `inline` on any non-function items. So if anything its a tiny performance win, because that was useless anyway.
2025-03-16Suppress must_use for ControlFlow in rust-analyzerMichael Goulet-17/+17
2025-03-16Suppress must_use in compiler and toolsMichael Goulet-4/+4
2025-03-16Merge pull request #19374 from lnicola/nextestLaurențiu Nicola-1/+3
minor: Use cargo nextest on CI
2025-03-16Merge pull request #19355 from Veykril/push-nzknrnouutnpLukas Wirth-179/+182
internal: Render root syntax contexts more clearly
2025-03-16internal: Render root syntax contexts more clearlyLukas Wirth-164/+177
2025-03-16internal: `Symbol` is not `PartialOrd`Lukas Wirth-15/+5
2025-03-16minor: Remove unnecessary allocations in `function::params_display`Lukas Wirth-16/+16
2025-03-16Merge pull request #19363 from euclio/varargs-detailLukas Wirth-1/+58
display varargs in completion detail
2025-03-16Merge pull request #19344 from BenjaminBrienen/add-iconsLukas Wirth-0/+2
Add icons to views
2025-03-16Merge pull request #19354 from ChayimFriedman2/rtn-prepLukas Wirth-82/+205
Preparation to Return Type Notation (RTN)
2025-03-16Use cargo nextest on CILaurențiu Nicola-1/+3
2025-03-16refactor: Remove unnecessary `Arc`Lukas Wirth-26/+22
2025-03-16refactor: Remove `CrateGraphBuilder::iter_mut`Lukas Wirth-1297/+75
2025-03-16Merge from rustcThe Miri Cronjob Bot-54/+53
2025-03-16Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-03-16Rollup merge of #138465 - klensy:linkchecker-b, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-13/+13
linkchecker: bump html5ever Bumping html5ever to 0.28 required small refactoring, see https://github.com/servo/html5ever/pull/548
2025-03-15display varargs in completion detailAndy Russell-1/+58
2025-03-15Add view iconsBenjaminBrienen-0/+2
2025-03-15cargo fmtBenjaminBrienen-3/+6
2025-03-15fix temporary value dropped while borrowedBenjaminBrienen-2/+2
2025-03-15cargo xtask tidyBenjaminBrienen-2/+2
2025-03-15cargo fmtBenjaminBrienen-2430/+2182
2025-03-15fix clippy::doc_overindented_list_itemsBenjaminBrienen-14/+13
2025-03-15cargo clippy --fixBenjaminBrienen-13/+13
2025-03-15edition = "2024"BenjaminBrienen-9/+9
2025-03-15rust-version = "1.85"BenjaminBrienen-2/+2
2025-03-15Fix 2024 syntax errorsBenjaminBrienen-28/+35