Matthias Krüger
3d7677d91a
Rollup merge of #106970 - kylematsuda:earlybinder-item-bounds, r=lcnr
...
Switch to `EarlyBinder` for `item_bounds` query
Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78 ).
Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `item_bounds` query and removes `bound_item_bounds`.
r? `@lcnr`
2023-01-17 20:21:28 +01:00
Matthias Krüger
68f12338af
Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726
...
Remove double spaces after dots in comments
Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17 20:21:25 +01:00
Kyle Matsuda
fc942eed7f
change item_bounds query to return EarlyBinder; remove bound_item_bounds query
2023-01-17 08:55:28 -07:00
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +00:00
Michael Goulet
90df86f474
Remove bound_{explicit,}_item_bounds
2023-01-15 15:36:06 +00:00
Kyle Matsuda
f29a334c90
change impl_trait_ref query to return EarlyBinder; remove bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14 00:29:56 -07:00
bors
279f1c9d8c
Auto merge of #106004 - fee1-dead-contrib:const-closures, r=oli-obk
...
Const closures
cc https://github.com/rust-lang/rust/issues/106003
2023-01-13 05:04:48 +00:00
Deadbeef
6e63f7be54
attempt to make a minimal example work
2023-01-12 02:28:37 +00:00
Michael Goulet
83fbc71d02
Filter impl and where-clause candidates that reference errors
2023-01-11 20:03:29 +00:00
Michael Goulet
3c41003873
Add type flags support for Ty and Const late-bound regions
2023-01-08 03:37:20 +00:00
Deadbeef
983606d367
Allow trait method paths to satisfy const Fn bounds
2022-12-28 09:06:31 +00:00
lcnr
a213bb36c9
implement the skeleton of the updated trait solver
2022-12-19 16:46:17 +00:00
Oli Scherer
a5cd3bde95
Ensure no one constructs AliasTys themselves
2022-12-14 15:36:39 +00:00
Michael Goulet
96cb18e864
Combine identical alias arms
2022-12-13 17:48:55 +00:00
Michael Goulet
61adaf8187
Combine projection and opaque into alias
2022-12-13 17:48:55 +00:00
Michael Goulet
c13bd83528
squash OpaqueTy and ProjectionTy into AliasTy
2022-12-13 17:40:27 +00:00
Michael Goulet
5c6afb850c
ProjectionTy.item_def_id -> ProjectionTy.def_id
2022-12-13 17:34:44 +00:00
Michael Goulet
7f3af72606
Use ty::OpaqueTy everywhere
2022-12-13 17:29:26 +00:00
Michael Goulet
d2a80c1571
Avoid noting cause code (which is usually misc, b/c codegen) for opaque type reveal overflow
2022-12-06 00:19:55 +00:00
bhbs
715d4a8949
Don't add a note for implementing a trait if its inner type is erroneous
2022-12-03 09:06:47 +09:00
Matthias Krüger
08a6c939a5
Rollup merge of #105066 - lcnr:mv-candidate_from_obligation, r=compiler-errors
...
move `candidate_from_obligation` out of assembly
it doesn't belong there as it also does winnowing
r? `@compiler-errors`
2022-11-29 22:43:22 +01:00
lcnr
bb982df771
move candidate_from_obligation out of assembly
...
it doesn't belong there as it also does winnowing
2022-11-29 20:32:48 +00:00
Michael Goulet
9512446a00
Explain why rematch_impl fails to be infallible
2022-11-29 19:02:40 +00:00
Dylan DPC
9178bc059f
Rollup merge of #104907 - compiler-errors:selcx-infcx, r=oli-obk
...
Remove `SelectionContext::infcx()` in favor of field access
Encapsulation doesn't seem particularly important here, and having two choices is always more confusing than having one.
r? types
2022-11-28 15:42:11 +05:30
Michael Goulet
6436c348db
Remove SelectionContext::infcx() in favor of field access
2022-11-25 23:31:37 +00:00
bors
aff003becd
Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwU
...
Add `ConstKind::Expr`
Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready.
r? `@lcnr`
2022-11-25 22:56:59 +00:00
bors
8681d4cffc
Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgr
...
Rollup of 8 pull requests
Successful merges:
- #104716 (move 2 candidates into builtin candidate)
- #104760 (Clarify `SyntaxExtensionKind::LegacyDerive`.)
- #104797 (rustc_codegen_ssa: write `.dwp` in a streaming fashion)
- #104835 (Use infcx.partially_normalize_associated_types_in)
- #104853 (Fix typo in miri sysroot)
- #104879 (jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath)
- #104887 (rustbuild: Don't build doc::SharedAssets when building JSON docs.)
- #104896 (rustdoc: fix broken tooltip CSS)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-25 19:09:30 +00:00
Matthias Krüger
9c7dc3e30b
Rollup merge of #104716 - lcnr:selection-candidate, r=jackh726
...
move 2 candidates into builtin candidate
having separate candidates for these isn't too helpful i think
r? types
2022-11-25 18:35:39 +01:00
bors
051cab2b84
Auto merge of #104846 - spastorino:santa-clauses-make-goals-early-christmas- 🎄 , r=oli-obk
...
Branch Clause from Predicate
r? `@oli-obk`
This is part of what's proposed in https://github.com/rust-lang/compiler-team/issues/531
2022-11-25 15:59:31 +00:00
lcnr
31431ccda9
move 2 candidates into builtin candidate
2022-11-25 11:59:08 +01:00
Boxy
2ac5d91d63
Make expand_abstract_consts infallible
2022-11-25 09:28:44 +00:00
Boxy
fd271ffe28
also handle it in evaluate
2022-11-25 09:28:43 +00:00
Boxy
d75cd5c051
fmt
2022-11-25 09:28:43 +00:00
kadmin
5bb1a9febc
Add expand_abstract_const
...
Adds the ability to directly expand a const to an expr without having to deal with intermediate
steps.
2022-11-25 09:28:43 +00:00
kadmin
f9750c1554
Add empty ConstKind::Abstract
...
Initial pass at expr/abstract const/s
Address comments
Switch to using a list instead of &[ty::Const], rm `AbstractConst`
Remove try_unify_abstract_consts
Update comments
Add edits
Recurse more
More edits
Prevent equating associated consts
Move failing test to ui
Changes this test from incremental to ui, and mark it as failing and a known bug.
Does not cause the compiler to ICE, so should be ok.
2022-11-25 09:28:43 +00:00
Santiago Pastorino
974e2837bb
Introduce PredicateKind::Clause
2022-11-25 00:04:54 -03:00
Michael Goulet
8927135274
Assert that we don't capture escaping bound vars in Fn trait selection
2022-11-24 21:50:04 +00:00
Arpad Borsos
9f36f988ad
Avoid GenFuture shim when compiling async constructs
...
Previously, async constructs would be lowered to "normal" generators,
with an additional `from_generator` / `GenFuture` shim in between to
convert from `Generator` to `Future`.
The compiler will now special-case these generators internally so that
async constructs will *directly* implement `Future` without the need
to go through the `from_generator` / `GenFuture` shim.
The primary motivation for this change was hiding this implementation
detail in stack traces and debuginfo, but it can in theory also help
the optimizer as there is less abstractions to see through.
2022-11-24 10:04:27 +01:00
Manish Goregaokar
53eab246db
Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnr
...
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases
r? ````@lcnr````
fixes #99840
2022-11-22 22:54:38 -05:00
Oli Scherer
7658e0fccf
Stop passing the self-type as a separate argument.
2022-11-21 20:39:46 +00:00
Oli Scherer
9e4c3f41c1
Use iterators instead of slices at more sites
2022-11-21 20:34:28 +00:00
Oli Scherer
ae80c764d4
Add an always-ambiguous predicate to make sure that we don't accidentlally allow trait resolution to prove false things during coherence
2022-11-21 16:35:04 +00:00
Oli Scherer
94fe30ff2f
Treat different opaque types of the same def id as equal during coherence
2022-11-21 16:06:07 +00:00
Matthias Krüger
06707c073d
Rollup merge of #104469 - estebank:long-types, r=oli-obk
...
Make "long type" printing type aware and trim types in E0275
Instead of simple string cutting, use a custom printer to hide parts of long printed types.
On E0275, check for type length before printing.
2022-11-19 15:35:21 +01:00
Esteban Küber
4ed1376490
On E0275 do not print out the full type in the msg
...
When printing requirement overflow errors, do not print out the full
type name when it is longer than 50 characters long.
2022-11-18 08:46:47 -08:00
Boxy
1c48039a87
rename is_tainted_by_errors
2022-11-18 13:25:17 +00:00
Boxy
9c510048fd
InferCtxt::is_tainted_by_errors returns ErrorGuaranteed
2022-11-18 13:25:17 +00:00
Matthias Krüger
ed97f245f1
Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errors
...
Convert predicates into Predicate in the Obligation constructor
instead of having almost all callers do that.
This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2022-11-17 22:33:19 +01:00
Oli Scherer
4f11f3b257
Convert predicates into Predicate in the Obligation constructor
2022-11-16 09:25:19 +00:00
Ralf Jung
1115ec601a
cleanup and dedupe CTFE and Miri error reporting
2022-11-16 10:13:29 +01:00