about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2019-07-10Auto merge of #62339 - ↵bors-0/+1
pnkfelix:issue-61188-use-visitor-for-structural-match-check, r=nikomatsakis use visitor for #[structural_match] check This changes the code so that we recur down the structure of a type of a const (rather than just inspecting at a shallow one or two levels) when we are looking to see if it has an ADT that did not derive `PartialEq` and `Eq`. Fix #61188 Fix #62307 Cc #62336
2019-07-09Rollup merge of #62450 - nagisa:reclimit, r=pnkfelixMazdak Farrokhzad-1/+1
Raise the default recursion limit to 128 The previous limit of 64 is being (just) barely hit by genuine code out there, which is causing issues like https://github.com/rust-lang/rust/issues/62059 to rear their end. Ideally, we wouldn’t have such arbitrary limits at all, but while we do, it makes a lot of sense to just raise this limit whenever genuine use-cases end up hitting it. r? @pnkfelix Fixes https://github.com/rust-lang/rust/issues/62059
2019-07-08Note that `eq_trait` denotes `trait PartialEq`, not `Eq`, so you don't have ↵Felix S. Klock II-0/+1
to go to trait def to double-check.
2019-07-07Support deprecation checking for macrosVadim Petrochenkov-63/+85
2019-07-07resolve: Use standard stability diagnostics for macrosVadim Petrochenkov-28/+32
2019-07-07Collect library features from non-exported macrosVadim Petrochenkov-1/+5
2019-07-06in which we suggest anonymizing single-use lifetimes in pathsZack M. Davis-25/+56
2019-07-07Raise the default recursion limit to 128Simonas Kazlauskas-1/+1
2019-07-06Cleanup liveness comment.Mazdak Farrokhzad-13/+6
2019-07-06Remove ExprKind::While from HIR.Mazdak Farrokhzad-66/+18
2019-07-04rename hir::map::local_def_id_from_hir_id to local_def_idljedrz-27/+27
2019-07-04Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, ↵Mazdak Farrokhzad-6/+5
r=dtolnay,Centril Use mem::take instead of mem::replace with default
2019-07-04Rollup merge of #62039 - jeremystucki:needless_lifetimes, r=eddybMazdak Farrokhzad-20/+20
Remove needless lifetimes (rustc)
2019-07-03Auto merge of #61995 - eddyb:hir-sep-ptr, r=petrochenkovbors-3/+3
rustc: use a separate copy of P for HIR than for AST. Note: this currently includes/is based on top of #61987. Like #61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation. There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle. r? @petrochenkov cc @rust-lang/compiler
2019-07-03Remove needless lifetimesJeremy Stucki-20/+20
2019-07-02Auto merge of #61871 - Zoxc:no-lift-branch, r=eddybbors-3/+5
Don't use lift to detect local types This overlaps with https://github.com/rust-lang/rust/pull/61392. r? @eddyb
2019-07-01Convert more usages overChris Gregory-6/+5
2019-07-01rustc: use a separate copy of P for HIR than for AST.Eduard-Mihai Burtescu-3/+3
2019-06-27Add suggestion for missing `.await` keywordNathan Corbyn-0/+1
2019-06-26Don't use lift to detect local typesJohn Kåre Alsaker-3/+5
2019-06-25Rollup merge of #62091 - ljedrz:hiridification_almost_there, r=ZoxcMazdak Farrokhzad-15/+13
HirIdification: almost there I'm beginning to run out of stuff to HirIdify :wink:. This time I targeted mainly `hir::map::{find, get_parent_node}`, but a few other bits got changed too. r? @Zoxc
2019-06-25Auto merge of #61572 - Aaron1011:fix/generator-ref, r=varkorbors-1/+107
Fix HIR visit order Fixes #61442 When rustc::middle::region::ScopeTree computes its yield_in_scope field, it relies on the HIR visitor order to properly compute which types must be live across yield points. In order for the computed scopes to agree with the generated MIR, we must ensure that expressions evaluated before a yield point are visited before the 'yield' expression. However, the visitor order for ExprKind::AssignOp was incorrect. The left-hand side of a compund assignment expression is evaluated before the right-hand side, but the right-hand expression was being visited before the left-hand expression. If the left-hand expression caused a new type to be introduced (e.g. through a deref-coercion), the new type would be incorrectly seen as occuring *after* the yield point, instead of before. This leads to a mismatch between the computed generator types and the MIR, since the MIR will correctly see the type as being live across the yield point. To fix this, we correct the visitor order for ExprKind::AssignOp to reflect the actual evaulation order.
2019-06-24HirIdification: miscellaneous bitsljedrz-5/+3
2019-06-24HIR: rename find_by_hir_id to findljedrz-7/+7
2019-06-24HIR: rename get_parent_node_by_hir_id to get_parent_nodeljedrz-2/+2
2019-06-24HIR: remove the NodeId get_parent_node, HirIdify is_argumentljedrz-1/+1
2019-06-23Replace Vec<Vec<_>> with Vec<_>Aaron Hill-18/+9
2019-06-23Fix typos pointed out by @varkorAaron Hill-9/+9
Co-Authored-By: varkor <github@varkor.com>
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-1/+1
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-06-22Fix fallout from rebaseAaron Hill-4/+4
2019-06-22Change how we compute yield_in_scopeAaron Hill-0/+115
Compound operators (e.g. 'a += b') have two different possible evaluation orders. When the left-hand side is a primitive type, the expression is evaluated right-to-left. However, when the left-hand side is a non-primitive type, the expression is evaluated left-to-right. This causes problems when we try to determine if a type is live across a yield point. Since we need to perform this computation before typecheck has run, we can't simply check the types of the operands. This commit calculates the most 'pessimistic' scenario - that is, erring on the side of treating more types as live, rather than fewer. This is perfectly safe - in fact, this initial liveness computation is already overly conservative (e.g. issue #57478). The important thing is that we compute a superset of the types that are actually live across yield points. When we generate MIR, we'll determine which types actually need to stay live across a given yield point, and which ones cam actually be dropped. Concretely, we force the computed HIR traversal index for right-hand-side yield expression to be equal to the maximum index for the left-hand side. This covers both possible execution orders: * If the expression is evalauted right-to-left, our 'pessismitic' index is unecessary, but safe. We visit the expressions in an ExprKind::AssignOp from right to left, so it actually would have been safe to do nothing. However, while increasing the index of a yield point might cause the compiler to reject code that could actually compile, it will never cause incorrect code to be accepted. * If the expression is evaluated left-to-right, our 'pessimistic' index correctly ensures that types in the left-hand-side are seen as occuring before the yield - which is exactly what we want
2019-06-20rename hir::map::get_by_hir_id to getljedrz-10/+10
2019-06-19Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centrilMazdak Farrokhzad-10/+23
Preserve generator and yield source for error messages Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages. Fixes #60615.
2019-06-19Rollup merge of #61842 - Zoxc:trim-lift, r=eddybMazdak Farrokhzad-4/+1
Remove unnecessary lift calls Note that some of these might be useful for sanity checking that there's no infer types or regions. r? @eddyb
2019-06-18Preserve generator and yield source for error messagesTaylor Cramer-10/+23
Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages.
2019-06-18rustc: remove unused lifetimes.Eduard-Mihai Burtescu-1/+1
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-17/+17
2019-06-17renamve hir_to_string to node_to_stringljedrz-3/+3
2019-06-17remove _by_hir_id if there is no NodeId counterpartljedrz-18/+18
2019-06-17replace some uses of NodeId with HirIdljedrz-24/+20
2019-06-16Rollup merge of #61866 - sinkuu:redundant_clone, r=petrochenkovMazdak Farrokhzad-1/+1
Remove redundant `clone()`s
2019-06-15Rollup merge of #61824 - rust-lang:single_derive, r=eddybMazdak Farrokhzad-0/+11
in which we decline to lint single-use lifetimes in `derive`d impls Resolves #53738. r? @eddyb
2019-06-15Remove unnecessary `.clone()`Shotaro Yamada-1/+1
2019-06-14Remove unnecessary lift callsJohn Kåre Alsaker-4/+1
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-43/+29
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-98/+98
2019-06-14in which we decline to lint single-use lifetimes in `derive`d implsZack M. Davis-0/+11
Resolves #53738.
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-91/+92
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-80/+80
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-41/+41