summary refs log tree commit diff
path: root/src/test/ui/lint
AgeCommit message (Collapse)AuthorLines
2018-03-26update testMark Mansi-7/+7
2018-03-26Stabilize i128_typeMark Mansi-2/+0
2018-03-14update testsGuillaume Gomez-2/+10
2018-03-02Remove isize testflip1995-11/+1
2018-03-01Adapt stderr of UI test to PR #48449flip1995-8/+8
2018-03-01Rewrite error reporting as requestedflip1995-17/+13
2018-03-01Suggest type for overflowing bin/hex-literalsflip1995-0/+105
2018-02-26Fix rebaseVadim Petrochenkov-10/+10
2018-02-26Update UI testsVadim Petrochenkov-7/+7
2018-02-26Update UI testsVadim Petrochenkov-80/+80
2018-02-25Update ui testsGuillaume Gomez-0/+2
2018-02-20Fix internal references to bad_style in test code.boats-3/+3
2018-02-20Fix filepath in lint test.boats-10/+10
2018-02-20Fix carets.boats-5/+5
2018-02-20Add nonstandard_style alias for bad_style.boats-0/+103
2018-02-07Rollup merge of #47922 - ↵Manish Goregaokar-0/+74
zackmdavis:and_the_case_of_the_unused_field_pattern, r=estebank correct unused field pattern suggestions ![unused_field_pattern_local](https://user-images.githubusercontent.com/1076988/35662336-7a69488a-06cc-11e8-9901-8d22b5cf924f.png) r? @estebank
2018-02-04Rollup merge of #47896 - ↵kennytm-0/+55
zackmdavis:and_the_case_of_the_necessary_unnecessary_parens, r=nikomatsakis decline to lint technically-unnecessary parens in function or method arguments inside of nested macros In #46980 ("in which the unused-parens lint..." (14982db2d6)), the unused-parens lint was made to check function and method arguments, which it previously did not (seemingly due to oversight rather than willful design). However, in #47775 and discussion thereon, user–developers of Geal/nom and graphql-rust/juniper reported that the lint was seemingly erroneously triggering on certain complex macros in those projects. While this doesn't seem like a bug in the lint in the particular strict sense that the expanded code would, in fact, contain unncecessary parentheses, it also doesn't seem like the sort of thing macro authors should have to think about: the spirit of the unused-parens lint is to prevent needless clutter in code, not to give macro authors extra heartache in the handling of token trees. We propose the expediency of declining to lint unused parentheses in function or method args inside of nested expansions: we believe that this should eliminate the petty, troublesome lint warnings reported in the issue, without forgoing the benefits of the lint in simpler macros. It seemed like too much duplicated code for the `Call` and `MethodCall` match arms to duplicate the nested-macro check in addition to each having their own `for` loop, so this occasioned a slight refactor so that the function and method cases could share code—hopefully the overall intent is at least no less clear to the gentle reader. This is concerning #47775.
2018-01-31concerning well-formed suggestions for unused shorthand field patternsZack M. Davis-0/+74
Previously, unused variables would get a note that the warning could be silenced by prefixing the variable with an underscore, but that doesn't work for field shorthand patterns, which the liveness analysis didn't know about. The "to avoid this warning" verbiage seemed unnecessary. Resolves #47390.
2018-01-30wherein the parens lint keeps its own counsel re args in nested macrosZack M. Davis-0/+55
In #46980 ("in which the unused-parens lint..." (14982db2d6)), the unused-parens lint was made to check function and method arguments, which it previously did not (seemingly due to oversight rather than willful design). However, in #47775 and discussion thereon, user–developers of Geal/nom and graphql-rust/juniper reported that the lint was seemingly erroneously triggering on certain complex macros in those projects. While this doesn't seem like a bug in the lint in the particular strict sense that the expanded code would, in fact, contain unncecessary parentheses, it also doesn't seem like the sort of thing macro authors should have to think about: the spirit of the unused-parens lint is to prevent needless clutter in code, not to give macro authors extra heartache in the handling of token trees. We propose the expediency of declining to lint unused parentheses in function or method args inside of nested expansions: we believe that this should eliminate the petty, troublesome lint warnings reported in the issue, without forgoing the benefits of the lint in simpler macros. It seemed like too much duplicated code for the `Call` and `MethodCall` match arms to duplicate the nested-macro check in addition to each having their own `for` loop, so this occasioned a slight refactor so that the function and method cases could share code—hopefully the overall intent is at least no less clear to the gentle reader. This is concerning #47775.
2018-01-26Consider all whitespace when preparing spanEsteban Küber-28/+46
2018-01-26Include space in suggestion `mut` in bindingsEsteban Küber-1/+1
2018-01-16in which the private no-mangle lints receive a valued lesson in humilityZack M. Davis-10/+32
The incompetent fool who added these suggestions in 38e5a964f2 apparently thought it was safe to assume that, because the offending function or static was unreachable, it would therefore have not have any existing visibility modifiers, making it safe for us to unconditionally suggest inserting `pub`. This isn't true. This resolves #47383.
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