summary refs log tree commit diff
path: root/src/test/ui/lint
AgeCommit message (Collapse)AuthorLines
2022-12-06Rollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiserMatthias Krüger-0/+49
Fix `emit_unused_delims_expr` ICE Fixes #104897 This is also related to #104433.
2022-12-02Auto merge of #104863 - nnethercote:reduce-lint-macros, r=cjgillotbors-70/+8
Reduce macro usage for lints r? `@cjgillot`
2022-12-02return when expr has errorTakayuki Maeda-0/+49
fmt add a comment
2022-12-02Rollup merge of #104614 - Nilstrieb:type-ascribe!, r=TaKO8KiMatthias Krüger-12/+3
Add `type_ascribe!` macro as placeholder syntax for type ascription This makes it still possible to test the internal semantics of type ascription even once the `:`-syntax is removed from the parser. The macro now gets used in a bunch of UI tests that test the semantics and not syntax of type ascription. I might have forgotten a few tests but this should hopefully be most of them. The remaining ones will certainly be found once type ascription is removed from the parser altogether. Part of #101728
2022-12-02Remove `-Zno-interleave-lints`.Nicholas Nethercote-70/+8
Because it complicates lint implementation greatly.
2022-11-28Change multiline span ASCII art visual orderEsteban Küber-3/+3
2022-11-25Use "must be init" instead of "must not be uninit" everywhereOli Scherer-11/+11
2022-11-25Add a `because` to errors derived from fieldsOli Scherer-12/+12
2022-11-25Don't show fields from other cratesOli Scherer-34/+4
2022-11-25Reinstate the previous compact form of "in this field" errorsOli Scherer-42/+21
2022-11-25Compute layout instead of manually procesisng the layout restriction attributesOli Scherer-0/+63
2022-11-25Print a trace through types to show how to get to the problematic typeOli Scherer-13/+36
2022-11-23lint: do not warn unused parens around higher-ranked function pointersMichael Howell-0/+18
Fixes #104397
2022-11-19Use `type_ascribe!` in many UI testsNilstrieb-12/+3
Use it in all UI tests that are about the semantics and not the syntax of type ascription.
2022-11-19Refactor `must_use` lint into two partsNilstrieb-33/+56
Before, the lint did the checking for `must_use` and pretty printing the types in a special format in one pass, causing quite complex and untranslatable code. Now the collection and printing is split in two. That should also make it easier to translate or extract the type pretty printing in the future. Also fixes an integer overflow in the array length pluralization calculation.
2022-11-17Rollup merge of #104433 - TaKO8Ki:fix-104392, r=estebankMatthias Krüger-0/+38
Fix `emit_unused_delims_expr` ICE Fixes #104392
2022-11-15Rollup merge of #104296 - compiler-errors:opaque-ty-ffi-normalization-cycle, ↵Matthias Krüger-0/+56
r=lcnr Walk types more carefully in `ProhibitOpaqueTypes` visitor The visitor didn't account for the case where you could have `<TAIT as Trait>::Assoc` normalize to itself, in the case of a `type TAIT = impl Trait` with an unconstrained associated type. That causes the visitor to loop on the same type over and over. Fixes #104291
2022-11-15return when expr has errorsTakayuki Maeda-0/+38
add ui tests
2022-11-15Normalize types before looking for opaquesMichael Goulet-0/+56
2022-11-14Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwcoMatthias Krüger-12/+12
Don't print full paths in overlap errors We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message. r? diagnostics
2022-11-11Auto merge of #104293 - Manishearth:rollup-xj92d0k, r=Manishearthbors-0/+97
Rollup of 8 pull requests Successful merges: - #95292 (Allow specialized const trait impls.) - #100386 (Make `Sized` coinductive, again) - #102215 (Implement the `+whole-archive` modifier for `wasm-ld`) - #103468 (Fix unused lint and parser caring about spaces to won't produce invalid code) - #103531 (Suggest calling the instance method of the same name when method not found) - #103960 (piece of diagnostic migrate) - #104051 (update Miri) - #104129 (rustdoc: use javascript to layout notable traits popups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-11Rollup merge of #103468 - chenyukang:yukang/fix-103435-extra-parentheses, ↵Manish Goregaokar-0/+97
r=estebank Fix unused lint and parser caring about spaces to won't produce invalid code Fixes #103435
2022-11-10Fix tests after rebaseEsteban Küber-2/+2
2022-11-10review commentsEsteban Küber-4/+4
2022-11-10Consider `#[must_use]` annotation on `async fn` as also affecting the ↵Esteban Küber-30/+78
`Future::Output` No longer lint against `#[must_use] async fn foo()`. When encountering a statement that awaits on a `Future`, check if the `Future`'s parent item is annotated with `#[must_use]` and emit a lint if so. This effectively makes `must_use` an annotation on the `Future::Output` instead of only the `Future` itself. Fix #78149.
2022-11-10Tweak span for `#[must_use]`Esteban Küber-39/+39
Do not point at whole statement, only at the expression (skip pointing at `;`)
2022-11-10Don't print full paths in overlap errorsMichael Goulet-12/+12
2022-11-04Rollup merge of #103397 - crlf0710:port_dead_code_lint, r=davidtwcoMatthias Krüger-4/+4
Port `dead_code` lints to be translatable. This adds an additional comma to lists with three or more items, to be consistent with list formatters like `icu4x`. r? `@davidtwco`
2022-10-31Rollup merge of #103338 - l4l:enum-unreachable-pub, r=nagisaDylan DPC-0/+45
Fix unreachable_pub suggestion for enum with fields Resolves #103317
2022-10-29Run rustfix test for 103317 caseKitsu-3/+18
2022-10-29Rollup merge of #103383 - compiler-errors:tait-scope, r=oli-obkMatthias Krüger-2/+2
Note scope of TAIT more accurately This maybe explains why the person was confused in #101897, since we say "same module" but really should've said "same impl". r? ``@oli-obk``
2022-10-24fix parentheses surrounding spacing issue in parseryukang-5/+27
2022-10-24Port `dead_code` lints to be translatable.Charles Lew-4/+4
2022-10-24fix #103435, unused lint won't produce invalid codeyukang-0/+75
2022-10-23Fix wrapped valid-range handling in ty_find_init_errorJosh Triplett-51/+69
Rust's niche handling allows for wrapping valid ranges with end < start; for instance, a valid range with start=43 and end=41 means a niche of 42. Most places in the compiler handle this correctly, but ty_find_init_error assumed that `lo > 0` means the type cannot contain a zero. Fix it to handle wrapping ranges. Add a test to cover this case.
2022-10-22Note scope of TAIT more accuratelyMichael Goulet-2/+2
2022-10-22Rollup merge of #102635 - lcnr:incoherent_auto_trait_objects, r=jackh726Matthias Krüger-0/+42
make `order_dependent_trait_objects` show up in future-breakage reports tried to change it to a hard error in #102474 but breaking the more than 1000 dependents of `traitobject` doesn't feel great :sweat_smile: This lint has existed since more than 3 years now and the way this is currently implemented is buggy and will break with #102472. imo we should upgrade it to also report for dependencies and maybe also backport this to beta. Then after maybe 2-3 stable versions I would like to finally convert this lint to a hard error.
2022-10-21Fix unreachable_pub suggestion for enum with fieldsKitsu-0/+30
2022-10-20Elaborate supertrait bounds when triggering unused_must_use on impl TraitMichael Goulet-0/+26
2022-10-17`order_dependent_trait_objects` to `ReportNow`lcnr-0/+42
2022-10-15Auto merge of #99292 - Aaron1011:stability-use-tree, r=cjgillotbors-2/+11
Correctly handle path stability for 'use tree' items PR #95956 started checking the stability of path segments. However, this was not applied to 'use tree' items (e.g. 'use some::path::{ItemOne, ItemTwo}') due to the way that we desugar these items in HIR lowering. This PR modifies 'use tree' lowering to preserve resolution information, which is needed by stability checking.
2022-10-13fix small word dupe typosRageking8-1/+1
2022-10-09fixup lint nameMaybe Waffle-1/+1
2022-10-09`for_loop_over_fallibles`: fix suggestion for "remove `.next()`" caseMaybe Waffle-3/+2
if the iterator is used after the loop, we need to use `.by_ref()`
2022-10-09Add a test for the `for_loop_over_fallibles` lintMaybe Waffle-0/+145
2022-10-07make const_err a hard errorRalf Jung-83/+43
2022-10-05Fix opaque_hidden_inferred_bound lint ICEMichael Goulet-0/+22
2022-10-05change might_permit_raw_init to fully detect LLVM UB, but not more than thatRalf Jung-26/+51
2022-10-04Rollup merge of #102489 - compiler-errors:issue-102074, r=oli-obkDylan DPC-2/+11
Normalize substs before resolving instance in `NoopMethodCall` lint Fixes #102074 r? types
2022-10-04Rollup merge of #102639 - nnethercote:improve-spans-splitting, r=Aaron1011Matthias Krüger-1/+1
Improve spans when splitting multi-char operator tokens for proc macros. When a two-char (or three-char) operator token is split into single-char operator tokens before being passed to a proc macro, the single-char tokens are given the original span of length two (or three). This PR gives them more accurate spans. r? `@Aaron1011` cc `@petrochenkov`