about summary refs log tree commit diff
path: root/src/test/ui/lint
AgeCommit message (Collapse)AuthorLines
2018-01-02Correct for changes in line numbers in expected stderr output.Ed Schouten-58/+58
Due to the disable-cloudabi tags being added to the source files, the expected output of the compiler is altered slightly.
2018-01-02Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.Ed Schouten-0/+1
It looks like many of these tests are already disabled on emscripten, which also doesn't seem to support environment variables and subprocess spawning. Just add a similar tag for CloudABI. While there, sort some of the lists of operating systems alphabetically.
2017-12-19Point at `while true` span instead of entire blockEsteban Küber-12/+2
2017-12-11Auto merge of #46608 - estebank:resolve-return, r=nikomatsakisbors-2/+2
Resolve type on return type suggestion Partially address #45871.
2017-12-10Update ui tests' line numbers.Tommy Ip-84/+84
2017-12-10Add must-compile-successfully comment to appropriate ui tests.Tommy Ip-0/+9
2017-12-09Resolve type on return type suggestionEsteban Küber-2/+2
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-42/+51
2017-11-20Update ui test to rustc masterOliver Schneider-1/+0
2017-11-20Include rendered diagnostic in jsonOliver Schneider-16/+137
2017-11-06Auto merge of #45737 - oli-obk:json, r=petrochenkovbors-5/+383
Pretty print json in ui tests I found the json output in one line to not be useful for reviewing r? @petrochenkov
2017-11-06Adjust json errors to byte changesOliver Schneider-32/+32
2017-11-03Auto merge of #45569 - zackmdavis:unexported_pub_lint, r=petrochenkovbors-0/+411
`unreachable-pub` lint (as authorized by RFC 2126) To whom it may concern: RFC 2126 commissions the creation of a lint for `pub` items that are not visible from crate root (#45521). We understand (but seek confirmation from more knowledgable compiler elders) that this can be implemented by linting HIR items that are _not_ ~~`cx.access_levels.is_exported`~~ `cx.access_levels.is_reachable` but have a `vis` (-ibility) field of `hir::Visibility::Public`. The lint, tentatively called ~~`unexported-pub`~~ `unreachable-pub` (with the understanding that much could be written on the merits of various names, as it is said of the colors of bicycle-sheds), suggests `crate` as a replacement for `pub` if the `crate_visibility_modifier` feature is enabled (see #45388), and `pub(crate)` otherwise. We also use help messaging to suggest the other potential fix of exporting the item; feedback is desired as to whether this may be confusing or could be worded better. As a preview of what respecting the proposed lint would look like (and to generate confirmatory evidence that this implementation doesn't issue false positives), ~~we take its suggestions for `libcore`~~ (save one, which is deferred to another pull request because it brings up an unrelated technical matter). I remain your obedient servant. ![unexported_pub](https://user-images.githubusercontent.com/1076988/32089794-fbd02420-baa0-11e7-87e5-3ec01f18924a.png) r? @petrochenkov
2017-11-03Don't add a new -Z flag, reuse -Zunstable-optionsOliver Schneider-2/+2
2017-11-03Pretty print json in ui testsOliver Schneider-5/+383
2017-11-02unreachable-pub lint for `pub` items not reachable from crate rootZack M. Davis-0/+411
This is with deepest thanks to Vadim Petrochenkov for thorough review, and resolves #45521.
2017-11-02Report lint names in json diagnosticsOliver Schneider-1/+1
2017-10-29Add several lints into `unused` lint groupVadim Petrochenkov-4/+10
Remove a couple of obsolete lints
2017-10-24Reduce the repetition in json error outputOliver Schneider-2/+2
2017-10-24Add a test reproducing the quadratic json explosionOliver Schneider-0/+23
2017-10-19Auto merge of #45080 - clippered:issue-44986/fix-windows-ui-path, r=estebankbors-3/+1
Issue 44986/fix windows ui path #44968
2017-10-16bolster UI test converage for lint suggestionsZack M. Davis-11/+83
2017-10-14rustc: Remove `used_mut_nodes` from `TyCtxt`Alex Crichton-14/+14
This updates the borrowck query to return a result, and this result is then used to incrementally check for unused mutable nodes given sets of all the used mutable nodes. Closes #42384
2017-10-11Fix #44968 Windows path in UI testsclippered-3/+1
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.