about summary refs log tree commit diff
path: root/src/librustc_mir/util/borrowck_errors.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-486/+0
2020-04-08Suggest move for closures and async blocks in more cases.Alex Aktsipetrov-1/+3
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-1/+1
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-1/+1
2020-03-26borrowck diagnostics: address review comments.Mazdak Farrokhzad-4/+3
2020-03-25borrowck: prefer "value" over "`_`".Mazdak Farrokhzad-17/+17
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-1/+0
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-3/+2
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-95/+25
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-11-11Fix soundness issue with index bounds checksMatthew Jasper-6/+8
An expression like `x[1][{ x = y; 2}]` would perform the bounds check for the inner index operation before evaluating the outer index. This would allow out of bounds memory accesses.
2019-09-25Rename `sty` to `kind`varkor-1/+1
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-1/+1
2019-07-14`pub(crate)` -> `crate`Matthew Jasper-25/+25
The borrow checker code is already using `crate` extensively, so prefer being consistent with it.
2019-07-14Remove BorrowckErrors traitMatthew Jasper-78/+63
Its methods are now inherent methods of `MirBorrowckCtxt`
2019-07-14Remove rustc_mir::borrowck_errors::OriginMatthew Jasper-32/+2
2019-07-14Remove unused BorrowckErrors methodsMatthew Jasper-105/+0
2019-07-11Remove rustc_mir dependency from rustc_borrowckMatthew Jasper-220/+108
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-5/+5
2019-06-03Improve cannot move errorsMatthew Jasper-9/+3
* Show the place and type being moved * Give a special error for variables in match guard * Simplify search for overloaded deref * Search for overloaded index
2019-05-13Rollup merge of #60176 - matthewjasper:yield-ref-to-local, r=pnkfelixMazdak Farrokhzad-2/+4
Explain error when yielding a reference to a local variable Closes #56508
2019-05-02Stub display impl for OriginChristopher Vittal-20/+4
2019-04-28Fix lint findings in librustc_mirflip1995-3/+3
2019-04-22Explain error when yielding a reference to a local variableMatthew Jasper-2/+4
2019-04-21Enable migrate mode by default on the 2015 editionMatthew Jasper-1/+1
This also fully stabilizes two-phase borrows on all editions
2019-02-08librustc_mir => 2018Taiki Endo-3/+3
2019-01-04Improve diagnostic labels and add note.David Wood-11/+32
This commit improves diagnostic labels to mention which field a borrow overlaps with and adds a note explaining that the fields overlap.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-11-30Refer to the second borrow as the "second borrow".Daan de Graaf-1/+5
2018-10-31use String::from() instead of format!() macro to construct Strings.Matthias Krüger-1/+1
2018-10-21Use new region infer errors for explaining borrowsMatthew Jasper-0/+25
This gives at least some explanation for why a borrow is expected to last for a certain free region. Also: * Reports E0373: "closure may outlive the current function" with NLL. * Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515). * Special case assigning a reference to a local variable in a closure to a captured variable.
2018-10-20Give an error number for "borrowed data escapes outside of closure"Matthew Jasper-0/+18
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-1/+1
2018-10-18Extend closure special-casing for generators.David Wood-2/+4
This commit extends existing special-casing of closures to highlight the use of variables within generators that are causing the generator to borrow them.
2018-09-25Change the diagnostic number from 714 to 716.Felix S. Klock II-1/+1
2018-09-25add "temporary value dropped while borrowed" errorMikhail Modin-0/+16
Issue #54131
2018-09-24Better messages for errors from Shallow borrowsMatthew Jasper-0/+23
2018-09-18Fine tune dianostics for when a borrow conflicts with a destructor that ↵Felix S. Klock II-0/+16
needs exclusive access. In particular: 1. Extend `WriteKind::StorageDeadOrDrop` with state to track whether we are running a destructor or just freeing backing storage. (As part of this, when we drop a Box<..<Box<T>..> where `T` does not need drop, we now signal that the drop of `T` is a kind of storage dead rather than a drop.) 2. When reporting that a value does not live long enough, check if we're doing an "interesting" drop, i.e. we aren't just trivally freeing the borrowed state, but rather a user-defined dtor will run and potentially require exclusive aces to the borrowed state. 3. Added a new diagnosic to describe the scenario here.
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-1/+1
or "".into()
2018-08-22Remove Ty prefix from ↵varkor-2/+2
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-07Special case error message for thread-local statics.David Wood-0/+16
2018-08-03Highlight closure spans for borrow and initialization errorsMatthew Jasper-2/+9
2018-07-20Improve NLL mutability errorsMatthew Jasper-3/+14
* Better explain why the place is immutable * Distinguish &T and *const T * Use better spans when a mutable borrow is for a closure capture
2018-06-22Run rustfmtSantiago Pastorino-313/+470
2018-06-22Fix erroneous error note when using field after moveSantiago Pastorino-2/+4
2018-06-06When NLL has illegal move due to borrowed content, provide feedback about ↵Felix S. Klock II-2/+6
why the move wasn't a copy. This should address #51190.
2018-04-07modify the error message- CR Commentsgaurikholkar-10/+4