about summary refs log tree commit diff
path: root/src/test/ui/lint
AgeCommit message (Collapse)AuthorLines
2021-07-14Add -Zfuture-incompat-test to assist with testing future-incompat reports.Eric Huss-0/+19
2021-07-14Warn about useless assignments of variables/fields to themselvesFabian Wolff-0/+94
2021-07-13Auto merge of #86827 - camsteffen:hash-lint-resolved, r=oli-obkbors-5/+4
Fix internal `default_hash_types` lint to use resolved path I run into false positives now and then (mostly in Clippy) when I want to name some util after HashMap.
2021-07-12Auto merge of #86320 - hi-rustin:rustin-patch-fix-span, r=estebankbors-59/+58
shrinking the deprecated span ref: https://github.com/rust-lang/rust/pull/85617#issuecomment-854947988 part of #85403 r? `@estebank` The reason is that if we use method_span directly, it will cause the in_derive_expansion judgment to fail.
2021-07-10Auto merge of #86968 - inquisitivecrystal:missing-docs-v2, r=oli-obkbors-0/+63
Remove `missing_docs` lint on private 2.0 macros https://github.com/rust-lang/rust/blob/798baebde1fe77e5a660490ec64e727a5d79970d/compiler/rustc_lint/src/builtin.rs#L573-L584 This code is the source of #57569. The problem is subtle, so let me point it out. This code makes the mistake of assuming that all of the macros in `krate.exported_macros` are exported. ...Yeah. For some historical reason, all `macro` macros are marked as exported, regardless of whether they actually are, which is dreadfully confusing. It would be more accurate to say that `exported_macros` currently contains only macros that have paths. This PR renames `exported_macros` to `importable_macros`, since these macros can be imported with `use` while others cannot. It also fixes the code above to no longer lint on private `macro` macros, since the `missing_docs` lint should only appear on exported items. Fixes #57569.
2021-07-09Fix default_hash_types to use resolved pathCameron Steffen-5/+4
2021-07-09Auto merge of #86888 - FabianWolff:issue-86600, r=davidtwcobors-0/+27
Fix double warning about illegal floating-point literal pattern This PR fixes #86600. The problem is that the `ConstToPat` struct contains a field `include_lint_checks`, which determines whether lints should be emitted or not, but this field is currently not obeyed at one point, leading to a warning being emitted more than once. I have fixed this behavior here.
2021-07-08Add regression testinquisitivecrystal-0/+63
2021-07-08Rollup merge of #86639 - eholk:lint-tool, r=petrochenkovYuki Okushi-0/+22
Support lint tool names in rustc command line options When rustc is running without a lint tool such as clippy enabled, options for lints such as `clippy::foo` are meant to be ignored. This was already working for those specified by attrs, such as `#![allow(clippy::foo)]`, but this did not work for command line arguments like `-A clippy::foo`. This PR fixes that issue. Note that we discovered this issue while discussing https://github.com/rust-lang/cargo/issues/5034. Fixes #86628.
2021-07-07Cleanup: unify lint name checkingEric Holk-0/+11
This change merges `check_lint_and_tool_name` into `check_lint_name` in order to avoid having two very similar functions. Also adds the `.stderr` file back for the test case, since apparently it is still needed.
2021-07-07Fix test caseEric Holk-12/+1
Previously this was using a `.stderr` file, but that does not seem to work for all cases. This change uses `// error-pattern:` instead.
2021-07-06Unify lint tool and lint name checkingEric Holk-4/+4
This shares a little more code between checking command line and attribute lint specifications.
2021-07-06Add ui test for command line lints with tool namesEric Holk-0/+22
This adds a ui test to make sure rustc accepts lint arguments such as `-A clippy::foo` when clippy is disabled.
2021-07-05Fix double warning about illegal floating-point literal patternFabian Wolff-0/+27
2021-07-01New force_warn diagnostic builder and ensure cap-lints doesn't reduce ↵Ryan Levick-1/+28
force_warn level
2021-06-30Force warnings even when can_emit_warnings == falseRyan Levick-0/+22
2021-06-29Auto merge of #86009 - cjgillot:fwarn, r=davidtwcobors-9/+9
Make ForceWarn a lint level. Follow-up to #85788 cc `@rylev`
2021-06-26Remove issue-78660-cap-lints-future-compat test.Mara Bos-10/+0
2021-06-26Make ForceWarn a lint level.Camille GILLOT-9/+9
2021-06-25Address PR feedbackRyan Levick-19/+19
2021-06-25Change how edition based future compatibility warnings are handledRyan Levick-30/+19
2021-06-18Lint for unused borrows as part of UNUSED_MUST_USEhi-rustin-0/+77
2021-06-15Use last segmenthi-rustin-3/+2
2021-06-15shrinking the deprecated method spanhi-rustin-56/+56
2021-06-10Fix force-warns to allow dashes.Eric Huss-1/+1
2021-06-10Auto merge of #82639 - jyn514:stable-options, r=Mark-Simulacrumbors-718/+53
Don't pass -Z unstable-options by default for UI tests Unconditionally passing -Z unstable-options makes it impossible to test whether an option requires unstable-options or not. This uncovered quite a lot of bugs, I'll open issues for each. These don't strictly need to be fixed before this is merged, it just makes the diff much larger because of the changes to diagnostics. - https://github.com/rust-lang/rust/issues/82636 - https://github.com/rust-lang/rust/issues/82637 - https://github.com/rust-lang/rust/issues/82638
2021-06-06Don't pass -Z unstable-options by default for UI testsJoshua Nelson-718/+53
- Pass it explicitly where appropriate - Update stderr files and warnings; it turns that unstable-options has far-reaching effects on diagnostics.
2021-06-05Auto merge of #86001 - richkadel:revert-85617-rustin-patch-fix, ↵bors-56/+56
r=Mark-Simulacrum Revert "shrinking the deprecated method span" Reverts rust-lang/rust#85617 Fixes: #86000 r? `@Mark-Simulacrum`
2021-06-04Make *const (), *mut () okay for FFIDavid Tolnay-11/+2
2021-06-04Add improper ctypes test for ptr to unit, ptr to tupleDavid Tolnay-45/+69
2021-06-05Rollup merge of #85853 - marmeladema:improper-ctypes-definitions-boxed-dst, ↵Yuki Okushi-20/+55
r=petrochenkov Warn against boxed DST in `improper_ctypes_definitions` lint Fixes #85714
2021-06-04Revert "shrinking the deprecated method span"Rich Kadel-56/+56
2021-06-04Auto merge of #85788 - rylev:force-warns, r=nikomatsakisbors-0/+195
Support for force-warns Implements https://github.com/rust-lang/rust/issues/85512. This PR adds a new command line option `force-warns` which will force the provided lints to warn even if they are allowed by some other mechanism such as `#![allow(warnings)]`. Some remaining issues: * https://github.com/rust-lang/rust/issues/85512 mentions that `force-warns` should also be capable of taking lint groups instead of individual lints. This is not implemented. * If a lint has a higher warning level than `warn`, this will cause that lint to warn instead. We probably want to allow the lint to error if it is set to a higher lint and is not allowed somewhere else. * One test is currently ignored because it's not working - when a deny-by-default lint is allowed, it does not currently warn under `force-warns`. I'm not sure why, but I wanted to get this in before the weekend. r? `@nikomatsakis`
2021-06-03Warn against boxed DST in `improper_ctypes_definitions` lintmarmeladema-20/+55
2021-06-03Update tests with new casingRyan Levick-9/+9
2021-06-02Add deny-by-default testRyan Levick-0/+22
2021-06-02Add missing stderr fileRyan Levick-0/+14
2021-06-02Add final testRyan Levick-7/+6
2021-06-02Force warn on lint groups as wellRyan Levick-4/+58
2021-06-01Fix issues and add testRyan Levick-1/+14
2021-05-28Initial support for force-warnsRyan Levick-0/+93
2021-05-24shrinking the deprecated method spanhi-rustin-56/+56
2021-05-21Warn about unreachable code following an expression with an uninhabited typeFabian Wolff-0/+109
2021-05-16More tests for issue-85255hi-rustin-5/+82
2021-05-15Warn about unused pub fields in non-pub structsFabian Wolff-0/+54
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-15/+15
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-05-07shrinking the deprecated method spanhi-rustin-48/+48
2021-05-05Suggest lint groupsCameron Steffen-1/+11
2021-05-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-7/+30
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-05-03parser: Remove support for inner attributes on non-block expressionsVadim Petrochenkov-8/+6