about summary refs log tree commit diff
path: root/src/librustc_mir
AgeCommit message (Collapse)AuthorLines
2019-11-11Remove trampoline, pass `ret` and `unwind` when handling intrinsicsAaron Hill-15/+13
2019-11-11Some code cleanupAaron Hill-28/+23
2019-11-11Make doc comment more accurateAaron Hill-1/+4
2019-11-11Add miri trampoline, fix handling of intrinsic returnAaron Hill-1/+10
2019-11-11Fix unwinding logicAaron Hill-12/+9
2019-11-11Some cleanupAaron Hill-38/+31
2019-11-11Add doc commentAaron Hill-0/+13
2019-11-11A few minor tweaksAaron Hill-2/+3
2019-11-11avoid the loop in unwinding stack poppingRalf Jung-107/+85
2019-11-11More fixes for rustc changesAaron Hill-4/+8
2019-11-11Remove old intrinsic checkAaron Hill-5/+0
2019-11-11Fix incorrect unwrap of destAaron Hill-6/+0
2019-11-11Formatting improvementsAaron Hill-3/+4
Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
2019-11-11Add hooks for Miri panic unwindingAaron Hill-59/+211
This commits adds in some additional hooks to allow Miri to properly handle panic unwinding. None of this should have any impact on CTFE mode
2019-11-11suggest to add a constraint except asyn-fn without explicit outputcsmoe-2/+2
2019-11-10Fix tidy.Camille GILLOT-1/+3
2019-11-10Merge hir::GeneratorMovability into ast::Movability.Camille GILLOT-4/+4
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-48/+48
2019-11-10tidyNadrieril-6/+7
2019-11-10Inline constructor_sub_pattern_tysNadrieril-67/+63
It was only used at a single location
2019-11-10Auto merge of #66259 - JohnTitor:rollup-x9nk1e2, r=JohnTitorbors-69/+163
Rollup of 7 pull requests Successful merges: - #65719 (Refactor sync::Once) - #65831 (Don't cast directly from &[T; N] to *const T) - #66048 (Correct error in documentation for Ipv4Addr method) - #66058 (Correct deprecated `is_global` IPv6 documentation) - #66216 ([mir-opt] Handle return place in ConstProp and improve SimplifyLocals pass) - #66217 (invalid_value lint: use diagnostic items) - #66235 (rustc_metadata: don't let LLVM confuse rmeta blobs for COFF object files.) Failed merges: r? @ghost
2019-11-10Rollup merge of #66216 - wesleywiser:const_prop_codegen_improvements, r=oli-obkYuki Okushi-13/+45
[mir-opt] Handle return place in ConstProp and improve SimplifyLocals pass Temporarily rebased on top of #66074. The top 2 commits are new. r? @oli-obk
2019-11-10Rollup merge of #65831 - matthewjasper:array-ptr-cast, r=oli-obkYuki Okushi-56/+118
Don't cast directly from &[T; N] to *const T Split out from #64588 r? @oli-obk
2019-11-09Auto merge of #65694 - wesleywiser:uninhabited_enum_variants_pass, r=oli-obkbors-0/+130
[mir-opt] Implement pass to remove branches on uninhabited variants Based on discussion [here](https://github.com/rust-lang/rust/pull/64890#discussion_r333612125), this is a pass to eliminate dead code that is caused by branching on an enum with uninhabited variants. r? @oli-obk
2019-11-08[mir-opt] Handle aggregates in SimplifyLocals passWesley Wiser-8/+15
2019-11-08[mir-opt] Handle const-prop for the return placeWesley Wiser-5/+30
2019-11-08Clean up dead code in `qualify_consts`Dylan MacKenzie-21/+0
We don't do promotion here anymore, so `Checker` will never even visit the body of a non-const `fn`.
2019-11-08Use new `PromoteTemps` for promotionDylan MacKenzie-42/+21
2019-11-08Add a `PromoteTemps` passDylan MacKenzie-35/+137
`remove_storage_dead_and_drop` has been copied to `promote_temps` and now operates on an array of `Candidate`s instead of a bitset.
2019-11-08Stop returning promotables from `mir_const_qualif`Dylan MacKenzie-57/+11
2019-11-08Rollup merge of #66188 - Centril:fnsig, r=davidtwcoMazdak Farrokhzad-6/+11
`MethodSig` -> `FnSig` & Use it in `ItemKind::Fn` In both AST & HIR, rename `MethodSig` to `FnSig` and then proceed to use it in `ItemKind::Fn` so that the overall structure is more regular. r? @davidtwco
2019-11-08Rollup merge of #66154 - RalfJung:to_usize, r=oli-obkMazdak Farrokhzad-8/+8
miri: Rename to_{u,i}size to to_machine_{u,i}size Having a function `to_usize` that does not return a (host) usize is somewhat confusing, so let's rename it. r? @oli-obk
2019-11-08Rollup merge of #66043 - RalfJung:memory-get-raw, r=cramertjMazdak Farrokhzad-43/+46
rename Memory::get methods to get_raw to indicate their unchecked nature Some recent Miri PRs started using these methods when they should not; this should discourage their use. In fact we could make these methods private to the `interp` module as far as Miri is concerned -- with the exception of the `uninit` intrinsic which will hopefully go away soon. @bjorn3 @oli-obk does priroda need these methods? It would be great to be able to seal them away.
2019-11-08Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obkMazdak Farrokhzad-28/+15
Transition future compat lints to {ERROR, DENY} - Take 2 Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992. - `legacy_ctor_visibility` (ERROR) -- closes #39207 - `legacy_directory_ownership` (ERROR) -- closes #37872 - `safe_extern_static` (ERROR) -- closes #36247 - `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238 - `duplicate_macro_exports` (ERROR) - `nested_impl_trait` (ERROR) -- closes #59014 - `ill_formed_attribute_input` (DENY) -- transitions #57571 - `patterns_in_fns_without_body` (DENY) -- transitions #35203 r? @varkor cc @petrochenkov
2019-11-08Use `eq_opaque_type_and_type` when type-checking closure signaturesAaron Hill-4/+16
This handles the case where a user explicitly annotations a closure signature with a opaque return type. Fixes #63263
2019-11-08hir::MethodSig -> hir::FnSigMazdak Farrokhzad-4/+4
2019-11-08hir::ItemKind::Fn: use hir::MethodSigMazdak Farrokhzad-3/+8
2019-11-08miri: Rename to_{u,i}size to to_machine_{u,i}sizeRalf Jung-8/+8
Having a function `to_usize` that does not return a usize is somewhat confusing
2019-11-08rename Memory::get methods to get_raw to indicate their unchecked natureRalf Jung-43/+46
2019-11-08Auto merge of #66066 - ecstatic-morse:remove-promotion-from-qualify-consts, ↵bors-439/+62
r=eddyb Remove promotion candidate gathering and checking from `qualify_consts.rs` This makes promotion candidate gathering and checking the exclusive domain of `promote_consts`, but the `QualifyAndPromoteConsts` pass is still responsible for both const-checking and creating promoted MIR fragments. This should not be merged until the beta branches on Nov. 5. r? @eddyb
2019-11-07Rollup merge of #65884 - Centril:non-hardcoded-abis, r=petrochenkovMazdak Farrokhzad-4/+1
syntax: ABI-oblivious grammar This PR has the following effects: 1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal. 2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate. 3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place. 4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat. cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :) r? @varkor
2019-11-07Rollup merge of #65752 - estebank:sugg, r=CentrilMazdak Farrokhzad-4/+1
Use structured suggestions for missing associated items When encountering an `impl` that is missing associated items required by its `trait`, use structured suggestions at an appropriate place in the `impl`.
2019-11-07syntax: use distinct FloatTy from rustc_target.Mazdak Farrokhzad-4/+1
We also sever syntax's dependency on rustc_target as a result. This should slightly improve pipe-lining. Moreover, some cleanup is done in related code.
2019-11-06Implement pass to remove branches on uninhabited variantsWesley Wiser-0/+130
2019-11-07Rollup merge of #66147 - RalfJung:no-scalar-ptr, r=oli-obkYuki Okushi-66/+36
Miri: Refactor to_scalar_ptr out of existence `to_scalar_ptr` is somewhat subtle as it just throws away the 2nd component of a `ScalarPair` if there is one -- without any check if this is truly a pointer or so. And indeed we used it wrong on two occasions! So I fixed those two, and then refactored things such that everyone calls `ref_to_mplace` instead (which they did anyway, I just moved up the calls), which is the only place that should interpret a `ScalarPair` as a wide ptr -- and it checks the type first. Thus we can remove `to_scalar_ptr` and `to_meta`. r? @oli-obk
2019-11-06Auto merge of #65728 - ecstatic-morse:promotion-const-proj, r=eddybbors-19/+10
Fix promotion in a `const` when projections are present Resolves #65727. This marks the entire local as "needs promotion" when only a projection of that local appears in a promotable context. This should only affect promotion in a `const` or `static`, not in a `fn` or `const fn`, which is handled in `promote_consts.rs`. r? @eddyb
2019-11-06review commentsEsteban Küber-4/+1
2019-11-06Factor out constructing a new wildcard patternNadrieril-10/+11
2019-11-06Apply suggestions from code reviewNadrieril Feneanar-9/+8
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-11-06Remove `IsNotPromotable` and `IsNotImplicitlyPromotable`Dylan MacKenzie-235/+11
The former was cleared from `qualifs_in_return_place`, and the latter was never checked. `QUALIF_ERROR_BIT` no longer corresponds to a real `Qualif`, however.