about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-06-08Add tests for mixed panic mode restriction and lintsGary Guo-0/+90
2022-06-08Ensure ffi_unwind_calls lint is gated behind c_unwindGary Guo-2/+27
2022-06-08Handle panic runtime speciallyGary Guo-12/+6
2022-06-08Rollup merge of #97883 - JohnTitor:no-more-compare-mode-nll, r=jackh726Michael Goulet-4/+0
Remove `ignore-compare-mode-nll` annotations from tests Since #95565 these do nothing as compare-mode-nll has been removed. r? `@jackh726`
2022-06-08Rollup merge of #97882 - JohnTitor:issue-67498, r=compiler-errorsMichael Goulet-0/+21
Add regresion test for #67498 Closes #67498 r? `@compiler-errors`
2022-06-08Rollup merge of #97871 - ChayimFriedman2:vec-iterator-unimplemented, ↵Michael Goulet-0/+24
r=compiler-errors Suggest using `iter()` or `into_iter()` for `Vec` We cannot do that for `&Vec` because `#[rustc_on_unimplemented]` is limited (it does not clean generic instantiation for references, only for ADTs). `@rustbot` label +A-diagnostics
2022-06-08Rollup merge of #97857 - ChayimFriedman2:box-identifier-help, r=compiler-errorsMichael Goulet-4/+69
Suggest escaping `box` as identifier Fixes #97810.
2022-06-08Rollup merge of #97856 - compiler-errors:bad-let-suggestions, r=estebankMichael Goulet-0/+93
Don't suggest adding `let` in certain `if` conditions Avoid being too eager to suggest `let` in an `if` condition with an `=`, namely when the LHS of the `=` isn't even valid as a pattern (to a first degree approximation). This heustic I came up with kinda sucks. Let me know if it needs to be refined.
2022-06-08Rollup merge of #97557 - compiler-errors:arg-mismatch-mini, r=jackh726Michael Goulet-29/+70
Fix indices and remove some unwraps in arg mismatch algorithm This is a more conservative fix than #97542, addressing some indices which were used incorectly and unwraps which are bound to panic (e.g. when the provided and expected arg counts differ). Beta nominating this as it's quite easy to cause ICEs -- I wrote a fuzzer and found hundreds of examples of ICEs. cc `@jackh726` as author of #92364, and `@estebank` as reviewer of that PR. fixes #97484 r? `@jackh726` this should be _much_ easier to review than the other PR :sweat_smile:
2022-06-08update tests + add future compat testlcnr-19/+35
2022-06-08Rollup merge of #97878 - GuillaumeGomez:regression-test-84634, r=notriddleMatthias Krüger-0/+28
Add regression test for anonymous lifetimes Fixes #84634. Seems like this issue was already solved. I added a regression test just in case so we can close it with peace in mind. r? `@notriddle`
2022-06-08add test + don't warn on `Res::SelfTy`lcnr-0/+76
2022-06-09Remove `ignore-compare-mode-nll` annotations from testsYuki Okushi-4/+0
2022-06-09Add regresion test for #67498Yuki Okushi-0/+21
2022-06-08Auto merge of #97873 - Dylan-DPC:rollup-g6ptsdq, r=Dylan-DPCbors-7/+15
Rollup of 5 pull requests Successful merges: - #97276 (Stabilize `const_intrinsic_copy`) - #97763 (Allow ptr_from_addr_cast to fail) - #97846 (Specify DWARF alignment in bits, not bytes.) - #97848 (Impl Traits lowering minor refactors) - #97865 (remove `BorrowckMode`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-08Add regression test for #84634Guillaume Gomez-0/+28
2022-06-08Remove related testsYuki Okushi-60/+3
2022-06-08Rollup merge of #97846 - pcwalton:align-bits, r=michaelwoeristerDylan DPC-0/+8
Specify DWARF alignment in bits, not bytes. In DWARF, alignment of types is specified in bits, as is made clear by the parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte alignment. This commit fixes that. This was noticed in upstream LLVM when I tried to check in a test consisting of LLVM IR generated from `rustc` and it triggered assertions [1]. [1]: https://reviews.llvm.org/D126835
2022-06-08Stabilize `const_intrinsic_copy`Yuki Okushi-7/+7
2022-06-08Suggest using `iter()` or `into_iter()` for `Vec`Chayim Refael Friedman-0/+24
We cannot do that for `&Vec` because `#[rustc_on_unimplemented]` is limited (it does not clean generic instantiation for references, only for ADTs).
2022-06-08lub: don't bail out due to empty binderslcnr-0/+165
2022-06-08Auto merge of #94732 - nnethercote:infallible-encoder, r=bjorn3bors-15/+28
Make `Encodable` and `Encoder` infallible. A follow-up to #93066. r? `@ghost`
2022-06-08need_type_info: don't ICE when detected ty aliaslcnr-0/+78
fixes #97698
2022-06-08dedup diagnostics default params handlinglcnr-10/+10
2022-06-08Suggest escaping `box` as identifierChayim Refael Friedman-4/+69
2022-06-08Rollup merge of #97823 - compiler-errors:missing-comma-match-arm, r=estebankDylan DPC-10/+6
Recover missing comma after match arm If we're missing a comma after a match arm expression, try parsing another pattern and a following `=>`. If we find both of those, then recover by suggesting to insert a `,`. Fixes #80112
2022-06-08Rollup merge of #97819 - compiler-errors:use-import, r=wesleywiserDylan DPC-0/+44
Recover `import` instead of `use` in item When we definitely don't have a macro invocation (i.e. when we don't have `import ::`), then it's more productive to parse `import` as if it was incorrectly mistaken for `use`. Not sure if this needs to be a verbose suggestion, but it renders strangely when it's not verbose: ``` error: expected item, found `import` --> /home/michael/test.rs:1:1 | 1 | import std::{io::{self, Write}, rc::Rc}; | ^^^^^^ help: items are imported using the `use` keyword: `use` ``` Happy to change it to `span_suggestion` instead of `span_suggestion_verbose` though. Fixes #97788
2022-06-08Rollup merge of #97597 - tmiasko:simplify-locals-side-effects, ↵Dylan DPC-0/+28
r=RalfJung,JakobDegen Preserve unused pointer to address casts Fixes #97421. cc `@RalfJung`
2022-06-08Rollup merge of #97595 - ouz-a:issue-97381, r=compiler-errorsDylan DPC-0/+115
Remove unwrap from get_vtable This avoids ICE on issue #97381 I think the bug is a bit deeper though, it compiles fine when `v` is `&v` which makes me think `Deref` is causing some issue with borrowck but it's fine I guess since this thing crashes since `nightly-2020-09-17` 😅
2022-06-07Don't suggest adding let in certain if conditionsMichael Goulet-0/+93
2022-06-07recover `import` instead of `use` in itemMichael Goulet-0/+44
2022-06-07Stabilize $$ in Rust 1.63.0Caio-55/+19
2022-06-08Rename `rustc_serialize::opaque::Encoder` as `MemEncoder`.Nicholas Nethercote-9/+9
This avoids the name clash with `rustc_serialize::Encoder` (a trait), and allows lots qualifiers to be removed and imports to be simplified (e.g. fewer `as` imports).
2022-06-08Move `finish` out of the `Encoder` trait.Nicholas Nethercote-3/+3
This simplifies things, but requires making `CacheEncoder` non-generic.
2022-06-07Rollup merge of #97845 - estebank:spancito, r=compiler-errorsMatthias Krüger-2/+2
Use more targeted suggestion when confusing i8 with std::i8 r? `@compiler-errors`
2022-06-07Rollup merge of #97829 - JohnTitor:issue-95307, r=compiler-errorsMatthias Krüger-0/+43
Add regresion test for #95307 Closes #95307 r? `@compiler-errors`
2022-06-07Make test `run-rustfix`Esteban Küber-9/+18
2022-06-08Use delayed error handling for `Encodable` and `Encoder` infallible.Nicholas Nethercote-12/+25
There are two impls of the `Encoder` trait: `opaque::Encoder` and `opaque::FileEncoder`. The former encodes into memory and is infallible, the latter writes to file and is fallible. Currently, standard `Result`/`?`/`unwrap` error handling is used, but this is a bit verbose and has non-trivial cost, which is annoying given how rare failures are (especially in the infallible `opaque::Encoder` case). This commit changes how `Encoder` fallibility is handled. All the `emit_*` methods are now infallible. `opaque::Encoder` requires no great changes for this. `opaque::FileEncoder` now implements a delayed error handling strategy. If a failure occurs, it records this via the `res` field, and all subsequent encoding operations are skipped if `res` indicates an error has occurred. Once encoding is complete, the new `finish` method is called, which returns a `Result`. In other words, there is now a single `Result`-producing method instead of many of them. This has very little effect on how any file errors are reported if `opaque::FileEncoder` has any failures. Much of this commit is boring mechanical changes, removing `Result` return values and `?` or `unwrap` from expressions. The more interesting parts are as follows. - serialize.rs: The `Encoder` trait gains an `Ok` associated type. The `into_inner` method is changed into `finish`, which returns `Result<Vec<u8>, !>`. - opaque.rs: The `FileEncoder` adopts the delayed error handling strategy. Its `Ok` type is a `usize`, returning the number of bytes written, replacing previous uses of `FileEncoder::position`. - Various methods that take an encoder now consume it, rather than being passed a mutable reference, e.g. `serialize_query_result_cache`.
2022-06-07Use more targeted suggestion when confusing i8 with std::i8Esteban Küber-2/+2
2022-06-07Specify DWARF alignment in bits, not bytes.Patrick Walton-0/+8
In DWARF, alignment of types is specified in bits, as is made clear by the parameter name `AlignInBits`. However, `rustc` was incorrectly passing a byte alignment. This commit fixes that. This was noticed in upstream LLVM when I tried to check in a test consisting of LLVM IR generated from `rustc` and it triggered assertions [1]. [1]: https://reviews.llvm.org/D126835
2022-06-07rustdoc: show auto/blanket docs for tuple and unitMichael Howell-0/+28
2022-06-07hexagon: adapt test for upstream output changesAugie Fackler-3/+3
The output of IR formatting changed slightly in upstream rev a0bc67e555f404d0e7ddb2e78cb891d96eaf913d (https://reviews.llvm.org/D123096). I'm not actually sure what any of that means, as I don't even know what hexagon is in this context, but this change allows the test to pass on both old and new LLVMs. r? @nikic
2022-06-07Preserve unused pointer to address castsTomasz Miąsko-0/+28
2022-06-07Rollup merge of #97826 - GuillaumeGomez:rustdoc-gui-tests-info, r=Dylan-DPCDylan DPC-5/+15
Add more information for rustdoc-gui tests It was missing `--no-sandbox` in the `--help` message and the README was a bit outdated. cc `@jsha` (I recall you asking some questions about passing arguments to the rustdoc gui tester so here it). r? `@notriddle`
2022-06-07Rollup merge of #97325 - tmiasko:capture-enum-field, r=arora-amanDylan DPC-0/+27
Fix precise field capture of univariant enums When constructing a MIR from a THIR field expression, introduce an additional downcast projection before accessing a field of an enum. When rebasing a place builder on top of a captured place, account for the fact that a single HIR enum field projection corresponds to two MIR projection elements: a downcast element and a field element. Fixes #95271. Fixes #96299. Fixes #96512. Fixes #97378. r? ``@nikomatsakis`` ``@arora-aman``
2022-06-08Add regresion test for #95307Yuki Okushi-0/+43
2022-06-07Auto merge of #97825 - Dylan-DPC:rollup-ya51k1k, r=Dylan-DPCbors-0/+94
Rollup of 5 pull requests Successful merges: - #97058 (Various refactors to the incr comp workproduct handling) - #97301 (Allow unstable items to be re-exported unstably without requiring the feature be enabled) - #97738 (Fix ICEs from zsts within unsized types with non-zero offsets) - #97771 (Remove SIGIO reference on Haiku) - #97808 (Add some unstable target features for the wasm target codegen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-07Update rustdoc-gui READMEGuillaume Gomez-5/+15
2022-06-07Rollup merge of #97738 - Kixiron:zst-panic, r=eddybDylan DPC-0/+28
Fix ICEs from zsts within unsized types with non-zero offsets - Fixes #97732 - Fixes ICEs while compiling `alloc` with `-Z randomize-layout` r? ``@eddyb``
2022-06-07Rollup merge of #97301 - semicoleon:unstable-reexport, r=petrochenkovDylan DPC-0/+66
Allow unstable items to be re-exported unstably without requiring the feature be enabled Closes #94972 The diagnostic may need some work still, and I haven't added a test yet