about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-06-06Rollup merge of #126035 - oli-obk:query_macro_errors, r=fmeaseJubilee-0/+1
Some minor query system cleanups * Improves diagnostics on conflicting query flags * removes unnecessary impls * `track_caller` pulled out of https://github.com/rust-lang/rust/pull/115613
2024-06-06Revert "Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, ↵Rémy Rakic-10/+10
r=davidtwco" This reverts commit 57dad1d75e562ff73051c1c43b07eaf65c7dbd74, reversing changes made to 36316df9fe6c3e246153fe6e78967643cf08c148.
2024-06-06Auto merge of #126068 - lqd:revert-124976, r=petrochenkovbors-3/+3
Revert "use `tcx.used_crates(())` more" before it reaches beta There are more open issues caused by #124976 than will be fixed by #125493 alone. The beta cut is soon, so let's revert it and buy some time to analyze and fix these issues in our own time. fixes https://github.com/rust-lang/rust/issues/125474 fixes https://github.com/rust-lang/rust/issues/125484 fixes https://github.com/rust-lang/rust/issues/125646 fixes https://github.com/rust-lang/rust/issues/125707 fixes #126066 fixes #125934 fixes https://github.com/rust-lang/rust/issues/126021 r? `@petrochenkov` `@bors` p=1
2024-06-06Do not use relative paths to Rust source root in run-make testsJakub Beránek-2/+3
2024-06-07compiletest: Allow multiple `//@ run-flags:` headersZalathar-10/+12
2024-06-06fix: incorrect formatting of hover actionsroife-2/+2
2024-06-06Auto merge of #125411 - onur-ozkan:sanity-check-libstdc++, r=Mark-Simulacrumbors-0/+27
check host's libstdc++ version when using ci llvm If the host's libstdc++ version is too old using ci-llvm may result in an ABI mismatch between the local libstdc++ and libLLVM.so. This PR adds a sanity check to immediately fail at the beginning of the bootstrap before starting the actual build. I am not sure if '8' is the best threshold, but it should be a good start and we can increase it anytime if needed. Fixes #123037
2024-06-06Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk"Rémy Rakic-3/+3
This reverts commit eda4a35f365535af72118118a3597edf5a13c12d, reversing changes made to eb6b35b5bcb3c2a594cb29cd478aeb2893f49d30.
2024-06-06Make the panic info more usefulOli Scherer-0/+1
2024-06-06Auto merge of #17352 - roife:fix-issue-17338, r=Veykrilbors-1/+30
fix: do not resolve prelude within block modules fix #17338 (continuing from #17251). In #17251, we injected preludes into non-top-level modules, which leading to r-a to directly resolve names in preludes in block modules. This PR fix it by checking whether the module is a pseudo-module introduced by blocks. (similar to what we do for extern preludes)
2024-06-06test: add regression test for prelude shadowing in block modulesroife-0/+24
2024-06-06fix: do not resolve prelude within block modulesroife-1/+6
2024-06-06Fix file loading of r-a toml filesLukas Wirth-90/+37
2024-06-06Migrate `run-make/manual-crate-name` to `rmake.rs`Guillaume Gomez-1/+0
2024-06-06Auto merge of #124482 - spastorino:unsafe-extern-blocks, r=oli-obkbors-2/+7
Unsafe extern blocks This implements RFC 3484. Tracking issue #123743 and RFC https://github.com/rust-lang/rfcs/pull/3484 This is better reviewed commit by commit.
2024-06-06Auto merge of #17346 - ChosenName:master, r=Veykrilbors-1399/+2221
Changed package.json so vscode extension settings have submenus There are a lot of options that are a part of rust-analyzer, sometimes it can be hard to find an option that you are looking for. To fix this I have put all configurations into categories based on their names. I have also changed the schema in `crates/rust-analyzer/src/config.rs` to reflect this. Currently for each generated entry the title is redeclared, this does function but I am prepared to change this if it is a problem.
2024-06-06Auto merge of #17350 - Wilfred:mark_missing_file_unused, r=Veykrilbors-10/+2
fix: Highlight unlinked files consistently with inactive files Currently, rust-analyzer highlights the entire region when a `cfg` is inactive (e.g. `#[cfg(windows)]` on a Linux machine). However, unlinked files only highlight the first three characters of the file. This was introduced in #8444, but users have repeatedly found themselves with no rust-analyzer support for a file and unsure why (see e.g. #13226 and the intentionally prominent pop-up added in PR #14366). (Anecdotally, we see this issue bite our users regularly, particularly people new to Rust.) Instead, highlight the entire inactive file, but mark it as all as unused. This allows users to hover and run the quickfix from any line. Whilst this is marginally more prominent, it's less invasive than a pop-up, and users do want to know why they're getting no rust-analyzer support in certain files. Before (note the subtle grey underline is only at the beginning of the first line): ![Screenshot 2024-06-05 at 5 41 17 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/96f5d778-612e-4838-876d-35d9647fe2aa) After (user can hover and fix from any line): ![Screenshot 2024-06-05 at 5 42 13 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/6af90b79-018c-42b9-b3c5-f497de2ccbff)
2024-06-06Auto merge of #126056 - matthiaskrgr:rollup-ytwg62v, r=matthiaskrgrbors-0/+14
Rollup of 6 pull requests Successful merges: - #124731 (Add translation support by mdbook-i18n-helpers to bootstrap) - #125168 (Match ergonomics 2024: align implementation with RFC) - #125925 (Don't trigger `unsafe_op_in_unsafe_fn` for deprecated safe fns) - #125987 (When `derive`ing, account for HRTB on `BareFn` fields) - #126045 (check_expr_struct_fields: taint context with errors if struct definit…) - #126048 (Fix typos in cargo-specifics.md) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-06skip `src/tools/libcxx-version` from tidyonur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06create libcxx-version tool for getting currently used libcxx versiononur-ozkan-0/+28
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06Auto merge of #125958 - BoxyUwU:remove_const_ty, r=lcnrbors-11/+15
Remove the `ty` field from type system `Const`s Fixes #125556 Fixes #122908 Part of the work on `adt_const_params`/`generic_const_param_types`/`min_generic_const_exprs`/generally making the compiler nicer. cc rust-lang/project-const-generics#44 Please review commit-by-commit otherwise I wasted a lot of time not just squashing this into a giant mess (and also it'll be SO much nicer because theres a lot of fluff changes mixed in with other more careful changes if looking via File Changes --- Why do this? - The `ty` field keeps causing ICEs and weird behaviour due to it either being treated as "part of the const" or it being forgotten about leading to ICEs. - As we move forward with `adt_const_params` and a potential `min_generic_const_exprs` it's going to become more complex to actually lower the correct `Ty<'tcx>` - It muddles the idea behind how we check `Const` arguments have the correct type. By having the `ty` field it may seem like we ought to be relating it when we relate two types, or that its generally important information about the `Const`. - Brings the compiler more in line with `a-mir-formality` as that also tracks the type of type system `Const`s via `ConstArgHasType` bounds in the env instead of on the `Const` itself. - A lot of stuff is a lot nicer when you dont have to pass around the type of a const lol. Everywhere we construct `Const` is now significantly nicer :sweat_smile: See #125671's description for some more information about the `ty` field --- General summary of changes in this PR: - Add `Ty` to `ConstKind::Value` as otherwise there is no way to implement `ConstArgHasType` to ensure that const arguments are correctly typed for the parameter when we stop creating anon consts for all const args. It's also just incredibly difficult/annoying to thread the correct `Ty` around to a bunch of ctfe functions otherwise. - Fully implement `ConstArgHasType` in both the old and new solver. Since it now has no reliance on the `ty` field it serves its originally intended purpose of being able to act as a double check that trait vs impls have correctly typed const parameters. It also will now be able to be responsible for checking types of const arguments to parameters under `min_generic_const_exprs`. - Add `Ty` to `mir::Const::Ty`. I dont have a great understanding of why mir constants are setup like this to be honest. Regardless they need to be able to determine the type of the const and the easiest way to make this happen was to simply store the `Ty` along side the `ty::Const`. Maybe we can do better here in the future but I'd have to spend way more time looking at everywhere we use `mir::Const`. - rustdoc has its own `Const` which also has a `ty` field. It was relatively easy to remove this. --- r? `@lcnr` `@compiler-errors`
2024-06-06Rollup merge of #124731 - dalance:add_translation_support, r=ehussMatthias Krüger-0/+14
Add translation support by mdbook-i18n-helpers to bootstrap This PR add translation support by [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) to bootstrap. This is draft PR because there is the dependency to my forked mdbook-i18n-helpers. If this PR is acceptable, I'll send a PR to the original mdbook-i18n-helpers and remove draft after changing the dependency to the original. Closes #124641
2024-06-05fix: Highlight unlinked files consistently with inactive filesWilfred Hughes-10/+2
Currently, rust-analyzer highlights the entire region when a `cfg` is inactive (e.g. `#[cfg(windows)]` on a Linux machine). However, unlinked files only highlight the first three characters of the file. This was introduced in #8444, but users have repeatedly found themselves with no rust-analyzer support for a file and unsure why (see e.g. #13226 and the intentionally prominent pop-up added in PR #14366). (Anecdotally, we see this issue bite our users regularly, particularly people new to Rust.) Instead, highlight the entire inactive file, but mark it as all as unused. This allows users to hover and run the quickfix from any line. Whilst this is marginally more prominent, it's less invasive than a pop-up, and users do want to know why they're getting no rust-analyzer support in certain files.
2024-06-05chore: Update Cargo.lock to avoid yanked versionWilfred Hughes-2/+2
2024-06-05Misc fixes to cranelift/clippy/miriBoxy-7/+8
2024-06-05Remove `Type` from rustdoc `Const`Boxy-4/+7
2024-06-05Auto merge of #126038 - matthiaskrgr:rollup-h4rm3x2, r=matthiaskrgrbors-4/+25
Rollup of 9 pull requests Successful merges: - #124840 (resolve: mark it undetermined if single import is not has any bindings) - #125622 (Winnow private method candidates instead of assuming any candidate of the right name will apply) - #125648 (Remove unused(?) `~/rustsrc` folder from docker script) - #125672 (Add more ABI test cases to miri (RFC 3391)) - #125800 (Fix `mut` static task queue in SGX target) - #125871 (Orphanck[old solver]: Consider opaque types to never cover type parameters) - #125893 (Handle all GVN binops in a single place.) - #126008 (Port `tests/run-make-fulldeps/issue-19371` to ui-fulldeps) - #126032 (Update description of the `IsTerminal` example) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-05Simplify the rayon calls in the installerJosh Stone-9/+3
Rayon's `try_for_each` makes the `CombinedEncoder` a lot simpler.
2024-06-05Promote `arm64ec-pc-windows-msvc` to tier 2Daniel Paoliello-0/+1
2024-06-05Rollup merge of #126008 - Zalathar:fulldeps-19371, r=jieyouxuMatthias Krüger-0/+10
Port `tests/run-make-fulldeps/issue-19371` to ui-fulldeps This test can run as an ordinary `tests/ui-fulldeps` test, with the help of some additional header variable substitutions to supply a sysroot and linker. --- Unlike #125973, this test appears to be testing something vaguely useful and breakable, which is why I didn't just delete it.
2024-06-05Rollup merge of #125672 - Lokathor:update-miri-result-ffi, r=RalfJungMatthias Krüger-2/+14
Add more ABI test cases to miri (RFC 3391) Part of https://github.com/rust-lang/rust/issues/110503 cc `@RalfJung`
2024-06-05Rollup merge of #125622 - oli-obk:define_opaque_types15, r=compiler-errorsMatthias Krüger-2/+1
Winnow private method candidates instead of assuming any candidate of the right name will apply partially reverts https://github.com/rust-lang/rust/pull/60721 My original motivation was just to avoid the `delay_span_bug` (by attempting to thread the `ErrorGuaranteed` through to here). But then I realized that the error message is wrong. It refers to the `Foo<A>::foo` instead of `Foo<B>::foo`. This is almost invisible, because both functions are the same, but on different lines, so `-Zui-testing` makes it so the test is the same no matter which of these two functions is referenced. But there's a much more obvious bug: If `Foo<B>` does not have a `foo` method at all, but `Foo<A>` has a private `foo` method, then we'll refer to that one. This has now been fixed, and we report a normal `method not found` error. The way this is done is by creating a list of all possible private functions (just like we create a list of the public functions that can actually be called), and then winnowing it by analyzing where bounds and `Self` types to see if any of the found methods can actually apply (again, just like with the list of public functions). I wonder if there is room for doing the same thing with unstable functions instead of running all of method resolution twice. r? ``@compiler-errors`` for method resolution stuff
2024-06-05Auto merge of #126005 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 9 commits in 7a6fad0984d28c8330974636972aa296b67c4513..34a6a87d8a2330d8c9d578f927489689328a652d 2024-05-31 22:26:03 +0000 to 2024-06-04 15:31:01 +0000 - Silence the warning about forgetting the vendoring (rust-lang/cargo#13886) - fix(vendor): Ensure sort happens for vendor (rust-lang/cargo#14004) - fix(add): Avoid escaping double-quotes by using string literals (rust-lang/cargo#14006) - refactor(source): Split `RecursivePathSource` out of `PathSource` (rust-lang/cargo#13993) - doc: Add README for resolver-tests (rust-lang/cargo#13977) - Allows the default git/gitoxide configuration to be obtained from the ENV and config (rust-lang/cargo#13687) - refactor: Transition direct assertions from cargo-test-support to snapbox (rust-lang/cargo#13980) - Fix: Skip deserialization of unrelated fields with overlapping name (rust-lang/cargo#14000) - chore(deps): update alpine docker tag to v3.20 (rust-lang/cargo#13996) r? ghost
2024-06-05Keep config diagnostics across changesLukas Wirth-100/+213
2024-06-05Diagnose most incorrect ra-toml config errorsLukas Wirth-25/+135
2024-06-05Auto merge of #17348 - regexident:fix-type-or-const-param-source, r=Veykrilbors-2/+2
Use `.get(…)` instead of `[…]` in `TypeOrConstParam::source(…)` and `LifetimeParam::source(…)` Resolves #17344.
2024-06-05Resolve #17344 by using `.get(…)` instead of `[…]` in ↵Vincent Esche-2/+2
`TypeOrConstParam::source(…)` (… and `LifetimeParam::source(…)`)
2024-06-05Fix local configs allowing to contain global changesLukas Wirth-15/+17
2024-06-05Shuffle around some of the configs between the levelsLukas Wirth-315/+278
2024-06-05Apply requested changes round 3Ali Bektas-31/+36
2024-06-05Apply requested changes round 2Ali Bektas-1269/+1159
2024-06-05Apply suggested changesAli Bektas-299/+1878
2024-06-05Add debug info to invalid offset errorLukas Wirth-2/+3
2024-06-05Rollup merge of #125815 - nnethercote:rustc_parse-top-level-cleanups, ↵Jubilee-20/+15
r=spastorino `rustc_parse` top-level cleanups A bunch of improvements in and around `compiler/rustc_parse/src/lib.rs`. Many of the changes streamline the API in that file from this (12 functions and one macro): ``` name args return type ---- ---- ----------- panictry_buffer! Result<T, Vec<Diag>> T pub parse_crate_from_file path PResult<Crate> pub parse_crate_attrs_from_file path PResult<AttrVec> pub parse_crate_from_source_str name,src PResult<Crate> pub parse_crate_attrs_from_source_str name,src PResult<AttrVec> pub new_parser_from_source_str name,src Parser pub maybe_new_parser_from_source_str name,src Result<Parser, Vec<Diag>> pub new_parser_from_file path,error_sp Parser maybe_source_file_to_parser srcfile Result<Parser, Vec<Diag>> pub parse_stream_from_source_str name,src,override_sp TokenStream pub source_file_to_stream srcfile,override_sp TokenStream maybe_file_to_stream srcfile,override_sp Result<TokenStream, Vec<Diag>> pub stream_to_parser stream,subparser_name Parser ``` to this: ``` name args return type ---- ---- ----------- unwrap_or_emit_fatal Result<T, Vec<Diag>> T pub new_parser_from_source_str name,src Result<Parser, Vec<Diag>> pub new_parser_from_file path,error_sp Result<Parser, Vec<Diag>> new_parser_from_source_file srcfile Result<Parser, Vec<Diag>> pub source_str_to_stream name,src,override_sp Result<TokenStream, Vec<Diag>> source_file_to_stream srcfile,override_sp Result<TokenStream, Vec<Diag>> ``` I found the old API quite confusing, with lots of similar-sounding function names and no clear structure. I think the new API is much better. r? `@spastorino`
2024-06-05Rollup merge of #125683 - Oneirical:patience-testing-test, r=jieyouxuJubilee-3/+7
Rewrite `suspicious-library`, `resolve-rename` and `incr-prev-body-beyond-eof` `run-make` tests in `rmake.rs` format Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Some oddly specific ignore flags in `incr-prev-body-beyond-eof`: ```rs // ignore-none // ignore-nvptx64-nvidia-cuda ``` it could be interesting to run a try job, but it seems there is no nvidia-cuda in the CI settings (`jobs.yml`). try-job: armhf-gnu
2024-06-05fmtThe Miri Cronjob Bot-3/+1
2024-06-05Merge from rustcThe Miri Cronjob Bot-1091/+3430
2024-06-05Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-06-04fmtChosenName-4/+4
2024-06-04fmtChosenName-5/+4