about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-02-18Auto merge of #117772 - surechen:for_117448, r=petrochenkovbors-35/+20
Tracking import use types for more accurate redundant import checking fixes #117448 By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-18tidy: add windows-coreklensy-0/+1
2024-02-18windows bump to 0.52klensy-1/+1
2024-02-18opt-dist: bump derive_builder to dedupe darling* and remove one more syn 1.* depklensy-1/+1
2024-02-18Auto merge of #121255 - lnicola:sync-from-ra, r=lnicolabors-1959/+7095
Subtree update of `rust-analyzer` r? ghost
2024-02-18By tracking import use types to check whether it is scope uses or the other ↵surechen-1/+0
situations like module-relative uses, we can do more accurate redundant import checking. fixes #117448 For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-18By tracking import use types to check whether it is scope uses or the other ↵surechen-35/+20
situations like module-relative uses, we can do more accurate redundant import checking. fixes #117448 For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-18Auto merge of #121034 - obeis:improve-static-mut-ref, r=RalfJungbors-6/+6
Improve wording of `static_mut_ref` Close #120964
2024-02-18Merge commit 'ac998a74b3c8ff4b81c3eeb9a18811d4cc76226d' into sync-from-raLaurențiu Nicola-1959/+7095
2024-02-18fmtThe Miri Conjob Bot-2/+1
2024-02-18Merge from rustcThe Miri Conjob Bot-21/+56
2024-02-18Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2024-02-18Rollup merge of #121218 - ShoyuVanilla:fix-issue-76736, r=notriddleLeón Orell Valerian Liehr-7/+16
Fix missing trait impls for type in rustc docs Fixes #76736
2024-02-18Rollup merge of #121160 - fmease:rustdoc-fix-n-refactor-html-rendering, ↵León Orell Valerian Liehr-281/+173
r=GuillaumeGomez rustdoc: fix and refactor HTML rendering a bit * refactoring: get rid of a bunch of manual `f.alternate()` branches * not sure why this wasn't done so already, is this perf-sensitive? * fix an ICE in debug builds of rustdoc * rustdoc used to crash on empty outlives-bounds: `where 'a:` * properly escape const generic defaults * actually print empty trait and outlives-bounds (doesn't work for cross-crate reexports yet, will fix that at some other point) since they can have semantic significance * outlives-bounds: forces lifetime params to be early-bound instead of late-bound which is technically speaking part of the public API * trait-bounds: can affect the well-formedness, consider * makeshift “const-evaluatable” bounds under `generic_const_exprs` * bounds to force wf-checking in light of #100041 (quite artificial I know, I couldn't figure out something better), see https://github.com/rust-lang/rust/pull/121160#discussion_r1491563816
2024-02-18Rollup merge of #120526 - GuillaumeGomez:mobile-long-crate-name, r=notriddleLeón Orell Valerian Liehr-7/+2
rustdoc: Correctly handle long crate names on mobile Fixes https://github.com/rust-lang/rust/issues/120471. It now renders like this: ![image](https://github.com/rust-lang/rust/assets/3050060/065b4b8b-ba55-4163-a928-8d7bf735c111) r? `@notriddle`
2024-02-17Remove old issues.txt entries with --blessJubilee Young-124/+97
2024-02-17Implement --bless for the issues lintJubilee Young-8/+33
2024-02-18Improve wording of static_mut_refObei Sideg-6/+6
Rename `static_mut_ref` lint to `static_mut_refs`.
2024-02-18Auto merge of #121214 - weihanglo:update-cargo, r=weihanglobors-0/+2
Update cargo 12 commits in fc1d58fd0531a57a6b942a14cdcdbcb82ece16f3..7b7af3077bff8d60b7f124189bc9de227d3063a9 2024-02-09 15:54:29 +0000 to 2024-02-17 14:13:00 +0000 - Remove unnecessary `use` statement in metabuild (rust-lang/cargo#13455) - chore: Update snapbox (rust-lang/cargo#13441) - chore(deps): update openssl to 3.2.1 again (rust-lang/cargo#13449) - fix(test): Suggest `--` for libtest arguments (rust-lang/cargo#13448) - chore(ci): Drop MSRV:1 patch field (rust-lang/cargo#13442) - fix(add): Remove inconsistent period (rust-lang/cargo#13446) - fix(add): Ensure users know a feature is being created (rust-lang/cargo#13434) - Update tests for changes in latest nightly (rust-lang/cargo#13444) - docs: Minor clarification of build script metadata. (rust-lang/cargo#13436) - Fix old_cargos tests (rust-lang/cargo#13435) - Fix confusing error messages for sparse index replaced source (rust-lang/cargo#13433) - Enable edition migration for 2024 (rust-lang/cargo#13429)
2024-02-17Update cargoWeihang Lo-0/+2
perl-core is added for building OpenSSL v3 See https://github.com/openssl/openssl/blob/openssl-3.2.1/NOTES-PERL.md
2024-02-18Move the extra directives for `Mode::CoverageRun` into `iter_header`Zalathar-39/+21
When these extra directives were ported over as part of #112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that #120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
2024-02-18Wrap `iter_header` callback arguments in a documentable structZalathar-12/+24
2024-02-17Grandfather new questionably-named testsJubilee Young-1387/+1519
~130 new entries, depending on how you count, with the rest being sorting churn.
2024-02-17Suggest pattern in meaningful test diagnosticJubilee Young-4/+4
As the reason for tidy failing the test name may seem slightly opaque, provide a suggestion on how to rename the file. There are some tests which merely would require reordering of the name according to the rule. I could modify the diagnostic further to identify those, but doing such would make it prone to bad suggestions. I have opted to trust contributors to recognize the diagnostic is robotic, as the pattern we are linting on is easier to match if we do not speculate on what parts of the name are meaningful: sometimes a word is a reason, but sometimes it is a mere "tag", such as with a pair like: issue-314159265-blue.rs issue-314159265-red.rs Starting them with `red-` and `blue-` means they do not sort together, despite being related, and the color names are still not very descriptive. Recognizing a good name is an open-ended task, though this pair might be: colored-circle-gen-blue.rs colored-circle-gen-red.rs Deciding exactly how to solve this is not the business of tidy, only recognizing a what.
2024-02-17Reapply "add tidy check that forbids issue ui test filenames"Jubilee Young-6/+4329
This reverts commit 686b3debfc19f124c9c2ec8a856c06892f6086a1.
2024-02-17Auto merge of #121240 - matthiaskrgr:rollup-lfb5i9w, r=matthiaskrgrbors-6/+24
Rollup of 9 pull requests Successful merges: - #120952 (Don't use mem::zeroed in vec::IntoIter) - #121085 (errors: only eagerly translate subdiagnostics) - #121091 (use build.rustc config and skip-stage0-validation flag) - #121149 (Fix typo in VecDeque::handle_capacity_increase() doc comment.) - #121193 (Use fulfillment in next trait solver coherence) - #121209 (Make `CodegenBackend::join_codegen` infallible.) - #121210 (Fix `cfg(target_abi = "sim")` on `i386-apple-ios`) - #121228 (create stamp file for clippy) - #121231 (remove a couple of redundant clones) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-17Rollup merge of #121231 - matthiaskrgr:cloone, r=compiler-errorsMatthias Krüger-2/+2
remove a couple of redundant clones
2024-02-17Rollup merge of #121228 - onur-ozkan:fix-clippy-stamp-bug, r=albertlarsan68Matthias Krüger-0/+1
create stamp file for clippy Due to missing stamp file, we were downloading (and applying nix patches if enabled) continuously every time `Config::download_clippy` was called. This change fixes that by creating stamp file at the end of the function. Fixes #119442
2024-02-17Rollup merge of #121091 - onur-ozkan:bypass-stage0-download-in-tests, ↵Matthias Krüger-3/+9
r=albertlarsan68 use build.rustc config and skip-stage0-validation flag This change helps us to bypass downloading the beta compiler in bootstrap tests. more context: https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/tests.20causing.20downloads.20of.20native.20rustc.20for.20other.20platforms/near/421467975
2024-02-17Rollup merge of #121085 - davidtwco:always-eager-diagnostics, r=nnethercoteMatthias Krüger-1/+12
errors: only eagerly translate subdiagnostics Subdiagnostics don't need to be lazily translated, they can always be eagerly translated. Eager translation is slightly more complex as we need to have a `DiagCtxt` available to perform the translation, which involves slightly more threading of that context. This slight increase in complexity should enable later simplifications - like passing `DiagCtxt` into `AddToDiagnostic` and moving Fluent messages into the diagnostic structs rather than having them in separate files (working on that was what led to this change). r? ```@nnethercote```
2024-02-17Auto merge of #120023 - klensy:tidy-alloc, r=Mark-Simulacrumbors-14/+24
tidy: reduce allocs this reduces allocs in tidy from (dhat output) ``` ==31349== Total: 1,365,199,543 bytes in 4,774,213 blocks ==31349== At t-gmax: 10,975,708 bytes in 66,093 blocks ==31349== At t-end: 2,880,947 bytes in 12,332 blocks ==31349== Reads: 5,210,008,956 bytes ==31349== Writes: 1,280,920,127 bytes ``` to ``` ==66633== Total: 791,565,538 bytes in 3,503,144 blocks ==66633== At t-gmax: 10,914,511 bytes in 65,997 blocks ==66633== At t-end: 395,531 bytes in 941 blocks ==66633== Reads: 4,249,388,949 bytes ==66633== Writes: 814,119,580 bytes ``` <del>by wrapping regex and updating `ignore` (effect probably not only from `ignore`, didn't measured)</del> also moves one more regex into `Lazy` to reduce regex rebuilds.
2024-02-17add direct test of pthread_condRalf Jung-4/+52
2024-02-17Auto merge of #121232 - RalfJung:miri, r=RalfJungbors-263/+2116
Miri subtree update r? `@ghost`
2024-02-17Fix non_local_definitions lint in rustdocUrgau-5/+7
2024-02-17Allow newly added non_local_definitions in rustfmtUrgau-0/+1
2024-02-17Allow newly added non_local_definitions lint in clippyUrgau-73/+86
2024-02-17remove a couple of redundant clonesMatthias Krüger-2/+2
2024-02-17create stamp file for clippy in `Config::download_clippy`onur-ozkan-0/+1
Due to missing stamp file, we were downloading (and applying nix patches if enabled) continuously every time `Config::download_clippy` was called. This change fixes that by creating stamp file at the end of the function. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-17compiletest: fix regex rebuildsklensy-2/+4
2024-02-17tidy: wrap regexes with lazy_staticklensy-12/+20
yes, once_cell better, but ... this reduces from ==31349== Total: 1,365,199,543 bytes in 4,774,213 blocks ==31349== At t-gmax: 10,975,708 bytes in 66,093 blocks ==31349== At t-end: 2,880,947 bytes in 12,332 blocks ==31349== Reads: 5,210,008,956 bytes ==31349== Writes: 1,280,920,127 bytes to ==47796== Total: 821,467,407 bytes in 3,955,595 blocks ==47796== At t-gmax: 10,976,209 bytes in 66,100 blocks ==47796== At t-end: 2,944,016 bytes in 12,490 blocks ==47796== Reads: 4,788,959,023 bytes ==47796== Writes: 975,493,639 bytes miropt-test-tools: remove regex usage this removes regex usage and slightly refactors ext stripping in one case
2024-02-17Fix missing trait impls for type in rustc docsShoyu Vanilla-7/+16
2024-02-17Merge from rustcThe Miri Conjob Bot-364/+718
2024-02-17Enable `ConstPropLint` for promotedsGurinder Singh-1/+6
This fixes the issue wherein the lint didn't fire for promoteds in the case of SHL/SHR operators in non-optimized builds and all arithmetic operators in optimized builds
2024-02-17Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2024-02-16Auto merge of #120881 - jieyouxu:migrate-ui-test-directives, r=oli-obkbors-302/+571
Migrate ui tests from legacy compiletest-style directives `//` to `ui_test`-style directives `//@` ## Preface There's an on-going effort to rewrite parts of or the entirety of compiletest (<https://github.com/rust-lang/compiler-team/issues/536>). A step towards this involve migrating ui tests to use the [`ui_test`](https://github.com/oli-obk/ui_test) framework, which involves changing compiletest directives in `// <directive-name>` style to `ui_test` `//@ <directive-name>` style (https://github.com/rust-lang/compiler-team/issues/512). This PR aims to implement the directive-style change from `//` to `//`@`` for ui tests only and make compiletest only accept `//`@`` directives in the "ui" test suite (only). ## Key Changes 1. All ui test `//` directives are replaced by `//`@`` directives. 2. Only accept `//`@`` directives for "ui" test suite. 3. Errors if a comment could be interpreted as a legacy-style `//` directive. ## Diff Generation The diff is generated by: - Collecting directives from ui tests via hacking on compiletest. - Using a migration tool to replace `//` directives in ui tests with `//`@`.` ### Reproduction Steps 0. Delete the temporary directory `$RUSTC_REPO_PATH/build/x86_64-apple-darwin/test/ui/__directive_lines` and the temporary file `$RUSTC_REPO_PATH/build/x86_64-apple-darwin/test/ui/__directive_lines.txt` (if you ran the collection script before). 1. Use the <https://github.com/jieyouxu/rust/tree/collect-test-directives> collect-test-directives script, which outputs temporary files recording headers occuring in each ui test. - You need to checkout this branch: `git checkout collect-test-directives`. - You might need to rebase on lastest master and ensure there are no conflicts. - You likely need to run `./x test tests/ui --stage 1 --force-rerun` to generate the temporary files consistently. 2. Checkout the `migrate-ui-test-directives` branch. 4. Run the migration tool <https://github.com/jieyouxu/compiletest-ui_test-header-migration>. - You will need to first generate a `migration_config.toml` via `cargo run -- generate-config` under `$CWD`. - Then, update `manual_directives = ["// should-fail"]` in `migration_config.toml`. This is required because the collection script doesn't deal with some special meta ui tests and there are no other `// should-fail` occurrences. 5. Check that the migration at least does not cause UI test failures if you change compiletest to accept `//`@`` directives for ui tests only. - `RUSTC_TEST_FAIL_FAST=1 ./x test tests/ui --stage 1 --bless` 6. Confirm that there is no difference after running the migration tool when you are on the `migrate-ui-test-directives` branch. ## Next Steps - [x] ~~Need to implement some kind of warning or tidy script to help contributors catch old-style `// <directive-name>` directives, while only accepting `ui_test`-style `//@ <directive-name>` directives.~~ An error is emitted if a comment that could be interpreted as legacy-style test directive is encountered. - [ ] Need to properly document this change in e.g. rustc-dev-guide (https://github.com/rust-lang/rustc-dev-guide/pull/1885). - [x] Add a `README.md` to `tests/ui` describing the directive style change.
2024-02-16Implement x86 AVX intrinsicsEduardo Sánchez Muñoz-50/+1844
2024-02-16rustdoc: fix and refactor HTML rendering a bitLeón Orell Valerian Liehr-281/+173
2024-02-16Implement infra support for migrating from `//` to `//@` ui test directives许杰友 Jieyou Xu (Joe)-302/+571
2024-02-16Auto merge of #120348 - bjorn3:per_target_backend_selection, r=albertlarsan68bors-37/+74
Support configuring the set of codegen backends to build per host triple This allows building the compiler itself with one backend while using another backend at runtime. For example this allows compiling rustc to wasm using LLVM, while using Cranelift at runtime to produce actual code. Cranelift can't compile to wasm, but is perfectly capable of running on wasm. LLVM can compile to wasm, but can't run on wasm. [^1] [^1]: The prototype of this still requires a couple of other patches.
2024-02-16Rollup merge of #121137 - GuillaumeGomez:add-clippy-cfg, r=Urgau,NilstriebGuillaume Gomez-1/+2
Add clippy into the known `cfg` list In clippy, we are removing the `feature = "cargo-clippy"` cfg to replace it with `clippy` in https://github.com/rust-lang/rust-clippy/pull/12292. But for it to work, we need to declare `clippy` as cfg. It makes it more coherent with other existing tools like rustdoc. cc `@flip1995`