Michael Goulet
be68e9e336
Rollup merge of #112596 - compiler-errors:missing-sig-with-rpitit, r=b-naber
...
Suggest correct signature on missing fn returning RPITIT/AFIT
Add `async` and unpeel the future's output type if the function is async
Fixes #108195
2023-06-19 17:53:34 -07:00
Matthias Krüger
3436069c34
Rollup merge of #112734 - dswij:bounds-predicates-clause, r=compiler-errors
...
Make `Bound::predicates` use `Clause`
Part of #107250
`Bound::predicates` returns an iterator over `Binder<_, Clause>` instead of `Predicate`.
I tried updating `explicit_predicates_of` as well, but it seems that it needs a lot more change than I thought. Will do it in a separate PR instead.
2023-06-18 08:06:43 +02:00
Michael Goulet
4343d36079
Move some bounds computation out of astconv into its own file
2023-06-17 21:27:13 +00:00
Michael Goulet
6594c75449
Move ConstEvaluatable to Clause
2023-06-17 21:27:13 +00:00
Michael Goulet
52d3fc93f2
Move WF goal to clause
2023-06-17 21:20:20 +00:00
dswij
f874345784
Bound::predicates
to return Clause
2023-06-17 17:16:30 +08:00
Oli Scherer
79c2c986a2
Pacify tidy
2023-06-16 19:39:48 +00:00
Oli Scherer
f3b7dd6388
Add AliasKind::Weak
for type aliases.
...
Only use it when the type alias contains an opaque type.
Also does wf-checking on such type aliases.
2023-06-16 19:39:48 +00:00
Oli Scherer
4fdd07fe88
Merge the orphan logic for all alias kinds
2023-06-16 16:16:41 +00:00
bors
6ee4265ca6
Auto merge of #104455 - the8472:dont-drain-on-drop, r=Amanieu
...
Don't drain-on-drop in DrainFilter impls of various collections.
This removes drain-on-drop behavior from various unstable DrainFilter impls (not yet for HashSet/Map) because that behavior [is problematic](https://github.com/rust-lang/rust/issues/43244#issuecomment-641638196 ) (because it can lead to panic-in-drop when user closures panic) and may become forbidden if [this draft RFC passes](https://github.com/rust-lang/rfcs/pull/3288 ).
closes #101122
[ACP](https://github.com/rust-lang/libs-team/issues/136 )
affected tracking issues
* #43244
* #70530
* #59618
Related hashbrown update: https://github.com/rust-lang/hashbrown/pull/374
2023-06-15 00:03:10 +00:00
bors
8c74a5d27c
Auto merge of #112625 - matthiaskrgr:rollup-jcobj3g, r=matthiaskrgr
...
Rollup of 7 pull requests
Successful merges:
- #112584 (loongarch64-none*: Remove environment component from llvm target)
- #112600 (Introduce a `Stable` trait to translate MIR to SMIR)
- #112605 (Improve docs/clean up negative overlap functions)
- #112611 (Error on unconstrained lifetime in RPITIT)
- #112612 (Fix explicit-outlives-requirements lint span)
- #112613 (Fix rustdoc-gui tests on Windows)
- #112620 (Fix small typo)
r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-14 20:20:40 +00:00
Matthias Krüger
c1b4d075a2
Rollup merge of #112506 - compiler-errors:const-infer-ice, r=b-naber
...
Properly check associated consts for infer placeholders
We only reported an error if it was in a "suggestable" position (according to `is_suggestable_infer_ty`) -- this isn't correct for infer tys that can show up in other places in the constant's type, like behind a dyn trait.
fixes #112491
2023-06-14 18:10:30 +02:00
The 8472
18c9a12d13
remove hash_drain_filter feature uses
2023-06-14 09:28:56 +02:00
The 8472
114d5f221c
s/drain_filter/extract_if/ for Vec, Btree{Map,Set} and LinkedList
2023-06-14 09:28:54 +02:00
Michael Goulet
bc78d0cbf1
Error on unconstrained lifetime in RPITIT
2023-06-14 05:20:31 +00:00
Michael Goulet
dbee24d949
Suggest correct signature on missing fn returning RPITIT/AFIT
2023-06-13 20:41:15 +00:00
Matthias Krüger
b7706e891d
Rollup merge of #111885 - compiler-errors:rust-call-abi-sized, r=eholk
...
Don't ICE on unsized `extern "rust-call"` call
Conceptually builds on #111864 , but doesn't depend on it.
2023-06-13 07:02:28 +02:00
Michael Goulet
2b40268f8b
properly check associated consts for infer placeholders
2023-06-11 00:27:03 +00:00
León Orell Valerian Liehr
a995255cf5
iat selection: normalize self ty & completely erase bound vars
2023-06-11 00:19:47 +02:00
Matthias Krüger
8747c0ebea
Rollup merge of #109953 - thomcc:thomcc/typeid128, r=WaffleLapkin
...
Use 128 bits for TypeId hash
Preliminary/Draft impl of https://github.com/rust-lang/compiler-team/issues/608
Prior art (probably incomplete list)
- https://github.com/rust-lang/rust/pull/75923
- https://github.com/rust-lang/rust/pull/95845
2023-06-08 12:36:17 +02:00
Dylan DPC
0b002eb906
Rollup merge of #112122 - compiler-errors:next-coherence, r=lcnr
...
Add `-Ztrait-solver=next-coherence`
Flag that conditionally uses the trait solver *only* during coherence, for more testing and/or eventual partial-migration onto the trait solver (in the medium- to long-term).
* This still uses the selection context in some of the coherence methods I think, so it's not "complete". Putting this up for review and/or for further work in-tree.
* I probably need to spend a bit more time making sure that we don't sneakily create any other infcx's during coherence that also need the new solver enabled.
r? `@lcnr`
2023-06-07 18:01:29 +05:30
bors
e94bda3bf1
Auto merge of #111047 - compiler-errors:rtn-no-ty-ct-params, r=spastorino
...
Emit an error when return-type-notation is used with type/const params
These are not intended to be supported initially, even though the compiler supports them internally...
2023-06-07 09:03:33 +00:00
Michael Goulet
b7095f5572
Don't ICE on unsized rust-call abi call
2023-06-06 20:15:49 +00:00
Michael Goulet
3d4da98273
Make TraitEngine::new use the right solver, add compare mode
2023-06-06 18:43:20 +00:00
Michael Goulet
e0acff796a
New trait solver is a property of inference context
2023-06-06 18:43:06 +00:00
lcnr
01aaad3f1f
remove has_error_field
helper method
2023-06-06 09:37:30 +02:00
Matthias Krüger
dcdd867a52
Rollup merge of #112322 - compiler-errors:no-IMPLIED_BOUNDS_ENTAILMENT-if-errs, r=eholk
...
Don't mention `IMPLIED_BOUNDS_ENTAILMENT` if signatures reference error
Fixes #112321
2023-06-05 23:48:00 +02:00
Michael Goulet
0e9e91a95a
Don't mention IMPLIED_BOUNDS_ENTAILMENT if signatures reference error
2023-06-05 21:20:51 +00:00
Michael Goulet
b0eaaca314
Remove redundant InferCtxtExt::fresh_item_substs
2023-06-05 20:05:08 +00:00
Michael Goulet
bbc536d3ac
Emit an error when RTN is used with ty/ct params
2023-06-05 19:52:04 +00:00
Oli Scherer
58972d19e7
Merge method, type and const object safety checks
2023-06-05 16:39:16 +00:00
Oli Scherer
604ffab063
Avoid going through queries if a value of type AssocItem
is already available
2023-06-05 14:22:45 +00:00
Thom Chiovoloni
9e5573a0d2
Use 128 bits for TypeId hash
...
- Switch TypeId to 128 bits
- Hack around the fact that tracing-subscriber dislikes how TypeId is hashed
- Remove lowering of type_id128 from rustc_codegen_llvm
- Remove unnecessary `type_id128` intrinsic (just change return type of `type_id`)
- Only hash the lower 64 bits of the TypeId
- Reword comment
2023-06-04 08:34:48 -07:00
Michael Goulet
e4a6b24245
Rollup merge of #112183 - compiler-errors:new-solver-anon-ct, r=BoxyUwU
...
Normalize anon consts in new solver
We don't do any of that `expand_abstract_consts` stuff so this isn't sufficient to make GCE work, but it does allow, e.g. `[(); 1]: Default`, to solve.
r? `@BoxyUwU`
2023-06-02 16:02:06 -07:00
Michael Goulet
4fbb43e70f
No more TyCtxt::lazy_normalization
2023-06-02 22:07:57 +00:00
Camille GILLOT
ca4d0d4c24
Separate AnonConst from ConstBlock in HIR.
2023-06-02 21:25:18 +00:00
Matthias Krüger
f121f77d8a
Rollup merge of #112165 - fee1-dead-contrib:rn-defualtness, r=compiler-errors
...
Rename `impl_defaultness` to `defaultness`
Since this isn't just about the `impl`.
2023-06-02 18:12:45 +02:00
bors
8ebf04225d
Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errors
...
Rollup of 7 pull requests
Successful merges:
- #111670 (Require that const param tys implement `ConstParamTy`)
- #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…)
- #112030 (Migrate `item_trait_alias` to Askama)
- #112150 (Support 128-bit atomics on all x86_64 Apple targets)
- #112174 (Fix broken link)
- #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.)
- #112193 (Check tuple elements are `Sized` in `offset_of`)
Failed merges:
- #112071 (Group rfcs tests)
r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-02 07:57:21 +00:00
Michael Goulet
847d50453c
Implement custom diagnostic for ConstParamTy
2023-06-01 18:21:42 +00:00
Boxy
bbf41279fa
Require that const param tys implement ConstParamTy
2023-06-01 18:03:59 +00:00
Deadbeef
4f83717cf7
Use translatable diagnostics in rustc_const_eval
2023-06-01 14:45:18 +00:00
Deadbeef
21bc5cded4
Rename impl_defaultness
to defaultness
2023-06-01 06:14:06 +00:00
Dylan DPC
ccf99bd769
Rollup merge of #111980 - compiler-errors:unmapped-substs, r=lcnr
...
Preserve substs in opaques recorded in typeck results
This means that we now prepopulate MIR with opaques with the right substs.
The first commit is a hack that I think we discussed, having to do with `DefiningAnchor::Bubble` basically being equivalent to `DefiningAnchor::Error` in the new solver, so having to use `DefiningAnchor::Bind` instead, lol.
r? `@lcnr`
2023-06-01 11:09:43 +05:30
Michael Goulet
df1c1afdaf
Check that RPITs are compatible with the opaques inferred during HIR typeck too
2023-05-31 17:45:45 +00:00
Nilstrieb
e7fdba84e2
Rollup merge of #112060 - lcnr:early-binder, r=jackh726
...
`EarlyBinder::new` -> `EarlyBinder::bind`
for consistency with `Binder::bind`. it may make sense to also add `EarlyBinder::dummy` in places where we know that no parameters exist, but I left that out of this PR.
r? `@jackh726` `@kylematsuda`
2023-05-30 12:57:40 +02:00
bors
45eec0fe93
Auto merge of #112075 - WaffleLapkin:unmkII, r=lcnr
...
Replace `tcx.mk_re_*` with `Region::new_*`
Second step in implementing https://github.com/rust-lang/compiler-team/issues/616
r? `@lcnr`
2023-05-30 04:26:59 +00:00
Matthias Krüger
880da380f1
Rollup merge of #112057 - MU001999:fix/self-sugg, r=compiler-errors
...
Suggest correct `self_ty`
Fixes #112036
2023-05-29 21:34:18 +02:00
Maybe Waffle
e33e20824f
Rename tcx.mk_re_*
=> Region::new_*
2023-05-29 17:54:53 +00:00
lcnr
08d149ca85
EarlyBinder::new -> EarlyBinder::bind
2023-05-29 13:46:10 +02:00
mu001999
2f65aac667
Determine self_ty
with expected ty
2023-05-29 12:26:27 +08:00