about summary refs log tree commit diff
path: root/src/librustc_borrowck
AgeCommit message (Collapse)AuthorLines
2019-07-11Move rustc_borrowck -> rustc_ast_borrowckMatthew Jasper-4916/+0
2019-07-11Remove rustc_mir dependency from rustc_borrowckMatthew Jasper-1743/+119
2019-07-11Rollup merge of #62476 - petrochenkov:expref, r=matthewjasperMazdak Farrokhzad-3/+3
Continue refactoring macro expansion and resolution This PR continues the work started in https://github.com/rust-lang/rust/pull/62042. It contains a set of more or less related refactorings with the general goal of making things simpler and more orthogonal. Along the way most of the issues uncovered in https://github.com/rust-lang/rust/pull/62086 are fixed. The PR is better read in per-commit fashion with whitespace changes ignored. I tried to leave some more detailed commit messages describing the motivation behind the individual changes. Fixes https://github.com/rust-lang/rust/issues/44692 Fixes https://github.com/rust-lang/rust/issues/52363 Unblocks https://github.com/rust-lang/rust/pull/62086 r? @matthewjasper
2019-07-11Rename some things in `syntax_pos/hygiene`Vadim Petrochenkov-3/+3
More consistent with other naming: ExpnFormat -> ExpnKind ExpnKind::name -> ExpnKind::descr DesugaringKind::name -> DesugaringKind::descr Shorter, no tautology: CompilerDesugaring -> Desugaring CompilerDesugaringKind -> DesugaringKind
2019-07-10Properly case indent_unit constantMark Rousskov-1/+1
2019-07-10Move pp::Printer helpers to direct implMark Rousskov-1/+0
2019-07-09Auto merge of #62233 - matthewjasper:exit-arm-scopes, r=pnkfelixbors-1/+2
Exit arm scopes Due to a bug in the HIR CFG construction, borrows for arm scopes were incorrectly leaking into other arms. This PR also includes some drive-by improvements to `-Zunpretty=hir,identified` that would have been helpful while investigating this. Closes #62107
2019-07-07rustc: Remove `dylib` crate type from most rustc cratesAlex Crichton-1/+1
Now that procedural macros no longer link transitively to libsyntax, this shouldn't be needed any more! This commit is an experiment in removing all dynamic libraries from rustc except for librustc_driver itself. Let's see how far we can get with that!
2019-07-06Add arm ids for -Zunpretty=hir,identifiedMatthew Jasper-1/+2
2019-07-05Rollup merge of #62168 - ljedrz:the_culmination_of_hiridification, r=ZoxcMazdak Farrokhzad-1/+1
The (almost) culmination of HirIdification It's finally over. This PR removes old `FIXME`s and renames some functions so that the `HirId` variant has the shorter name. All that remains (and rightfully so) is stuff in `resolve`, `save_analysis` and (as far as I can tell) in a few places where we can't replace `NodeId` with `HirId`.
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-1/+0
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2019-07-05Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddybbors-11/+9
Remove io::Result from syntax::print Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-07-04rename hir::map::local_def_id_from_hir_id to local_def_idljedrz-1/+1
2019-07-03Remove needless lifetimesJeremy Stucki-3/+3
2019-07-03Remove needless lifetimesJeremy Stucki-3/+3
2019-06-29Remove io::Result from syntax::printMark Rousskov-11/+9
Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-06-24Enable internal lints in bootstrapflip1995-1/+0
2019-06-24HIR: rename find_by_hir_id to findljedrz-1/+1
2019-06-24HIR: rename get_parent_node_by_hir_id to get_parent_nodeljedrz-3/+3
2019-06-20rename hir::map::get_by_hir_id to getljedrz-8/+8
2019-06-20rename hir::map::expect_expr_by_hir_id to expect_exprljedrz-1/+1
2019-06-20rename hir::map::name_by_hir_id to ::nameljedrz-2/+2
2019-06-18Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-10/+14
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-9/+9
2019-06-17remove superfluous spaceljedrz-1/+1
2019-06-17renamve hir_to_string to node_to_stringljedrz-3/+3
2019-06-17remove _by_hir_id if there is no NodeId counterpartljedrz-9/+9
2019-06-17replace some uses of NodeId with HirIdljedrz-11/+8
2019-06-15Remove unnecessary `.clone()`Shotaro Yamada-1/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-15/+15
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-67/+86
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-15/+15
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-8/+8
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-54/+55
2019-06-11rustc_borrowck: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+2
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-10/+9
2019-06-01rustc: track the body owner DefId in MC and EUV.Eduard-Mihai Burtescu-0/+2
2019-05-23Update borrowckJohn Kåre Alsaker-4/+3
2019-05-01Auto merge of #60195 - varkor:commontypes-to-common, r=eddybbors-1/+1
Split `CommonTypes` into `CommonTypes` and `CommonLifetimes` The so-called "`CommonTypes`" contains more than just types. r? @eddyb
2019-04-25Update existing usagesvarkor-1/+1
2019-04-25Update region_scope_treeJohn Kåre Alsaker-1/+1
2019-04-21Enable migrate mode by default on the 2015 editionMatthew Jasper-122/+0
This also fully stabilizes two-phase borrows on all editions
2019-04-19Emit specific error for struct literal in conditionsEsteban Küber-3/+1
2019-04-18Auto merge of #60025 - JohnTitor:rename-files, r=petrochenkovbors-0/+0
Rename files about error codes fixes #60017 This PR will be failed in tidy. <details> <summary>The log is here:</summary> ``` tidy check tidy error: duplicate error code: 411 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:83: __diagnostic_used!(E0411); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:84: err.code(DiagnosticId::Error("E0411".to_owned())); tidy error: duplicate error code: 424 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:90: debug!("smart_resolve_path_fragment: E0424, source={:?}", source); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:92: __diagnostic_used!(E0424); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:93: err.code(DiagnosticId::Error("E0424".to_owned())); some tidy checks failed ``` </details> I'd like to fix this but I don't know what to do. I will work on later. Please let me know if you have any solutions. r? @petrochenkov
2019-04-17Rename diagnostics to error_codesYuki OKUSHI-0/+0
2019-04-17Deny `internal` in stage0Mateusz Mikuła-1/+1
2019-04-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
2019-03-25Auto merge of #59195 - estebank:for-loop-move, r=petrochenkovbors-0/+14
When moving out of a for loop head, suggest borrowing it When encountering code like the following, suggest borrowing the for loop head to avoid moving it into the for loop pattern: ``` fn main() { let a = vec![1, 2, 3]; for i in &a { for j in a { println!("{} * {} = {}", i, j, i * j); } } } ``` Fix #25534.
2019-03-24When moving out of a for loop head, suggest borrowing itEsteban Küber-0/+14
When encountering code like the following, suggest borrowing the for loop head to avoid moving it into the for loop pattern: ``` fn main() { let a = vec![1, 2, 3]; for i in &a { for j in a { println!("{} * {} = {}", i, j, i * j); } } } ```
2019-03-24Remove `CtorOf` from `Node::Ctor`.David Wood-1/+1
This commit removes `CtorOf` from `Node::Ctor` as the parent of the constructor can be determined by looking at the node's parent in the few places where knowing this is necessary.