about summary refs log tree commit diff
path: root/src/librustc_middle
AgeCommit message (Collapse)AuthorLines
2020-04-18Remove `AssocTypeBound` and propagate bound `Span`sEsteban Küber-10/+0
2020-04-18Detect mistyped associated consts in `Instance::resolve`.Eduard-Mihai Burtescu-15/+31
2020-04-18ty/instance: use `ParamEnvAnd` in the `resolve_instance` query.Eduard-Mihai Burtescu-14/+12
2020-04-18Auto merge of #71218 - eddyb:a-lifetime-stranded-in-fn-def, r=nikomatsakisbors-6/+26
outlives: ignore lifetimes shallowly found in `ty::FnDef`s. Fixes #70917 by restoring the pre-#70164 behavior for now. r? @nikomatsakis
2020-04-17Make `needs_drop` less pessimistic on generatorsJonas Schievink-5/+3
2020-04-17Minor fix and addition to doc commentsJOE1994-3/+3
1. Fixed doc comment of struct 'rustc_middle::mir::Location' Currently, the general explanation of the struct appears at the field explanation section. I moved and changed the doc comments slightly, so that the general explanation would appear in the proper location in docs. 2. Added doc comment explaining 'rustc_mir::util::pretty::write_mir_fn' Unlike other counterparts, brief explanation for this function was missing, so I added one. Thank you for reviewing this PR :)
2020-04-17Auto merge of #71049 - eddyb:const-err, r=oli-obkbors-59/+72
Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it. By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output). This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now. r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid
2020-04-17Auto merge of #70629 - anyska:fields-variant, r=oli-obkbors-4/+11
rustc_target::abi: add Primitive variant to FieldsShape. Originally suggested by @eddyb.
2020-04-17ty/print: pretty-print constant aggregates (arrays, tuples and ADTs).Eduard-Mihai Burtescu-17/+64
2020-04-17mir: pretty-print `Rvalue::Aggregate` correctly.Eduard-Mihai Burtescu-15/+17
2020-04-17record await span inside GeneratorInteriorTypeCausecsmoe-3/+5
2020-04-17Rollup merge of #71206 - RalfJung:dont-try, r=oli-obkDylan DPC-4/+4
Miri error messages: avoid try terminology r? @oli-obk
2020-04-17ty/print/pretty: use `comma_sep` instead of replicating it.Eduard-Mihai Burtescu-36/+12
2020-04-16outlives: ignore lifetimes shallowly found in `ty::FnDef`s.Eduard-Mihai Burtescu-6/+26
2020-04-16bikeshedRalf Jung-2/+2
2020-04-16ty: convert `ErrorHandled::Reported` to `ConstKind::Error`.Eduard-Mihai Burtescu-2/+7
2020-04-16mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.Eduard-Mihai Burtescu-36/+30
2020-04-16ty: add `ty::ConstKind::Error` to replace `tcx.consts.err`.Eduard-Mihai Burtescu-21/+35
2020-04-16Miri error messages: avoid try terminologyRalf Jung-4/+4
2020-04-16rustc_target::abi: add Primitive variant to FieldsShape.Ana-Maria Mihalache-4/+11
2020-04-15Do not ICE in the face of invalid enum discriminantEsteban Küber-1/+5
2020-04-15Rollup merge of #71116 - marmeladema:dummy-hir-id-removal, r=eddybMazdak Farrokhzad-29/+23
Entirely remove `DUMMY_HIR_ID` Some helpers functions have been introduced to deal with (buggy) cases where either a `NodeId` or a `DefId` do not have a corresponding `HirId`. Those cases are tracked in issue #71104.
2020-04-14ty: erase lifetimes early in `ty::Const::eval`.Eduard-Mihai Burtescu-30/+28
2020-04-14Remove `DUMMY_HIR_ID`marmeladema-22/+3
2020-04-14Do not use `DUMMY_HIR_ID` as placeholder value in node_id_to_hir_id tablemarmeladema-7/+20
Some helpers functions have been introduced to deal with (buggy) cases where either a `NodeId` or a `DefId` do not have a corresponding `HirId`. Those cases are tracked in issue #71104.
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-26/+16
Rename fn_has_self_argument to fn_has_self_parameter Rename AssocItemKind::Method to AssocItemKind::Fn Refine has_no_input_arg Refine has_no_input_arg Revert has_no_input_arg Refine suggestion_descr Move as_def_kind into AssocKind Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Fix tidy check issue Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-13Auto merge of #70961 - ecstatic-morse:into-def-id, r=eddybbors-13/+46
Take `impl Into<DefId>` for query methods on `TyCtxt` Alternative implementation of #70956. cc #70853.
2020-04-12Rollup merge of #71069 - marmeladema:dummy-hir-id-obligation-clause, r=eddybDylan DPC-9/+8
Remove some usage of `DUMMY_HIR_ID` Use `ObligationClause::dummy()` when appropriate or replace `hir::DUMMY_HIR_ID`by `hir::CRATE_HIR_ID`, as used in `ObligationClause::dummy()`.
2020-04-12Rollup merge of #71013 - jonas-schievink:visit-projection, r=eddybDylan DPC-26/+33
Pass the `PlaceElem::Index` local to `visit_local` Fixes https://github.com/rust-lang/rust/issues/71008 cc @rust-lang/wg-mir-opt r? @spastorino
2020-04-12Remove usage of `DUMMY_HIR_ID` in `Scope::hir_id`marmeladema-9/+8
2020-04-11Add `#[inline(always)]` to `into_query_param`Dylan MacKenzie-0/+2
2020-04-11Apply suggestions from reviewDylan MacKenzie-14/+20
2020-04-11Use custom trait instead of `Into`Dylan MacKenzie-3/+23
2020-04-11Simplify macroDylan MacKenzie-57/+19
2020-04-11Fix inference falloutDylan MacKenzie-1/+1
2020-04-11Make query helpers on `TyCtxt` take `impl Into<DefId>`Dylan MacKenzie-23/+66
2020-04-11Auto merge of #71031 - Dylan-DPC:rollup-zr8hh86, r=Dylan-DPCbors-1/+18
Rollup of 5 pull requests Successful merges: - #70644 (Clean up `ModuleConfig` initialization) - #70937 (Fix staticlib name for *-pc-windows-gnu targets) - #70996 (Add or_insert_with_key to Entry of HashMap/BTreeMap) - #71020 (Store UNICODE_VERSION as a tuple) - #71021 (Use write!-style syntax for MIR assert terminator) Failed merges: r? @ghost
2020-04-11Rollup merge of #71021 - robojumper:71000-mir-assert-syntax, r=jonas-schievinkDylan DPC-1/+18
Use write!-style syntax for MIR assert terminator Fixes #71000. r? @jonas-schievink
2020-04-11Auto merge of #70161 - cjgillot:query-arena, r=nikomatsakisbors-28/+18
Allocate some query results on an arena This avoids a cloning few `Lrc` and `Vec`s in the queries.
2020-04-11Use write!-style syntax for MIR assert terminatorrobojumper-1/+18
2020-04-11Pass the `PlaceElem::Index` local to `visit_local`Jonas Schievink-26/+33
2020-04-10Auto merge of #70986 - marmeladema:issue70853/librustc_middle-local-def-id, ↵bors-22/+21
r=eddyb rustc_middle: return `LocalDefId` where possible in hir::map module This changes the return type of the following functions to return a `LocalDefId` instead of a `DefId`: * opt_local_def_id_from_node_id * opt_local_def_id * body_owner_def_id * local_def_id_from_node_id * get_parent_id This is another step in the right direction for #70853 This pull request will be followed by another (substantial one) which changes the return type of `local_def_id` function but this change being more invasive, we might want to wait for #70956 or #70961 (or some other form it) to land first.
2020-04-10librustc_middle: return LocalDefId instead of DefId in get_parent_didmarmeladema-3/+2
2020-04-10librustc_middle: return LocalDefId instead of DefId in local_def_id_from_node_idmarmeladema-12/+9
2020-04-10librustc_middle: return LocalDefId instead of DefId in body_owner_def_idmarmeladema-6/+5
2020-04-10librustc_middle: return LocalDefId instead of DefId in opt_local_def_idmarmeladema-10/+12
2020-04-10librustc_middle: return LocalDefId instead of DefId in ↵marmeladema-11/+13
opt_local_def_id_from_node_id
2020-04-10Rollup merge of #70913 - eddyb:rc-arc-diagnostic-items, r=matthewjasperMazdak Farrokhzad-40/+7
Replace "rc"/"arc" lang items with Rc/Arc diagnostic items. `Rc`/`Arc` should have no special semantics, so it seems appropriate for them to not be lang items. r? @matthewjasper
2020-04-09Auto merge of #70909 - marmeladema:issue70853/librustc_hir-local-def-id, r=eddybbors-3/+3
librustc_hir: return LocalDefId instead of DefId in local_def_id Its a first try to remove a few calls to `expect_local` and use `LocalDefId` instead of `DefId` where possible for #70853 This adds some calls to `.to_def_id()` to get a `DefId` back when needed. I don't know if I should push `LocalDefId` even further and change, for example, `Res::Def` to accept a `LocalDefId` instead of a `DefId` as second argument. cc @ecstatic-morse
2020-04-09Auto merge of #70860 - lcnr:has_local_value, r=nikomatsakisbors-28/+14
remove `KEEP_IN_LOCAL_TCX` flag closes #70285 I did not rename `needs_infer` here as this complex enough as is. Will probably open a followup for that. r? @eddyb