summary refs log tree commit diff
path: root/src/test/ui/lint
AgeCommit message (Collapse)AuthorLines
2017-10-01correct unused-parens lint suggestion to strip exact pairZack M. Davis-0/+26
2017-09-30code suggestions for unused-mut, while-true lints; UI testZack M. Davis-0/+65
2017-09-15RFC 1940 UI test in own directory, exercise must_use trait methodsZack M. Davis-53/+0
(It was put forward that all tests related to a feature being in their own directory makes stabilization decisionmaking more convenient.)
2017-08-31add a lowercase suggestion to unknown_lintsAndre Bogus-0/+41
2017-08-22hard feature-gate for #[must_use] on functionsZack M. Davis-6/+7
We'll actually want a new "soft" warning-only gate to maintain backwards-compatibility, but it's cleaner to start out with the established, well-understood gate before implementing the alternative warn-only behavior in a later commit. This is in the matter of #43302.
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-18/+29
In preparation for incremental compilation this commit refactors the lint handling infrastructure in the compiler to be more "eager" and overall more incremental-friendly. Many passes of the compiler can emit lints at various points but before this commit all lints were buffered in a table to be emitted at the very end of compilation. This commit changes these lints to be emitted immediately during compilation using pre-calculated lint level-related data structures. Linting today is split into two phases, one set of "early" lints run on the `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the "early" lints to running as late as possible in compilation, just before HIR lowering. This notably means that we're catching resolve-related lints just before HIR lowering. The early linting remains a pass very similar to how it was before, maintaining context of the current lint level as it walks the tree. Post-HIR, however, linting is structured as a method on the `TyCtxt` which transitively executes a query to calculate lint levels. Each request to lint on a `TyCtxt` will query the entire crate's 'lint level data structure' and then go from there about whether the lint should be emitted or not. The query depends on the entire HIR crate but should be very quick to calculate (just a quick walk of the HIR) and the red-green system should notice that the lint level data structure rarely changes, and should hopefully preserve incrementality. Overall this resulted in a pretty big change to the test suite now that lints are emitted much earlier in compilation (on-demand vs only at the end). This in turn necessitated the addition of many `#![allow(warnings)]` directives throughout the compile-fail test suite and a number of updates to the UI test suite.
2017-08-08#[must_use] for functions (RFC 1940)Zack M. Davis-0/+47
The return value of a function annotated with `must_use`, must be used. This is in the matter of #43302.
2017-07-02report the total number of errors on compilation failureAriel Ben-Yehuda-1/+1
Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed. This changes the compiler driver API to handle errors more smoothly, and therefore is a compiler-api-[breaking-change]. Fixes #42793.
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-3/+3
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-06-29Rollup merge of #42919 - zackmdavis:once_again_we_heard_you_the_first_time, ↵Ariel Ben-Yehuda-5/+5
r=eddyb make lint on-by-default/implied-by messages appear only once From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060). ![we_heard](https://user-images.githubusercontent.com/1076988/27564103-6284b78e-5a8a-11e7-9d35-f7f297ca9573.png) r? @nikomatsakis
2017-06-26make lint on-by-default/implied-by messages appear only onceZack M. Davis-5/+5
From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).
2017-06-23only set "overruled by outer forbid" once for lint groups, by group nameZack M. Davis-0/+51
Previously, conflicting forbid/allow attributes for a lint group would result in a separate "allow(L) overruled by outer forbid(L)" error for every lint L in the group. This was needlessly and annoyingly verbose; we prefer to just have one error pointing out the conflicting attributes. Resolves #42873.
2017-05-24Change error count messagesMichael Kohl-3/+3
See #33525 for details.
2017-02-04note wording: lint implied by lint group, not lint group implies lintZack M. Davis-8/+8
2017-02-04make lint-group-style test a UI rather than a compile-fail testZack M. Davis-0/+103
As suggested by Niko Matsakis in review (https://github.com/rust-lang/rust/pull/38103#discussion_r94460982) regarding the endeavor prompted by #36846.
2017-02-04note lint group set on command line triggering individual lintZack M. Davis-0/+88
Previously, the note/message for the source of a lint being the command line unconditionally named the individual lint, even if the actual command specified a lint group (e.g., `-D warnings`); here, we take note of the actual command options so we can be more specific. This remains in the matter of #36846.