about summary refs log tree commit diff
path: root/src/librustc_mir
AgeCommit message (Collapse)AuthorLines
2020-01-04Update ABI in const impls of panic_fn/begin_panic_fn.Adam Perry-39/+22
2020-01-04core and std macros and panic internals use panic::Location::caller.Adam Perry-1/+1
2020-01-04{HirId,ItemLocal}{Map,Set} -> rustc::hir & nix rustc::nodemapMazdak Farrokhzad-3/+1
2020-01-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-6/+3
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-8/+9
2020-01-04extract rustc::middle::codegen_fn_attrsMazdak Farrokhzad-3/+4
2020-01-04Rollup merge of #67822 - wesleywiser:revert_67676, r=oli-obkGuillaume Gomez-63/+7
Revert `const_err` lint checking of casts Reverts part of #67676 r? @oli-obk cc @SimonSapin
2020-01-04Rollup merge of #67786 - Centril:canon-span, r=petrochenkovMazdak Farrokhzad-24/+23
Nix reexports from `rustc_span` in `syntax` Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly. r? @petrochenkov
2020-01-03Rollup merge of #67796 - Aaron1011:fix/mir-inline-proj, r=wesleywiserYuki Okushi-8/+4
Ensure that we process projections during MIR inlining Fixes #67710 Previously, we were not calling `super_place`, which resulted in us failing to update any local references that occur in ProjectionElem::Index. This caused the post-inlining MIR to contain a reference to a local ID from the inlined callee, leading to an ICE due to a type mismatch.
2020-01-03Rollup merge of #67783 - LeSeulArtichaut:pattern-ref-warning, r=CentrilYuki Okushi-1/+1
Warn for bindings named same as variants when matching against a borrow Fixes #67776
2020-01-03Rollup merge of #67595 - ohadravid:impl-trait-does-not-live-long-enough, ↵Yuki Okushi-2/+43
r=estebank Suggest adding a lifetime constraint for opaque type Fixes #67577, where code like this: ``` struct List { data: Vec<String>, } impl List { fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> { self.data.iter().filter(|s| s.starts_with(prefix)).map(|s| s.as_ref()) } } ``` will show this error: ``` Compiling playground v0.0.1 (/playground) error[E0597]: `prefix` does not live long enough --> src/lib.rs:6:47 | 5 | fn started_with<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item=&'a str> { | -- lifetime `'a` defined here --------------------------- opaque type requires that `prefix` is borrowed for `'a` ... ``` but without suggesting the lovely `help: you can add a constraint..`. r? @estebank
2020-01-02Revert `const_err` lint checking of castsWesley Wiser-63/+7
Reverts part of #67676
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-15/+15
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-9/+8
2020-01-01Ensure that we process projections during MIR inliningAaron Hill-8/+4
Fixes #67710 Previously, we were not calling `super_place`, which resulted in us failing to update any local references that occur in ProjectionElem::Index. This caused the post-inlining MIR to contain a reference to a local ID from the inlined callee, leading to an ICE due to a type mismatch.
2020-01-02Warn for bindings named same as variants when matching against a borrowLeSeulArtichaut-1/+1
2020-01-01Auto merge of #67676 - wesleywiser:lint_overflowing_int_casts, r=oli-obkbors-63/+135
Lint overflowing integer casts in const prop This extends the invalid cases we catch in const prop to include overflowing integer casts using the same machinery as the overflowing binary and unary operation logic. r? @oli-obk
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-58/+58
2019-12-31Change wording for lifetime suggestion for opaque types from `constraint` to ↵Ohad Ravid-2/+2
`bound`
2019-12-31Auto merge of #67032 - cjgillot:hirene, r=Zoxcbors-2/+2
Allocate HIR on an arena 4/4 This is the fourth and last PR in the series started by #66931, #66936 and #66942. The last commits should compile on their own. The difference with the previous PR is given by https://github.com/cjgillot/rust/compare/hirene-ty...hirene A few more cleanups may be necessary, please tell me. r? @eddyb like the other cc @Zoxc
2019-12-30[const-prop] Expand comment about casting ZST enumsWesley Wiser-1/+3
2019-12-30[const-prop] Clean up `check_cast()` a bitWesley Wiser-31/+35
2019-12-30[const-prop] Extract some functions out of `_const_prop`Wesley Wiser-91/+118
2019-12-30Lint overflowing integer casts in const propWesley Wiser-7/+46
This extends the invalid cases we catch in const prop to include overflowing integer casts using the same machinery as the overflowing binary and unary operation logic.
2019-12-30Auto merge of #67707 - petrochenkov:crateren, r=Centrilbors-1/+1
Rename some crates and modules in the frontend Migrate from `syntax_*` naming scheme to `rustc_*`. See https://github.com/rust-lang/rust/pull/65324#issuecomment-551103396 and several comments below. Renamed crates: `syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` ([motivation](https://github.com/rust-lang/rust/pull/65324#issuecomment-552173320)) `syntax_ext` -> `rustc_builtin_macros` Also one module in resolve is renamed for consistency and to avoid tautology. r? @Centril
2019-12-30Suggest adding a lifetime constraint when opaque type is responsible for ↵Ohad Ravid-1/+42
"does not live long enough" error
2019-12-30Make things build againVadim Petrochenkov-1/+1
2019-12-30Auto merge of #67474 - mark-i-m:simplify-borrow_check-4, r=matthewjasperbors-239/+119
Get rid of ErrorReportingCtx [5/N] We can now use `MirBorrowckCtxt` instead :) ``` 6 files changed, 122 insertions(+), 243 deletions(-) ``` This is a followup to (and thus blocked on) #67241. r? @matthewjasper cc @eddyb I while try to do one more to get rid of the weird usage of `RegionInferenceCtx` in `borrow_check::diagnostics::{region_errors, region_naming}`. I think those uses can possibly also be refactored to use `MirBorrowckCtxt`...
2019-12-30Handle recursive instantiation of drop shimsMatthew Jasper-2/+2
2019-12-30Auto merge of #67667 - wesleywiser:speed_up_trivially_valid_constants, r=oli-obkbors-3/+12
Resolve long compile times when evaluating always valid constants This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539 r? @oli-obk cc @RalfJung @spastorino
2019-12-30Remove HirVec from Generics.Camille GILLOT-2/+2
2019-12-30Auto merge of #67658 - spastorino:do-not-copy-zsts, r=oli-obkbors-25/+37
Avoid memory copy logic for zsts r? @oli-obk One of the included commits is work done by @HeroicKatora in #62655
2019-12-30Auto merge of #67721 - JohnTitor:rollup-o8zm4r9, r=JohnTitorbors-2/+20
Rollup of 10 pull requests Successful merges: - #64273 (Stabilize attribute macros on inline modules) - #67287 (typeck: note other end-point when checking range pats) - #67564 (docs: Iterator adapters have unspecified results after a panic) - #67622 (Some keyword documentation.) - #67657 (Clean up const-hack PRs now that const if / match exist.) - #67677 (resolve: Minor cleanup of duplicate macro reexports) - #67687 (Do not ICE on lifetime error involving closures) - #67698 (Move reachable_set and diagnostic_items to librustc_passes.) - #67701 (tidy: Enforce formatting rather than just check it if `--bless` is specified) - #67715 (Typo fix) Failed merges: r? @ghost
2019-12-30Rollup merge of #67687 - estebank:issue-67634, r=matthewjasperYuki Okushi-2/+20
Do not ICE on lifetime error involving closures Fix #67634.
2019-12-29fix review commentmark-5/+6
2019-12-29Get rid of ErrorReportingCtxmark-243/+122
2019-12-30Auto merge of #67631 - oli-obk:polymorphic_promotion, r=wesleywiserbors-32/+82
Work around a resolve bug in const prop r? @wesleywiser @anp This isn't exposed right now, but further changes to rustc may start causing bugs without this.
2019-12-29Auto merge of #66942 - cjgillot:hirene-ty, r=Zoxcbors-11/+11
Allocate HIR on an arena 3/4 -- Ty This is the third PR in the series started by #66931 and #66936 Once again, commits don't really make sense on their own. They are mostly split by type of compile error. The additional diff is here: https://github.com/cjgillot/rust/compare/hirene-expr...hirene-ty
2019-12-29Resolve long compile times when evaluating always valid constantsWesley Wiser-3/+12
This extends the existing logic which skips validating every integer or floating point number type to also skip validating empty structs because they are also trivially valid. Fixes #67539
2019-12-29Ensure that we don't cause *new* hard errors if we suddenly can evaluate ↵Oliver Scherer-29/+41
more constants during const prop
2019-12-28Do not ICE on lifetime error involving closuresEsteban Küber-2/+20
2019-12-28Avoid copying some undef memory in MIRSantiago Pastorino-24/+28
During MIR interpretation it may happen that a place containing uninitialized bytes is copied. This would read the current representation of these bytes and write it to the destination even though they must, by definition, not matter to the execution. This elides that representation change when no bytes are defined in such a copy, saving some cpu cycles. In such a case, the memory of the target allocation is not touched at all which also means that sometimes no physical page backing the memory allocation of the representation needs to be provided by the OS at all, reducing memory pressure on the system.
2019-12-28Change "be returning" to "return"Matthew Kraai-1/+1
2019-12-28Rollup merge of #67659 - SimonSapin:matches, r=rkruppeOliver Scherer-1/+0
Stabilize the `matches!` macro Fixes https://github.com/rust-lang/rust/issues/65721 FCP: https://github.com/rust-lang/rust/issues/65721#issuecomment-569118119
2019-12-28Rollup merge of #67632 - kraai:remove-collapsed-reference-links, r=steveklabnikOliver Scherer-1/+1
Convert collapsed to shortcut reference links
2019-12-28Rollup merge of #67621 - matthewjasper:correct-static-type, r=oli-obkOliver Scherer-9/+8
Use the correct type for static qualifs Closes #67609
2019-12-28Prevent polymorphic const prop on assignmentsOliver Scherer-0/+7
2019-12-28Work around a resolve bug in const propOliver Scherer-1/+7
2019-12-27Fallout in other crates.Camille GILLOT-11/+11
2019-12-27Fix `Instance::resolve()` incorrectly returning specialized instancesWesley Wiser-16/+41
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes #66901