about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-08-01Auto merge of #99476 - dpaoliello:rawdylibvectorcall, r=michaelwoeristerbors-24/+134
Add tests for raw-dylib with vectorcall, and fix vectorcall code generation * Adds tests for using `raw-dylib` (#58713) with `vectorcall`. * Fixed code generation for `vectorcall` (parameters have to be marked with `InReg`, just like `fastcall`). * Enabled running the `raw-dylib` `fastcall` tests when using MSVC (since I had to add support in the test for running MSVC-only tests since GCC doesn't support `vectorcall`).
2022-08-01Auto merge of #100024 - matthiaskrgr:rollup-36ab4wx, r=matthiaskrgrbors-151/+193
Rollup of 8 pull requests Successful merges: - #99340 (Fix ICE in Definitions::create_def) - #99629 (Improve `cannot move out of` error message) - #99864 (bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty) - #99911 (Remove some uses of `guess_head_span`) - #99976 (Make Rustdoc exit with correct error code when scraping examples from invalid files) - #100003 (Improve size assertions.) - #100012 (Avoid `Ty` to `String` conversions) - #100020 (better error when python is not found in x - issue #99648) Failed merges: - #99994 (Replace `guess_head_span` with `opt_span`) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-01Rollup merge of #100020 - CallumIO:issue-99648, r=jyn514Matthias Krüger-3/+3
better error when python is not found in x - issue #99648 `x` now shows an appropriate error message and exits, when a version of `python` is not found on the users `PATH`. Resolves #99648
2022-08-01Rollup merge of #100003 - nnethercote:improve-size-assertions, r=lqdMatthias Krüger-39/+16
Improve size assertions. - For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order. r? `@lqd`
2022-08-01Rollup merge of #99976 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+27
Make Rustdoc exit with correct error code when scraping examples from invalid files This PR fixes a small issue with the new Rustdoc scrape-examples feature. If a file that is being scraped has a type error, then currently that error is printed out, but the rustdoc process exits as if it succeeded. This is a problem for Cargo, which needs to track whether scraping succeeded (see rust-lang/cargo#10343). This PR fixes the issue by checking whether an error is emitted, and aborting if so.
2022-08-01Rollup merge of #99911 - cjgillot:no-guess, r=davidtwcoMatthias Krüger-56/+65
Remove some uses of `guess_head_span` That function cuts a span at the first occurrence of `{`. Using `def_span` is almost always more precise.
2022-08-01Rollup merge of #99864 - klensy:bootstrap-art-dupe, r=jyn514Matthias Krüger-24/+28
bootstrap: don't emit warn about duplicated deps with same/different features if some of sets actually empty Example (https://github.com/rust-lang-ci/rust/runs/7551453940?check_suite_focus=true#step:25:15008): ``` duplicate artifacts found when compiling a tool, this typically means that something was recompiled because a transitive dependency has different features activated than in a previous build: the following dependencies are duplicated although they have the same features enabled: the following dependencies have different features: memchr 2.5.0 (registry+https://github.com/rust-lang/crates.io-index) `clippy-driver` additionally enabled features {} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-freebsd/release/deps/libmemchr-44aa6ff4f08e293f.rlib" `cargo` additionally enabled features {"use_std"} at "/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-freebsd/release/deps/libmemchr-70e29af0fd3ef292.rlib" ``` Notice that no info printed under `the following dependencies are duplicated although they have the same features enabled:`
2022-08-01Rollup merge of #99629 - obeis:issue-99470, r=compiler-errorsMatthias Krüger-29/+54
Improve `cannot move out of` error message Closes #99470 r? `@bjorn3`
2022-08-01Auto merge of #99884 - nnethercote:lexer-improvements, r=matkladbors-5/+5
Lexer improvements Some cleanups and small speed improvements. r? `@matklad`
2022-08-01fix: better error when python not found in xCallum Leslie-3/+3
chore: clean comments to be relevant
2022-08-01Make Rustdoc exit with correct error code when scrape examples from invalid ↵Will Crichton-0/+27
files
2022-08-01Auto merge of #99944 - bjorn3:hide_proc_macro_symbols, r=eddybbors-35/+35
Limit symbols exported from proc macros Only `__rustc_proc_macro_decls_*__` and `rust_metadata_*` need to be exported for proc macros to work. All other symbols only increase binary size and have the potential to conflict with symbols from the host compiler. Fixes https://github.com/rust-lang/rust/issues/99909 Fixes #59998 cc `@eddyb`
2022-08-01Auto merge of #99998 - matthiaskrgr:rollup-igafy0r, r=matthiaskrgrbors-1014/+1037
Rollup of 7 pull requests Successful merges: - #99519 (Remove implicit names and values from `--cfg` in `--check-cfg`) - #99620 (`-Z location-detail`: provide option to disable all location details) - #99932 (Fix unwinding on certain platforms when debug assertions are enabled) - #99973 (Layout things) - #99980 (Remove more Clean trait implementations) - #99984 (Fix compat.rs for `cfg(miri)`) - #99986 (Add wrap suggestions for record variants) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-01Improve size assertions.Nicholas Nethercote-39/+16
- For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order.
2022-08-01Shrink `Token`.Nicholas Nethercote-5/+5
From 72 bytes to 12 bytes (on x86-64). There are two parts to this: - Changing various source code offsets from 64-bit to 32-bit. This is not a problem because the rest of rustc also uses 32-bit source code offsets. This means `Token` is no longer `Copy` but this causes no problems. - Removing the `RawStrError` from `LiteralKind`. Raw string literal invalidity is now indicated by a `None` value within `RawStr`/`RawByteStr`, and the new `validate_raw_str` function can be used to re-lex an invalid raw string literal to get the `RawStrError`. There is one very small change in behaviour. Previously, if a raw string literal matched both the `InvalidStarter` and `TooManyHashes` cases, the latter would override the former. This has now changed, because `raw_double_quoted_string` now uses `?` and so returns immediately upon detecting the `InvalidStarter` case. I think this is a slight improvement to report the earlier-detected error, and it explains the change in the `test_too_many_hashes` test. The commit also removes a couple of comments that refer to #77629 and say that the size of these types don't affect performance. These comments are wrong, though the performance effect is small.
2022-07-31Rollup merge of #99986 - WaffleLapkin:record_struct_wrap_suggestion, ↵Matthias Krüger-5/+15
r=compiler-errors Add wrap suggestions for record variants This PR adds a suggestions to wrap an expression in a record struct/variant when encountering mismatched types, similarly to a suggestion to wrap expression in a tuple struct that was added before. An example: ```rust struct B { f: u8, } enum E { A(u32), B { f: u8 }, } fn main() { let _: B = 1; let _: E = 1; } ``` ```text error[E0308]: mismatched types --> ./t.rs:11:16 | 11 | let _: B = 1; | - ^ expected struct `B`, found integer | | | expected due to this | help: try wrapping the expression in `B` | 11 | let _: B = B { f: 1 }; | ++++++ + error[E0308]: mismatched types --> ./t.rs:12:16 | 12 | let _: E = 1; | - ^ expected enum `E`, found integer | | | expected due to this | help: try wrapping the expression in a variant of `E` | 12 | let _: E = E::A(1); | +++++ + 12 | let _: E = E::B { f: 1 }; | +++++++++ + ``` r? `@compiler-errors`
2022-07-31Rollup merge of #99980 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPCMatthias Krüger-22/+16
Remove more Clean trait implementations This time as well it allowed to remove a function. Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-07-31Rollup merge of #99973 - RalfJung:layout-things, r=eddybMatthias Krüger-920/+920
Layout things These two commits are pretty independent, but didn't seem worth doing individual PRs for: - Always check that size is a multiple of align, even without debug assertions - Change Layout debug printing to put `variants` last, since it often huge and not usually the part we are most interested in Cc `@eddyb`
2022-07-31Rollup merge of #99620 - hudson-ayers:fix-location-detail, r=davidtwcoMatthias Krüger-3/+14
`-Z location-detail`: provide option to disable all location details As reported [here](https://github.com/rust-lang/rust/pull/89920#issuecomment-1190598924), when I first implemented the `-Z location-detail` flag there was a bug, where passing an empty list was not correctly supported, and instead rejected by the compiler. This PR fixes that such that passing an empty list results in no location details being tracked, as originally specified in https://github.com/rust-lang/rfcs/pull/2091 . This PR also adds a test case to verify that this option continues to work as intended.
2022-07-31Rollup merge of #99519 - Urgau:check-cfg-implicit, r=petrochenkovMatthias Krüger-64/+72
Remove implicit names and values from `--cfg` in `--check-cfg` This PR remove the implicit names and values from `--cfg` in `--check-cfg` because the behavior is quite surprising but also because it's really easy to inadvertently really on the implicitness and when the `--cfg` is not set anymore to have an unexpected warning from an unexpected condition that pass with the implicitness. This change in behavior will also enable us to warn when an unexpected `--cfg` is passed, ex: the user wrote `--cfg=unstabl` instead of `--cfg=unstable`. The implementation of the warning will be done in a follow-up PR. cc `@petrochenkov`
2022-07-31Improve `cannot move out of` error messageObei Sideg-29/+54
2022-07-31Allow try-perf branch to run in CIRyan Levick-2/+2
2022-07-31--bless testsMaybe Waffle-5/+15
2022-07-31Remove Clean trait implementation for hir::TypeBindingKindGuillaume Gomez-8/+2
2022-07-31reorder fields in Laout debug outputRalf Jung-920/+920
2022-07-31Remove Clean trait implementation for hir::TypeBindingGuillaume Gomez-7/+9
2022-07-31Remove Clean trait implementation for hir::PathGuillaume Gomez-8/+6
2022-07-31Rollup merge of #99974 - ↵Dylan DPC-0/+200
TaKO8Ki:suggest-removing-semicolon-and-boxing-the-expressions, r=compiler-errors Suggest removing a semicolon and boxing the expressions for if-else `InferCtxt::suggest_remove_semi_or_return_binding` was not working well, so I fixed it and added a ui test.
2022-07-31Rollup merge of #99741 - compiler-errors:copy-impl-impl-generics, r=fee1-deadDylan DPC-0/+95
Use `impl`'s generics when suggesting fix on bad `impl Copy` See the UI test for a more complicated example, but we weren't correctly suggesting to add bounds given a manual `impl` whose generics didn't match the struct generics. ```rust #[derive(Clone)] struct Wrapper<T>(T); impl<S> Copy for Wrapper<S> {} ``` Coincidentally this fix didn't cause any regressions for `derive(Copy)` impls, I think because those use the same spans in the impl generics as the struct generics, so the machinery still applies the same change.
2022-07-31Rollup merge of #99186 - camsteffen:closure-localdefid, r=cjgillotDylan DPC-1/+1
Use LocalDefId for closures more
2022-07-31Add issue referencebjorn3-2/+2
2022-07-31Remove workarounds for issue 59998bjorn3-35/+5
2022-07-31Auto merge of #99529 - Milo123459:stage-1-test, r=jyn514bors-1/+50
Run `x test --stage 1` in CI Fixes #99135 r? `@jyn514`
2022-07-31add a test to check if `suggest_remove_semi_or_return_binding` is working ↵Takayuki Maeda-0/+200
well for if-else
2022-07-30Auto merge of #99959 - cuviper:niche-size, r=eddybbors-0/+469
Fix the size of niche enums with ZST alignment For enums with an aligned ZST variant, like `[T; 0]`, the niche layout was not computing a sufficient size to be consistent with alignment. Now we pad that size up to the alignment, and also make sure to only use the niche variant's ABI when the size and alignment still match. Fixes #99836 r? `@eddyb`
2022-07-30dont run stage1 tests in prMilo-4/+1
2022-07-30add to full test-suiteMilo-0/+5
2022-07-30Use LocalDefId for closures moreCameron Steffen-1/+1
2022-07-30Rollup merge of #99962 - Mark-Simulacrum:detect-ci-artifact-channel, r=jyn514Matthias Krüger-6/+13
Discover channel for LLVM download r? `@jyn514` cc `@RalfJung` Reported on Zulip: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/No.20prebuilt.20LLVM.20for.20the.20beta.20branch.3F
2022-07-30Rollup merge of #99950 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPCMatthias Krüger-38/+30
Remove more Clean trait implementations This time it even allowed to remove a function. Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-07-30Rollup merge of #99890 - compiler-errors:issue-99828, r=lcnrMatthias Krüger-6/+41
Do not allow bad projection term to leak into the type checker Fixes #99828
2022-07-30Rollup merge of #99873 - ↵Matthias Krüger-2/+28
notriddle:notriddle/invalid-html-tags-webcomponents, r=GuillaumeGomezp rustdoc: align invalid-html-tags lint with commonmark spec
2022-07-30Rollup merge of #99650 - jyn514:keep-stage-check, r=Mark-SimulacrumMatthias Krüger-9/+0
Support `x --keep-stage 0 check` Stage 1 check has been supported since https://github.com/rust-lang/rust/pull/81064. https://github.com/rust-lang/rust/pull/81064 changed the error message for this, but I don't think there's any reason we should prevent using it. I tested locally and `keep-stage` works fine. r? `@Mark-Simulacrum`
2022-07-30Discover channel for artifact downloadMark Rousskov-6/+13
When we're downloading based on a CI commit, that can still be -beta- or even -stable-, so we should lookup the channel it was built with.
2022-07-30Test another enum niche with multiple ZST alignmentsJosh Stone-3/+132
2022-07-30Fix the size of niche enums with ZST alignmentJosh Stone-0/+340
For enums with an aligned ZST variant, like `[T; 0]`, the niche layout was not computing a sufficient size to be consistent with alignment. Now we pad that size up to the alignment, and also make sure to only use the niche variant's ABI when the size and alignment still match.
2022-07-30Auto merge of #99948 - Dylan-DPC:rollup-ed5136t, r=Dylan-DPCbors-144/+228
Rollup of 5 pull requests Successful merges: - #99311 (change maybe_body_owned_by to take local def id) - #99862 (Improve type mismatch w/ function signatures) - #99895 (don't call type ascription "cast") - #99900 (remove some manual hash stable impls) - #99903 (Add diagnostic when using public instead of pub) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-30Update src/librustdoc/passes/html_tags.rsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-07-30Remove Clean trait implementation for hir::VariantDataGuillaume Gomez-19/+13
2022-07-30Remove Clean trait implementation for ty::VariantDefGuillaume Gomez-20/+18