about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2019-04-28Fix lint findings in librustcflip1995-4/+4
2019-04-27Auto merge of #59540 - Zoxc:the-arena-2, r=michaelwoeristerbors-8/+5
Use arenas to avoid Lrc in queries #1 Based on https://github.com/rust-lang/rust/pull/59536.
2019-04-25Update rvalue_promotable_mapJohn Kåre Alsaker-5/+3
2019-04-25Update region_scope_treeJohn Kåre Alsaker-3/+2
2019-04-25Introduce hir::ExprKind::Use and employ in for loop desugaring.Mazdak Farrokhzad-4/+16
Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the same way as '{ let _tmp = expr; _tmp }' does.
2019-04-23Add rustc_allow_const_fn_ptrTaylor Cramer-0/+1
2019-04-23Rollup merge of #59823 - davidtwco:issue-54716, r=cramertjMazdak Farrokhzad-1/+1
[wg-async-await] Drop `async fn` arguments in async block Fixes #54716. This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body. ``` async fn foo(<pattern>: <type>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>) { async move { let <pattern>: <ty> = __arg0; } // <-- dropped as you "exit" the async block } ``` However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this. r? @cramertj cc @nikomatsakis
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-04-21Introduce `ArgSource` for diagnostics.David Wood-1/+1
This commit introduces an `ArgSource` enum that is lowered into the HIR so that diagnostics can correctly refer to the argument pattern's original name rather than the generated pattern.
2019-04-21Remove mutability from `Def::Static`Vadim Petrochenkov-2/+5
2019-04-20Auto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obkbors-11/+3
Refactor Adjust and CastKind fixes rust-lang#59588
2019-04-16refactor Adjustment to use new PointerCast enumSaleem Jaffer-11/+3
2019-04-16Rollup merge of #59993 - euclio:unused-ref-field, r=estebankMazdak Farrokhzad-5/+12
include mode in unused binding suggestion span Fixes #54180.
2019-04-16Rollup merge of #59903 - estebank:after-main, r=oli-obkMazdak Farrokhzad-1/+0
Continue evaluating after missing main
2019-04-15include mode in unused binding suggestion spanAndy Russell-5/+12
2019-04-15Make check_name genericJohn Kåre Alsaker-3/+3
2019-04-14Auto merge of #59335 - Aaron1011:fix/extern-priv-final, r=Aaron1011bors-0/+1
Properly parse '--extern-private' with name and path It turns out that https://github.com/rust-lang/rust/pull/57586 didn't properly parse `--extern-private name=path`. This PR properly implements the `--extern-private` option. I've added a new `extern-private` option to `compiletest`, which causes an `--extern-private` option to be passed to the compiler with the proper path. Part of https://github.com/rust-lang/rust/issues/44663
2019-04-14HirIdify hir::Defljedrz-13/+13
2019-04-14Properly parse '--extern-private' with name and pathAaron Hill-0/+1
2019-04-11Continue evaluating after missing mainEsteban Küber-1/+0
2019-04-01Refactor async fn return type loweringTaylor Cramer-1/+1
async fn now lowers directly to an existential type declaration rather than reusing the `impl Trait` return type lowering. As part of this, it lowers all argument-position elided lifetimes using the in-band-lifetimes machinery, creating fresh parameter names for each of them, using each lifetime parameter as a generic argument to the generated existential type. This doesn't currently successfully allow multiple argument-position elided lifetimes since `existential type` doesn't yet support multiple lifetimes where neither outlive the other. This requires a separate fix.
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-2/+2
2019-03-29Rollup merge of #59486 - varkor:dead-code-impl, r=sanxiynMazdak Farrokhzad-8/+6
Visit `ImplItem` in `dead_code` lint Fixes https://github.com/rust-lang/rust/issues/47131.
2019-03-28Walk all items for dead_code lint by defaultvarkor-9/+6
2019-03-28Rollup merge of #59216 - stepnivlk:type_dependent_defs-wrappers, r=oli-obkMazdak Farrokhzad-5/+4
Type dependent defs wrappers First of all, forgive me if something would seem lame to you or I offend some rule (although I tried to read through docs), this is my first PR. Issue: https://github.com/rust-lang/rust/issues/59094 This PR adds 3 helper methods to `TypeckTables`: * `opt_type_dependent_def` * `opt_type_dependent_def_id` * `type_dependent_def_id` I didn't add `type_dependent_def` as was proposed in the issue simply because it wasn't used anywhere in the code. Only non-option wrapped`type_dependent_defs()[]` accesses were found in clippy which always called `def_id()` on result. Speaking of clippy, should I open separate PR in its own repo, given it's used as submodule here? Sry it took me so long, as I said I'm new here and I had tough week :).
2019-03-28Rollup merge of #59413 - Zoxc:hirid, r=oli-obkMazdak Farrokhzad-4/+5
HirIdify hir::ItemId Version of https://github.com/rust-lang/rust/pull/59092. r? @oli-obk
2019-03-28Visit ItemKind::Impl for dead code lintvarkor-0/+1
2019-03-26Rollup merge of #59389 - euclio:deprecated-suggestion, r=varkorMazdak Farrokhzad-1/+1
replace redundant note in deprecation warning
2019-03-25Allocate HIR id counters for use trees in MiscCollectorJohn Kåre Alsaker-1/+1
2019-03-25Auto merge of #59256 - petrochenkov:derval2, r=Zoxcbors-9/+8
Make meta-item API compatible with `LocalInternedString::get` soundness fix r? @Zoxc
2019-03-25hir: replace NodeId with HirId in ItemIdljedrz-3/+4
2019-03-24Re-order fields in `Def::Ctor`.David Wood-5/+5
This commit moves the `DefId` field of `Def::Ctor` to be the first field.
2019-03-24Move `CtorOf` into `hir::def`.David Wood-8/+8
This commit moves the definition of `CtorOf` from `rustc::hir` to `rustc::hir::def` and adds imports wherever it is used.
2019-03-24replace redundant note in deprecation warningAndy Russell-1/+1
2019-03-24Remove `VariantDef::parent_did`Vadim Petrochenkov-1/+1
2019-03-24Separate variant id and variant constructor id.David Wood-31/+64
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-23Auto merge of #59096 - ljedrz:HirIdify_AccessLevel, r=Zoxcbors-7/+6
middle: replace NodeId with HirId in AccessLevels Pushing the limits of HirIdification (#57578). Replaces `NodeId` with `HirId` in `middle::privacy::AccessLevels`. Actually this time I was more successful and cracked it; I probably tried to HirIdify too much at once when I attempted it last time ^^. r? @Zoxc
2019-03-17Auto merge of #58994 - oli-obk:deprecated_derive, r=petrochenkovbors-1/+4
Hide deprecation warnings inside derive expansions Fixes #58822
2019-03-17Make meta-item API compatible with `LocalInternedString::get` soundness fixVadim Petrochenkov-9/+8
2019-03-16Don't report deprecation lints in derive expansionsOliver Scherer-1/+4
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-8/+9
2019-03-16Rollup merge of #59146 - estebank:suggest-return-lt, r=varkorkennytm-5/+41
Suggest return lifetime when there's only one named lifetime Fix #29094.
2019-03-16Add def getting methods to librustc/ty/contextTomas Koutsky-5/+4
2019-03-15rustc: rename item_path to def_path (except the module in ty).Eduard-Mihai Burtescu-2/+2
2019-03-15rustc: remove TyCtxt::parent_def_id in favor of TyCtxt::parent.Eduard-Mihai Burtescu-8/+8
2019-03-15rustc: remove fmt::{Debug,Display} from ty::TyKind.Eduard-Mihai Burtescu-7/+10
2019-03-13middle: replace NodeId with HirId in AccessLevelsljedrz-7/+6
2019-03-13Auto merge of #56864 - Zoxc:stable-hash-macro, r=michaelwoeristerbors-15/+28
Use derive macro for HashStable Blocked on https://github.com/rust-lang/rust/pull/56795
2019-03-12Suggest adding lifetime to struct fieldEsteban Küber-1/+8
2019-03-13Use derive macro for HashStableJohn Kåre Alsaker-15/+28