about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-04-19Support linking to rust dylibs from a staticlibbjorn3-13/+65
2023-04-19Auto merge of #110393 - fee1-dead-contrib:rm-const-traits, r=oli-obkbors-1953/+1460
Rm const traits in libcore See [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const.20Trait.60.20removal.20or.20rework) * [x] Bless ui tests * [ ] Re constify some unstable functions with workarounds if they are needed
2023-04-19temporarily ignore run-make coverage testsDeadbeef-0/+6
2023-04-19Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwcobors-293/+398
Add `rustc_fluent_macro` to decouple fluent from `rustc_macros` Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-19Auto merge of #110522 - matthiaskrgr:rollup-9m7rw3u, r=matthiaskrgrbors-57/+303
Rollup of 7 pull requests Successful merges: - #110432 (Report more detailed reason why `Index` impl is not satisfied) - #110451 (Minor changes to `IndexVec::ensure_contains_elem` & related methods) - #110476 (Delay a good path bug on drop for `TypeErrCtxt` (instead of a regular delayed bug)) - #110498 (Switch to `EarlyBinder` for `collect_return_position_impl_trait_in_trait_tys`) - #110507 (boostrap: print output during building tools) - #110510 (Fix ICE for transmutability in candidate assembly) - #110513 (make `non_upper_case_globals` lint not report trait impls) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-19Rollup merge of #110513 - Ezrashaw:fix-trait-const-name-lint, r=compiler-errorsMatthias Krüger-6/+38
make `non_upper_case_globals` lint not report trait impls We should not lint on trait `impl`s for `non_upper_case_globals`; the user doesn't have control over the name. This brings `non_upper_case_globals` into consistency with other `nonstandard_style` lints.
2023-04-19Rollup merge of #110510 - bryangarza:issue-110467-safe-transmute, ↵Matthias Krüger-1/+18
r=compiler-errors Fix ICE for transmutability in candidate assembly Don't skip transmutability check just because there may be generics in the ParamEnv. Fixes #110467
2023-04-19Rollup merge of #110507 - weihanglo:print-try-run-output, r=jyn514Matthias Krüger-1/+1
boostrap: print output during building tools Fixes #110506
2023-04-19Rollup merge of #110498 - kylematsuda:earlybinder-rpitit-tys, r=compiler-errorsMatthias Krüger-20/+18
Switch to `EarlyBinder` for `collect_return_position_impl_trait_in_trait_tys` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `collect_return_position_impl_trait_in_trait_tys` query and removes `bound_return_position_impl_trait_in_trait_tys`. r? `@lcnr`
2023-04-19Rollup merge of #110476 - compiler-errors:ty-err-ctxt-good-path, r=lcnrMatthias Krüger-3/+21
Delay a good path bug on drop for `TypeErrCtxt` (instead of a regular delayed bug) r? `@lcnr` Perhaps we should just delete the `Drop` impl altogether though? Fixes rust-lang/rust-clippy#10645 `@matthiaskrgr:` I don't know how to make a clippy test for this. Any idea? Clippy's UI tests run with `-D warnings` and I have no idea how to switch it off to make a test that triggers this ICE in the clippy test suite 🤣
2023-04-19Rollup merge of #110451 - WaffleLapkin:ensure_return_elem, r=scottmcmMatthias Krüger-26/+24
Minor changes to `IndexVec::ensure_contains_elem` & related methods r? `@scottmcm`
2023-04-19Rollup merge of #110432 - compiler-errors:unsatisfied-index-impl, r=cjgillotMatthias Krüger-0/+183
Report more detailed reason why `Index` impl is not satisfied Fixes #110373
2023-04-19Auto merge of #110477 - miguelraz:canoodling2-electric-boogaloo, ↵bors-48/+56
r=compiler-errors Don't allocate on SimplifyCfg/Locals/Const on every MIR pass Hey! 👋🏾 This is a first PR attempt to see if I could speed up some rustc internals. Thought process: ```rust pub struct SimplifyCfg { label: String, } ``` in [compiler/src/rustc_mir_transform/simplify.rs](https://github.com/rust-lang/rust/blob/7908a1d65496b88626e4b7c193c81d777005d6f3/compiler/rustc_mir_transform/src/simplify.rs#L39) fires multiple times per MIR analysis. This means that a likely string allocation is happening in each of these runs, which may add up, as they are not being lazily allocated or cached in between the different passes. ...yes, I know that adding a global static array is probably not the future-proof solution, but I wanted to lob this now as a proof of concept to see if it's worth shaving off a few cycles and then making more robust.
2023-04-19make `non_upper_case_globals` lint not report trait implsEzra Shaw-6/+38
2023-04-19Auto merge of #110229 - jyn514:download-rustc-tests, r=albertlarsan68bors-17/+84
Fix no_std tests that load libc from the sysroot when download-rustc is enabled There were a series of unfortunate interactions here. Here's an MCVE of the test this fixes (committed as `tests/ui/meta/no_std-extern-libc.rs`): ```rust #![crate_type = "lib"] #![no_std] #![feature(rustc_private)] extern crate libc; ``` Before, this would give an error about duplicate versions of libc: ``` error[E0464]: multiple candidates for `rlib` dependency `libc` found --> fake-test-src-base/allocator/no_std-alloc-error-handler-default.rs:15:1 | LL | extern crate libc; | ^^^^^^^^^^^^^^^^^^ | = note: candidate #1: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-358db1024b7d9957.rlib = note: candidate #2: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-ebc478710122a279.rmeta ``` Both these versions were downloaded from CI, but one came from the `rust-std` component and one came from `rustc-dev`: ``` ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rust-std-nightly-x86_64-unknown-linux-gnu/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rustc-dev-nightly-x86_64-unknown-linux-gnu/rustc-dev/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f226c9fbdd92a0fd.rmeta ``` The fix was to only copy files from `rust-std` unless a Step explicitly requests for the `rustc-dev` components to be available by calling `builder.ensure(compile::Rustc)`. To avoid having to re-parse the `rustc-dev.tar.xz` tarball every time, which is quite slow, this adds a new `build/host/ci-rustc/.rustc-dev-contents` cache file which stores only the names of files we need to copy into the sysroot. This also allows reverting the hack in https://github.com/rust-lang/rust/pull/110121; now that we only copy rustc-dev on-demand, we can correctly add the `Rustc` check artifacts into the sysroot, so that this works correctly even when `download-rustc` is forced to `true` and some tool depends on a local change to `compiler`. --- See https://github.com/rust-lang/rust/issues/108767#issuecomment-1501217657 for why `no_std` is required for the MCVE test to fail; it's complicated and not particularly important. Fixes https://github.com/rust-lang/rust/issues/108767.
2023-04-18Fix ICE for transmutability in candidate assemblyBryan Garza-1/+18
Don't skip transmutability check just because there may be generics in the ParamEnv. Fixes #110467
2023-04-18add EarlyBinder to return type of ↵Kyle Matsuda-20/+18
collect_return_position_impl_trait_in_trait_tys query; remove bound_X version
2023-04-18Auto merge of #110083 - saethlin:encode-hashes-as-bytes, r=cjgillotbors-137/+288
Encode hashes as bytes, not varint In a few places, we store hashes as `u64` or `u128` and then apply `derive(Decodable, Encodable)` to the enclosing struct/enum. It is more efficient to encode hashes directly than try to apply some varint encoding. This PR adds two new types `Hash64` and `Hash128` which are produced by `StableHasher` and replace every use of storing a `u64` or `u128` that represents a hash. Distribution of the byte lengths of leb128 encodings, from `x build --stage 2` with `incremental = true` Before: ``` ( 1) 373418203 (53.7%, 53.7%): 1 ( 2) 196240113 (28.2%, 81.9%): 3 ( 3) 108157958 (15.6%, 97.5%): 2 ( 4) 17213120 ( 2.5%, 99.9%): 4 ( 5) 223614 ( 0.0%,100.0%): 9 ( 6) 216262 ( 0.0%,100.0%): 10 ( 7) 15447 ( 0.0%,100.0%): 5 ( 8) 3633 ( 0.0%,100.0%): 19 ( 9) 3030 ( 0.0%,100.0%): 8 ( 10) 1167 ( 0.0%,100.0%): 18 ( 11) 1032 ( 0.0%,100.0%): 7 ( 12) 1003 ( 0.0%,100.0%): 6 ( 13) 10 ( 0.0%,100.0%): 16 ( 14) 10 ( 0.0%,100.0%): 17 ( 15) 5 ( 0.0%,100.0%): 12 ( 16) 4 ( 0.0%,100.0%): 14 ``` After: ``` ( 1) 372939136 (53.7%, 53.7%): 1 ( 2) 196240140 (28.3%, 82.0%): 3 ( 3) 108014969 (15.6%, 97.5%): 2 ( 4) 17192375 ( 2.5%,100.0%): 4 ( 5) 435 ( 0.0%,100.0%): 5 ( 6) 83 ( 0.0%,100.0%): 18 ( 7) 79 ( 0.0%,100.0%): 10 ( 8) 50 ( 0.0%,100.0%): 9 ( 9) 6 ( 0.0%,100.0%): 19 ``` The remaining 9 or 10 and 18 or 19 are `u64` and `u128` respectively that have the high bits set. As far as I can tell these are coming primarily from `SwitchTargets`.
2023-04-18boostrap: print output during building toolsWeihang Lo-1/+1
2023-04-18Auto merge of #109772 - petrochenkov:slimchild, r=cjgillotbors-16/+12
rustc_metadata: Remove `Span` from `ModChild` It can be decoded on demand from regular `def_span` tables. Partially mitigates perf regressions from https://github.com/rust-lang/rust/pull/109500.
2023-04-18Test downstream errors from bad index exprMichael Goulet-28/+75
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-293/+398
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-18Use a diagnostic item instead of filtering for Index::OutputMichael Goulet-9/+4
2023-04-18Report reason why index impl is not satisfied deeplyMichael Goulet-0/+141
2023-04-18clippy: add test for https://github.com/rust-lang/rust-clippy/issues/10645Matthias Krüger-1/+20
2023-04-18refactor SimlifyCfg and friends - no globals, just enumsmiguelraz-48/+56
2023-04-18Add #[inline] to some new functionsBen Kimock-0/+4
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2023-04-18Auto merge of #110492 - GuillaumeGomez:rollup-n4tpbl4, r=GuillaumeGomezbors-172/+183
Rollup of 5 pull requests Successful merges: - #110417 (Spelling compiler) - #110441 (5 little typos) - #110485 (Fix bootstrap locking) - #110488 (Add a failing rustdoc-ui test for public infinite recursive type) - #110490 (Bump `download-ci-llvm-stamp` for loong support) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-18Document how the HashN types are different from FingerprintBen Kimock-4/+15
2023-04-18Store hashes in special types so they aren't accidentally encoded as numbersBen Kimock-138/+274
2023-04-18rustc_metadata: Remove `Span` from `ModChild`Vadim Petrochenkov-16/+12
It can be decoded on demand from regular `def_span` tables. Partially mitigates perf regressions from #109500.
2023-04-18Don't allocate it `IndexVec::remove`Maybe Waffle-1/+1
2023-04-18Rollup merge of #110490 - jyn514:bump-llvm, r=nikicGuillaume Gomez-1/+1
Bump `download-ci-llvm-stamp` for loong support This was missed in https://github.com/rust-lang/rust/pull/96971 and resulted in the LLVM we cache in CI being different from the one built locally. We didn't catch it because nothing tested the loong support. Fixes https://github.com/rust-lang/rust/issues/110474. r? `@nikic`
2023-04-18Rollup merge of #110488 - GuillaumeGomez:test-infinite-recursive-type, r=jyn514Guillaume Gomez-0/+9
Add a failing rustdoc-ui test for public infinite recursive type As suggested in https://github.com/rust-lang/rust/pull/110450#discussion_r1169271643. r? `@jyn514`
2023-04-18Rollup merge of #110485 - albertlarsan68:fix-bootstrap-lock, r=ozkanonurGuillaume Gomez-2/+4
Fix bootstrap locking Fix the regression introduced in #108607 Fixes #109967
2023-04-18Rollup merge of #110441 - kadiwa4:typos, r=thomccGuillaume Gomez-10/+10
5 little typos
2023-04-18Rollup merge of #110417 - jsoref:spelling-compiler, r=NilstriebGuillaume Gomez-159/+159
Spelling compiler This is per https://github.com/rust-lang/rust/pull/110392#issuecomment-1510193656 I'm going to delay performing a squash because I really don't expect people to be perfectly happy w/ my changes, I really am a human and I really do make mistakes. r? Nilstrieb I'm going to be flying this evening, but I should be able to squash / respond to reviews w/in a day or two. I tried to be careful about dropping changes to `tests`, afaict only two files had changes that were likely related to the changes for a given commit (this is where not having eagerly squashed should have given me an advantage), but, that said, picking things apart can be error prone.
2023-04-18Bump `download-ci-llvm-stamp` for loong supportjyn-1/+1
This was missed in https://github.com/rust-lang/rust/pull/96971 and resulted in the LLVM we cache in CI being different from the one built locally. We didn't catch it because nothing tested the loong support.
2023-04-18Fix no_std tests that load libc when download-rustc is enabledJoshua Nelson-17/+84
There were a series of unfortunate interactions here. Here's an MCVE of the test this fixes (committed as `tests/ui/meta/no_std-extern-libc.rs`): ```rust #![crate_type = "lib"] #![no_std] #![feature(rustc_private)] extern crate libc; ``` Before, this would give an error about duplicate versions of libc: ``` error[E0464]: multiple candidates for `rlib` dependency `libc` found --> fake-test-src-base/allocator/no_std-alloc-error-handler-default.rs:15:1 | LL | extern crate libc; | ^^^^^^^^^^^^^^^^^^ | = note: candidate #1: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-358db1024b7d9957.rlib = note: candidate #2: /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage2/lib/rustlib/aarch64-unknown-linux-gnu/lib/liblibc-ebc478710122a279.rmeta ``` Both these versions were downloaded from CI, but one came from the `rust-std` component and one came from `rustc-dev`: ``` ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rust-std-nightly-x86_64-unknown-linux-gnu/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-68a2d9e195dd6ed2.rlib ; tar -tf build/cache/f2d9a3d0771504f1ae776226a5799dcb4408a91a/rustc-dev-nightly-x86_64-unknown-linux-gnu.tar.xz | grep liblibc rustc-dev-nightly-x86_64-unknown-linux-gnu/rustc-dev/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f226c9fbdd92a0fd.rmeta ``` The fix was to only copy files from `rust-std` unless a Step explicitly requests for the `rustc-dev` components to be available by calling `builder.ensure(compile::Rustc)`. To avoid having to re-parse the `rustc-dev.tar.xz` tarball every time, which is quite slow, this adds a new `build/host/ci-rustc/.rustc-dev-contents` cache file which stores only the names of files we need to copy into the sysroot. This also allows reverting the hack in https://github.com/rust-lang/rust/pull/110121; now that we only copy rustc-dev on-demand, we can correctly add the `Rustc` check artifacts into the sysroot, so that this works correctly even when `download-rustc` is forced to `true`. --- See https://github.com/rust-lang/rust/issues/108767#issuecomment-1501217657 for why `no_std` is required for the MCVE test to fail; it's complicated and not particularly important. Fixes https://github.com/rust-lang/rust/issues/108767.
2023-04-18Add a failing rustdoc-ui test for public infinite recursive typeGuillaume Gomez-0/+9
2023-04-18Auto merge of #110478 - jyn514:stage1-fulldeps, r=albertlarsan68bors-204/+236
Support `x test --stage 1 ui-fulldeps` `@Nilstrieb` had an excellent idea the other day: the same way that rustdoc is able to load `rustc_driver` from the sysroot, ui-fulldeps tests should also be able to load it from the sysroot. That allows us to run fulldeps tests with stage1, without having to fully rebuild the compiler twice. It does unfortunately have the downside that we're building the tests with the *bootstrap* compiler, not the in-tree sources, but since most of the fulldeps tests are for the *API* of the compiler, that seems ok. I think it's possible to extend this to `run-make-fulldeps`, but I've run out of energy for tonight. - Move `plugin` tests into a subdirectory. Plugins are loaded at runtime with `dlopen` and so require the ABI of the running compile to match the ABI of the compiler linked with `rustc_driver`. As a result they can't be supported in stage 1 and have to use `// ignore-stage1`. - Remove `ignore-stage1` from most non-plugin tests - Ignore diagnostic tests in stage 1. Even though this requires a stage 2 build to load rustc_driver, it's primarily testing the error message that the *running* compiler emits when the diagnostic struct is malformed. - Pass `-Zforce-unstable-if-unmarked` in stage1, not just stage2. That allows running `hash-stable-is-unstable` in stage1, since it now suggests adding `rustc_private` to enable loading the crates. - Add libLLVM.so to the stage0 target sysroot, to allow fulldeps tests that act as custom drivers to load it at runtime. - Pass `--sysroot stage0-sysroot` in compiletest so that we use the correct version of std. - Move a few lint tests from ui-fulldeps to ui These had an `aux-build:lint-group-plugin-test.rs` that they never actually loaded with `feature(plugin)` nor tested. I removed the unused aux-build and they pass fine with stage 1. Fixes https://github.com/rust-lang/rust/issues/75905.
2023-04-18Auto merge of #110242 - cuviper:vanilla-llvm-16, r=Mark-Simulacrumbors-7/+81
ci: add a runner for vanilla LLVM 16 Like #107044, this will let us track compatibility with LLVM 16 going forward, especially after we eventually upgrade our own to the next. This also drops `tidy` here and in `x86_64-gnu-llvm-15`, syncing with that change in #106085.
2023-04-18Fix bootstrap lockingAlbert Larsan-2/+4
Fix the regression introduced in 108607
2023-04-18Auto merge of #110481 - matthiaskrgr:rollup-phkkgm9, r=matthiaskrgrbors-70/+244
Rollup of 7 pull requests Successful merges: - #109981 (Set commit information environment variables when building tools) - #110348 (Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book) - #110409 (Don't use `serde_json` to serialize a simple JSON object) - #110442 (Avoid including dry run steps in the build metrics) - #110450 (rustdoc: Fix invalid handling of nested items with `--document-private-items`) - #110461 (Use `Item::expect_*` and `ImplItem::expect_*` more) - #110465 (Assure everyone that `has_type_flags` is fast) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-18Rollup merge of #110465 - ↵Matthias Krüger-0/+8
WaffleLapkin:assure_everyone_that_has_type_flags_is_fast, r=oli-obk Assure everyone that `has_type_flags` is fast `number_of_people_who_tripped_on_this += 1` r? ``@oli-obk``
2023-04-18Rollup merge of #110461 - WaffleLapkin:expect_, r=NilstriebMatthias Krüger-24/+11
Use `Item::expect_*` and `ImplItem::expect_*` more r? ``@Nilstrieb``
2023-04-18Rollup merge of #110450 - GuillaumeGomez:fix-nested-items-on-private-doc, ↵Matthias Krüger-27/+106
r=notriddle,jyn514 rustdoc: Fix invalid handling of nested items with `--document-private-items` Fixes #110422. The problem is that only impl block and re-exported `macro_rules!` items are "visible" as nested items. This PR adds the missing checks to handle this correctly. cc `@compiler-errors` r? `@notriddle`
2023-04-18Rollup merge of #110442 - ferrocene:pa-build-metrics-dry-run, r=ozkanonurMatthias Krüger-6/+22
Avoid including dry run steps in the build metrics Including steps executed during the dry run will result in a duplication of all the steps in the build metrics, which just adds noise.
2023-04-18Rollup merge of #110409 - ↵Matthias Krüger-10/+52
Nilstrieb:some-manual-javascript-object-notationing, r=fee1-dead Don't use `serde_json` to serialize a simple JSON object This avoids `rustc_data_structures` depending on `serde_json` which allows it to be compiled much earlier, unlocking most of rustc. This used to not matter, but after #110407 we're not blocked on fluent anymore, which means that it's now a blocking edge. ![image](https://user-images.githubusercontent.com/48135649/232313178-e0150420-3020-4eb6-98d3-fe5294a8f947.png) This saves a few more seconds. cc ````@Zoxc```` who added it recently
2023-04-18Rollup merge of #110348 - ↵Matthias Krüger-3/+8
GuillaumeGomez:disambiguators-suffixes-rustdoc-book, r=Manishearth Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book This information is otherwise only provided in case an error occurs, which isn't great. r? ```@notriddle```