about summary refs log tree commit diff
path: root/src/librustc_middle
AgeCommit message (Collapse)AuthorLines
2020-05-17Put lazy normalization behind a feature gateBen Lewis-19/+21
2020-05-17Assume unevaluated consts are equal to the other consts and add ConstEquate ↵Ben Lewis-21/+45
obligation. This delays the need to evaluate consts eagerly and therefore gets around const eval query cycles.
2020-05-16Rollup merge of #72060 - lcnr:move-list, r=estebankRalf Jung-145/+155
move `ty::List` into a new submodule `rustc_middle/ty` is currently right below the 3000 lines tidy file length limit. Moves `rustc_middle::ty::List` to the private module `rustc_middle::ty::list` and adds a `pub use self::list::List` at its previous location.
2020-05-16Continue lowering for unsupported async generator instead of returning an error.marmeladema-10/+7
This way the hir is "valid" and we can remove one more call to `opt_node_id_to_hir_id` but an error is still emitted. This is another partial fix for #71104
2020-05-16Rollup merge of #71948 - csmoe:issue-61076, r=oli-obkDylan DPC-5/+19
Suggest to await future before ? operator Closes https://github.com/rust-lang/rust/issues/71811 cc #61076
2020-05-15InvalidUninitBytes: Track more info about accessDavid Cook-19/+59
2020-05-15implement type_implments_trait querycsmoe-1/+19
2020-05-15Rollup merge of #72214 - JOE1994:nitpicky, r=jonas-schievinkDylan DPC-2/+2
Minor fixes to comments * In 'src/librustc_ast_passes/node_count.rs' * typo fix ('rought' -> 'rough') * In 'src/librustc_middle/middle/region.rs', * fixed broken link to 'rustc-dev-guide' * typo fix ('aluded' -> 'alluded') Thank you for reviewing this PR :)
2020-05-14Minor fixes to commentsJOE1994-2/+2
* In 'src/librustc_ast_passes/node_count.rs' * typo fix ('rought' -> 'rough') * In 'src/librustc_middle/middle/region.rs', * fixed broken link to 'rustc-dev-guide' * typo fix ('aluded' -> 'alluded') Thank you for reviewing this PR :)
2020-05-14Rollup merge of #72170 - lcnr:lang_item, r=oli-obkDylan DPC-7/+9
use `require_lang_item` over `unwrap`. Does not yet replace all uses of `lang_items\(\)\.*\.unwrap\(\)`, as there are more than I expected :sweat_smile: Fixes #72099 r? @RalfJung *edit: The goal of this this PR is to change ICE from missing lang items to a fatal error.*
2020-05-14Rollup merge of #72150 - jackh726:unnorm_projection, r=nikomatsakisRalf Jung-47/+7
Remove UnnormalizedProjection This was only used for the old chalk integration with chalk-engine r? @nikomatsakis
2020-05-14Rollup merge of #72138 - wesleywiser:add_doc_comment, r=matthewjasperRalf Jung-0/+3
Add doc comment for `rustc_middle::mir::mono::Linkage`
2020-05-14Rollup merge of #71741 - RalfJung:pointer-print, r=oli-obkRalf Jung-10/+18
Pointer printing: do not print 0 offset r? @eddyb Cc @oli-obk
2020-05-13use `require_lang_item` over `unwrap`.Bastian Kauschke-7/+9
2020-05-12Don't `type_of` on trait assoc ty without defaultEsteban Küber-7/+6
Fix #72076.
2020-05-12Add doc comment for `rustc_middle::mir::mono::Linkage`Wesley Wiser-0/+3
2020-05-12Pointer printing: do not print 0 offsetRalf Jung-10/+18
2020-05-12Rollup merge of #72048 - jonas-schievink:visit-return, r=oli-obkDylan DPC-1/+17
Visit move out of `_0` when visiting `return` Closes https://github.com/rust-lang/rust/issues/72032
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-47/+7
2020-05-11Rollup merge of #72109 - matthiaskrgr:cl8ppy, r=Dylan-DPCDylan DPC-9/+5
Fix clippy warnings Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed} r? @Dylan-DPC
2020-05-11Rollup merge of #72052 - lcnr:const_pprint, r=ecstatic-morseDylan DPC-1/+3
display `ConstKind::Param`
2020-05-11Fix clippy warningsMatthias Krüger-9/+5
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
2020-05-11bless ui testscsmoe-5/+1
2020-05-10use min_specialization for some rustc crates where it requires no changesRalf Jung-1/+1
2020-05-09move `ty::List` into a new submoduleBastian Kauschke-145/+155
2020-05-09display `ConstKind::Param`Bastian Kauschke-1/+3
2020-05-09Visit move out of `_0` when visiting `return`Jonas Schievink-1/+17
2020-05-09Rollup merge of #71555 - cjgillot:nameless, r=matthewjasperRalf Jung-44/+43
Remove ast::{Ident, Name} reexports. The reexport of `Symbol` into `Name` confused me.
2020-05-09Rollup merge of #71508 - oli-obk:alloc_map_unlock, r=RalfJungRalf Jung-67/+82
Simplify the `tcx.alloc_map` API This PR changes all functions that require manually locking the `alloc_map` to functions on `TyCtxt` that lock the map internally. In the same step we make the `TyCtxt::alloc_map` field private. r? @RalfJung
2020-05-09Rollup merge of #69406 - jackh726:chalk-upgrade, r=nikomatsakisRalf Jung-1/+421
upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir Reintegrate chalk into rustc. r? @nikomatsakis cc. @rust-lang/wg-traits
2020-05-09Auto merge of #72036 - Dylan-DPC:rollup-ca8b0ql, r=Dylan-DPCbors-70/+70
Rollup of 8 pull requests Successful merges: - #70834 (Add core::future::{pending,ready}) - #71839 (Make BTreeMap::new and BTreeSet::new const) - #71890 (Simplify the error Registry methods a little) - #71942 (Shrink `LocalDecl`) - #71947 (Dead-code pass highlights too much of impl functions) - #71981 (Fix `strip-priv-imports` pass name in the rustdoc documentation) - #72018 (Fix canonicalization links) - #72031 (Better documentation for io::Read::read() return value) Failed merges: r? @ghost
2020-05-09Support coercion between (FnDef | Closure) and (FnDef | Closure) when ↵Donough Liu-10/+11
Closure is non-capturing
2020-05-09Rollup merge of #72018 - mark-i-m:canon-chalk, r=mark-i-mDylan DPC-1/+1
Fix canonicalization links
2020-05-09Rollup merge of #71942 - nnethercote:shrink-LocalDecl, r=matthewjasperDylan DPC-69/+69
Shrink `LocalDecl` `LocalDecl` contributes 4-8% of peak heap memory usage on a range of benchmarks. This PR reduces its size from 128 bytes to 56 bytes on 64-bit, and does some clean-ups as well. r? @matthewjasper
2020-05-08Auto merge of #71418 - hbina:rename_miri_undef, r=RalfJungbors-65/+65
Renamed "undef" -> "uninit" 1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-08Document `global_alloc`Oliver Scherer-0/+4
2020-05-08fix canonicalization linksmark-1/+1
2020-05-08Rollup merge of #71989 - ecstatic-morse:const-context-enum, r=oli-obkDylan DPC-0/+20
Use a single enum for the kind of a const context This adds a `ConstContext` enum to the `rustc_hir` crate and method that can be called via `tcx.hir()` to get the `ConstContext` for a given body owner. This arose from discussion in #71824. r? @oli-obk
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-44/+43
2020-05-08Create a convenience wrapper for `get_global_alloc(id).unwrap()`Oliver Scherer-15/+17
2020-05-08Shrink visibility of the `AllocMap` and its methodsOliver Scherer-3/+3
2020-05-08Move `unwrap_fn` and `unwrap_memory` to `GlobalAlloc`Oliver Scherer-20/+31
2020-05-08Simplify the `tcx.alloc_map` APIOliver Scherer-46/+44
2020-05-07Reintegrate chalk using chalk-solveJack Huey-1/+421
2020-05-07Add `hir::ConstContext`Dylan MacKenzie-0/+20
2020-05-07Renamed "undef" stuff to "uninit"Hanif Bin Ariffin-65/+65
1. InvalidUndefBytes -> InvalidUninitBytes 2. ScalarMaybeUndef -> ScalarMaybeUninit 3. UndefMask -> InitMask Related issue #71193
2020-05-07Auto merge of #55617 - oli-obk:stacker, r=nagisa,oli-obkbors-2/+7
Prevent compiler stack overflow for deeply recursive code I was unable to write a test that 1. runs in under 1s 2. overflows on my machine without this patch The following reproduces the issue, but I don't think it's sensible to include a test that takes 30s to compile. We can now easily squash newly appearing overflows by the strategic insertion of calls to `ensure_sufficient_stack`. ```rust // compile-pass #![recursion_limit="1000000"] macro_rules! chain { (EE $e:expr) => {$e.sin()}; (RECURSE $i:ident $e:expr) => {chain!($i chain!($i chain!($i chain!($i $e))))}; (Z $e:expr) => {chain!(RECURSE EE $e)}; (Y $e:expr) => {chain!(RECURSE Z $e)}; (X $e:expr) => {chain!(RECURSE Y $e)}; (A $e:expr) => {chain!(RECURSE X $e)}; (B $e:expr) => {chain!(RECURSE A $e)}; (C $e:expr) => {chain!(RECURSE B $e)}; // causes overflow on x86_64 linux // less than 1 second until overflow on test machine // after overflow has been fixed, takes 30s to compile :/ (D $e:expr) => {chain!(RECURSE C $e)}; (E $e:expr) => {chain!(RECURSE D $e)}; (F $e:expr) => {chain!(RECURSE E $e)}; // more than 10 seconds (G $e:expr) => {chain!(RECURSE F $e)}; (H $e:expr) => {chain!(RECURSE G $e)}; (I $e:expr) => {chain!(RECURSE H $e)}; (J $e:expr) => {chain!(RECURSE I $e)}; (K $e:expr) => {chain!(RECURSE J $e)}; (L $e:expr) => {chain!(RECURSE L $e)}; } fn main() { let x = chain!(D 42.0_f32); } ``` fixes #55471 fixes #41884 fixes #40161 fixes #34844 fixes #32594 cc @alexcrichton @rust-lang/compiler I looked at all code that checks the recursion limit and inserted stack growth calls where appropriate.
2020-05-06Rollup merge of #71950 - RalfJung:try-validation-cleanup, r=oli-obkDylan DPC-5/+14
Miri validation error handling cleanup Slightly expand @jumbatm's pattern macro and use it throughout validation. This ensures we never incorrectly swallow `InvalidProgram` errors or ICE when they occur. Fixes https://github.com/rust-lang/rust/issues/71353 r? @oli-obk
2020-05-06Rollup merge of #70908 - estebank:suggest-add, r=nikomatsakisDylan DPC-3/+224
Provide suggestions for type parameters missing bounds for associated types When implementing the binary operator traits it is easy to forget to restrict the `Output` associated type. `rustc` now accounts for different cases to lead users in the right direction to add the necessary restrictions. The structured suggestions in the following output are new: ``` error: equality constraints are not yet supported in `where` clauses --> $DIR/missing-bounds.rs:37:33 | LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B { | ^^^^^^^^^^^^^^^^^^^^^^ not supported | = note: see issue #20041 <https://github.com/rust-lang/rust/issues/20041> for more information help: if `Output` is an associated type you're trying to set, use the associated type binding syntax | LL | impl<B: Add> Add for E<B> where B: Add<Output = B> { | ^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types --> $DIR/missing-bounds.rs:11:11 | 7 | impl<B> Add for A<B> where B: Add { | - this type parameter ... 11 | A(self.0 + rhs.0) | ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `<B as std::ops::Add>::Output` help: consider further restricting this bound | 7 | impl<B> Add for A<B> where B: Add + std::ops::Add<Output = B> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0369]: cannot add `B` to `B` --> $DIR/missing-bounds.rs:31:21 | 31 | Self(self.0 + rhs.0) | ------ ^ ----- B | | | B | help: consider restricting type parameter `B` | 27 | impl<B: std::ops::Add<Output = B>> Add for D<B> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` That output is given for the following cases: ```rust struct A<B>(B); impl<B> Add for A<B> where B: Add { type Output = Self; fn add(self, rhs: Self) -> Self { A(self.0 + rhs.0) //~ ERROR mismatched types } } struct D<B>(B); impl<B> Add for D<B> { type Output = Self; fn add(self, rhs: Self) -> Self { Self(self.0 + rhs.0) //~ ERROR cannot add `B` to `B` } } struct E<B>(B); impl<B: Add> Add for E<B> where <B as Add>::Output = B { type Output = Self; fn add(self, rhs: Self) -> Self { Self(self.0 + rhs.0) } } ```
2020-05-06properly catch invalid-drop-fn errorsRalf Jung-8/+12