about summary refs log tree commit diff
path: root/src/librustc_lint/array_into_iter.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-97/+0
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-4/+4
2020-07-03Use 'tcx for references to AccessLevels wherever possible.Eduard-Mihai Burtescu-2/+2
2020-06-26rustc_lint: only query `typeck_tables_of` when a lint needs it.Eduard-Mihai Burtescu-4/+4
2020-06-10Track span of function in method calls, and use this in #[track_caller]Aaron Hill-1/+1
Fixes #69977 When we parse a chain of method calls like `foo.a().b().c()`, each `MethodCallExpr` gets assigned a span that starts at the beginning of the call chain (`foo`). While this is useful for diagnostics, it means that `Location::caller` will return the same location for every call in a call chain. This PR makes us separately record the span of the function name and arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This `Span` is passed through HIR lowering and MIR building to `TerminatorKind::Call`, where it is used in preference to `Terminator.source_info.span` when determining `Location::caller`. This new span is also useful for diagnostics where we want to emphasize a particular method call - for an example, see https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-2/+2
2020-02-11Invert control in struct_lint_level.jumbatm-3/+4
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-01-11move rustc::lint::{context, passes} to rustc_lint.Mazdak Farrokhzad-1/+1
Also do some cleanup of the interface.
2020-01-11lints: promote levels.rs to lint.rs & extract passes.rsMazdak Farrokhzad-1/+2
2020-01-11prepare moving HardwiredLints to rustc_sessionMazdak Farrokhzad-2/+1
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-8/+4
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+2
2019-12-26Fallout in other crates.Camille GILLOT-1/+1
2019-12-25Auto merge of #67524 - LukasKalbertodt:improve-into-iter-lint, r=matthewjasperbors-6/+18
Generalize `array_into_iter` lint to also lint for boxed arrays `Box` is special in that a method call on a box can move the value out of the box. Thus, the same backwards-compatibility problem can arise for boxed arrays as for simple arrays. --- CC #66145 r? @matthewjasper (as you reviewed the first PR)
2019-12-24Generalize `array_into_iter` lint to also lint for boxed arraysLukas Kalbertodt-6/+18
`Box` is special in that a method call on a box can move the value out of the box. Thus, the same backwards-compatibility problem can arise for boxed arrays as for simple arrays.
2019-12-22Format the worldMark Rousskov-9/+5
2019-11-06Add future incompatibility lint for `array.into_iter()`Lukas Kalbertodt-0/+91
As we might want to add `IntoIterator` impls for arrays in the future, and since that introduces a breaking change, this lint warns and suggests using `iter()` instead (which is shorter and more explicit).