about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2021-02-14bumped smallvec depsklensy-1/+1
2021-02-14update messageHenry Boisdequin-5/+5
2021-02-13Remove unnecessary function parameters project.rsMatthew Jasper-21/+9
2021-02-13Make ProjectionTy::trait_ref truncate substs againMatthew Jasper-2/+1
Also make sure that type arguments of associated types are printed in some error messages.
2021-02-13Remove some unnecessary `trait_ref` callsMatthew Jasper-15/+11
2021-02-13Don't go through TraitRef to relate projectionsMatthew Jasper-17/+18
2021-02-13Remove ProjectionTy::from_ref_and_nameMatthew Jasper-6/+4
2021-02-13Use debug log level for developer oriented logsTomasz Miąsko-2/+2
The information logged here is of limited general interest, while at the same times makes it impractical to simply enable logging and share the resulting logs due to the amount of the output produced. Reduce log level from info to debug for developer oriented information. For example, when building cargo, this reduces the amount of logs generated by `RUSTC_LOG=info cargo build` from 265 MB to 79 MB. Continuation of changes from 81350.
2021-02-12Auto merge of #81744 - rylev:overlapping-early-exit2, r=lcnrbors-1/+29
Try fast_reject::simplify_type in coherence before doing full check This is a reattempt at landing #69010 (by `@jonas-schievink).` The change adds a fast path for coherence checking to see if there's no way for types to unify since full coherence checking can be somewhat expensive. This has big effects on code generated by the [`windows`](https://github.com/microsoft/windows-rs) which in some cases spends as much as 20% of compilation time in the `specialization_graph_of` query. In local benchmarks this took a compilation that previously took ~500 seconds down to ~380 seconds. This is surely not going to make a difference on much smaller crates, so the question is whether it will have a negative impact. #69010 was closed because some of the perf suite crates did show small regressions. Additional discussion of this issue is happening [here](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/windows-rs.20perf).
2021-02-12Don't check self type twiceRyan Levick-4/+1
2021-02-12Switch boolean checksRyan Levick-1/+1
2021-02-12Short circuit full corherence check when dealing with types with different ↵Ryan Levick-5/+6
reference mutability
2021-02-12Rollup merge of #81990 - matsujika:suggest-mut-reference, r=estebankYuki Okushi-16/+15
Make suggestion of changing mutability of arguments broader Fix #81421 Previously rustc tries to emit the suggestion of changing mutablity unless `!trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)` and this led to some false negatives to occur.
2021-02-11Auto merge of #81350 - tmiasko:instrument-debug, r=lcnrbors-1/+1
Reduce log level used by tracing instrumentation from info to debug Restore log level to debug to avoid make info log level overly verbose (the uses of instrument attribute modified there, were for the most part a replacement for `debug!`; one use was novel).
2021-02-11Make suggestion of changing mutability of arguments broaderHirochika Matsumoto-16/+15
2021-02-09Rollup merge of #80732 - spastorino:trait-inheritance-self2, r=nikomatsakisDylan DPC-1/+2
Allow Trait inheritance with cycles on associated types take 2 This reverts the revert of #79209 and fixes the ICEs that's occasioned by that PR exposing some problems that are addressed in #80648 and #79811. For easier review I'd say, check only the last commit, the first one is just a revert of the revert of #79209 which was already approved. This also could be considered part or the actual fix of #79560 but I guess for that to be closed and fixed completely we would need to land #80648 and #79811 too. r? `@nikomatsakis` cc `@Aaron1011`
2021-02-06Rollup merge of #81738 - camelid:misc-small-diag-cleanup, r=lcnrJonas Schievink-3/+3
Miscellaneous small diagnostics cleanup
2021-02-05Revert "Auto merge of #79637 - spastorino:revert-trait-inheritance-self, ↵Santiago Pastorino-1/+2
r=Mark-Simulacrum" This reverts commit b4def89d76896eec73b4af33642ba7e5eb53c567, reversing changes made to 7dc1e852d43cb8c9e77dc1e53014f0eb85d2ebfb.
2021-02-05Rollup merge of #80726 - lcnr:unsize-query, r=oli-obkMara Bos-18/+44
relax adt unsizing requirements Changes unsizing of structs in case the last struct field shares generic params with other adt fields which do not change. This change is currently insta stable and changes the language, so it at least requires a lang fcp. I feel like the current state is fairly unintuitive. An example for what's now allowed would be https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6dd331d23f5c9ffc8c978175aae2e967 ```rust struct A<T, U: ?Sized>(T, B<T, U>); // previously ERR // struct A<T, U: ?Sized>(T, B<[u32; 1], U>); // ok struct B<T, U: ?Sized>(T, U); fn main() { let x = A([0; 1], B([0; 1], [0; 1])); let y: &A<[u32; 1], [u32]> = &x; assert_eq!(y.1.1.len(), 1); } ```
2021-02-04remove subst_supertrait callb-naber-3/+1
2021-02-04Try fast_reject::simplify_type in coherence before doing full checkRyan Levick-1/+31
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com> Co-authored-by: Ryan Levick <me@ryanlevick.com>
2021-02-03Miscellaneous small diagnostics cleanupCamelid-3/+3
2021-02-04add `relaxed_struct_unsize` feature gateBastian Kauschke-15/+44
2021-02-04relax adt unsizing requirementsBastian Kauschke-8/+5
2021-02-03added a suggestion to create a `const` item if the `fn` in the array repeat ↵Henry Boisdequin-1/+17
expression is a `const fn`
2021-02-02Rollup merge of #81544 - JulianKnodt:sat_where, r=lcnrJack Huey-13/+17
Add better diagnostic for unbounded Abst. Const ~~In the case where a generic abst. const requires a trivial where bound: `where TypeWithConst<const_fn(N)>: ,`, instead of requiring a where bound, just check that only consts are being substituted in to skip over where check.~~ ~~This is pretty sketchy, but I think it works. Presumably, if there is checking for type bounds added later, it can first check nested requirements, and see if they're satisfied by the current `ParamEnv`.~~ Changed the diagnostic to add a better example, which is more practical than what was previously proposed. r? ```@lcnr```
2021-02-02Add better diagnostic for missing where clausekadmin-13/+17
Previously, it's not clear what exactly should be added in the suggested where clause, so this adds an example to demonstrate.
2021-02-02Auto merge of #80843 - Mark-Simulacrum:fmt-bump, r=petrochenkovbors-6/+9
Bump rustfmt version
2021-02-02Bump rustfmt versionMark Rousskov-6/+9
Also switches on formatting of the mir build module
2021-02-01more things are const evaluatable *sparkles*Ellen-11/+24
2021-02-01Rollup merge of #79291 - JulianKnodt:ce_priv, r=petrochenkovJonas Schievink-1/+1
Add error message for private fn Attempts to add a more detailed error when a `const_evaluatable` fn from another scope is used inside of a scope which cannot access it. r? ````@lcnr````
2021-01-31Add error message for private fnkadmin-1/+1
Bless tests Update with changes from comments
2021-01-31Rollup merge of #80404 - JulianKnodt:arr_ref, r=oli-obkJonas Schievink-14/+1
Remove const_in_array_repeat Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682. I thought there might be some issue with `Repeats(_, 0)`, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.
2021-01-31Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-seJonas Schievink-1/+0
Stabilize by-value `[T; N]` iterator `core::array::IntoIter` Tracking issue: https://github.com/rust-lang/rust/issues/65798 This is unblocked now that `min_const_generics` has been stabilized in https://github.com/rust-lang/rust/pull/79135. This PR does *not* include the corresponding `IntoIterator` impl, which is https://github.com/rust-lang/rust/pull/65819. Instead, an iterator can be constructed through the `new` method. `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
2021-01-30Remove const_in_array_rep_exprkadmin-14/+1
2021-01-28Auto merge of #81055 - matthewjasper:non-fatal-overflow, r=nikomatsakisbors-12/+3
Make hitting the recursion limit in projection non-fatal This change was originally made in #80246 to avoid future (effectively) infinite loop bugs in projections, but wundergraph relies on rustc recovering here. cc #80953 r? `@nikomatsakis`
2021-01-28Rollup merge of #81426 - BoxyUwU:boxychangesv2, r=oli-obkYuki Okushi-4/+22
const_evaluatable: expand abstract consts in try_unify See this [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/combining.20const.20bounds) for more info cc ```@lcnr``` r? ```@oli-obk```
2021-01-27commentsEllen-1/+3
2021-01-27boop, ur abstract consts are now expandedEllen-4/+20
2021-01-27Rollup merge of #81407 - osa1:issue81098, r=estebankYuki Okushi-2/+4
Refine "remove semicolon" suggestion in trait selection Don't suggest it if the last statement doesn't have a semicolon Fixes #81098 See also #54771 for why this suggestion was added
2021-01-26Refine "remove semicolon" suggestion in trait selectionÖmer Sinan Ağacan-2/+4
Don't suggest it if the last statement doesn't have a semicolon Fixes #81098 See also #54771 for why this suggestion was added
2021-01-24Account for generics when suggesting boundEsteban Küber-12/+23
Fix #81175.
2021-01-24Reduce log level used by tracing instrumentation from info to debugTomasz Miąsko-1/+1
2021-01-18Add suggestion for impl_candidates with E0283Daiki Ihara-5/+13
Update compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2021-01-17Auto merge of #80679 - jackh726:predicate-kind-take2, r=lcnrbors-146/+148
Remove PredicateKind and instead only use Binder<PredicateAtom> Originally brought up in https://github.com/rust-lang/rust/pull/76814#discussion_r546858171 r? `@lcnr`
2021-01-17Rollup merge of #80635 - sexxi-goose:use-place-instead-of-symbol, ↵Mara Bos-4/+4
r=nikomatsakis` Improve diagnostics when closure doesn't meet trait bound Improves the diagnostics when closure doesn't meet trait bound by modifying `TypeckResuts::closure_kind_origins` such that `hir::Place` is used instead of `Symbol`. Using `hir::Place` to describe which capture influenced the decision of selecting a trait a closure satisfies to (Fn/FnMut/FnOnce, Copy) allows us to show precise path in the diagnostics when `capture_disjoint_field` feature is enabled. Closes rust-lang/project-rfc-2229/issues/21 r? ```@nikomatsakis```
2021-01-16Review changesJack Huey-150/+150
2021-01-16CleanupJack Huey-1/+1
2021-01-16Remove PredicateKindJack Huey-1/+1
2021-01-16Intermediate formatting and suchJack Huey-40/+40