about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-03-08Suggest `if let`/`let_else` for refutable pat in `let`Esteban Kuber-49/+125
2022-03-08Rollup merge of #94708 - notriddle:notriddle/cargo-toml-warning, r=lcnrMatthias Krüger-24/+114
diagnostics: only talk about `Cargo.toml` if running under Cargo Fixes #94646
2022-03-08Rollup merge of #94586 - sunfishcode:sunfishcode/io-lifetimes-tests, r=davidtwcoMatthias Krüger-2/+2
Generalize `get_nullable_type` to allow types where null is all-ones. Generalize get_nullable_type to accept types that have an all-ones bit pattern as their sentry "null" value. This will allow [`OwnedFd`], [`BorrowedFd`], [`OwnedSocket`], and [`BorrowedSocket`] to be marked with `#[rustc_nonnull_optimization_guaranteed]`, which will allow `Option<OwnedFd>`, `Option<BorrowedFd>`, `Option<OwnedSocket>`, and `Option<BorrowedSocket>` to be used in FFI declarations, as described in the [I/O safety RFC]. For example, it will allow a function like `open` on Unix and `WSASocketW` on Windows to be declared using `Option<OwnedFd>` and `Option<OwnedSocket>` return types, respectively. The actual change to add `#[rustc_nonnull_optimization_guaranteed]` to the abovementioned types will be a separate PR, as it'll depend on having this patch in the stage0 compiler. Also, update the diagnostics to mention that "niche optimizations" are used in libstd as well as libcore, as `rustc_layout_scalar_valid_range_start` and `rustc_layout_scalar_valid_range_end` are already in use in libstd. [`OwnedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L49 [`BorrowedFd`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/fd/owned.rs#L29 [`OwnedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L51 [`BorrowedSocket`]: https://github.com/rust-lang/rust/blob/c9dc44be24c58ff13ce46416c4b97ab5c1bd8429/library/std/src/os/windows/io/socket.rs#L29 [I/O safety RFC]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md#ownedfd-and-borrowedfdfd-1
2022-03-08Rollup merge of #94580 - xFrednet:55112-only-reason-in-lint-attr, r=lcnrMatthias Krüger-9/+81
Emit `unused_attributes` if a level attr only has a reason Fixes a comment from `compiler/rustc_lint/src/levels.rs`. Lint level attributes that only contain a reason will also trigger the `unused_attribute` lint. The lint now also checks for the `expect` lint level. That's it, have a great rest of the day for everyone reasoning this :upside_down_face: cc: #55112
2022-03-08Rollup merge of #91993 - estebank:match-span-suggestion, r=oli-obkMatthias Krüger-955/+2314
Tweak output for non-exhaustive `match` expression * Provide structured suggestion when missing `match` arms * Move pointing at the missing variants *after* the main error <img width="1164" alt="" src="https://user-images.githubusercontent.com/1606434/146312085-b57ef4a3-6e96-4f32-aa2a-803637d9eeba.png">
2022-03-08suggest adding `{ .. }` around a const function with argumentsTakayuki Maeda-0/+75
2022-03-07only emit pointer-like metadata for BZST-allocator BoxMichael Goulet-1/+24
2022-03-07Bless testJack Huey-3/+12
2022-03-08Change wording of suggestion to add missing `match` armEsteban Kuber-266/+266
2022-03-08Point at uncovered variants in enum definition in `note` instead of a ↵Esteban Kuber-689/+1014
`span_label` This makes the order of the output always consistent: 1. Place of the `match` missing arms 2. The `enum` definition span 3. The structured suggestion to add a fallthrough arm
2022-03-08When finding a match expr with multiple arms that requires more, suggest itEsteban Kuber-50/+248
Given ```rust match Some(42) { Some(0) => {} Some(1) => {} } ``` suggest ```rust match Some(42) { Some(0) => {} Some(1) => {} None | Some(_) => todo!(), } ```
2022-03-08When finding a match expr with a single arm that requires more, suggest itEsteban Kuber-159/+790
Given ```rust match Some(42) { Some(0) => {} } ``` suggest ```rust match Some(42) { Some(0) => {} None | Some(_) => todo!(), } ```
2022-03-08When encountering a match expr with no arms, suggest itEsteban Kuber-266/+471
Given ```rust match Some(42) {} ``` suggest ```rust match Some(42) { None | Some(_) => todo!(), } ```
2022-03-07Bless issue-91130 testJack Huey-1/+12
2022-03-07Try to normalize associated types before processing obligationsJack Huey-205/+265
2022-03-07Handle `#[expect(unfulfilled_lint_expectations)]` with a lint messagexFrednet-0/+77
2022-03-07fixouz-a-0/+92
2022-03-07diagnostics: only talk about `Cargo.toml` if running under CargoMichael Howell-24/+114
Fixes #94646
2022-03-07Move test to right placeEric Holk-0/+22
2022-03-07Update testsEric Holk-7/+5
2022-03-07Stabilize const_impl_trait as wellEric Holk-33/+2
2022-03-07Update tests after feature stabilizationEric Holk-659/+107
2022-03-07Do not allow `#[rustc_legacy_const_generics]` on methodsChayim Refael Friedman-3/+16
It caused an ICE since `item` was `None`.
2022-03-07Rollup merge of #94688 - ↵Matthias Krüger-0/+31
compiler-errors:free-regions-in-copy-predicate-check, r=oli-obk Erase regions when checking for missing Copy predicates Fixes #94662
2022-03-07Rollup merge of #94553 - lcnr:add-tests, r=Dylan-DPCMatthias Krüger-0/+45
add tests for #94502 cc #94552
2022-03-07add tests for #94502lcnr-0/+45
2022-03-07Rollup merge of #94636 - compiler-errors:issue-94599, r=davidtwcoMatthias Krüger-0/+21
Check extra function arg exprs even if the fn is not C-variadic We should still call check_expr on the args that exceed the formal input ty count, so that we have expr types to emit during writeback. Not sure where this regressed, but it wasn't due to the same root cause as #94334 I think. I thought this might've regressed in #92360, but I think that is in stable, ad the test I provided (which minimizes #94599) passes on stable in playground. Maybe it regressed in #93118. Anywho, fixes #94599.
2022-03-06allow referencing impl substs from rustc_on_unimplementedMichael Goulet-0/+28
2022-03-06use impl substs in on_unimplementedMichael Goulet-2/+57
2022-03-06Erase regions when checking for missing Copy predicatesMichael Goulet-0/+31
2022-03-06Updated corresponding stderrJoe-1/+1
2022-03-06Auto merge of #90076 - jackh726:wherethewhere, r=nikomatsakisbors-127/+171
Change location of where clause on GATs Closes #89122 ~Blocked on lang FCP~ r? `@nikomatsakis`
2022-03-06Constify slice index for stringsDeadbeef-8/+8
2022-03-05Auto merge of #94648 - RalfJung:rollup-4iorcrd, r=RalfJungbors-0/+18
Rollup of 4 pull requests Successful merges: - #94630 (Update note about tier 2 docs.) - #94633 (Suggest removing a semicolon after derive attributes) - #94642 (Fix source code pages scroll) - #94645 (do not attempt to open cgroup files under Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-05Update new testsJack Huey-27/+5
2022-03-05Review changesJack Huey-44/+106
2022-03-05Change to lintJack Huey-12/+18
2022-03-05Change syntax for TyAlias where clausesJack Huey-98/+96
2022-03-05Rollup merge of #94633 - ↵Ralf Jung-0/+18
TaKO8Ki:suggest-removing-semicolon-after-derive-attribute, r=cjgillot Suggest removing a semicolon after derive attributes closes #93942
2022-03-05Auto merge of #92123 - m-ou-se:thread-local-cell-methods, r=joshtriplettbors-63/+120
Implement RFC 3184 - thread local cell methods This implements [RFC 3184](https://github.com/rust-lang/rfcs/pull/3184), with `@danielhenrymantilla's` [suggestion](https://github.com/rust-lang/rfcs/pull/3184#issuecomment-965773616) for the `with_` method names. Tracking issue: https://github.com/rust-lang/rust/issues/92122
2022-03-06suggest removing a semicolon after derive attributesTakayuki Maeda-0/+18
use current token span
2022-03-05Restrict oom_unwind test to LinuxAmanieu d'Antras-0/+1
2022-03-05Improve unexpected_cfgs lint when their is no value expectedLoïc BRANSTETT-4/+22
2022-03-05Update tests.Mara Bos-63/+120
2022-03-05Auto merge of #94634 - Dylan-DPC:rollup-8wx1yrj, r=Dylan-DPCbors-69/+61
Rollup of 6 pull requests Successful merges: - #94446 (UNIX `remove_dir_all()`: Try recursing first on the slow path) - #94460 (Reenable generator drop tracking tests and fix mutation handling) - #94620 (Edit docs on consistency of `PartialOrd` and `PartialEq`) - #94624 (Downgrade `#[test]` on macro call to warning) - #94626 (Add known-bug directive to issue #47511 test case) - #94631 (Fix typo in c-variadic) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-04check extra args even if the function is not c_variadicMichael Goulet-0/+21
2022-03-05Rollup merge of #94626 - marmeladema:issue-47511-known-bug, r=jackh726Dylan DPC-4/+5
Add known-bug directive to issue #47511 test case
2022-03-05Rollup merge of #94624 - estebank:regression-94508, r=Dylan-DPCDylan DPC-27/+15
Downgrade `#[test]` on macro call to warning Follow up to #92959. Address #94508.
2022-03-05Rollup merge of #94460 - eholk:reenable-drop-tracking-tests, r=tmiaskoDylan DPC-38/+41
Reenable generator drop tracking tests and fix mutation handling The previous PR, #94068, was overly zealous in counting mutations as borrows, which effectively nullified drop tracking. We would have caught this except the drop tracking tests were still ignored, despite having the option of using the `-Zdrop-tracking` flag now. This PR fixes the issue introduced by #94068 by only counting mutations as borrows the mutated place has a project. This is sufficient to distinguish `x.y = 42` (which should count as a borrow of `x`) from `x = 42` (which is not a borrow of `x` because the whole variable is overwritten). This PR also re-enables the drop tracking regression tests using the `-Zdrop-tracking` flag so we will avoid introducing these sorts of issues in the future. Thanks to ``@tmiasko`` for noticing this problem and pointing it out! r? ``@tmiasko``
2022-03-05Auto merge of #93142 - estebank:missing-main, r=wesleywiserbors-86/+45
Do not point at whole file missing `fn main` Only point at the end of the crate. We could try making it point at the beginning of the crate, but that is confused with `DUMMY_SP`, causing the output to be *worse*. This change will make it so that VSCode will *not* underline the whole file when `main` is missing, so other errors will be visible.