about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-12-20Rollup merge of #105897 - oli-obk:tait_patterns, r=TaKO8KiMatthias Krüger-0/+10
Fix an opaque type ICE fixes #104551 The issue is that if you have ```rust type T = impl Sized; let (_a, _b): T = .. ``` we have only the type annotation `T`, but want to use that ascription for `_a` and `_b`, so what we generate is a type ascription plus a field projection saying `_a`'s type is `T::0`. Of course `T` has no fields. Of course we could also not generate type annotations for projections into opaque types at all, but that's more fragile, as we now have to make sure that https://github.com/rust-lang/rust/blob/12bbdbdb440119a0b86d2ee742ec1460cdb2c5b9/compiler/rustc_mir_build/src/build/matches/mod.rs#L709 doesn't have any arm that introduces a user type annotation except for `PatKind::Binding`.
2022-12-20Rollup merge of #105791 - Ezrashaw:add-e0472-long-docs, r=GuillaumeGomezMatthias Krüger-0/+2
docs: add long error explanation for error E0472 Add long-form error docs for E0472: "inline assembly not supported on this target" and update UI tests. R? `@GuillaumeGomez`
2022-12-20Add `-Zno-jump-tables`Miguel Ojeda-0/+57
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches. In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function. The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch). [1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables [2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables [3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83 Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-20Re-enable fn trait call notation errorMichael Goulet-0/+26
2022-12-20rustdoc: prevent CSS layout of line numbers shrinking into nothingMichael Howell-2/+107
2022-12-20Hackily fix an opaque type ICEOli Scherer-0/+10
2022-12-20Rollup merge of #105945 - JohnTitor:issue-57404, r=compiler-errorsMatthias Krüger-0/+23
Add regression test for #57404 r? `@compiler-errors` Closes https://github.com/rust-lang/rust/issues/57404 Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20Rollup merge of #105944 - JohnTitor:issue-80816, r=compiler-errorsMatthias Krüger-0/+81
Add regression test for #80816 Closes #80816 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20Rollup merge of #105943 - JohnTitor:issue-102206, r=compiler-errorsMatthias Krüger-0/+31
Add regression test for #102206 Closes #102206 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20Rollup merge of #105939 - GuillaumeGomez:improve-description-gui-test, ↵Matthias Krüger-1/+1
r=Dylan-DPC Improve description of struct-fields GUI test I moved the comment at the top of the file and clarified it a little bit. r? `@notriddle`
2022-12-20Rollup merge of #105930 - JakobDegen:nal-unsound, r=oli-obkMatthias Krüger-18/+10
Disable `NormalizeArrayLen` cc #105929 r? mir-opt
2022-12-20Rollup merge of #105835 - tmiasko:cleanup-post-borrowck, r=JakobDegenMatthias Krüger-9/+7
Refactor post borrowck cleanup passes
2022-12-20Add regression test for #57404Yuki Okushi-0/+23
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20Add regression test for #80816Yuki Okushi-0/+81
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20Add regression test for #102206Yuki Okushi-0/+31
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-20docs: add long error explanation for error E0472Ezra Shaw-0/+2
2022-12-20Rollup merge of #105935 - Ezrashaw:add-test+docs-for-e0377, r=GuillaumeGomezMatthias Krüger-0/+23
docs/test: add UI test and long-form error docs for `E0377`
2022-12-20Rollup merge of #105912 - notriddle:notriddle/pre-line-height, r=GuillaumeGomezMatthias Krüger-0/+24
rustdoc: force pre tags to have the default line height Fixes #105906
2022-12-20Improve description of struct-fields GUI testGuillaume Gomez-1/+1
2022-12-20docs/test: add UI test and long-form error docs for `E0377`Ezra Shaw-0/+23
2022-12-20Auto merge of #105575 - compiler-errors:impl-wf-lint, r=oli-obkbors-0/+75
Add `IMPLIED_BOUNDS_ENTAILMENT` lint Implements a lint (#105572) version of the hard-error introduced in #105483. Context is in that PR. r? `@lcnr` cc `@oli-obk` who had asked for this to be a lint first Not sure if this needs to be an FCP, since it's a lint for now.
2022-12-19Disable `NormalizeArrayLen`Jakob Degen-18/+10
2022-12-20Auto merge of #105918 - matthiaskrgr:rollup-mmazd62, r=matthiaskrgrbors-23/+71
Rollup of 7 pull requests Successful merges: - #105801 (Realistic `Path::as_mut_os_str` doctest) - #105860 (Add long error docs for `E0460` and `E0457`) - #105895 (Test that we don't add a new kind of breaking change with TAITs) - #105902 (docs: improve pin docs) - #105910 (Update books) - #105913 (rustdoc: remove width-limiter from source pages, stop overriding CSS) - #105915 (Revert "Replace usage of `ResumeTy` in async lowering with `Context`") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-19Rollup merge of #105915 - andrewpollack:revert-105250-async-rm-resumety, ↵Matthias Krüger-23/+16
r=tmandry Revert "Replace usage of `ResumeTy` in async lowering with `Context`" Reverts rust-lang/rust#105250 Fixes: #105501 Following instructions from [forge](https://forge.rust-lang.org/compiler/reviews.html#reverts). This change introduced a breaking change that is not actionable nor relevant, and is blocking updates to our toolchain. Along with other comments on the CL marking issues that are fixed by reverts, reverting is best until these issues can be resolved cc. `@Swatinem`
2022-12-19Rollup merge of #105895 - oli-obk:tait_coherence, r=lcnrMatthias Krüger-0/+46
Test that we don't add a new kind of breaking change with TAITs r? ``@lcnr``
2022-12-19Rollup merge of #105860 - Ezrashaw:add-long-errors-0460-0457, ↵Matthias Krüger-0/+9
r=jruderman,GuillaumeGomez Add long error docs for `E0460` and `E0457` Final docs for errors in #61137 that have UI tests, my next PRs will also add these tests. r? ``@GuillaumeGomez``
2022-12-19Revert "Replace usage of `ResumeTy` in async lowering with `Context`"Andrew Pollack-23/+16
2022-12-19add non-regression test for issue 105809Rémy Rakic-0/+36
2022-12-19Downgrade IMPLIED_BOUNDS_ENTAILMENT to warn by default, add it to builtin ↵Michael Goulet-26/+16
lint list
2022-12-19Add IMPLIED_BOUNDS_ENTAILMENT lintMichael Goulet-0/+85
2022-12-19rustdoc: force pre tags to have the default line heightMichael Howell-0/+24
Fixes #105906
2022-12-19implement the skeleton of the updated trait solverlcnr-0/+54
2022-12-19add function to tell if the current ambiguity error matches a previous one ↵Yiming Lei-54/+8
in ambiguity_errors if 2 errors of the kind and ident and span of the ident, b1, b2 and misc1 misc2 are the same then these 2 ambiguity errors matched prevent identical ambiguity error from pushing into vector of ambiguity_errors this will fix #105177
2022-12-19Revert "Auto merge of #103880 - b-naber:field-ty-mir, r=lcnr"Rémy Rakic-76/+0
This reverts commit 03770f0e2b60c02db8fcf52fed5fb36aac70cedc, reversing changes made to 01ef4b21dc5251b58bd9c6fd6face2ae95d56da1.
2022-12-19Test that we don't add a new kind of breaking change with TAITsOli Scherer-0/+46
2022-12-19Rollup merge of #105882 - compiler-errors:issue-105832, r=jackh726Dylan DPC-0/+32
Don't ICE in closure arg borrow suggestion Fixes #105832
2022-12-19Rollup merge of #105839 - LegionMammal978:mut-upvar-not-send, r=lcnrDylan DPC-0/+81
Suggest a `T: Send` bound for `&mut T` upvars in `Send` generators Right now, we suggest a `T: Sync` bound for both `&T` and `&mut T` upvars. A user on URLO [found this confusing](https://users.rust-lang.org/t/error-complains-about-missing-sync-but-send-is-whats-missing/86021), so I wrote this quick fix to look at the mutability before making the suggestion.
2022-12-19Auto merge of #105883 - matthiaskrgr:rollup-v5n53t1, r=matthiaskrgrbors-7/+143
Rollup of 8 pull requests Successful merges: - #105419 (Add tests for #41731) - #105447 (Add a test for #103095) - #105842 (print argument name in arg mismatch if possible) - #105863 (Update browser-ui-test version to reduce GUI tests flakyness) - #105867 (remove redundant fn params that were only "used" in recursion) - #105869 (don't clone Copy types) - #105873 (use &str / String literals instead of format!()) - #105879 (Revert "Introduce lowering_arena to avoid creating AST nodes on the fly") Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-18Rollup merge of #105842 - compiler-errors:arg-name-sugg, r=petrochenkovMatthias Krüger-7/+7
print argument name in arg mismatch if possible A bit more contextual than just `/* value */`, at least when the argument is named something related to its context. The UI test cases are... not super convincing, but also they're minimized tests.
2022-12-18Rollup merge of #105447 - TaKO8Ki:add-test-for-103095, r=petrochenkovMatthias Krüger-0/+30
Add a test for #103095 closes #103095
2022-12-18Rollup merge of #105419 - YC:issue-41731, r=petrochenkovMatthias Krüger-0/+106
Add tests for #41731 Closes #41731
2022-12-18Auto merge of #105446 - erikdesjardins:vt-size, r=nikicbors-1/+52
Add 0..=isize::MAX range metadata to size loads from vtables This is the (much belated) size counterpart to #91569. Inspired by https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/Range.20metadata.20for.20.60size_of_val.60.20and.20other.20isize.3A.3AMAX.20limits. This could help optimize layout computations based on the size of a dyn trait. Though, admittedly, adding this to vtables wouldn't be as beneficial as adding it to slice len, which is used much more often. Miri detects this UB already: https://github.com/rust-lang/rust/blob/b7cc99142ad0cfe47e2fe9f7a82eaf5b672c0573/compiler/rustc_const_eval/src/interpret/traits.rs#L119-L121 (In fact Miri goes further, [assuming a 48-bit address space on 64-bit platforms](https://github.com/rust-lang/rust/blob/9db224fc908059986c179fc6ec433944e9cfce50/compiler/rustc_abi/src/lib.rs#L312-L331), but I don't think we can assume that in an optimization.)
2022-12-18Don't ICE in closure arg borrow suggestionMichael Goulet-0/+32
2022-12-19docs: add long-form error-code docs for E0457Ezra Shaw-0/+1
2022-12-19docs: add long-form error-code docs for E0460Ezra Shaw-0/+8
2022-12-18Rollup merge of #105420 - tmiasko:dest-prop-dead-code, r=JakobDegenMatthias Krüger-0/+104
Remove dead code after destination propagation Fixes #105428. cc `@JakobDegen`
2022-12-18Auto merge of #104417 - mejrs:mir_build, r=davidtwcobors-11/+11
Migrate rustc_mir_build diagnostics Rebases https://github.com/rust-lang/rust/pull/100854 ~~The remaining issue is how to better resolve https://github.com/rust-lang/rust/commit/72bea68af4ee2a41c44998916f6a789163f12e7d~~ ~~The diagnostic macros seems to generate a broken diagnostic, and I couldn't figure out how to manually format the fluent message, so I hardcoded the format string for now. I'd like pointers to a better fix for this.~~ Also, I'm not 100% sure I didn't mess up a rebase somewhere 🙂 r? `@davidtwco`
2022-12-18higher-ranked lifetime messageMichael Goulet-0/+36
2022-12-17Rollup merge of #105814 - JakobDegen:custom-mir-terms, r=oli-obkMatthias Krüger-0/+180
Support call and drop terminators in custom mir The only caveat with this change is that cleanup blocks are not supported. I would like to add them, but it's not quite clear to me what the best way to do that is, so I'll have to think about it some more. r? ``@oli-obk``
2022-12-17Rollup merge of #105792 - Ezrashaw:add-e0320-long-docs, r=GuillaumeGomezMatthias Krüger-0/+4
docs: add long error explanation for error E0320 Continuation of #105791 r? ``@GuillaumeGomez``