about summary refs log tree commit diff
path: root/src/librustc/lint
AgeCommit message (Collapse)AuthorLines
2019-04-28Implement internal lintsflip1995-10/+122
- USAGE_OF_QUALIFIED_TY - TY_PASS_BY_REFERENCE
2019-04-23Rollup merge of #59823 - davidtwco:issue-54716, r=cramertjMazdak Farrokhzad-0/+19
[wg-async-await] Drop `async fn` arguments in async block Fixes #54716. This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body. ``` async fn foo(<pattern>: <type>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>) { async move { let <pattern>: <ty> = __arg0; } // <-- dropped as you "exit" the async block } ``` However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this. r? @cramertj cc @nikomatsakis
2019-04-23Remove visit_subpats from check_pat in favor of state in ↵Tomas Koutsky-6/+5
EllipsisInclusiveRangePatterns
2019-04-21Introduce `ArgSource` for diagnostics.David Wood-0/+3
This commit introduces an `ArgSource` enum that is lowered into the HIR so that diagnostics can correctly refer to the argument pattern's original name rather than the generated pattern.
2019-04-21Add `AsyncArgument` to AST.David Wood-0/+16
This commit adds an `AsyncArgument` struct to the AST that contains the generated argument and statement that will be used in HIR lowering, name resolution and def collection.
2019-04-15Rollup merge of #59779 - flip1995:uplift_get_def_path, r=ManishearthMazdak Farrokhzad-6/+28
Uplift `get_def_path` from Clippy cc rust-lang/rust-clippy#3926 cc #59738 This uplifts `get_def_path` from Clippy. This is a follow up on the implementation of internal lints: #59316 The internal lint implementation also copied the implementation of the `AbsolutePathPrinter`. To get rid of this code duplication this also uplifts the `get_def_path` function from Clippy. This also renames `match_path` to `match_def_path`, as it was originally named in Clippy. r? @Manishearth
2019-04-12Uplift `get_def_path` from Clippyflip1995-6/+28
This uplifts `get_def_path` from Clippy. This is a follow up on the implementation of internal lints: #59316 The internal lint implementation also copied the implementation of the `AbsolutePathPrinter`. To get rid of this code duplication this also uplifts the `get_def_path` function from Clippy. This also renames `match_path` to `match_def_path`, as it was originally named in Clippy.
2019-04-10forgot oneMark Mansi-1/+0
2019-04-10make duplicate matcher bindings a hard errorMark Mansi-8/+1
2019-04-07Auto merge of #58739 - matthewjasper:more-restrictive-tpb, r=pnkfelixbors-1/+12
More restrictive 2 phase borrows - take 2 Signal lint diagnostic `mutable_borrow_reservation_conflict` when borrow-check finds a 2-phase borrow's reservation overlapping with a shared borrow. (pnkfelix updated description) cc #56254 , #59159 blocks PR #59114 r? @pnkfelix cc @RalfJung @nikomatsakis
2019-04-05Move match_path from DefId to lint::LateContextflip1995-3/+112
2019-04-04Placate tidyFelix S Klock II-2/+2
Get us back below 100 characters per line to placate tidy.
2019-04-04Adjust the mutable_borrow_reservation_conflict messageMatthew Jasper-0/+4
We aren't sure if this will become an error or not yet.
2019-04-04add mutable_borrow_reservation_conflict future-incompatibility lint.Felix S. Klock II-0/+7
Convert the new 2-phase reservation errors into instances of the lint so that they will be controlled by that attribute.
2019-04-04Use declare_lint_pass! and impl_lint_pass! in more placeshgallagher1993-20/+2
2019-04-04Rollup merge of #59669 - Centril:lint-pass-macro, r=oli-obkMazdak Farrokhzad-75/+87
Reduce repetition in librustc(_lint) wrt. impl LintPass by using macros r? @oli-obk cc @Zoxc
2019-04-03reduce repetition in librustc(_lint) wrt. impl LintPassMazdak Farrokhzad-75/+87
2019-04-03Deduplicate code in TyKind lintflip1995-48/+30
2019-04-03Fix bug in TyKind lintflip1995-5/+8
2019-04-03Make internal lints allow-by-defaultflip1995-2/+2
2019-04-03use check_path instead of check_exprflip1995-49/+27
2019-04-03Fix rebase falloutflip1995-16/+15
2019-04-03Add internal lints default_hash_types and usage_of_ty_tykindflip1995-0/+166
2019-03-30Change message to present tenseFabian Drinck-1/+1
2019-03-30Replace REDUNDANT_IMPORT with UNUSED_IMPORTSFabian Drinck-7/+1
2019-03-30Distinguish between imported and defined itemsFabian Drinck-3/+4
2019-03-30Improve warningFabian Drinck-0/+9
2019-03-30Add lint for redundant importsFabian Drinck-0/+6
Co-authored-by: Stephan Schauerte <stephan.schauerte@gmail.com>
2019-03-29Rollup merge of #59394 - mark-i-m:dup-matcher-bindings-2, r=CentrilMazdak Farrokhzad-1/+2
warn -> deny duplicate match bindings This is the next step of https://github.com/rust-lang/rust/issues/57742 r? @Centril - [x] Decide whether to go to deny-by-default or hard error. - My preference is to make this deny-by-default, rather than going straight to a hard error. The CI should fail because I haven't updated the ui test yet. I'll update it when we decide which to do. - [x] Update [test](https://github.com/mark-i-m/rust/blob/c25d6b83441e0c060ee0273193ef27b29e1318cd/src/test/ui/macros/macro-multiple-matcher-bindings.rs) - [ ] ~Crater run~ see https://github.com/rust-lang/rust/pull/59394#issuecomment-477817351
2019-03-28deny duplicate matcher bindings by defaultmark-1/+2
2019-03-28Run module lint passes in parallelJohn Kåre Alsaker-14/+13
2019-03-28Remove LintSession and run incremental and whole crate lints in parallelJohn Kåre Alsaker-67/+39
2019-03-28Combine all builtin late lintsJohn Kåre Alsaker-151/+243
2019-03-25Make more lints incrementalJohn Kåre Alsaker-0/+6
2019-03-25Make some lints incrementalJohn Kåre Alsaker-9/+72
2019-03-25Auto merge of #59256 - petrochenkov:derval2, r=Zoxcbors-7/+2
Make meta-item API compatible with `LocalInternedString::get` soundness fix r? @Zoxc
2019-03-24Separate variant id and variant constructor id.David Wood-3/+5
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-17Auto merge of #58994 - oli-obk:deprecated_derive, r=petrochenkovbors-1/+16
Hide deprecation warnings inside derive expansions Fixes #58822
2019-03-17Make meta-item API compatible with `LocalInternedString::get` soundness fixVadim Petrochenkov-7/+2
2019-03-16Don't report deprecation lints in derive expansionsOliver Scherer-1/+16
2019-03-16Fix rebaseVadim Petrochenkov-1/+1
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-10/+10
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16Rename `MetaItem::ident` to `MetaItem::path`Vadim Petrochenkov-6/+6
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-10/+11
2019-03-14Auto merge of #58176 - Zoxc:lint-levels, r=oli-obkbors-9/+19
Only insert nodes which changes lint levels in the LintLevelMap r? @eddyb
2019-03-08Temporarily emulate the (accidentally) omitted recursion during impl Trait ↵Felix S. Klock II-0/+14
check. Note that the two previous visitors were omitting slightly different recursive calls, so I need two flags to properly emulate them.
2019-03-05Add `return`John Kåre Alsaker-1/+1
2019-03-05Only insert nodes which changes lint levels in the LintLevelMapJohn Kåre Alsaker-9/+19
2019-03-02Rollup merge of #58785 - euclio:tool-lint-attrs, r=estebankkennytm-6/+14
allow specifying attributes for tool lints Needed for clippy to fix `unused_doc_comments` warnings that will be exposed by #57882 (and thus unblock it).
2019-03-01ty: HirIdify some lintsljedrz-2/+1