about summary refs log tree commit diff
path: root/src/test/ui/lint
AgeCommit message (Collapse)AuthorLines
2021-02-28Bless some testsGiacomo Stevanato-6/+6
2021-02-28Apply lint restrictions from renamed lintsJoshua Nelson-0/+37
Previously, if you denied the old name of a renamed lint, it would warn about using the new name, but otherwise do nothing. Now, it will behave the same as if you'd used the new name.
2021-02-27Enable report_in_external_macro in unaligned_referencesTaiki Endo-0/+68
2021-02-24Properly account for non-shorthand pattern field in unused variable lintEsteban Küber-0/+46
Fix #82488
2021-02-19Consider auto derefs before warning about write only fieldsTomasz Miąsko-1/+68
Changes from 81473 extended the dead code lint with an ability to detect fields that are written to but never read from. The implementation skips over fields on the left hand side of an assignment, without marking them as live. A field access might involve an automatic dereference and de-facto read the field. Conservatively mark expressions with deref adjustments as live to avoid generating false positive warnings.
2021-02-18Rollup merge of #82203 - c410-f3r:tests-tests-tests, r=Dylan-DPCYuki Okushi-0/+8
Move some tests to more reasonable directories - 4 cc #81941
2021-02-17Rollup merge of #79981 - camelid:overflowing_literals-inference-error, r=lcnrGuillaume Gomez-18/+38
Add 'consider using' message to overflowing_literals Fixes #79744. Ironically, the `overflowing_literals` handler for binary or hex already had this message! You would think it would be the other way around :) cc ```@scottmcm```
2021-02-16Move some tests to more reasonable directoriesCaio-0/+8
2021-02-13Improve error and help messagesCamelid-38/+38
2021-02-10Inherit `#[stable(..)]` annotations in enum variants and fields from its itemEsteban Küber-118/+148
2021-02-10Auto merge of #79804 - tmiasko:improper-ctypes-no-niche, r=pnkfelixbors-46/+147
Types with a hidden niche are not known to be non-null Fixes #79787.
2021-02-09Rollup merge of #72209 - Nemo157:lint-no-mangle-in-unsafe-code, r=nikomatsakisDylan DPC-20/+113
Add checking for no_mangle to unsafe_code lint fixes #72188 r? `@estebank`
2021-02-07Auto merge of #81462 - osa1:issue75158, r=Mark-Simulacrumbors-19/+0
Add test for #75158 This also shifts some type-size related tests into a new directory, so that we keep the number of files at the root down. Closes #75158
2021-02-06path trimming: ignore type aliasesDan Aloni-11/+11
2021-02-05Move type size check tests to new dir ui/limitsÖmer Sinan Ağacan-19/+0
2021-02-04Rollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=pnkfelixMara Bos-24/+417
introduce future-compatibility warning for forbidden lint groups We used to ignore `forbid(group)` scenarios completely. This changed in #78864, but that led to a number of regressions (#80988, #81218). This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect. r? ``@Mark-Simulacrum``
2021-02-03Really fix early lints inside an async desugaringJethro Beekman-0/+5
2021-02-02introduce future-compatibility warning for forbidden lint groupsNiko Matsakis-24/+417
We used to ignore `forbid(group)` scenarios completely. This changed in #78864, but that led to a number of regressions (#80988, #81218). This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect.
2021-02-02Fix early lints inside an async desugaringAaron Hill-3/+9
Fixes #81531 When we buffer an early lint for a macro invocation, we need to determine which NodeId to take the lint level from. Currently, we use the `NodeId` of the closest def parent. However, if the macro invocation is inside the desugared closure from an `async fn` or async closure, that `NodeId` does not actually exist in the AST. This commit explicitly calls `check_lint` for the `NodeId`s of closures desugared from async expressions, ensuring that we do not miss any buffered lints.
2021-02-01Rollup merge of #81529 - estebank:case_lints, r=davidtwcoJonas Schievink-4/+4
Fix invalid camel case suggestion involving unicode idents Follow up to #77805.
2021-01-31Move some tests to more reasonable directoriesCaio-0/+126
2021-01-30Rollup merge of #81473 - sanxiyn:write-only-field, r=oli-obkYuki Okushi-0/+46
Warn write-only fields cc `@Boscop's` example in #49256.
2021-01-29Fix invalid camel case suggestion involving unicode identsEsteban Küber-4/+4
Follow up to #77805.
2021-01-28Warn write-only fieldsSeo Sanghyeon-0/+46
2021-01-28Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lintAaron Hill-0/+78
cc #79813 This PR adds an allow-by-default future-compatibility lint `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a macro body is ignored due to the macro being used in expression position: ```rust macro_rules! foo { () => { true; // WARN } } fn main() { let val = match true { true => false, _ => foo!() }; } ``` The lint takes its level from the macro call site, and can be allowed for a particular macro by adding `#[allow(semicolon_in_expressions_from_macros)]`. The lint is set to warn for all internal rustc crates (when being built by a stage1 compiler). After the next beta bump, we can enable the lint for the bootstrap compiler as well.
2021-01-24Rollup merge of #81310 - tmiasko:in-pattern, r=petrochenkovJonas Schievink-1/+40
Do not mark unit variants as used when in path pattern Record that we are processing a pattern so that code responsible for handling path resolution can correctly decide whether to mark it as used or not. Closes #76788.
2021-01-24Auto merge of #80919 - cjgillot:defkey-span, r=oli-obkbors-8/+2
Generate metadata by iterating on DefId instead of traversing the HIR tree 1/N Sample from #80347.
2021-01-23Iterate DefId to encode spans.Camille GILLOT-8/+2
2021-01-23Do not mark unit variants as used when in path patternTomasz Miąsko-1/+40
Record that we are processing a pattern so that code responsible for handling path resolution can correctly decide whether to mark it as used or not.
2021-01-17Fix formatting for removed lintsJoshua Nelson-13/+13
- Don't add backticks for the reason a lint was removed. This is almost never a code block, and when it is the backticks should be in the reason itself. - Don't assume clippy is the only tool that needs to be checked for backwards compatibility
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+394
Address comments Update limits
2021-01-13Update code to account for extern ABI requirementMark Rousskov-4/+4
2021-01-13Update tests for extern block lintingMark Rousskov-44/+74
2021-01-12Add test case for wasm non-clash.jumbatm-0/+21
2021-01-02Add snake case lint note about keyword identifiers which cannot be rawSkynoodle-0/+2
2021-01-01Add reserved identifier test cases for snake case lintSkynoodle-0/+84
2020-12-30Rollup merge of #78934 - DeveloperC286:issue_60302_vec, r=m-ou-seMara Bos-1/+1
refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength This PR removes the need for ignore-tidy-filelength for library/alloc/src/vec/mod.rs which is part of the issue #60302 It is probably easiest to review this PR by looking at it commit by commit rather than looking at the overall diff.
2020-12-30Rollup merge of #79812 - Aaron1011:lint-item-trailing-semi, r=oli-obkYuki Okushi-6/+22
Lint on redundant trailing semicolon after item We now lint on code like this: ```rust fn main() { fn foo() {}; struct Bar {}; } ``` Previously, this caused warnings in Cargo, so it was disabled.
2020-12-29Lint on redundant trailing semicolon after itemAaron Hill-6/+22
We now lint on code like this: ```rust fn main() { fn foo() {}; struct Bar {}; } ``` Previously, this caused warnings in Cargo, so it was disabled.
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-0/+94
2020-12-29test: updated expected Vec src pathC-1/+1
2020-12-26update testsBastian Kauschke-1/+1
2020-12-22Revert "Promote missing_fragment_specifier to hard error"Wesley Wiser-4/+22
This reverts commit 02eae432e7476a0686633a8c2b7cb1d5aab1bd2c.
2020-12-17Suppress `CONST_ITEM_MUTATION` lint if a dereference occurs anywhereAaron Hill-8/+16
Fixes #79971
2020-12-12Add 'consider using' message to overflowing_literalsCamelid-0/+20
Ironically, the overflowing_literals handler for binary or hex already had this message! You would think it would be the other way around :)
2020-12-10Types with a hidden niche are not known to be non-nullTomasz Miąsko-46/+147
2020-12-08Visit ForeignItems when marking dead code.Camille GILLOT-0/+19
2020-12-03Auto merge of #79620 - JohnTitor:label-name-sugg, r=davidtwcobors-1/+1
Tweak diagnostics on shadowing lifetimes/labels Fixes #79610 Skip adding a new test assuming we have already sufficient tests.
2020-12-02Tweak diagnostics on shadowing lifetimes/labelsYuki Okushi-1/+1
2020-12-02Auto merge of #78864 - Mark-Simulacrum:warn-on-forbids, r=pnkfelixbors-164/+84
Use true previous lint level when detecting overriden forbids Previously, cap-lints was ignored when checking the previous forbid level, which meant that it was a hard error to do so. This is different from the normal behavior of lints, which are silenced by cap-lints; if the forbid would not take effect regardless, there is not much point in complaining about the fact that we are reducing its level. It might be considered a bug that even `--cap-lints deny` would suffice to silence the error on overriding forbid, depending on if one cares about failing the build or precisely forbid being set. But setting cap-lints to deny is quite odd and not really done in practice, so we don't try to handle it specially. This also unifies the code paths for nested and same-level scopes. However, the special case for CLI lint flags is left in place (introduced by #70918) to fix the regression noted in #70819. That means that CLI flags do not lint on forbid being overridden by a non-forbid level. It is unclear whether this is a bug or a desirable feature, but it is certainly inconsistent. CLI flags are a sufficiently different "type" of place though that this is deemed out of scope for this commit. r? `@pnkfelix` perhaps? cc #77713 -- not marking as "Fixes" because of the lack of proper unused attribute handling in this PR