about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-07-14Rollup merge of #113685 - Kobzol:opt-dist-binary-sizes, r=Mark-SimulacrumMatthias Krüger-5/+45
Print artifact sizes in `opt-dist` The Python PGO script printed a nice table of artifact sizes (`librustc_driver.so`, `libLLVM.so`, ...) at the end of the CI run, which was useful to quickly see the sizes of important files. I forgot to port this functionality into the Rust (`opt-dist`) version in https://github.com/rust-lang/rust/pull/112235. This PR fixes that. r? bootstrap
2023-07-14Auto merge of #113591 - mdibaiee:genericargs-cleanup, r=oli-obkbors-405/+403
refactor(rustc_middle): Substs -> GenericArg resolves #110793 - [x] rename `SubstsRef` and `InternalSubsts` to `GenericArgsRef<'tcx>` and `GenericArgs<'tcx>`. - [x] rename variables and fields currently using `substs` to `args`. - [x] update the module name of `ty::subst` to `ty::generic_args` or sth. Make that module private and publicly reexport its content in the ty module. - [x] rename `EarlyBinder::subst(_identity)` to `EarlyBinder::instantiate(_identity)`. - [x] types called `[a-zA-Z]+Substs` renamed to `XArgs`. - [x] functions containing `substs` now use `args` or `generic_args` (mostly the former). However, the verb of "substituting" is still being used here and there, mostly in comments. I think that can be a separate PR as part of https://github.com/rust-lang/rust/issues/110254 to change the verb to `replace_generics` or something similar.
2023-07-14Print artifact sizes in `opt-dist`Jakub Beránek-5/+45
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-405/+403
2023-07-14bootstrap: update defaults for `compiler` and `library` aliasesLukas Markeffsky-86/+114
2023-07-14Rollup merge of #113668 - kupiakos:patch-1, r=calebcartwrightMatthias Krüger-1/+1
Correct `the` -> `there` typo in items.md
2023-07-14Rollup merge of #113640 - jyn514:nodejs-defaults, r=GuillaumeGomezMatthias Krüger-43/+39
Make `nodejs` control the default for RustdocJs tests instead of a hard-off switch If someone says `x test rustdoc-js-std` explicitly on the command line, it's because they want to run the tests. Give an error instead of doing nothing and reporting success. Before: ``` ; x t rustdoc-js No nodejs found, skipping "tests/rustdoc-js" tests Build completed successfully in 0:00:00 ``` After: ``` ; x t rustdoc-js thread 'main' panicked at 'need nodejs to run js-doc-test suite', test.rs:1566:13 Build completed unsuccessfully in 0:00:00 ``` I recommend viewing the diff with whitespace changes disabled. r? ````@GuillaumeGomez````
2023-07-13Rollup merge of #113623 - GuillaumeGomez:add-jump-to-doc, r=notriddleMatthias Krüger-25/+84
Add jump to doc I'm using the source code pages of the compiler quite a lot, but one thing missing is the possibility to jump back from the source code to the item documentation. Since I also got a few others complaining about it, I think it's fine to add it since this option is nightly only. This PR adds a link to jump back to item's documentation on the item definition (so on `Bar` in `struct Bar {... }`, as described in the unofficial [RFC](https://github.com/GuillaumeGomez/rfcs/blob/rustdoc-jump-to-definition/text/000-rustdoc-jump-to-definition.md)). r? ````@notriddle````
2023-07-13Correct `the` -> `there` typo in items.mdAlyssa Haroldsen-1/+1
2023-07-13Auto merge of #113637 - Mark-Simulacrum:bootstrap-bump, r=ozkanonurbors-465/+444
Bump bootstrap to 1.72 beta
2023-07-13Rollup merge of #113616 - edg-l:fix_bootstrap, r=albertlarsan68Matthias Krüger-1/+1
Fix bootstrap.py uname error The x.py script fails with `ValueError: too many values to unpack (expected 3)` when uname -smp gives more than 3 words The error I got: ``` ❯ ./x check Traceback (most recent call last): File "/data1/edgar/rust/x.py", line 50, in <module> bootstrap.main() File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 1113, in main bootstrap(args) File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 1070, in bootstrap build = RustBuild(config_toml, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 505, in __init__ self.build = args.build or self.build_triple() ^^^^^^^^^^^^^^^^^^^ File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 976, in build_triple return config or default_build_triple(self.verbose) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data1/edgar/rust/src/bootstrap/bootstrap.py", line 259, in default_build_triple kernel, cputype, processor = uname.decode(default_encoding).split() ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: too many values to unpack (expected 3) ``` This is because ``` ❯ uname -smp Linux x86_64 AMD Ryzen 7 5800X 8-Core Processor ``` Returns more than 3 space separated words.
2023-07-13Rollup merge of #113613 - GuillaumeGomez:allow-dash-in-file-name, r=notriddleMatthias Krüger-4/+13
Allow to have `-` in rustdoc-json test file name I extracted this commit from https://github.com/rust-lang/rust/pull/113574. When I added the test, it kept saying that the JSON file couldn't be found. After investigating for a while, I discovered that we were expecting files to always use `_`, which is quite bad. So I added support for `-` in file names. r? ``@notriddle``
2023-07-13Rollup merge of #113603 - workingjubilee:test-for-98016, r=oli-obkMatthias Krüger-12/+13
Test simd-wide-sum for codegen error This adds the necessary test infrastructure to "build-pass" codegen tests, for the purpose of doing that for a single revision of a codegen test. When mir-opts are tested, the output may vary from the usual, and maybe for positive reasons... but we don't necessarily want to output such bad LLVMIR that LLVM starts crashing on it. Currently when enabling MIR opts at higher levels this LLVMIR is still emitted, but it was previously disabled for getting in mir-opt's way and as this new revision without `// [mir-opt3]build-pass` would make it more likely to, I would like to not see the testing for the actual results regress again just because it was bundled with an ICE check as well. This fixes https://github.com/rust-lang/rust/issues/98016
2023-07-13Rollup merge of #113598 - weihanglo:update-cargo, r=weihangloMatthias Krüger-0/+3
Update cargo 10 commits in 45782b6b8afd1da042d45c2daeec9c0744f72cc7..694a579566a9a1482b20aff8a68f0e4edd99bd28 2023-07-05 16:54:51 +0000 to 2023-07-11 22:28:29 +0000 - fix(embedded): Always generate valid package names (rust-lang/cargo#12349) - fix(embedded): Error on unsupported commands (rust-lang/cargo#12350) - chore(ci): Automatically test new packages by using `--workspace` (rust-lang/cargo#12342) - contrib docs: Add some more detail about how publishing works (rust-lang/cargo#12344) - docs: Put cargo-add change under nightly (rust-lang/cargo#12343) - Minor: Use "number" instead of "digit" when explaining Cargo's use of semver (rust-lang/cargo#12340) - Update criterion (rust-lang/cargo#12338) - Add profile strip to config docs. (rust-lang/cargo#12337) - update re: multiple versions that differ only in the metadata tag (rust-lang/cargo#12335) - doc: state `PackageId`/`SourceId` string is opaque (rust-lang/cargo#12313) r? ``@ghost``
2023-07-13Rollup merge of #113353 - compiler-errors:select-better, r=lcnrMatthias Krüger-1/+1
Implement selection for `Unsize` for better coercion behavior In order for much of coercion to succeed, we need to be able to deal with partial ambiguity of `Unsize` traits during selection. However, I pessimistically implemented selection in the new trait solver to just bail out with ambiguity if it was a built-in impl: https://github.com/rust-lang/rust/blob/9227ff28aff55b252314076fcf21c9a66f10ac1e/compiler/rustc_trait_selection/src/solve/eval_ctxt/select.rs#L126 This implements a proper "rematch" procedure for dealing with built-in `Unsize` goals, so that even if the goal is ambiguous, we are able to get nested obligations which are used in the coercion selection-like loop: https://github.com/rust-lang/rust/blob/9227ff28aff55b252314076fcf21c9a66f10ac1e/compiler/rustc_hir_typeck/src/coercion.rs#L702 Second commit just moves a `resolve_vars_if_possible` call to fix a bug where we weren't detecting a trait upcasting to occur. r? ``@lcnr``
2023-07-13Make `nodejs` control the default for RustdocJs tests instead of a hard-off ↵jyn-43/+39
switch If someone says `x test rustdoc-js-std` explicitly on the command line, it's because they want to run the tests. Give an error instead of doing nothing and reporting success.
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-57/+76
2023-07-12Bump bootstrap compiler to latestMark Rousskov-408/+368
2023-07-12Auto merge of #113621 - ehuss:ignore-clippy-tests, r=Nilstriebbors-0/+9
Ignore flaky clippy tests. These tests are frequently failing due to an issue in ui_test. ui_test doesn't appear to have a blanket ignore instruction that I could find, so I just approximated it with ignoring both 32 and 64 bit. Fixes #113585
2023-07-12Add jump to docGuillaume Gomez-25/+84
2023-07-12Ignore flaky clippy tests.Eric Huss-0/+9
2023-07-12Auto merge of #113214 - GuillaumeGomez:try-run-fix, r=ozkanonur,jyn514bors-27/+22
Don't fail early if `try_run` returns an error Fixes https://github.com/rust-lang/rust/issues/113208. Follow-up of #112962. r? `@jyn514`
2023-07-12Auto merge of #112945 - compiler-errors:tighten-span-of-adjustment-error, ↵bors-15/+8
r=oli-obk (re-)tighten sourceinfo span of adjustments in MIR Diagnostics rely on the spans of MIR statements being (approximately) correct in order to give suggestions relative to that span (i.e. `shrink_to_hi` and `shrink_to_lo`). I discovered that we're *intentionally* lowering THIR exprs with their parent expr's span if they come from adjustments that are due to a parent expression. While I understand why that may be desirable to demonstrate the relationship of an adjustment and the expression that requires it, it leads to 1. very verbose borrowck output 2. incorrect spans for suggestions Some diagnostics get around that by giving suggestions relative to other spans we've collected during MIR lowering, such as the span of the method's identifier (e.g. `name` in `.name()`), but this doesn't work too well when things come from desugaring. I assume it also has lead to numerous tweaks and complications to diagnostics code down the road, which this PR doesn't necessarily aim to fix but may open the gates to fixing later... The last three commits are simplifications due to the fact that we can assume that the move span actually points to what is being moved (and a test). This regressed in #89110, which was debated somewhat in #90286. cc `@Aaron1011` who originally made this change. r? diagnostics Fixes #113547 Fixes #111016
2023-07-12Auto merge of #113569 - RalfJung:miri, r=oli-obkbors-84/+546
miri: protect Move() function arguments during the call This gives `Move` operands a meaning specific to function calls: - for the duration of the call, the place the operand comes from is protected, making all read and write accesses insta-UB. - the contents of that place are reset to `Uninit`, so looking at them again after the function returns, we cannot observe their contents Turns out we can replace the existing "retag return place" hack with the exact same sort of protection on the return place, which is nicely symmetric. Fixes https://github.com/rust-lang/rust/issues/112564 Fixes https://github.com/rust-lang/miri/issues/2927 This starts with a Miri rustc-push, since we'd otherwise conflict with a PR that recently landed in Miri. (The "miri tree borrows" commit is an unrelated cleanup I noticed while doing the PR. I can remove it if you prefer.) r? `@oli-obk`
2023-07-12Update cargoWeihang Lo-0/+3
2023-07-12Fix bootstrap.py uname error.Edgar Luque-1/+1
The x.py script fails with `ValueError: too many values to unpack (expected 3)` when uname -smp gives more than 3 words
2023-07-12Allow to have `-` in the rustdoc-json test file nameGuillaume Gomez-4/+13
2023-07-11Rollup merge of #113579 - ekusiadadus:master, r=albertlarsan68Jubilee-5/+1
Revert "fix: :bug: etc/bash_complettion -> src/etc/... to avoid copy … ## why - [x] revert my broken PR https://github.com/rust-lang/rust/pull/110906 This reverts commit 08ce68b6a6bad360e9c3611ad60cf6598401f878.
2023-07-11Rollup merge of #113385 - joshtriplett:style-guide-cleanup-chains, ↵Jubilee-4/+3
r=calebcartwright style-guide: Fix chain example to match rustfmt behavior The style guide gave an example of breaking a multi-line chain element and all subsequent elements to a new line, but that same example and the accompanying text also had several chain items stacked on the first line. rustfmt doesn't do this, except when the rule saying to combine ``` shrt .y() ``` into ``` shrt.y() ``` applies. This is a bugfix to match rustfmt behavior, so it's not a breaking change, and it just needs a ``@rust-lang/style`` reviewer to r+.
2023-07-11Rollup merge of #113373 - jyn514:download-rustc-fixes, r=albertlarsan68Jubilee-29/+63
various download-rustc fixes separated out from https://github.com/rust-lang/rust/pull/112143 because it keeps getting stuck in limbo. best reviewed commit-by-commit
2023-07-11Revert "Fix `x test lint-docs` when download-rustc is enabled"jyn-7/+0
This was not the correct fix. The problem was two-fold: - `download-rustc` didn't respect `llvm.assertions` - `rust-dev` was missing a bump to `download-ci-llvm-stamp` The first is fixed in this PR and the latter was fixed a while ago. Revert this change to avoid breaking `rpath = false`.
2023-07-11Move `ci_rustc_dir` to Config and use it consistentlyjyn-8/+9
2023-07-11Support build-pass in codegen testsJubilee Young-12/+13
2023-07-11fix handling of alignment for dyn-sized placesRalf Jung-5/+6
2023-07-11miri tree borrows: skip retag_reference early if there is no NewPermissionRalf Jung-13/+15
2023-07-11miri: protect Move() function arguments during the callRalf Jung-85/+422
2023-07-12Revert "fix: :bug: etc/bash_complettion -> src/etc/... to avoid copy error"ekusiadadus-5/+1
This reverts commit 08ce68b6a6bad360e9c3611ad60cf6598401f878.
2023-07-11Don't fail early if `try_run` returns an errorGuillaume Gomez-27/+22
2023-07-11Auto merge of #111717 - Urgau:uplift_fn_null_check, r=oli-obkbors-223/+64
Uplift `clippy::fn_null_check` lint This PR aims at uplifting the `clippy::fn_null_check` lint into rustc. ## `incorrect_fn_null_checks` (warn-by-default) The `incorrect_fn_null_checks` lint checks for expression that checks if a function pointer is null. ### Example ```rust let fn_ptr: fn() = /* somehow obtained nullable function pointer */ if (fn_ptr as *const ()).is_null() { /* ... */ } ``` ### Explanation Function pointers are assumed to be non-null, checking for their nullity is incorrect. ----- Mostly followed the instructions for uplifting a clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751 `@rustbot` label: +I-lang-nominated r? compiler
2023-07-11Auto merge of #113559 - matthiaskrgr:rollup-jrqyctc, r=matthiaskrgrbors-8/+22
Rollup of 7 pull requests Successful merges: - #113386 (style-guide: Expand example of combinable expressions to include arrays) - #113523 (Reuse LLVMConstInBoundsGEP2) - #113528 (Dynamically size sigaltstk in rustc) - #113543 (Remove `rustc_llvm` from llvm-stamp nags) - #113548 (Update books) - #113551 (bootstrap: Don't print "Skipping" twice) - #113556 (Don't use serde-derive in the rls shim) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-11Rollup merge of #113556 - cuviper:trim-rls, r=Mark-SimulacrumMatthias Krüger-5/+5
Don't use serde-derive in the rls shim The already-small RLS shim can get a little smaller, and faster to build, if we drop the serde-derive dependency and decode the one "method" field it needs manually from `serde_json::Value`.
2023-07-11Rollup merge of #113551 - jyn514:dry-run-exclude, r=ozkanonurMatthias Krüger-3/+7
bootstrap: Don't print "Skipping" twice Bootstrap executes itself twice: once with DryRun::SelfCheck and DryRun::Disabled. Change it not to print the "Skipping" message if SelfCheck is enabled. See https://github.com/rust-lang/rust/actions/runs/5503931599/jobs/10029625567?pr=113514#step:24:772.
2023-07-11Rollup merge of #113548 - rustbot:docs-update, r=ehussMatthias Krüger-0/+0
Update books ## rust-lang/book 1 commits in 21cf840842bdf768a798869f06373c96c1cc5122..668c64760b5c7ea654facb4ba5fe9faddfda27cc 2023-06-29 13:50:36 UTC to 2023-06-29 13:50:36 UTC - Remove adjective about what kind of number this is ## rust-lang/edition-guide 2 commits in f63e578b92ff43e8cc38fcaa257b660f45c8a8c2..2751bdcef125468ea2ee006c11992cd1405aebe5 2023-07-10 14:29:51 UTC to 2023-07-08 18:05:44 UTC - Update a link to a section in the cargo workspaces. (rust-lang/edition-guide#283) - b'...' byte strings -> byte chars (rust-lang/edition-guide#282) ## rust-embedded/book 2 commits in f2aed2fe8e9f55508c86ba3aa4b6789b18a08a22..1e5556dd1b864109985d5871616ae6b9164bcead 2023-06-29 07:34:47 UTC to 2023-06-27 23:43:06 UTC - add constgebra to list of math crates (rust-embedded/book#358) - Switch to GHMQ (rust-embedded/book#357) ## rust-lang/nomicon 1 commits in c369e4b489332f8721fbae630354fa83385d457d..302b995bcb24b70fd883980fd174738c3a10b705 2023-07-05 16:08:32 UTC to 2023-07-05 16:08:32 UTC - Minor improvements (rust-lang/nomicon#414) ## rust-lang/reference 5 commits in 5ca365eac678cb0d41a20b3204546d6ed70c7171..1ea0178266b3f3f613b0fabdaf16a83961c99cdb 2023-07-08 22:11:07 UTC to 2023-06-26 16:51:55 UTC - Remove doc of unstable feature of never type (rust-lang/reference#1376) - Typo: 'assingee' to 'assignee' in expressions.md (rust-lang/reference#1377) - str type: make sentence more readable (rust-lang/reference#1374) - Remove obsolete note about soundness hole in type-layout.md (rust-lang/reference#1367) - Typo: 'a' to 'an' in destructors.md (rust-lang/reference#1371) ## rust-lang/rust-by-example 1 commits in 57636d6926762861f34e030d52ca25a71e95e5bf..8a87926a985ce32ca1fad1be4008ee161a0b91eb 2023-07-07 22:44:06 UTC to 2023-07-07 22:44:06 UTC - Hint for RGB color calculation (rust-lang/rust-by-example#1726) ## rust-lang/rustc-dev-guide 18 commits in 17fe3e948498c50e208047a750f17d6a8d89669b..b5a12d95e32ae53791cc6ab44417774667ed2ac6 2023-07-09 14:50:50 UTC to 2023-06-28 04:55:24 UTC - fix: update link to function coverage (rust-lang/rustc-dev-guide#1727) - Fix a bug in getting-started.md (rust-lang/rustc-dev-guide#1726) - improve explanation of placing tests in separate file (rust-lang/rustc-dev-guide#1721) - various fixes/improvements to Contributing chapter (rust-lang/rustc-dev-guide#1723) - ty::ConstKind has moved (rust-lang/rustc-dev-guide#1724) - document `./x test --rustc-args` option (rust-lang/rustc-dev-guide#1719) - tests/run-make files have moved (rust-lang/rustc-dev-guide#1716) - replace dead link (rust-lang/rustc-dev-guide#1717) - fix link (rust-lang/rustc-dev-guide#1718) - update link (rust-lang/rustc-dev-guide#1709) - typo (rust-lang/rustc-dev-guide#1706) - OwningRef exists no more (rust-lang/rustc-dev-guide#1715) - Try to avoid confusion (rust-lang/rustc-dev-guide#1713) - Issue1707 doc simply use x (rust-lang/rustc-dev-guide#1710) - include rustc-dev-guide's own issues in suggested search (rust-lang/rustc-dev-guide#1708) - Improve feature gate and x.py docs (rust-lang/rustc-dev-guide#1701) - Fix some links (rust-lang/rustc-dev-guide#1705) - Define more lint terms. (rust-lang/rustc-dev-guide#1681)
2023-07-11Rollup merge of #113386 - joshtriplett:style-guide-combinable-expressions, ↵Matthias Krüger-0/+10
r=compiler-errors style-guide: Expand example of combinable expressions to include arrays Arrays are allowed as combinable expressions, but none of the examples show that.
2023-07-10Auto merge of #113544 - Kobzol:ci-macos-13, r=jyn514bors-1/+1
CI: use `macos-13` runner for Apple jobs Trying if performance of Apple CI improves with macOS 13 and SIP disabled. Speed-up: ``` x86_64-apple-1: ~2h 20m > ~1h 20m x86_64-apple-2: ~1h 45m > ~1h 15m ``` r? `@pietroalbini`
2023-07-10Don't use serde-derive in the rls shimJosh Stone-5/+5
The already-small RLS shim can get a little smaller, and faster to build, if we drop the serde-derive dependency and decode the one "method" field it needs manually from `serde_json::Value`.
2023-07-10Don't print "Skipping" twicejyn-3/+7
Bootstrap executes itself twice: once with DryRun::SelfCheck and DryRun::Disabled. Change it not to print the "Skipping" message if SelfCheck is enabled. See https://github.com/rust-lang/rust/actions/runs/5503931599/jobs/10029625567?pr=113514#step:24:772.
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-15/+8
2023-07-10Update booksrustbot-0/+0
2023-07-10Auto merge of #112988 - spastorino:new-rpitit-24, r=compiler-errorsbors-3/+2
Replace RPITIT current impl with new strategy that lowers as a GAT This PR replaces the current implementation of RPITITs with the new implementation that we had under -Zlower-impl-trait-in-trait-to-assoc-ty flag that lowers the RPIT as a GAT on the trait and on the impls that implement that trait. Opening this PR as a draft because this goes after #112682, ~#112981~ and ~#112983~. As soon as those are merged, I can rebase and we should run perf, crater and test a lot. r? `@compiler-errors`