about summary refs log tree commit diff
path: root/src/test/ui/lint
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-31639/+0
2022-12-28Rollup merge of #104024 - noeddl:unused-must-use, r=compiler-errorsfee1-dead-1/+1
Fix `unused_must_use` warning for `Box::from_raw`
2022-12-27Rollup merge of #105515 - estebank:issue-104141, r=oli-obkMatthias Krüger-0/+6
Account for macros in const generics Fix #104141.
2022-12-22Rollup merge of #105837 - compiler-errors:issue-105728, r=estebankMatthias Krüger-0/+21
Don't ICE in `check_must_not_suspend_ty` for mismatched tuple arity These expressions are just used for their spans, so make it best-effort here. Fixes #105728
2022-12-17Don't ICE in check_must_not_suspend_ty for mismatched tuple arityMichael Goulet-0/+21
2022-12-17Try to fix ICEmejrs-11/+11
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-6/+0
available
2022-12-10Rollup merge of #105505 - WaffleLapkin:yeet_unused_parens_lint, r=fee1-deadMatthias Krüger-20/+34
Don't warn about unused parens when they are used by yeet expr Don't even get me started on how I've found this.
2022-12-09Account for macros in const genericsEsteban Küber-0/+6
2022-12-09Rollup merge of #102406 - mejrs:missing_copy, r=wesleywiserMatthias Krüger-0/+35
Make `missing_copy_implementations` more cautious - Fixes https://github.com/rust-lang/rust/issues/98348 - Also makes the lint not fire on large types and types containing raw pointers. Thoughts?
2022-12-09Don't warn about unused parens when they are used by yeet exprMaybe Waffle-20/+34
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-29Make `missing_copy_implementations` more cautiousmejrs-0/+35
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-05Fix unused_must_use warning for Box::from_rawAnett Seeker-1/+1
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.