about summary refs log tree commit diff
path: root/src/librustc/lint
AgeCommit message (Collapse)AuthorLines
2016-08-23Use idiomatic names for string-related methods names.Corey Farwell-4/+4
2016-08-15Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakisbors-1/+1
Take commandline arguments into account for incr. comp. Implements the conservative strategy described in https://github.com/rust-lang/rust/issues/33727. From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples. The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct. One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data. It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map. Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.
2016-08-11Make `private_in_public` compatibility lint deny-by-defaultVadim Petrochenkov-1/+1
2016-08-11Add the notion of a dependency tracking status to commandline arguments.Michael Woerister-1/+1
Commandline arguments influence whether incremental compilation can use its compilation cache and thus their changes relative to previous compilation sessions need to be taking into account. This commit makes sure that one has to specify for every commandline argument whether it influences incremental compilation or not.
2016-07-30diagnostically note source of overruling outer forbidZack M. Davis-6/+16
When we emit E0453 (lint level attribute overruled by outer `forbid` lint level), it could be helpful to note where the `forbid` level was set, for the convenience of users who, e.g., believe that the correct fix is to weaken the `forbid` to `deny`.
2016-07-30Rollup merge of #35090 - michaelwoerister:get-rid-of-id-visitor, r=eddybManish Goregaokar-11/+25
intravisit: Fold functionality of IdVisitor into the regular Visitor.
2016-07-29intravisit: Fold functionality of IdVisitor into the regular Visitor.Michael Woerister-11/+25
2016-07-26Deny (by default) transmuting from fn item types to pointer-sized types.Eduard Burtescu-1/+1
2016-07-25Adressed PR comments.cgswords-9/+9
2016-07-25General MetaItem encapsulation rewrites.cgswords-11/+11
2016-07-11Get rid of `node_levels` and `node_lint_levels`Jonas Schievink-8/+0
2016-07-10Move variant_size_differences out of transJonas Schievink-42/+3
Also enhances the error message a bit, fixes #30505 on the way, and adds a test (which was missing). Closes #34018
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-7/+4
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-06-26Rollup merge of #34339 - jseyfried:thin_vec, r=petrochenkov,ManishearthJeffrey Seyfried-5/+4
Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>`.
2016-06-26Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddybJeffrey Seyfried-6/+0
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-3/+3
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-3/+3
2016-06-19Generalize and abstract `ThinAttributes`Jeffrey Seyfried-5/+4
2016-06-17Fix falloutJeffrey Seyfried-6/+0
2016-06-14Remove the type parameter from `syntax::visit::Visitor`Jeffrey Seyfried-3/+3
2016-05-28Add an AST sanity checking pass and use it to catch some illegal ↵Vadim Petrochenkov-1/+8
lifetime/label names
2016-05-25Remove ExplicitSelf from ASTVadim Petrochenkov-7/+0
2016-05-17warn for where/return-types that reference regionsNiko Matsakis-1/+9
This is a step towards fixing #32330. The full fix would be a breaking change, so we begin by issuing warnings for scenarios that will break.
2016-05-14Remove ExplicitSelf from HIRVadim Petrochenkov-5/+0
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-3/+4
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-4/+5
2016-05-03change the newly-added errors to warningsAriel Ben-Yehuda-1/+15
this commit should be reverted after a release cycle
2016-05-02move "lint level defined here" into secondary noteNiko Matsakis-1/+1
It does not help you to understand the error, just explains why you are seeing it, so it is clearly secondary.
2016-05-02replace fileline_{help,note} with {help,note}Niko Matsakis-9/+5
The extra filename and line was mainly there to keep the indentation relative to the main snippet; now that this doesn't include filename/line-number as a prefix, it is distracted.
2016-04-12Remove unused trait importsSeo Sanghyeon-1/+1
2016-04-06Rollup merge of #32766 - nikomatsakis:constant-pattern-warning-cycle, r=eddybSteve Klabnik-1/+1
change constant patterns to have a warning cycle This was the original intention :( r? @eddyb
2016-04-06Rollup merge of #32570 - eddyb:tis-but-a-front, r=nikomatsakisManish Goregaokar-38/+13
r? @nikomatsakis Conflicts: src/librustc_save_analysis/lib.rs src/libsyntax/ast_util.rs
2016-04-06change constant patterns to have a warning cycleNiko Matsakis-1/+1
This was the original intention :(
2016-04-06Move span into `StructField`Vadim Petrochenkov-1/+1
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-32/+7
2016-04-06rustc: dismantle hir::util, mostly moving functions to methods.Eduard Burtescu-3/+3
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-5/+5
2016-04-05Rollup merge of #32403 - vlastachu:super_in_path, r=jseyfriedManish Goregaokar-1/+8
Fix issue: Global paths in `use` directives can begin with `super` or `self` #32225 This PR fixes #32225 by warning on `use ::super::...` and `use ::self::...` on `resolve`. Current changes is the most minimal and ad-hoc.
2016-04-05Fixes bug which accepting using `super` in use statemet.vlastachu-1/+8
Issue: #32225
2016-03-31librustc: replace panic!() with bug!()Benjamin Herr-2/+2
2016-03-31librustc: replace span_bug calls with span_bug!()Benjamin Herr-6/+4
2016-03-31librustc: replace tcx.sess.bug calls with bug!()Benjamin Herr-3/+3
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-1/+1
2016-03-25check for both partialeq and eqNiko Matsakis-1/+1
2016-03-25issue a future-compat lint for constants of invalid typeNiko Matsakis-0/+15
This is a [breaking-change]: according to RFC #1445, constants used as patterns must be of a type that *derives* `Eq`. If you encounter a problem, you are most likely using a constant in an expression where the type of the constant is some struct that does not currently implement `Eq`. Something like the following: ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` The easiest and most future compatible fix is to annotate the type in question with `#[derive(Eq)]` (note that merely *implementing* `Eq` is not enough, it must be *derived*): ```rust struct SomeType { ... } const SOME_CONST: SomeType = ...; match foo { SOME_CONST => ... } ``` Another good option is to rewrite the match arm to use an `if` condition (this is also particularly good for floating point types, which implement `PartialEq` but not `Eq`): ```rust match foo { c if c == SOME_CONST => ... } ``` Finally, a third alternative is to tag the type with `#[structural_match]`; but this is not recommended, as the attribute is never expected to be stabilized. Please see RFC #1445 for more details.
2016-03-23Make warnings of renamed and removed lints themselves lintsBrian Anderson-27/+29
This adds the `renamed_and_removed_lints` warning, defaulting to the warning level. Fixes #31141
2016-03-18Change inherent overlap error to a warning for now, to ease the breakage.Aaron Turon-1/+8
2016-03-09trans: Keep transmutes from fn item types working, but lint them.Eduard Burtescu-1/+11
2016-03-09Auto merge of #30804 - shssoichiro:deny-warnings-msg, r=nrcbors-2/+7
Show clearer error message when #![deny(warnings)] escalates a warning Addresses #30730
2016-03-03Rename middle::ty::ctxt to TyCtxtJeffrey Seyfried-4/+4