Maybe Waffle
09485eaae1
rustc_hir_analysis
: remove ref
patterns
2023-01-17 07:48:19 +00:00
Maybe Waffle
d60e772e14
rustc_hir_analysis
: some general code improvements
2023-01-17 07:48:19 +00:00
Maybe Waffle
360e978437
Don't call closures immediately, use try{}
blocks
2023-01-17 07:48:19 +00:00
Matthias Krüger
6b49435480
Rollup merge of #106829 - compiler-errors:more-alias-combine, r=spastorino
...
Unify `Opaque`/`Projection` handling in region outlives code
They share basically identical paths in most places which are even easier to unify now that they're both `ty::Alias`
r? types
2023-01-17 05:25:22 +01:00
Michael Goulet
90df86f474
Remove bound_{explicit,}_item_bounds
2023-01-15 15:36:06 +00:00
Michael Goulet
9b28edb6d7
Make InstantiatedPredicates impl IntoIterator
2023-01-15 15:36:06 +00:00
Michael Goulet
91fd862df0
instantiate_own doesn't need to return a pair of vectors
2023-01-15 15:29:53 +00:00
Matthias Krüger
d7fcd01f67
Rollup merge of #106072 - eopb:dyn-derive, r=estebank
...
fix: misleading "add dyn keyword before derive macro" suggestion
Fixes #106071
2023-01-15 01:01:36 +01:00
Ethan Brierley
1caec6fa1d
fix: misleading add dyn
to derive macro suggestion
2023-01-14 12:14:06 +00:00
Kyle Matsuda
6e969ea85e
fix various subst_identity vs skip_binder
2023-01-14 00:30:03 -07: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
Kyle Matsuda
be130b57d4
change usages of impl_trait_ref to bound_impl_trait_ref
2023-01-14 00:23:32 -07:00
Kyle Matsuda
ef58baf8b8
change const_param_default query to return EarlyBinder; remove bound_const_param_default query; add EarlyBinder to const_param_default in metadata
2023-01-14 00:13:07 -07:00
Kyle Matsuda
bd6c63597b
change usages of const_param_default query to bound_const_param_default
2023-01-14 00:13:07 -07:00
Michael Goulet
1ea6862db3
Unify Opaque/Projection handling in region outlives code
2023-01-13 23:53:28 +00:00
Matthias Krüger
c6e3a47843
Rollup merge of #106585 - estebank:issue-46585, r=compiler-errors
...
When suggesting writing a fully qualified path probe for appropriate types
Address the more common part of #46585 .
2023-01-13 19:16:42 +01:00
Matthias Krüger
1dc43b2e8b
Rollup merge of #106465 - compiler-errors:bump-IMPLIED_BOUNDS_ENTAILMENT, r=lcnr
...
Bump `IMPLIED_BOUNDS_ENTAILMENT` to Deny + ReportNow
https://github.com/rust-lang/rust/pull/105575#issuecomment-1357201969
> and then later in the same cycle increase the lint to `deny` and change it to `FutureCompatReportNow` in this nightly cycle.
r? ```@lcnr``` when they're back from holiday 😄
2023-01-13 19:16:41 +01:00
Yuki Okushi
5adc7a5e37
Rollup merge of #106785 - compiler-errors:better-impl-wf-spans, r=estebank
...
Make blame spans better for impl wfcheck
r? types
2023-01-13 16:54:24 +09:00
Michael Goulet
eaa7cc84d3
Add logic to make IMPLIED_BOUNDS_ENTAILMENT easier to understand
2023-01-13 00:39:54 +00:00
Michael Goulet
5924c2511e
Only point at impl self ty in WF if trait predicate shares self ty
2023-01-12 22:25:30 +00:00
Yuki Okushi
bbb2a22ced
Rollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot
...
Revert "Make nested RPITIT inherit the parent opaque's generics."
This reverts commit e2d41f4c97
, and adjusts the `tests/ui/async-await/in-trait/nested-rpit.rs` test.
r? `@cjgillot`
fixes #106332 , manually verified because it had no minimization :/
reopens #105197
cc #106729
2023-01-13 05:47:24 +09:00
Michael Goulet
2aabb0fd5d
Point at impl self type for impl wf obligations
2023-01-12 20:44:47 +00:00
Michael Goulet
d76e168f01
Point at HIR types when impl trait ref doesn't normalize
2023-01-12 20:44:47 +00:00
Michael Goulet
9ec36f5668
Rollup merge of #106739 - WaffleLapkin:astconv, r=estebank
...
Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`
This removes the need for <>><><><<>> dances and makes the code a bit nicer.
Not sure if `astconv` is the best name though, maybe someone has a better idea?
2023-01-11 22:25:50 -08:00
Michael Goulet
0a2b55d4c8
Revert "Make nested RPITIT inherit the parent opaque's generics." and adjust test
...
This reverts commit e2d41f4c97
.
2023-01-12 06:07:53 +00:00
Esteban Küber
c6f322bf30
review comments: account for generics
2023-01-11 21:30:32 +00:00
Esteban Küber
147c9bf4d5
review comments
2023-01-11 21:30:10 +00:00
Esteban Küber
12ddf77811
When suggesting writing a fully qualified path probe for appropriate types
...
Fix #46585 .
2023-01-11 21:30:10 +00:00
Michael Goulet
c8334ce60c
Move autoderef to rustc_hir_analysis
2023-01-11 20:12:57 +00:00
Maybe Waffle
d642781708
Make selfless dyn AstConv
methods into toplevel functions
2023-01-11 19:07:03 +00:00
Maybe Waffle
89f1555824
Add AstConv::astconv
method to remove <dyn AstConv>::
calls
2023-01-11 18:58:44 +00:00
Albert Larsan
40ba0e84d5
Change src/test
to tests
in source files, fix tidy and tests
2023-01-11 09:32:13 +00:00
Yuki Okushi
e5e116dca9
Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obk
...
No need to take opaques in `check_type_bounds`
`InferCtxt` already has its defining use anchor set to err
r? ``@oli-obk``
2023-01-10 08:05:34 +09:00
bors
3020239de9
Auto merge of #106637 - fee1-dead-contrib:rollup-ticvmsd, r=fee1-dead
...
Rollup of 10 pull requests
Successful merges:
- #105292 (Change a commit_if_ok call to probe)
- #105655 (Remove invalid case for mutable borrow suggestion)
- #106047 (Fix ui constant tests for big-endian platforms)
- #106061 (Enable Shadow Call Stack for Fuchsia on AArch64)
- #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`)
- #106291 (Fix incorrect suggestion for extra `&` in pattern)
- #106389 (Simplify some canonical type alias names)
- #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`)
- #106549 (Use fmt named parameters in rustc_borrowck)
- #106614 (error-code docs improvements (No. 2))
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-09 18:20:00 +00:00
Michael Goulet
f769d34291
Assert defining anchor is set in take_opaque_types
2023-01-09 18:14:28 +00:00
Michael Goulet
5132e13f13
No need to take opaques in check_type_bounds
2023-01-09 17:27:42 +00:00
fee1-dead
7779386a3a
Rollup merge of #106164 - compiler-errors:check-region-tweak, r=oli-obk
...
Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`
Makes sense for this function to live with its sibling `resolve_regions_and_report_errors`, around which it's basically just a wrapper.
2023-01-09 23:35:29 +08:00
bors
af58fc8699
Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnr
...
Don't normalize in AstConv
See individual commits.
Fixes #101350
Fixes #54940
2023-01-09 15:29:59 +00:00
bors
c54c8cbac8
Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnr
...
Improve spans of non-WF implied bound types
Fixes #60980
2023-01-09 08:40:08 +00:00
Michael Goulet
6afd16171d
Rollup merge of #106131 - compiler-errors:not-ptrs, r=davidtwco
...
Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible
Fixes #80929
Fixes #67296
2023-01-08 19:57:53 -08:00
Michael Goulet
0bddce5090
Normalize assumed_wf_types after wfchecking is complete, for better spans
2023-01-08 18:50:09 +00:00
Michael Goulet
ca554efaf7
Improve spans of non-WF implied bound types
2023-01-08 18:50:08 +00:00
bors
fa51fc01ca
Auto merge of #106235 - compiler-errors:rework-bounds-collection, r=davidtwco
...
Rework `Bounds` collection
I think it's weird for the `Bounds` struct in astconv to store its predicates *almost* converted into real predicates... so we do this eagerly, instead of lazily.
2023-01-08 14:40:52 +00:00
Michael Goulet
49f849a3d2
Mention signature rather than fn pointers when comparing impl/trait methods
2023-01-08 03:49:24 +00:00
Michael Goulet
3c41003873
Add type flags support for Ty and Const late-bound regions
2023-01-08 03:37:20 +00:00
Ali MJ Al-Nasrawy
34329d6f6c
introduce AstConv::probe_adt
2023-01-07 13:38:38 +03:00
Ali MJ Al-Nasrawy
d227506683
don't normalize in astconv
...
We delay projection normalization to further stages in order to
register user type annotations before normalization in HIR typeck.
There are two consumers of astconv: ItemCtxt and FnCtxt.
The former already expects unnormalized types from astconv, see its
AstConv trait impl.
The latter needs `RawTy` for a cleaner interface.
Unfortunately astconv still needs the normalization machinery in
order to resolve enum variants that have projections in the self type,
e.g. `<<T as Trait>::Assoc>::StructVariant {}`.
This is why `AstConv::normalize_ty_2` is necessary.
2023-01-07 13:38:38 +03:00
bors
d72b7d2d2a
Auto merge of #106283 - JulianKnodt:enum_err, r=cjgillot
...
Add help diag. for `const = Enum` missing braces around `Enum`
Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces.
Thus, add a simple diagnostic that suggests wrapping enum variants in braces.
Fixes #105927
2023-01-07 10:04:39 +00:00
Michael Goulet
eeb76eb593
Rollup merge of #106533 - TaKO8Ki:use-smaller-span-for-missing-lifetime/generic-args, r=compiler-errors
...
Use smaller spans for missing lifetime/generic args
We can remove ident from suggestions.
2023-01-06 21:54:00 -08:00
Takayuki Maeda
804dea9ca6
use smaller spans for missing lifetime/generic args
...
fix rustdoc ui test
2023-01-06 21:55:23 +09:00