about summary refs log tree commit diff
path: root/src/librustc/lint
AgeCommit message (Collapse)AuthorLines
2016-03-02Move span into `StructField`Vadim Petrochenkov-1/+1
+ some cleanup in rustdoc
2016-02-27more check_*_post methods for LintPassesllogiq-0/+22
2016-02-24Warn instead of error when using an inaccessable extern crateJeffrey Seyfried-0/+7
2016-02-18Make future-compat lint `match_of_unit_variant_via_paren_dotdot` deny by defaultVadim Petrochenkov-1/+1
2016-02-13Auto merge of #31562 - llogiq:lint_post, r=Manishearthbors-0/+14
This fixes #31512 for me. A bit of explanation: I want to have `check_block_post(&mut self, &Context, &Block)` and `check_crate_post(&mut self, &Context, &Crate)` methods in both early and late lint passes. Ideally we'd have _post methods for all operations that walk, but this'll do for now. @Manishearth r?
2016-02-12fix double check_itemllogiq-1/+1
2016-02-11add item_post methodsllogiq-0/+4
2016-02-11[breaking-change] don't glob export ast::MetaItem_Oliver 'ker' Schneider-2/+2
2016-02-11Add _post methods for blocks and cratesllogiq-0/+10
2016-01-27Auto merge of #30487 - jonas-schievink:more-attrs-lint-fixes, r=alexcrichtonbors-5/+9
`LateContext` already does this, looks like this was just forgotten in #29850. Found while investigating #30326 (but doesn't fix it)
2016-01-15Auto merge of #30878 - brson:raw-pointer-derive, r=brsonbors-36/+157
This adds back the raw_pointer_derive lint as a 'removed' lint, so that its removal does not cause errors (#30346) but warnings. In the process I discovered regressions in the code for renamed and removed lints, which didn't appear to have any tests. The addition of a second lint pass (ast vs. hir) meant that attributes were being inspected twice, renamed and removed warnings printed twice. I restructured the code so these tests are only done once and added tests. Unfortunately it makes the patch more complicated for the needed beta backport. r? @nikomatsakis
2016-01-15Rollup merge of #30787 - nikomatsakis:future-incompatible-lint, r=brsonManish Goregaokar-10/+38
There is now more structure to the report, so that you can specify e.g. an RFC/PR/issue number and other explanatory details. Example message: ``` type-parameter-invalid-lint.rs:14:8: 14:9 error: defaults for type parameters are only allowed on type definitions, like `struct` or `enum` type-parameter-invalid-lint.rs:14 fn avg<T=i32>(_: T) {} ^ type-parameter-invalid-lint.rs:14:8: 14:9 warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! type-parameter-invalid-lint.rs:14:8: 14:9 note: for more information, see PR 30742 <https://github.com/rust-lang/rust/pull/30724> type-parameter-invalid-lint.rs:11:9: 11:28 note: lint level defined here type-parameter-invalid-lint.rs:11 #![deny(future_incompatible)] ^~~~~~~~~~~~~~~~~~~ error: aborting due to previous error ``` r? @brson I would really like feedback also on the specific messages! Fixes #30746
2016-01-14rustc: Fix bugs in renamed and removed lints and re-add raw_pointer_deriveBrian Anderson-36/+157
cc #30346
2016-01-15Add an --output option for specifying an error emitterNick Cameron-4/+5
2016-01-13improve use of `,` vs `;`Niko Matsakis-2/+2
2016-01-13s/HARD ERROR/hard error/ -- perhaps the warning is enoughNiko Matsakis-1/+1
2016-01-12use fileline_ and not full span_ for the followon messagesNiko Matsakis-2/+2
2016-01-12Revamp the "future incompatible" section to clarify the situationNiko Matsakis-10/+38
better
2016-01-09Show clearer error message when #![deny(warnings)] escalates a warningvagrant-2/+7
Addresses #30730
2016-01-08Added proper lint for the unit variant/struct warning.Felix S. Klock II-0/+7
2016-01-07Auto merge of #30724 - nikomatsakis:feature-gate-defaulted-type-parameters, ↵bors-3/+27
r=pnkfelix It was recently realized that we accept defaulted type parameters everywhere, without feature gate, even though the only place that we really *intended* to accept them were on types. This PR adds a lint warning unless the "type-parameter-defaults" feature is enabled. This should eventually become a hard error. This is a [breaking-change] in that new feature gates are required (or simply removing the defaults, which is probably a better choice as they have little effect at this time). Results of a [crater run][crater] suggest that approximately 5-15 crates are affected. I didn't do the measurement quite right so that run cannot distinguish "true" regressions from "non-root" regressions, but even the upper bound of 15 affected crates seems relatively minimal. [crater]: https://gist.github.com/nikomatsakis/760c6a67698bd24253bf cc @rust-lang/lang r? @pnkfelix
2016-01-05Annotate the compiler with information about what it is doing when.Niko Matsakis-0/+3
2016-01-05convert from hard error to future-incompatible lintNiko Matsakis-0/+7
2016-01-05improve visibility of future-incompatibilities (mildly, at least)Niko Matsakis-3/+20
2015-12-30RefactoringNick Cameron-15/+10
2015-12-30use structured errorsNick Cameron-21/+72
2015-12-19Wrap EarlyContext::visit_local/visit_expr in with_lint_attrs callsJonas Schievink-5/+9
LateContext already does this, looks like this was just forgotten in #29850
2015-12-18Auto merge of #29973 - petrochenkov:privinpub, r=nikomatsakisbors-0/+8
Some notes: This patch enforces the rules from [RFC 136](https://github.com/rust-lang/rfcs/blob/master/text/0136-no-privates-in-public.md) and makes "private in public" a module-level concept and not crate-level. Only `pub` annotations are used by the new algorithm, crate-level exported node set produced by `EmbargoVisitor` is not used. The error messages are tweaked accordingly and don't use the word "exported" to avoid confusing people (https://github.com/rust-lang/rust/issues/29668). The old algorithm tried to be extra smart with impls, but it mostly led to unpredictable behavior and bugs like https://github.com/rust-lang/rust/issues/28325. The new algorithm tries to be as simple as possible - an impl is considered public iff its type is public and its trait is public (if presents). A type or trait is considered public if all its components are public, [complications](https://internals.rust-lang.org/t/limits-of-type-inference-smartness/2919) with private types leaking to other crates/modules through trait impls and type inference are deliberately ignored so far. The new algorithm is not recursive and uses the nice new facility `Crate::visit_all_items`! Obsolete pre-1.0 feature `visible_private_types` is removed. This is a [breaking-change]. The two main vectors of breakage are type aliases (https://github.com/rust-lang/rust/issues/28450) and impls (https://github.com/rust-lang/rust/issues/28325). I need some statistics from a crater run (cc @alexcrichton) to decide on the breakage mitigation strategy. UPDATE: All the new errors are reported as warnings controlled by a lint `private_in_public` and lint group `future_incompatible`, but the intent is to make them hard errors eventually. Closes https://github.com/rust-lang/rust/issues/28325 Closes https://github.com/rust-lang/rust/issues/28450 Closes https://github.com/rust-lang/rust/issues/29524 Closes https://github.com/rust-lang/rust/issues/29627 Closes https://github.com/rust-lang/rust/issues/29668 Closes https://github.com/rust-lang/rust/issues/30055 r? @nikomatsakis
2015-12-18Rollup merge of #30384 - nrc:diagnostics, r=@nikomatsakisManish Goregaokar-3/+3
Should make it possible to add JSON or HTML errors. Also tidies up a lot.
2015-12-18Use lint instead of warningVadim Petrochenkov-0/+8
2015-12-17Remove unused importsJeffrey Seyfried-1/+1
2015-12-17move error handling from libsyntax/diagnostics.rs to libsyntax/errors/*Nick Cameron-3/+3
Also split out emitters into their own module.
2015-11-26Moved and refactored ThinAttributesMarvin Löbel-3/+4
2015-11-26Add syntax support for attributes on expressions and all syntaxMarvin Löbel-5/+14
nodes in statement position. Extended #[cfg] folder to allow removal of statements, and of expressions in optional positions like expression lists and trailing block expressions. Extended lint checker to recognize lint levels on expressions and locals.
2015-11-19Changes to data produced by privacy passVadim Petrochenkov-8/+7
2015-11-18Various straight-forward ports that override `visit_nested_items`Niko Matsakis-6/+16
to do "in-situ" visits.
2015-11-18Rework the `IdVisitor` so that it only visits item contents (and doesn'tNiko Matsakis-6/+1
visit nested items). This is what all clients wanted anyhow.
2015-10-18Auto merge of #28845 - oli-obk:rfc1229, r=pnkfelixbors-1/+8
This PR turns statically known erroneous code (e.g. numeric overflow) into a warning and continues normal code-generation to emit the same code that would have been generated without `check_const` detecting that the result can be computed at compile-time. <del>It's not done yet, as I don't know how to properly emit a lint from trans. I can't seem to extract the real lint level of the item the erroneous expression is in.</del> It's an unconditional warning now. r? @pnkfelix cc @nikomatsakis * [RFC 1229 text](https://github.com/rust-lang/rfcs/blob/master/text/1229-compile-time-asserts.md) * RFC PR: rust-lang/rfcs#1229 * tracking issue: https://github.com/rust-lang/rust/issues/28238
2015-10-17Add span_lint_note and span_lint_help to the LintContextnxnfufunezn-0/+22
2015-10-13implement RFC 1229Oliver Schneider-1/+8
const eval errors outside of true constant enviroments are not reported anymore, but instead forwarded to a lint.
2015-10-13Dict -> Struct, StructDef -> VariantData, def -> dataVadim Petrochenkov-8/+8
2015-10-13Provide span for visit_struct_def + remove some dead codeVadim Petrochenkov-2/+4
2015-10-13Remove now redundant NodeId from VariantVadim Petrochenkov-10/+10
2015-09-29Fill in some missing parts in the default HIR visitorVadim Petrochenkov-8/+3
2015-09-28Fill in some missing parts in the default AST visitorVadim Petrochenkov-11/+3
+ Add helper macro for walking lists (including Options)
2015-09-22Use Names in HIR visitors and foldersVadim Petrochenkov-8/+8
2015-09-22Auto merge of #28364 - petrochenkov:usegate, r=alexcrichtonbors-0/+12
Closes https://github.com/rust-lang/rust/issues/28075 Closes https://github.com/rust-lang/rust/issues/28388 r? @eddyb cc @brson
2015-09-20Miscellaneous cleanup for old issues.Lee Jeffery-1/+0
2015-09-19Remove check_macManish Goregaokar-4/+0
2015-09-17Fix code broken by rebaseVadim Petrochenkov-3/+8