about summary refs log tree commit diff
path: root/src/librustc_lint/context.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-862/+0
2020-08-17Auto merge of #75120 - JulianKnodt:rm_reps, r=oli-obkbors-1/+1
rust_ast::ast => rustc_ast Rework of #71199 which is a rework #70621 Still working on this but just made the PR to track progress r? @Dylan-DPC
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-16hir: introduce `QPath::LangItem`David Wood-1/+1
This commit introduces `QPath::LangItem` to the HIR and uses it in AST lowering instead of constructing a `hir::Path` from a slice of symbols. This might be better for performance, but is also much cleaner as the previous approach is fragile. In addition, it resolves a bug (#61019) where an extern crate imported as "std" would result in the paths created during AST lowering being resolved incorrectly (or not at all). Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
2020-07-26report kind of deprecated item in messageAndy Russell-1/+1
This is important for fields, which are incorrectly referred to as "items".
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-15/+15
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-2/+5
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-03Use 'tcx for references to AccessLevels wherever possible.Eduard-Mihai Burtescu-5/+5
2020-07-02rustc_lint: avoid using TypeckTables::empty for LateContext.Eduard-Mihai Burtescu-13/+28
2020-06-26rustc_lint: only query `typeck_tables_of` when a lint needs it.Eduard-Mihai Burtescu-3/+28
2020-04-21Clarify unused_doc_comments note on macro invocationsDavid Tolnay-1/+1
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-1/+2
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-3/+2
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-5/+5
2020-03-27Rename TyLayout to TyAndLayout.Ana-Maria Mihalache-3/+3
2020-03-21{rustc::hir::map -> rustc_hir}::definitionsMazdak Farrokhzad-1/+1
2020-03-21add_elided_lifetime_in_path_suggestion -> rustc_sessionMazdak Farrokhzad-2/+1
2020-03-05Rollup merge of #69736 - matthiaskrgr:even_more_clippy, r=Dylan-DPCDylan DPC-2/+2
even more clippy cleanups * Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed) * Use more efficient &&str to String conversion (clippy::inefficient_to_string) * Don't always eval arguments inside .expect(), use unwrap_or_else and closure. (clippy::expect_fun_call) * Use righthand '&' instead of lefthand "ref". (clippy::toplevel_ref_arg) * Use simple 'for i in x' loops instead of 'while let Some(i) = x.next()' loops on iterators. (clippy::while_let_on_iterator) * Const items have by default a static lifetime, there's no need to annotate it. (clippy::redundant_static_lifetimes) * Remove redundant patterns when matching ( x @ _ to x) (clippy::redundant_pattern)
2020-03-05Use more efficient &&str to String conversion (clippy::inefficient_to_string)Matthias Krüger-2/+2
2020-03-04Don't use "if let" bindings to only check a value and not actually bind ↵Matthias Krüger-1/+1
anything. For example: `if let Some(_) = foo() {}` can be reduced to `if foo().is_some() {}` (clippy::redundant_pattern_matching)
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-02-21clean things upJane Lusby-0/+5
2020-02-11Avoid allocs in a few places.jumbatm-0/+2
- AnonymousParameters::check_trait_item - TypeAliasBounds::check_item - NonSnakeCase::check_snake_case
2020-02-11Address review nitpicks.jumbatm-2/+2
2020-02-11Make cx.span_lint methods lazyjumbatm-47/+10
- Make report_unsafe take decorate function - Remove span_lint, replacing calls with struct_span_lint, as caller is now responsible for emitting. - Remove lookup_and_emit, replacing with just lookup which takes a decorate function. - Remove span_lint_note, span_lint_help. These methods aren't easily made lazy as standalone methods, private, and unused. If this functionality is needed, to be lazy, they can easily be made into Fn(&mut DiagnosticBuilder) that are meant to be called _within_ the decorate function. - Rename lookup_and_emit_with_diagnostics to lookup_with_diagnostics to better reflect the fact that it doesn't emit for you.
2020-02-11Run RustFmtjumbatm-4/+7
2020-02-11Invert control in struct_lint_level.jumbatm-96/+102
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-1/+0
2020-01-16don't clone types that are copyMatthias Krüger-1/+1
found via clippy
2020-01-11move rustc::lint::{context, passes} to rustc_lint.Mazdak Farrokhzad-0/+842
Also do some cleanup of the interface.