about summary refs log tree commit diff
path: root/src/librustc_borrowck
AgeCommit message (Collapse)AuthorLines
2018-07-12lint with ref_spancsmoe-7/+5
2018-07-12fix wrong replacingcsmoe-1/+1
2018-07-12Deny bare trait objects in the rest of rustljedrz-0/+1
2018-07-08Auto merge of #52106 - PramodBisht:issue/52049, r=oli-obkbors-1/+4
Don't suggest `let` bindings if they don't help with borrows @oli-obk I have added a condition to address #52049, right now, this is on WIP because I think code change is also required on `error_reporting.rs`. Plus I need to check if any test cases fail. I will ping you again if everything passes r? @oli-obk
2018-07-07Addresses #52049Pramod Bisht-1/+4
2018-07-06Rollup merge of #52083 - spastorino:dont-run-ast-borrowck-on-mir-mode, ↵Mark Rousskov-0/+2
r=nikomatsakis Dont run ast borrowck on mir mode r? @nikomatsakis
2018-07-05Do not run AST borrowck when -Zborrowck=mirSantiago Pastorino-0/+2
2018-07-02Add more safeguards to "missing binding mode" errorsvarkor-9/+9
2018-07-01use HirId in middle::mem_categorization::cmt_, and consequences of thatZack M. Davis-11/+17
For the HirIdification initiative #50928.
2018-06-28Use `Ident`s in a number of structures in HIRVadim Petrochenkov-7/+5
Namely: labels, type parameters, bindings in patterns, parameter names in functions without body. All of these do not need hygiene after lowering to HIR, only span locations.
2018-06-26Rollup merge of #51769 - alexcameron89:update_rustc_guide_links, r=frewsxcvPietro Albini-1/+1
Update broken rustc-guide links Recently, there has been some rearrangement of the content in the Rustc Guide, and this commit changes the urls the match the updated guide.
2018-06-24Update broken rustc-guide linksAlex Kitchens-1/+1
Recently, there has been some rearrangement of the content in the Rustc Guide, and this commit changes the urls the match the updated guide.
2018-06-22Fix erroneous error note when using field after moveSantiago Pastorino-1/+1
2018-06-19Parallel codeJohn Kåre Alsaker-2/+4
2018-06-14rustc: rename ty::maps to ty::query.Eduard-Mihai Burtescu-2/+2
2018-06-06When NLL has illegal move due to borrowed content, provide feedback about ↵Felix S. Klock II-1/+1
why the move wasn't a copy. This should address #51190.
2018-06-01Suggest not mutably borrowing a mutable referenceYaron Tausky-17/+45
This commit is concerned with the case where the user tries to mutably borrow a mutable reference, thereby triggering an error. Instead of the existing suggestion to make the binding mutable, the compiler will now suggest to avoid borrowing altogether.
2018-05-31change `PointerKind::Implicit` to a noteNiko Matsakis-6/+2
`PointerKind` is included in `LoanPath` and hence forms part of the equality check; this led to having two unequal paths that both represent `*x`, depending on whether the `*` was inserted automatically or explicitly. Bad mojo. The `note` field, in contrast, is intended more-or-less primarily for this purpose of adding extra data.
2018-05-28operate on `HirId` in `hir::Pat::each_binding`, and consequences of thatZack M. Davis-11/+11
Changing the `each_binding` utility method to take the `HirId` of a binding pattern rather than its `NodeId` seems like a modest first step in support of the `HirId`ification initiative #50928. (The inspiration for choosing this in particular came from the present author's previous work on diagnostics issued during liveness analysis, which is the most greatly affected module in this change.)
2018-05-26Use `Ident`s for fields in HIRVadim Petrochenkov-4/+7
2018-05-17Rename trans to codegen everywhere.Irina Popa-1/+1
2018-05-05Auto merge of #50418 - nnethercote:cmt, r=eddybbors-77/+73
Avoid many `cmt` allocations. `cmt` is a ref-counted wrapper around `cmt_` The use of refcounting keeps `cmt` handling simple, but a lot of `cmt` instances are very short-lived, and heap-allocating the short-lived ones takes up time. This patch changes things in the following ways. - Most of the functions that produced `cmt` instances now produce `cmt_` instances. The `Rc::new` calls that occurred within those functions now occur at their call sites (but only when necessary, which isn't that often). - Many of the functions that took `cmt` arguments now take `&cmt_` arguments. This includes all the methods in the `Delegate` trait. As a result, the vast majority of the heap allocations are avoided. In an extreme case, the number of calls to malloc in tuple-stress drops from 9.9M to 7.9M, a drop of 20%. And the compile times for many runs of coercions, deep-vector, and tuple-stress drop by 1--2%.
2018-05-03Avoid many `cmt` allocations.Nicholas Nethercote-77/+73
`cmt` is a ref-counted wrapper around `cmt_` The use of refcounting keeps `cmt` handling simple, but a lot of `cmt` instances are very short-lived, and heap-allocating the short-lived ones takes up time. This patch changes things in the following ways. - Most of the functions that produced `cmt` instances now produce `cmt_` instances. The `Rc::new` calls that occurred within those functions now occur at their call sites (but only when necessary, which isn't that often). - Many of the functions that took `cmt` arguments now take `&cmt_` arguments. This includes all the methods in the `Delegate` trait. As a result, the vast majority of the heap allocations are avoided. In an extreme case, the number of calls to malloc in tuple-stress drops from 9.9M to 7.9M, a drop of 20%. And the compile times for many runs of coercions, deep-vector, and tuple-stress drop by 1--2%.
2018-04-28Disable AST unused mut check when using MIR borrowckKeith Yeung-1/+4
2018-04-12Avoid comparing fields by name when possibleVadim Petrochenkov-9/+10
Resolve them into field indices once and then use those resolutions + Fix rebase
2018-04-12AST/HIR: Merge field access expressions for named and numeric fieldsVadim Petrochenkov-18/+8
2018-04-11Auto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichtonbors-1/+0
Move deny(warnings) into rustbuild This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-10Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoeristerbors-1/+1
More thread-safety changes r? @michaelwoerister
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-1/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-03-28Stabilize match_default_bindingsTaylor Cramer-1/+1
This includes a submodule update to rustfmt in order to allow a stable feature declaration.
2018-03-28Make Steal thread-safeJohn Kåre Alsaker-1/+1
2018-03-20Rollup merge of #49092 - mark-i-m:deptrack_readme, r=nikomatsakiskennytm-0/+5
Replace many of the last references to readmes In particular, this removes the dep track readme, so it should not be merged before https://github.com/rust-lang-nursery/rustc-guide/pull/92 Fix #47935 cc #48478 r? @nikomatsakis
2018-03-16Replace many of the last references to readmesMark Mansi-0/+5
2018-03-16change &self to self and fix lifetime annotationscsmoe-14/+14
2018-03-13add `canonicalize` method to `InferCtxt` [VIC]Niko Matsakis-0/+2
2018-03-05Turn features() into a query.Michael Woerister-1/+1
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-4/+7
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2018-02-06Rollup merge of #47543 - topecongiro:issue-42344, r=nikomatsakiskennytm-11/+1
Disallow mutable borrow to non-mut statics Closes #42344.
2018-02-04Remove delay_span_bug() in check_aliasabilitySeiichi Uchida-11/+1
This path was considered to be unreachable. However, `&mut` could potentially live inside `static`. For example, `static TAB: [&mut [u8]; 0] = [];`.
2018-02-02Auto merge of #47465 - estebank:include-space-after-mut, r=nikomatsakisbors-1/+1
Include space in suggestion `mut` in bindings Fix #46614.
2018-01-29rustc_borrowck: replace "lvalue" terminology with "place" in docs.Eduard-Mihai Burtescu-80/+80
2018-01-29rustc: replace "lvalue" terminology with "place" in the code.Eduard-Mihai Burtescu-3/+3
2018-01-27end_point handling multibyte characters correctly.David Wood-3/+4
2018-01-26Consider all whitespace when preparing spanEsteban Küber-1/+1
2018-01-26Include space in suggestion `mut` in bindingsEsteban Küber-1/+1
2018-01-23Use delay_span_bug for things that should be errorsJohn Kåre Alsaker-3/+11
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-68/+100
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-15Do not suggest to make `mut` binding external to `Fn` closureEsteban Küber-3/+25