about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-02-14Fix tests after rebaseMatthew Jasper-51/+82
2020-02-14Split `type_of` out of collect.rsMatthew Jasper-653/+666
2020-02-14Add fast path to eq_opaque_type_and_typeMatthew Jasper-3/+25
2020-02-14Fix and test nested impl TraitMatthew Jasper-5/+29
2020-02-14Update testsMatthew Jasper-231/+124
2020-02-14Use member constraint for most opaque types in NLLMatthew Jasper-15/+43
This ensures that NLL will infer suitable values for regions in opaque types when it's possible.
2020-02-14Always check upper bounds when choosing member regionsMatthew Jasper-40/+81
Also correctly calculate what the upper bounds are.
2020-02-14Improve opaque type lifetime errorsMatthew Jasper-31/+41
* Use better span for member constraint errors * Avoid a bad suggestion * Don't report member constraint errors if we have other universal region errors.
2020-02-14Handle equal regions in opaque type inferenceMatthew Jasper-18/+127
2020-02-14Show inferred opaque types with `#[rustc_regions]`Matthew Jasper-5/+29
2020-02-14Address review commentsMatthew Jasper-55/+67
2020-02-14Update testsMatthew Jasper-157/+291
2020-02-14Erase regions in opaque types in typeckMatthew Jasper-27/+65
2020-02-14Ensure RPIT types get recorded in borrowckMatthew Jasper-7/+27
2020-02-14Avoid unnecessary opaque type errors in borrowckMatthew Jasper-0/+8
2020-02-14Infer opaque type regions in borrow checkingMatthew Jasper-3/+83
We want type checking for function bodies to ignore/erase regions. As such, we need to infer the regions in opaque types in borrow check instead.
2020-02-14Prepare to use borrowck to resolve opaque typesMatthew Jasper-68/+128
2020-02-14Arena allocate the result of mir_borrowckMatthew Jasper-13/+12
2020-02-14Generate more accurate MIR in `construct_error`Matthew Jasper-5/+42
2020-02-14Simplify function signature in opaque_typesMatthew Jasper-9/+5
2020-02-14Give some more queries descriptionsMatthew Jasper-1/+6
2020-02-14Distinguish RPIT from other impl traitMatthew Jasper-20/+39
2020-02-14Call `is_freeze` less in unsafety-checkingMatthew Jasper-19/+58
This is to avoid cycles when calling `is_freeze` on an opaque type.
2020-02-14Check associated opaque types don't use unconstrained lifetimesMatthew Jasper-14/+57
2020-02-14Explain a testMatthew Jasper-2/+9
2020-02-14Auto merge of #69100 - cjgillot:resolve_instance, r=Zoxcbors-123/+160
Move resolve_instance to rustc_ty. r? @Zoxc
2020-02-14update miriRalf Jung-7/+7
2020-02-14Auto merge of #68693 - Zoxc:query-no-arc, r=michaelwoeristerbors-161/+323
Construct query job latches on-demand r? @michaelwoerister
2020-02-13Auto merge of #69144 - Dylan-DPC:rollup-apt6zjj, r=Dylan-DPCbors-866/+754
Rollup of 9 pull requests Successful merges: - #68728 (parse: merge `fn` syntax + cleanup item parsing) - #68938 (fix lifetime shadowing check in GATs) - #69057 (expand: misc cleanups and simplifications) - #69108 (Use HirId in TraitCandidate.) - #69125 (Add comment to SGX entry code) - #69126 (miri: fix exact_div) - #69127 (Enable use after scope detection in the new LLVM pass manager) - #69135 (Spelling error "represening" to "representing") - #69141 (Don't error on network failures) Failed merges: r? @ghost
2020-02-13Rollup merge of #69141 - mark-i-m:proper-linkcheck-2, r=Dylan-DPCDylan DPC-0/+2
Don't error on network failures This should further reduce spurious failures. r? @JohnTitor and/or @ehuss
2020-02-13Rollup merge of #69135 - drewrip:drewrip-spelling, r=jonas-schievinkDylan DPC-1/+1
Spelling error "represening" to "representing" Small spelling mistake I noticed when looking through the Rust lexer.
2020-02-13Rollup merge of #69127 - tmiasko:new-pass-manager-use-after-scope, r=nikicDylan DPC-2/+2
Enable use after scope detection in the new LLVM pass manager Implementation of 08a1c566a792dcf9657d293155f7ada87746bb65 for the new LLVM pass manager, support for which landed in the meantime.
2020-02-13Rollup merge of #69126 - RalfJung:exact-div, r=oli-obkDylan DPC-2/+4
miri: fix exact_div Turns out `exact_div` was relying on the broken behavior of `Rem` for `int_min % -1` that was fixed in https://github.com/rust-lang/rust/pull/69002. This PR fixes `exact_div`. Inside rustc, `exact_div` is only used in a single place where the divisor is always positive (in `ptr_offset_from`), so we cannot test the fix in rustc. The Miri test suite covers this through the `exact_div` intrinsic, though (and it is how I found out). One step to https://github.com/rust-lang/rust/issues/69117 (then we also need to address build failures introduced by https://github.com/rust-lang/rust/pull/68969) r? @oli-obk
2020-02-13Rollup merge of #69125 - jethrogb:jb/cleanup-sgx-entry, r=Dylan-DPCDylan DPC-0/+1
Add comment to SGX entry code Meant to force push this to be included in #69040, but forgot r? @nagisa
2020-02-13Rollup merge of #69108 - cjgillot:trait_candidate, r=ZoxcDylan DPC-18/+29
Use HirId in TraitCandidate. I had to duplicate the `TraitMap` type to hold `NodeId`s until AST->HIR lowering is done. r? @Zoxc
2020-02-13Rollup merge of #69057 - Centril:clean-expand, r=petrochenkovDylan DPC-114/+94
expand: misc cleanups and simplifications Some work I did while trying to understand expand for the purposes of https://github.com/rust-lang/rust/issues/64197. r? @petrochenkov
2020-02-13Rollup merge of #68938 - Areredify:gat_lifetime_shadowing, r=estebankDylan DPC-6/+25
fix lifetime shadowing check in GATs closes #67512
2020-02-13Rollup merge of #68728 - Centril:towards-fn-merge, r=petrochenkovDylan DPC-723/+596
parse: merge `fn` syntax + cleanup item parsing Here we continue the work in https://github.com/rust-lang/rust/pull/67131 in particular to merge the grammars of `fn` items in various positions. A list of *language level* changes (as sanctioned by the language team in https://github.com/rust-lang/rust/issues/65041#issuecomment-538105286 and https://github.com/rust-lang/rust/pull/67131): - `self` parameters are now *syntactically* allowed as the first parameter irrespective of item context (and in function pointers). Instead, semantic validation (`ast_validation`) is used. - Syntactically, `fn` items in `extern { ... }` blocks can now have bodies (`fn foo() { ... }` as opposed to `fn foo();`). As above, we use semantic restrictions instead. - Syntactically, `fn` items in free contexts (directly in a file or a module) can now be without bodies (`fn foo();` as opposed to `fn foo() { ... }`. As above, we use semantic restrictions instead, including for non-ident parameter patterns. - `const extern fn` feature gating is now done post-expansion such that we do not have conditional compatibilities of function qualifiers *in parsing*. - The `FnFrontMatter` grammar becomes: ```rust Extern = "extern" StringLit ; FnQual = "const"? "async"? "unsafe"? Extern? ; FnFrontMatter = FnQual "fn" ; ``` That is, all item contexts now *syntactically* allow `const async unsafe extern "C" fn` and use semantic restrictions to rule out combinations previously prevented syntactically. The semantic restrictions include in particular: - `fn`s in `extern { ... }` can have no qualifiers. - `const` and `async` cannot be combined. - To fuse the list-of-items parsing in the 4 contexts that items are allowed, we now must permit inner attributes (`#![attr]`) inside `trait Foo { ... }` definitions. That is, we now allow e.g. `trait Foo { #![attr] }`. This was probably an oversight due to not using a uniform parsing mechanism, which we now do have (`fn parse_item_list`). The semantic support (including e.g. for linting) falls out directly from the attributes infrastructure. To ensure this, we include a test for lints. Put together, these grammar changes allow us to substantially reduce the complexity of item parsing and its grammar. There are however some other non-language improvements that allow the compression to take place. A list of *compiler-internal* changes (in particular noting the parser-external data-structure changes): - We use `enum AllowPlus/RecoverQPath/AllowCVariadic { Yes, No }` in `parser/ty.rs` instead of passing around 3 different `bool`s. I felt this was necessary as it was becoming mentally taxing to track which-is-which. - `fn visit_trait_item` and `fn visit_impl_item` are merged into `fn visit_assoc_item` which now is passed an `AssocCtxt` to check which one it is. - We change `FnKind` to: ```rust pub enum FnKind<'a> { Fn(FnCtxt, Ident, &'a FnSig, &'a Visibility, Option<&'a Block>), Closure(&'a FnDecl, &'a Expr), } ``` with: ```rust pub enum FnCtxt { Free, Foreign, Assoc(AssocCtxt), } ``` This is then taken advantage of in tweaking the various semantic restrictions as well as in pretty printing. - In `ItemKind::Fn`, we change `P<Block>` to `Option<P<Block>>`. - In `ForeignItemKind::Fn`, we change `P<FnDecl>` to `FnSig` and `P<Block>` to `Option<P<Block>>`. - We change `ast::{Unsafety, Spanned<Constness>}>` into `enum ast::{Unsafe, Const} { Yes(Span), No }` respectively. This change in formulation allow us to exclude `Span` in the case of `No`, which facilitates parsing. Moreover, we also add a `Span` to `IsAsync` which is renamed to `Async`. The new `Span`s in `Unsafety` and `Async` are then taken advantage of for better diagnostics. A reason this change was made is to have a more uniform and clear naming scheme. The HIR keeps the structures in AST (with those definitions moved into HIR) for now to avoid regressing perf. - Various cleanups, bug fixes, and diagnostics improvements are made along the way. It is probably best to understand those via the diffs. I would recommend reviewing this commit-by-commit with whitespace changes hidden. r? @estebank @petrochenkov
2020-02-13Auto merge of #68406 - andjo403:selfprofileLlvm, r=wesleywiserbors-4/+164
[self-profiler] add selfprofiling to llvm using pass name as event id and add additional data with name of module, function … ![image](https://user-images.githubusercontent.com/844398/72761970-205d8600-3bde-11ea-86de-87386e127944.png) r? @michaelwoerister or @wesleywiser
2020-02-13Move resolve_instance to rustc_ty.Camille GILLOT-123/+160
2020-02-13don't error on network failuresMark Mansi-0/+2
2020-02-13Spelling error "represening" to "representing"Drew Ripberger-1/+1
2020-02-13Make TraitCandidate generic.Camille GILLOT-30/+26
2020-02-13Use HirId in TraitCandidate.Camille GILLOT-16/+31
2020-02-13parser: inline parse_assoc_macro_invocMazdak Farrokhzad-20/+10
2020-02-13parser: misc small item related improvements & cleanups.Mazdak Farrokhzad-249/+233
2020-02-13parser: extract `recover_const_mut`.Mazdak Farrokhzad-13/+17
2020-02-13parser: fuse `trait` parsing & layer with `is_path_start_item`Mazdak Farrokhzad-35/+27
2020-02-13parser: make `eat_macro_def` redundant.Mazdak Farrokhzad-33/+12
2020-02-13parser: remove `Option<Vec<Attribute>>` in `ItemInfo`.Mazdak Farrokhzad-59/+50