Scott McMurray
4abb455529
Update ty::VariantDef to use IndexVec<FieldIdx, FieldDef>
...
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`.
There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places.
Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-30 09:23:40 -07:00
bors
cf073ec2cb
Auto merge of #109202 - compiler-errors:new-solver-fast-reject-faster-2, r=lcnr
...
Don't pass `TreatProjections` separately to `fast_reject`
Don't pass `TreatProjections` separately to `fast_reject`, and instead use the original approach of switching on two variants of `TreatParams` (undoes this: https://github.com/rust-lang/rust/pull/108830#pullrequestreview-1330371417 ).
Fixes the regression introduced in https://github.com/rust-lang/rust/pull/108830#issuecomment-1468116419
2023-03-23 23:53:56 +00:00
Michael Goulet
fc0cbe8340
Don't split up TreatProjections and TreatParams anymore
2023-03-23 18:57:02 +00:00
Matthias Krüger
acd7f878ae
Rollup merge of #107718 - Zoxc:z-time, r=nnethercote
...
Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes`
This adds back the `-Z time` option as that is useful for [my rustc benchmark tool](https://github.com/Zoxc/rcb ), reverting https://github.com/rust-lang/rust/pull/102725 . It now uses nanoseconds and bytes as the units so it is renamed to `time-precise`.
2023-03-23 19:55:43 +01:00
bors
9bdb4881c7
Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errors
...
a general type system cleanup
removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR.
also removes some other small - and imo unnecessary - helpers.
r? types
2023-03-22 05:33:18 +00:00
John Kåre Alsaker
b0dc15c61b
Reduce output spam
2023-03-21 18:18:25 +01:00
Michael Goulet
2eb1c08e43
Use local key in providers
2023-03-21 15:38:51 +00:00
lcnr
791ce0b7b5
remove some trait solver helpers
...
they add more complexity then they are worth. It's confusing
which of these helpers should be used in which context.
2023-03-21 09:57:20 +01:00
lcnr
d2b7604db9
always make define_opaque_types explicit
2023-03-15 14:00:15 +01:00
Michael Goulet
84d254ead0
Better names?
2023-03-13 16:34:16 +00:00
Michael Goulet
c32527fb92
Treat projections with infer as placeholder during fast reject in new solver
2023-03-13 16:34:16 +00:00
Michael Goulet
fd34549686
Remove body_def_id from Inherited
2023-03-09 23:25:23 +00:00
Michael Goulet
0f4255ece2
Dedup copy field errors for identical types
2023-03-08 00:00:19 +00:00
Michael Goulet
a439c0293c
may not => cannot
2023-03-08 00:00:18 +00:00
Mu42
2fe288fd29
emit the suspicious_auto_trait_impls for negative impls as well
2023-03-06 20:04:33 +08:00
est31
6df5ae4fb0
Match unmatched backticks in comments in compiler/
2023-03-03 08:39:00 +01:00
bors
0978711950
Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, r=compiler-errors,davidtwco,estebank,oli-obk
...
diagnostics: if AssocFn has self argument, describe as method
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515
This commit also changes the tooltips on rustdoc intra-doc links targeting methods.
For anyone not sure why this is being done, see the Reference definitions of these terms in <https://doc.rust-lang.org/1.67.1/reference/items/associated-items.html#methods >
> Associated functions whose first parameter is named `self` are called methods and may be invoked using the [method call operator](https://doc.rust-lang.org/1.67.1/reference/expressions/method-call-expr.html ), for example, `x.foo()`, as well as the usual function call notation.
In particular, while this means it's technically correct for rustc to refer to a method as an associated function (and there are a few cases where it'll still do so), rustc *must never* use the term "method" to refer to an associated function that does not have a `self` parameter.
2023-02-23 00:19:12 +00:00
Alan Egerton
695072daa6
Remove type-traversal trait aliases
2023-02-22 17:04:58 +00:00
Michael Howell
3d056c3125
diagnostics: if AssocFn has self argument, describe as method
...
Discussed in
https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515
This commit also changes the tooltips on rustdoc intra-doc links
targeting methods.
2023-02-22 08:40:33 -07:00
bors
9aa5c24b7d
Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstrieb
...
Remove `arena_cache` modifier from `associated_item` query & copy `ty::AssocItem` instead of passing by ref
r? `@ghost`
2023-02-17 17:42:51 +00:00
Kyle Matsuda
c183110cc2
remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata
2023-02-16 17:05:56 -07:00
Kyle Matsuda
d822b97a27
change usages of type_of to bound_type_of
2023-02-16 17:01:52 -07:00
Maybe Waffle
a32d392741
Copy ty::AssocItem all other the place
2023-02-15 20:22:41 +00:00
Camille GILLOT
065f0b222d
Move query out of path.
2023-02-14 20:27:38 +00:00
Camille GILLOT
40cb4d1bc7
Even less HIR.
2023-02-14 20:27:38 +00:00
Camille GILLOT
2a51e73ac9
Do not fetch HIR for inherent impls.
2023-02-14 19:55:45 +00:00
Camille GILLOT
03dff82d59
Add of_trait to DefKind::Impl.
2023-02-14 19:55:44 +00:00
Matthias Krüger
5f3d360844
Rollup merge of #107942 - compiler-errors:tighter-inherent-impl-bad-spans, r=Nilstrieb
...
Tighter spans for bad inherent `impl` self types
Self-explanatory
2023-02-13 23:25:12 +01:00
Michael Goulet
e20f6ff1dc
Tighter spans for bad inherent impl types
2023-02-13 18:41:18 +00:00
Alan Egerton
dea342d861
Make visiting traits generic over the Interner
2023-02-13 10:24:49 +00:00
Alan Egerton
ba55a453eb
Alias folding/visiting traits instead of re-export
2023-02-13 10:24:46 +00:00
Edward Shen
af5a37e844
Modify existing bounds if they exist
2023-02-06 11:26:36 -08:00
David Tolnay
4501d3abe1
Autotrait bounds on dyn-safe trait methods
2023-02-03 08:33:40 -08:00
David Tolnay
9e1c600f74
Disallow impl autotrait for trait object
2023-02-03 08:33:40 -08: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
Gary Guo
94e59cb6e2
Rename is_object_safe to check_is_object_safe to hint side effects
2023-01-28 15:07:57 +00:00
Camille GILLOT
1974b6b68d
Introduce GeneratorWitnessMIR.
2023-01-27 18:58:44 +00:00
Vincenzo Palazzo
7d2c1103d7
fix: use LocalDefId instead of HirId in trait res
...
use LocalDefId instead of HirId in trait resolution to simplify
the obligation clause resolution
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-23 11:42:18 +00:00
bors
94a300b9b8
Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
...
Check ADT fields for copy implementations considering regions
Fixes #88901
r? `@ghost`
2023-01-20 21:29:52 +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
Scott McMurray
925dc37313
Stop using BREAK & CONTINUE in compiler
...
Switching them to `Break(())` and `Continue(())` instead.
libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17 23:17:51 -08: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
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
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
Michael Goulet
16cfadbfe8
Suggest lifetime bound in illegal Copy impl
2023-01-13 23:06:29 +00:00