about summary refs log tree commit diff
path: root/src/librustc_trait_selection/traits
AgeCommit message (Collapse)AuthorLines
2020-04-05"cannot resolve" → "cannot satisfy"Esteban Küber-5/+5
2020-04-05Allocate query Vecs on the arena.Camille GILLOT-4/+8
2020-04-03Rollup merge of #70641 - estebank:dedup-code, r=nikomatsakisMazdak Farrokhzad-295/+2
Remove duplicated code in trait selection
2020-04-03Rollup merge of #70731 - JohnTitor:follow-up-rustc-middle, r=eddybDylan DPC-1/+1
Minor follow-up after renaming librustc(_middle) Fixes #70537 r? @Centril @eddyb
2020-04-03Minor follow-up after renaming librustc(_middle)Yuki Okushi-1/+1
2020-04-03.unwrap() less on .span_to_snippet()Mazdak Farrokhzad-17/+15
2020-04-03get_fn_like_arguments: avoid .unwrapMazdak Farrokhzad-33/+24
2020-04-02Rollup merge of #70658 - davidtwco:issue-70285-still-further-specializable, ↵Mazdak Farrokhzad-1/+1
r=eddyb add `STILL_FURTHER_SPECIALIZABLE` flag Contributes to #70285. This PR adds a `STILL_FURTHER_SPECIALIZABLE` flag to `TypeFlags` which replaces `needs_infer` and `needs_subst` in `Instance::resolve` and `assemble_candidates_from_impls`. r? @eddyb
2020-04-02direct imports for langitem stuffMazdak Farrokhzad-2/+2
2020-04-02use direct import for ErrorReportedMazdak Farrokhzad-5/+3
2020-04-02nix rustc_target::abi::* reexport in ty::layoutMazdak Farrokhzad-1/+1
2020-04-02add `STILL_FURTHER_SPECIALIZABLE` flagDavid Wood-1/+1
This commit adds a STILL_FURTHER_SPECIALIZABLE flag to `TypeFlags` which replaces `needs_infer` and `needs_subst` in `Instance::resolve` and `assemble_candidates_from_impls.` Signed-off-by: David Wood <david@davidtw.co>
2020-04-01Remove duplicated code in trait selectionEsteban Küber-295/+2
2020-03-30Use query instead of `impl_is_default` fnJonas Schievink-2/+1
2020-03-30Sync `Instance::resolve` with the projection codeJonas Schievink-45/+2
2020-03-30spec. graph: track defining and finalizing implsJonas Schievink-55/+14
2020-03-30Simplify `NodeItem`Jonas Schievink-1/+1
The generic parameter is unused, and so is `map`
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-94/+83
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-36/+42
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-83/+83
2020-03-29Tweak `suggest_constraining_type_param`Esteban Küber-146/+61
Some of the bound restriction structured suggestions were incorrect while others had subpar output.
2020-03-29Auto merge of #70370 - petrochenkov:nosmatch, r=Centrilbors-5/+5
Remove attribute `#[structural_match]` and any references to it A small remaining part of https://github.com/rust-lang/rust/issues/63438.
2020-03-27Rollup merge of #70344 - Centril:hir-pretty, r=eddybDylan DPC-24/+24
Decouple `rustc_hir::print` into `rustc_hir_pretty` High level summary: - The HIR pretty printer, `rustc_hir::print` is moved into a new crate `rustc_hir_pretty`. - `rustc_ast_pretty` and `rustc_errors` are dropped as `rustc_hir` dependencies. - The dependence on HIR pretty is generally reduced, leaving `rustc_save_analysis`, `rustdoc`, `rustc_metadata`, and `rustc_driver` as the remaining clients. The main goal here is to reduce `rustc_hir`'s dependencies and its size such that it can start and finish earlier, thereby working towards https://github.com/rust-lang/rust/issues/65031. r? @Zoxc
2020-03-26make a custom error for overlap with negative implsNiko Matsakis-80/+165
2020-03-26trait_bound_spans -> sized_trait_bound_spansMazdak Farrokhzad-3/+3
2020-03-26Rollup merge of #69866 - estebank:guess_head_span, r=eddybMazdak Farrokhzad-14/+13
Rename `def_span` to `guess_head_span` r? @eddyb
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-14/+13
2020-03-25Rollup merge of #70319 - lcnr:issue63695, r=eddybDylan DPC-0/+2
correctly normalize constants closes #70317 implements https://github.com/rust-lang/rust/issues/70125#issuecomment-602133708 r? eddyb cc @varkor
2020-03-24Remove attribute `#[structural_match]` and any references to itVadim Petrochenkov-5/+5
2020-03-24Rollup merge of #70213 - eddyb:stalled-on-ty-or-const, r=nikomatsakisMazdak Farrokhzad-27/+27
traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet). This PR addresses the representation side of #70180, but only *actually collects* `ty::Infer`s via `Ty::walk` into `stalled_on` (collecting `ty::ConstKind::Infer`s requires #70164). However, it should be enough to handle #70107's needs (WF obligations are stalled only on the outermost type/const being an inference variable, no `walk`-ing is involved). This is my second attempt, see #70181 for the previous one, which unacceptably regressed perf. r? @nikomatsakis cc @nnethercote
2020-03-24rustc_hir: nix rustc_errors depMazdak Farrokhzad-24/+24
2020-03-23add missing const super foldsBastian Kauschke-0/+2
2020-03-23Rollup merge of #69968 - eddyb:tupled-closure-captures, r=nikomatsakisMazdak Farrokhzad-39/+25
rustc: keep upvars tupled in {Closure,Generator}Substs. Previously, each closure/generator capture's (aka "upvar") type was tracked as one "synthetic" type parameter in the closure/generator substs, and figuring out where the parent `fn`'s generics end and the synthetics start involved slicing at `tcx.generics_of(def_id).parent_count`. Needing to query `generics_of` limited @davidtwco (who wants to compute some `TypeFlags` differently for parent generics vs upvars, and `TyCtxt` is not available there), which is how I got started on this, but it's also possible that the `generics_of` queries are slowing down `{Closure,Generator}Substs` methods. To give an example, for a `foo::<T, U>::{closure#0}` with captures `x: X` and `y: Y`, substs are: * before this PR: `[T, U, /*kind*/, /*signature*/, X, Y]` * after this PR: `[T, U, /*kind*/, /*signature*/, (X, Y)]` You can see that, with this PR, no matter how many captures, the last 3 entries in the substs (or 5 for a generator) are always the "synthetic" ones, with the last one being the tuple of capture types. r? @nikomatsakis cc @Zoxc
2020-03-23Rollup merge of #69942 - estebank:sized-verbose-sugg, r=matthewjasperMazdak Farrokhzad-17/+18
Increase verbosity when suggesting subtle code changes Do not suggest changes that are actually quite small inline, to minimize the likelihood of confusion. Fix #69243.
2020-03-23Rollup merge of #70269 - matthiaskrgr:clippy_closures, r=Dylan-DPCMazdak Farrokhzad-9/+5
remove redundant closures (clippy::redundant_closure)
2020-03-22Increase verbosity when suggesting subtle code changesEsteban Küber-17/+18
2020-03-22Rollup merge of #70229 - matthiaskrgr:cl3ppy, r=Mark-SimulacrumDylan DPC-1/+1
more clippy fixes * remove unused unit values (clippy::unused_unit) * make some let-if-bindings more idiomatic (clippy::useless_let_if_seq) * clarify when we pass () to functions (clippy::unit_arg) * don't redundantly repeat field names (clippy::redundant_field_names) * remove redundant returns (clippy::needless_return) * use let instead of match for matches with single bindings (clippy::match_single_binding) * don't convert results to options just for matching (clippy::if_let_some_result)
2020-03-22remove redundant closures (clippy::redundant_closure)Matthias Krüger-9/+5
2020-03-21don't redundantly repeat field names (clippy::redundant_field_names)Matthias Krüger-1/+1
2020-03-21rustc: keep upvars tupled in {Closure,Generator}Substs.Eduard-Mihai Burtescu-39/+25
2020-03-21Rollup merge of #70119 - eddyb:typeck-tables-local-def-id, r=petrochenkovDylan DPC-3/+3
rustc: use LocalDefId instead of DefId in TypeckTables. The logic in `TypeckTables`' implementation of `HashStable`, which created `DefId`s by combining a `CrateNum` from a `DefId` and a `DefIndex` from a `LocalDefId`, bothered me a bit. I don't know how much this matters, but it works so might as well submit it.
2020-03-21traits/fulfill: add a couple FIXME comments about potential optimizations.Eduard-Mihai Burtescu-0/+5
2020-03-21traits/fulfill: allow `stalled_on` to track `ty::Const::Infer(_)` (unused yet).Eduard-Mihai Burtescu-27/+22
2020-03-21infer: export methods on `InferCtxt` instead of `ShallowResolver`.Eduard-Mihai Burtescu-3/+3
2020-03-21Rollup merge of #70089 - eddyb:closure-sig-infer, r=nikomatsakisMazdak Farrokhzad-7/+5
rustc_infer: remove InferCtxt::closure_sig as the FnSig is always shallowly known. That is, `ClosureSubsts` is always created (in `rustc_typeck::check::closure`) with a `FnSig`, as the number of inputs is known, even if they might all have inference types. The only useful thing `InferCtxt::closure_sig` was doing is resolving an inference variable used just to get the `ty::FnPtr` containing that `FnSig` into `ClosureSubsts`. The ideal way to solve this would be to add a constructor for `ClosureSubsts`, that combines the parent `Substs`, the closure kind, the signature, and capture types together, but for now I've went with resolving the inference types just after unifying them with the real types. r? @nikomatsakis
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-20/+16
2020-03-19rustc: use LocalDefId instead of DefId in TypeckTables.Eduard-Mihai Burtescu-3/+3
2020-03-19rustc: use LocalDefId instead of DefIndex in HirId.Eduard-Mihai Burtescu-2/+2
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-2/+2
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
2020-03-18rustc_infer: remove InferCtxt::closure_sig as the FnSig is always shallowly ↵Eduard-Mihai Burtescu-7/+5
known.