Michael Goulet
eff2cb7760
Rename some region-specific stuff
2023-02-16 03:39:59 +00:00
Nicholas Nethercote
7a72560154
Reduce direct mk_ty
usage.
...
We use more specific `mk_*` functions in most places, might as well use
them as much as possible.
2023-02-13 09:32:48 +11:00
bors
1623ab0246
Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnr
...
Implement `deferred_projection_equality` for erica solver
Somewhat of a revival of #96912 . When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-11 05:46:24 +00:00
Boxy
23ab2464be
add AliasEq
to PredicateKind
2023-02-10 13:44:46 +00:00
Esteban Küber
3689295a6b
Use ErrorGuaranteed
more in ReError
2023-02-09 10:38:45 +00:00
Esteban Küber
861f451235
Change to ReError(ErrorGuaranteed)
2023-02-09 10:26:49 +00:00
Esteban Küber
30cf7a3f51
Introduce ReError
...
CC #69314
2023-02-09 10:26:49 +00:00
Michael Goulet
0b5941aa11
Make const/fn return params more suggestable
2023-02-03 21:37:41 +00:00
Matthias Krüger
4ac1796267
Rollup merge of #107125 - WaffleLapkin:expect_an_item_in_your_hir_by_the_next_morning, r=Nilstrieb
...
Add and use expect methods to hir.
[The future has come](https://github.com/rust-lang/rust/pull/106090/files#r1070062462 ).
r? `@Nilstrieb`
tbh I'm not even sure if it's worth it
2023-01-30 17:50:08 +01:00
Matthias Krüger
28188d17ba
Rollup merge of #107100 - compiler-errors:issue-107087, r=lcnr
...
Use proper `InferCtxt` when probing for associated types in astconv
Fixes #107087
2023-01-28 05:20:16 +01:00
Kyle Matsuda
c2414dfaa4
change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add EarlyBinder to fn_sig in metadata
2023-01-26 20:28:25 -07:00
Michael Goulet
da3ecb09d8
Use proper InferCtxt when probing for associated types in astconv
2023-01-23 16:53:23 +00:00
Maybe Waffle
70f9d52079
Add and use expect methods to hir.
2023-01-20 17:40:50 +00:00
bors
56ee85274e
Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb
...
Remove some `ref` patterns from the compiler
Previous PR: https://github.com/rust-lang/rust/pull/105368
r? `@Nilstrieb`
2023-01-20 04:52:28 +00:00
Michael Goulet
200f466d1a
Encode whether foreign opaques are TAITs or not
2023-01-19 15:45:49 +00: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
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +00:00
Maybe Waffle
c21b1f742e
Self review suggestions
...
- add back accidentally removed new lines
- try to deref in patterns, rather than in expressions
(maybe this was the reason of perf regression?...)
2023-01-17 07:48:20 +00:00
Maybe Waffle
09485eaae1
rustc_hir_analysis
: remove ref
patterns
2023-01-17 07:48:19 +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
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
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
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
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
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
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
b1b19bd851
get_parent and find_parent
2023-01-04 00:43:13 +00:00
Michael Goulet
a313ef05a7
rename get_parent_node to parent_id
2023-01-04 00:43:13 +00:00
kadmin
077fae94a1
Add note about wrapping in braces
...
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.
2023-01-03 23:26:57 +00:00
Michael Goulet
520b5fac10
Rework hir Bounds collection
2022-12-28 23:40:09 +00:00
Nilstrieb
9067e4417e
Rename Rptr
to Ref
in AST and HIR
...
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already
as well.
2022-12-28 18:52:36 +01:00
KaDiWa
7b371d2ad9
fix some typos
2022-12-25 00:43:50 +01:00
bors
935dc07218
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
...
Address some `EarlyBinder` nits
2022-12-19 19:21:35 +00:00
Matthias Krüger
3af7df91fc
use &str / String literals instead of format!()
2022-12-18 16:17:46 +01:00
Oli Scherer
0ae3da34c3
Remove TraitRef::new
2022-12-14 15:36:39 +00:00
Oli Scherer
fef872a875
Guard AliasTy
creation against passing the wrong number of substs
2022-12-14 15:36:39 +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
5dea1d1c6e
EarlyBinder nits
2022-12-13 04:53:36 +00:00