Commit Graph

1239 Commits

Author SHA1 Message Date
Matthias Krüger
0b13deb548
Rollup merge of #113661 - oli-obk:tait_wtf, r=lcnr
Double check that hidden types match the expected hidden type

Fixes https://github.com/rust-lang/rust/issues/113278 specifically, but I left a TODO for where we should also add some hardening.

It feels a bit like papering over the issue, but at least this way we don't get unsoundness, but just surprising errors. Errors will be improved and given spans before this PR lands.

r? `@compiler-errors` `@lcnr`
2023-07-25 23:34:07 +02:00
Matthias Krüger
c64ef5e070 inline format!() args from rustc_codegen_llvm to the end (4)
r? @WaffleLapkin
2023-07-25 23:20:28 +02:00
Oli Scherer
df4bfd9e97 Try explaining where Inner is in the signature better 2023-07-25 13:40:04 +00:00
Oli Scherer
30f787800a Explain RPITs in the way they actually work 2023-07-24 15:34:36 +00:00
Oli Scherer
5b4549dd13 Some documentation nits 2023-07-24 14:20:53 +00:00
Oli Scherer
10d0ff975c Explain what the heck is going on with this lifetime remapping business 2023-07-24 13:48:06 +00:00
Matthias Krüger
b594798ae3 fix clippy::useless_format 2023-07-23 11:14:52 +02:00
Matthias Krüger
00e147543c
Rollup merge of #113950 - cjgillot:clean-resolve, r=jackh726
Remove Scope::Elision from bound-vars resolution.

This scope is a remnant of HIR-based lifetime resolution.

It's only role was to ensure that object lifetime resolution falled back to `'static`. This can be done using `ObjectLifetimeDefault` scope.
2023-07-22 19:57:37 +02:00
Camille GILLOT
b8701ff9d3 Remove Scope::Elision. 2023-07-22 08:32:53 +00:00
Oli Scherer
44e21503a8 Double check that hidden types match the expected hidden type 2023-07-21 13:19:36 +00:00
David Rheinsberg
b0dadff6de error/E0691: include alignment in error message
Include the computed alignment of the violating field when rejecting
transparent types with non-trivially aligned ZSTs.

ZST member fields in transparent types must have an alignment of 1 (to
ensure it does not raise the layout requirements of the transparent
field). The current error message looks like this:

 LL | struct Foobar(u32, [u32; 0]);
    |                    ^^^^^^^^ has alignment larger than 1

This patch changes the report to include the alignment of the violating
field:

 LL | struct Foobar(u32, [u32; 0]);
    |                    ^^^^^^^^ has alignment of 4, which is larger than 1

In case of unknown alignments, it will yield:

 LL | struct Foobar<T>(u32, [T; 0]);
    |                       ^^^^^^ may have alignment larger than 1

This allows developers to get a better grasp why a specific field is
rejected. Knowing the alignment of the violating field makes it easier
to judge where that alignment-requirement originates, and thus hopefully
provide better hints on how to mitigate the problem.

This idea was proposed in 2022 in #98071 as part of a bigger change.
This commit simply extracts this error-message change, to decouple it
from the other diagnostic improvements.
2023-07-21 11:04:16 +02:00
bors
1554942cdc Auto merge of #113546 - cjgillot:unused-query, r=compiler-errors
Querify unused trait check.

This code transitively loads information for all bodies, and from resolutions. As it does not return a value, it should be beneficial to have it as a query.
2023-07-20 18:45:09 +00:00
lcnr
fdaec57a28 XSimplifiedType to SimplifiedType::X 2023-07-20 11:05:52 +02:00
Matthias Krüger
b128750bc4
Rollup merge of #113795 - compiler-errors:doc, r=spastorino
Properly document `lifetime_mapping` in `OpaqueTy`

Also use an `Option` to signify that the value is actually present, instead of just no captured lifetimes.
2023-07-20 07:08:42 +02:00
Michael Goulet
846cc63e38 Make it clearer that edition functions are >=, not == 2023-07-19 16:38:35 +00:00
Michael Goulet
05f6890b3e Rename arg_iter to iter_instantiated 2023-07-17 21:04:12 +00:00
Michael Goulet
603fd426df Properly document lifetime_mapping in OpaqueTy 2023-07-17 14:56:33 +00:00
Camille GILLOT
a4a5e5b4ae Querify unused trait check. 2023-07-16 21:51:00 +00:00
Camille GILLOT
87233da5c2 Check entry type as part of item type checking. 2023-07-15 22:02:16 +00:00
Matthias Krüger
0baf4406da
Rollup merge of #113698 - compiler-errors:rpitit-check, r=spastorino
Make it clearer that we're just checking for an RPITIT

Tiny nit to use `is_impl_trait_in_trait` more, to make it clearer that we're just checking whether a def-id is an RPITIT, rather than doing something meaningful with the `opt_rpitit_info`.

r? `@spastorino`
2023-07-14 19:33:29 +02:00
Michael Goulet
14672eba8b Make it clearer that we're just checking for an RPITIT 2023-07-14 15:18:48 +00:00
Mahdi Dibaiee
e55583c4b8 refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
Michael Woerister
457b787a52 Introduce ExtentUnord trait for collections that can safely consume UnordItems. 2023-07-14 10:10:15 +02:00
bors
7d60819bfd Auto merge of #113519 - SparrowLii:parallel_typeck, r=cjgillot
typeck in parallel

#108118 caused `typeck` to be transferred to the serial part (`check_unused`), which made the performance of parallel rustc significantly reduced.

This pr re-parallelize this part, which increases the average performance improvement of parallel rustc in `full` and `incr-full` scenarios from [14.4%](https://github.com/rust-lang/rust/pull/110284#issuecomment-1545354608) to [23.2%](https://github.com/rust-lang/rust/pull/110284#issuecomment-1624770626).

r? `@cjgillot`
cc `@oli-obk` `@Zoxc`
2023-07-14 03:47:02 +00:00
Mark Rousskov
cc907f80b9 Re-format let-else per rustfmt update 2023-07-12 21:49:27 -04:00
SparrowLii
50896c13db typeck in parallel 2023-07-11 17:52:43 +08:00
Santiago Pastorino
20429af7a3
Replace RPITIT current impl with new strategy that lowers as a GAT 2023-07-08 18:21:34 -03:00
bors
ce519c5945 Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #113413 (Add needs-triage to all new issues)
 - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions)
 - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case)
 - #113441 (miri: check that assignments do not self-overlap)
 - #113453 (Remove unused from_method from rustc_on_unimplemented)
 - #113456 (Avoid calling report_forbidden_specialization for RPITITs)
 - #113466 (Update cargo)
 - #113467 (Fix comment of `fn_can_unwind`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-08 10:46:29 +00:00
Michael Goulet
cf1f8c55d5
Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors
Avoid calling report_forbidden_specialization for RPITITs

Fixes #113438

r? ``@compiler-errors``
2023-07-07 22:12:18 -07:00
Michael Goulet
751dcaceb4
Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, r=spastorino
Remove `variances_of` on RPITIT GATs, remove its one use-case

It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance:

85bf07972a/compiler/rustc_middle/src/ty/relate.rs (L569-L579)

r? ``@spastorino``
2023-07-07 22:12:16 -07:00
bors
d4096e0412 Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errors
Require TAITs to be mentioned in the signatures of functions that register hidden types for them

r? `@lcnr` `@compiler-errors`

This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164).
2023-07-08 03:22:54 +00:00
Michael Goulet
b7191d8388 Don't ICE in resolve_bound_vars when associated return-type bounds are in bad positions 2023-07-07 19:43:23 +00:00
Santiago Pastorino
24326ee508
Avoid calling report_forbidden_specialization for RPITITs 2023-07-07 16:24:08 -03:00
bors
cb80ff132a Auto merge of #113245 - lukas-code:unsizing-sanity-check, r=the8472
sanity check field offsets in unsizeable structs

As promised in https://github.com/rust-lang/rust/pull/112062#issuecomment-1567494994, this PR extends the layout sanity checks to ensure that structs fields don't move around when unsizing and prevent issues like https://github.com/rust-lang/rust/issues/112048 in the future. Like most other layout sanity checks, this only runs on compilers with debug assertions enabled.

Here is how it looks when it fails:
```text
error: internal compiler error: compiler/rustc_ty_utils/src/layout.rs:533:21: unsizing GcNode<std::boxed::Box<i32>> changed field order!
                                Layout { size: Size(32 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: true }, fields: Arbitrary { offsets: [Size(0 bytes), Size(8 bytes), Size(24 bytes)], memory_index: [0, 1, 2] }, largest_niche: Some(Niche { offset: Size(24 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 } }
                                Layout { size: Size(24 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: false }, fields: Arbitrary { offsets: [Size(16 bytes), Size(0 bytes), Size(24 bytes)], memory_index: [1, 0, 2] }, largest_niche: None, variants: Single { index: 0 } }
```

r? `@the8472`
2023-07-07 15:42:29 +00:00
Oli Scherer
4c99872efe Require TAITs to be mentioned in the signatures of functions that register hidden types for them 2023-07-07 13:13:18 +00:00
Michael Goulet
ca8202d429 Remove variances_of on RPITIT gats, remove its one use-case 2023-07-07 02:29:57 +00:00
Santiago Pastorino
07a230b5a5
Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys 2023-07-06 17:07:11 -03:00
Lukas Markeffsky
7aa5f39d3b add helper methods for accessing struct tail 2023-07-06 13:15:05 +00:00
Boxy
12138b8e5e Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
bors
e4cd161006 Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obk
Effects/keyword generics MVP

This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits.

r? `@oli-obk`
2023-07-05 13:42:00 +00:00
Oli Scherer
3219993fa8 Only use a single loop over the associated types 2023-07-05 07:46:05 +00:00
Oli Scherer
243687a37c Prefer retain over hand-rolling an inefficient version of it 2023-07-05 07:46:05 +00:00
Oli Scherer
62fbbac2d9 tidy: move a large function out of an even larger file 2023-07-05 07:46:04 +00:00
Oli Scherer
a49b736568 Lint now-unnecessary associated type bounds 2023-07-05 07:42:53 +00:00
Oli Scherer
ca581f9161 Don't require associated types with Self: Sized bounds in dyn Trait objects 2023-07-05 07:42:53 +00:00
Deadbeef
58c105af04 include host_effect_index in Generics 2023-07-04 17:21:52 +00:00
Boxy
d30f56dbf2 Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
Boxy
ddbc774e74 Replace mk_const with Const::new_x methods 2023-07-04 14:26:33 +01:00
Deadbeef
30b21b758a add test 2023-07-04 11:47:46 +00:00
bors
cd68ead9ec Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnr
Remove chalk support from the compiler

Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly:
* Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk`
* Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation
* Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms)
* Remove the chalk migration mode from compiletest
* Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??)

Fulfills rust-lang/types-team#93.

r? `@jackh726`
2023-07-04 09:09:09 +00:00
bors
0130c3a06e Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorino
Make RPITITs assume/require their parent method's predicates

Removes a FIXME from the `param_env` query where we were manually adding the parent function's predicates to the RPITIT's assumptions.

r? `@spastorino`
2023-07-04 04:24:24 +00:00
Michael Goulet
0c73b41cd6 remove TypeWellFormedFromEnv 2023-07-03 21:40:04 +00:00
Guillaume Gomez
157bab670f
Rollup merge of #113286 - fmease:iat-dont-select-if-not-enabled, r=compiler-errors
Don't perform selection if inherent associated types are not enabled

Fixes #113265.

As discussed
r? `@compiler-errors`
2023-07-03 18:46:14 +02:00
León Orell Valerian Liehr
838f85d6f7
Don't perform selection if IATs are not enabled 2023-07-03 14:33:38 +02:00
lcnr
5378f07d64 use deeply_normalize for assumed_wf_types 2023-07-03 09:12:14 +02:00
Matthias Krüger
ca7e27a71c
Rollup merge of #113182 - compiler-errors:rpit-stricter-captures, r=oli-obk
Error when RPITITs' hidden types capture more lifetimes than their trait definitions

This implements a stricter set of captures rules for RPITITs. They now may only capture:
1. Lifetimes from the impl header (both the self type and any trait substs -- we may want to restrict just to the self type's lifetimes, but the PR makes that easy to do, too)
2. Lifetimes mentioned by the `impl Trait` in the trait method's definition.

Namely, they may not mention lifetimes from the method (early or late) that are not mentioned in the `impl Trait`.

cc #105258 which I think was trying to do this too, though I'm not super familiar with what exactly differs from that or why that one was broken.
cc #112194 (doesn't fix this issue per se, because it's still an open question, but I think this is objectively better than the status quo, and gets us closer to resolving that issue.)

Technically is a fix for the ICE in #108580, but it turns that issue into an error now. We can decide separately whether or not nested RPITITs should capture lifetimes from their parents.

r? ``@oli-obk``
2023-07-01 13:46:01 +02:00
bors
7383ab7378 Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errors
change snapshot tracking in fulfillment contexts

use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-07-01 01:53:10 +00:00
Michael Goulet
a14285ca7e RPITITs inherit method predicates 2023-06-30 20:08:56 +00:00
Michael Goulet
982f025cad use explicit predicates 2023-06-30 18:55:43 +00:00
Matthias Krüger
38e6bba9c1
Rollup merge of #113171 - spastorino:new-rpitit-25, r=compiler-errors
Properly implement variances_of for RPITIT GAT

This fixes some of the issues found by crater run in https://github.com/rust-lang/rust/pull/112988#issuecomment-1610019572

r? ``@compiler-errors``
2023-06-30 08:01:14 +02:00
Matthias Krüger
0b96b25bdf
Rollup merge of #113071 - compiler-errors:no-parent-non-lifetime-args-in-apit, r=eholk
Account for late-bound vars from parent arg-position impl trait

We should be reporting an error like we do for late-bound args coming from a parent APIT.

Fixes #113016
2023-06-30 08:01:13 +02:00
Michael Goulet
473c88dfb6 Flip the order of binder instantiation for better diagnostics 2023-06-30 02:17:07 +00:00
Michael Goulet
d567e4f8b6 Error for RPITIT hidden tys that capture more than their trait defn 2023-06-30 02:17:07 +00:00
Santiago Pastorino
a10406318e
Properly implement variances_of for RPITIT GAT 2023-06-29 23:08:32 -03:00
Santiago Pastorino
4925b57782
Add bidirectional where clauses on RPITIT synthesized GATs 2023-06-29 14:26:26 -03:00
Santiago Pastorino
d70deac161
Intern OpaqueTy on ItemKind::OpaqueTy 2023-06-29 14:05:10 -03:00
Santiago Pastorino
373293c3ca
Extract compute_bidirectional_outlives_predicates fn 2023-06-29 14:04:26 -03:00
lcnr
d04775d739 change snapshot tracking in fulfillment contexts 2023-06-29 10:02:26 +02:00
bors
75726cae37 Auto merge of #112629 - compiler-errors:atb-imply, r=jackh726
Make associated type bounds in supertrait position implied

`trait A: B<Assoc: C> {}` should be able to imply both `Self: B` and `<Self as B>::Assoc: C`. Adjust the way that we collect implied predicates to do so.

Fixes #112573
Fixes #112568
2023-06-28 23:58:28 +00:00
bors
08fd6f719e Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwco
Validate fluent variable references in tests

Closes #101109

Under `cfg(test)`, the `fluent_messages` macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a `#[test]` that checks that each referenced variable exists in the structure it's applied to.
2023-06-28 03:47:02 +00:00
Matthias Krüger
d505582ce2
Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb
Simplify some conditions

r? `@Nilstrieb`

Some things taken out of my `is_none_or` pr.
2023-06-27 22:10:15 +02:00
Michael Goulet
de0e7d32fd pass PredicateFilter to compute_bounds 2023-06-27 18:28:27 +00:00
Michael Goulet
858a861fff Make associated type bounds in supertrait position implied 2023-06-27 18:28:07 +00:00
Maybe Waffle
ef05533c39 Simplify some conditions 2023-06-27 07:40:47 +00:00
Michael Goulet
374173cd99 TypeWellFormedInEnv 2023-06-26 23:12:04 +00:00
Michael Goulet
fbdef58414 Migrate predicates_of and caller_bounds to Clause 2023-06-26 23:12:03 +00:00
Michael Goulet
724f3ff50d migrate lifetime too 2023-06-26 19:14:49 +00:00
Michael Goulet
26cd5486f8 Account for late-bound vars from parent arg-position impl trait 2023-06-26 19:14:27 +00:00
Matthias Krüger
6c7575721f
Rollup merge of #113036 - TaKO8Ki:fix-112094, r=compiler-errors
Accept `ReStatic` for RPITIT

Fixes #112094

Regression in 8216b7f229

If there is a better suggestion, I will go with that.
2023-06-25 22:34:32 +02:00
Takayuki Maeda
83722c62b0 accept ReStatic for RPITIT
add an ui test for #112094
2023-06-26 01:11:44 +09:00
Michael Goulet
bfe6e5c418
Rollup merge of #112983 - spastorino:new-rpitit-23, r=compiler-errors
Fix return type notation associated type suggestion when -Zlower-impl-trait-in-trait-to-assoc-ty

This avoid suggesting the associated types generated for RPITITs when the one the code refers to doesn't exist and rustc looks for a suggestion.

r? `@compiler-errors`
2023-06-23 19:47:22 -07:00
Michael Goulet
4a175523b1
Rollup merge of #112981 - spastorino:new-rpitit-22, r=compiler-errors
Fix return type notation errors with -Zlower-impl-trait-in-trait-to-assoc-ty

This just adjust the way we check for RPITITs and uses the new helper method to do the "old" and "new" check at once.

r? `@compiler-errors`
2023-06-23 19:47:21 -07:00
bors
1d67eba687 Auto merge of #112891 - oli-obk:impl_trait_in_assoc_tys_cleanup, r=compiler-errors
Various impl trait in assoc tys cleanups

r? `@compiler-errors`

All commits except for the last are pure refactorings. 274dab5bd658c97886a8987340bf50ae57900c39 allows struct fields to participate in deciding whether a function has an opaque in its signature.

best reviewed commit by commit
2023-06-23 23:26:38 +00:00
Santiago Pastorino
6d997876c1
Fix associated type suggestion when -Zlower-impl-trait-in-trait-to-assoc-ty 2023-06-23 18:23:52 -03:00
Santiago Pastorino
d77e55bbb9
Fix return type notation errors with -Zlower-impl-trait-in-trait-to-assoc-ty 2023-06-23 17:34:33 -03:00
Michael Goulet
471830b3a4 migrate inferred_outlives_of to Clause 2023-06-22 18:34:24 +00:00
Michael Goulet
2fa796a3c7 Expect clause more 2023-06-22 18:34:24 +00:00
Michael Goulet
46a650f4e0 Migrate item_bounds to ty::Clause 2023-06-22 18:34:23 +00:00
Oli Scherer
c8979e587b Move opaque_type_origin_unchecked onto TyCtxt and re-use it where it was open coded 2023-06-22 14:31:15 +00:00
Guillaume Gomez
5ed75a9628
Rollup merge of #112868 - compiler-errors:liberate-afit-sugg, r=WaffleLapkin
Liberate bound vars properly when suggesting missing async-fn-in-trait

Fixes #112848
2023-06-21 20:00:50 +02:00
Michael Goulet
7563909a28 Liberate bound vars properly when suggesting missing AFIT 2023-06-21 16:32:26 +00:00
Guillaume Gomez
009d72b3ae
Rollup merge of #112853 - GuillaumeGomez:type_alias_type, r=oli-obk
Add `lazy_type_alias` feature gate

Add the `type_alias_type` to be able to have the weak alias used without restrictions.

Part of #112792.

cc `@compiler-errors`
r? `@oli-obk`
2023-06-21 15:45:16 +02:00
Guillaume Gomez
60ec8405eb Add lazy_type_alias feature gate 2023-06-21 13:45:00 +02:00
Nilstrieb
a98c14f3a9
Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnr
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind`

Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`).

1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`.
2. Add a new `Clause` type which is parallel to `Predicate`.
    * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸

The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that...

r? ``@lcnr`` or ``@oli-obk``

[^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-21 07:37:01 +02:00
bors
6fc0273b5a Auto merge of #112320 - compiler-errors:do-not-impl-via-obj, r=lcnr
Add `implement_via_object` to `rustc_deny_explicit_impl` to control object candidate assembly

Some built-in traits are special, since they are used to prove facts about the program that are important for later phases of compilation such as codegen and CTFE. For example, the `Unsize` trait is used to assert to the compiler that we are able to unsize a type into another type. It doesn't have any methods because it doesn't actually *instruct* the compiler how to do this unsizing, but this is later used (alongside an exhaustive match of combinations of unsizeable types) during codegen to generate unsize coercion code.

Due to this, these built-in traits are incompatible with the type erasure provided by object types. For example, the existence of `dyn Unsize<T>` does not mean that the compiler is able to unsize `Box<dyn Unsize<T>>` into `Box<T>`, since `Unsize` is a *witness* to the fact that a type can be unsized, and it doesn't actually encode that unsizing operation in its vtable as mentioned above.

The old trait solver gets around this fact by having complex control flow that never considers object bounds for certain built-in traits:
2f896da247/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs (L61-L132)

However, candidate assembly in the new solver is much more lovely, and I'd hate to add this list of opt-out cases into the new solver. Instead of maintaining this complex and hard-coded control flow, instead we can make this a property of the trait via a built-in attribute. We already have such a build attribute that's applied to every single trait that we care about: `rustc_deny_explicit_impl`. This PR adds `implement_via_object` as a meta-item to that attribute that allows us to opt a trait out of object-bound candidate assembly as well.

r? `@lcnr`
2023-06-20 08:42:37 +00:00
Michael Goulet
ca68cf0d46 Merge attrs, better validation 2023-06-20 04:38:55 +00:00
Michael Goulet
91e5c3f2e5 Make rustc_deny_explicit_impl only local as well 2023-06-20 04:38:46 +00:00
Michael Goulet
657d3f43a9 Add rustc_do_not_implement_via_object 2023-06-20 04:38:46 +00:00
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
Michael Goulet
21226eefb2 Fully fledged Clause type 2023-06-19 15:46:08 +00:00
Michael Goulet
fca56a8d2c s/Clause/ClauseKind 2023-06-19 14:57:42 +00: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
Nicholas Nethercote
781111ef35 Use Cow in {D,Subd}iagnosticMessage.
Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment:
```
// FIXME(davidtwco): can a `Cow<'static, str>` be used here?
```
This commit answers that question in the affirmative. It's not the most
compelling change ever, but it might be worth merging.

This requires changing the `impl<'a> From<&'a str>` impls to `impl
From<&'static str>`, which involves a bunch of knock-on changes that
require/result in call sites being a little more precise about exactly
what kind of string they use to create errors, and not just `&str`. This
will result in fewer unnecessary allocations, though this will not have
any notable perf effects given that these are error paths.

Note that I was lazy within Clippy, using `to_string` in a few places to
preserve the existing string imprecision. I could have used `impl
Into<{D,Subd}iagnosticMessage>` in various places as is done in the
compiler, but that would have required changes to *many* call sites
(mostly changing `&format("...")` to `format!("...")`) which didn't seem
worthwhile.
2023-05-29 09:23:43 +10:00
Kyle Matsuda
c40e9cc7ca Make EarlyBinder's inner value private; and fix all of the resulting errors 2023-05-28 10:44:53 -06:00
Kyle Matsuda
03534ac8b7 Replace EarlyBinder(x) with EarlyBinder::new(x) 2023-05-28 10:44:50 -06:00
Boxy
ad77bc8427 print const and type errors in braces not square brackets 2023-05-26 16:01:29 +01:00
Michael Goulet
3d09b990d7 Wait until type_of to remap HIR opaques back to their defn params 2023-05-26 14:42:52 +00:00
clubby789
220bb61b33 Fix diagnostics with errors 2023-05-26 10:44:18 +00:00
clubby789
f97fddab91 Ensure Fluent messages are in alphabetical order 2023-05-25 23:49:35 +00:00
Michael Goulet
a2d7ffc635 Move DefiningAnchor 2023-05-25 03:21:21 +00:00
bors
7664dfe433 Auto merge of #111925 - Manishearth:rollup-z6z6l2v, r=Manishearth
Rollup of 5 pull requests

Successful merges:

 - #111741 (Use `ObligationCtxt` in custom type ops)
 - #111840 (Expose more information in `get_body_with_borrowck_facts`)
 - #111876 (Roll compiler_builtins to 0.1.92)
 - #111912 (Use `Option::is_some_and` and `Result::is_ok_and` in the compiler  )
 - #111915 (libtest: Improve error when missing `-Zunstable-options`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-25 00:33:43 +00:00
Michael Goulet
d7ccbdd696 Split out opaque from type_of 2023-05-24 17:23:58 +00:00
Maybe Waffle
fb0f74a8c9 Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
Matthias Krüger
224b6511b1
Rollup merge of #111861 - compiler-errors:rtn-in-super, r=jackh726
Don't ICE on return-type notation when promoting trait preds to associated type bounds

Fixes #111846
2023-05-24 06:05:37 +02:00
Dylan DPC
6583025c93
Rollup merge of #111853 - compiler-errors:opaque-check, r=oli-obk
Check opaques for mismatch during writeback

Revive #111705.

I realized that we don't need to put any substs in the writeback results since all of the hidden types have already been remapped. See the comment in `compiler/rustc_middle/src/ty/typeck_results.rs`, which should make that clear for other explorers of the codebase.

Additionally, we need to do some diagnostic stashing because the diagnostics we produce during HIR typeck is very poor and we should prefer the diagnostic that comes from MIR, if we have one.

r? `@oli-obk`
2023-05-23 16:44:28 +05:30
Michael Goulet
e54bc1c5ff Don't ICE on RPITIT when promoting trait preds to associated type bounds 2023-05-23 03:43:09 +00:00
Michael Goulet
0307db4a59 Check opaques for mismatch during writeback 2023-05-22 23:33:34 +00:00
Michael Goulet
4cfafb275e Structurally normalize in the new solver 2023-05-22 21:18:20 +00:00
Dylan DPC
ea6ac450e2
Rollup merge of #111686 - cjgillot:no-foreign-item, r=compiler-errors
Retire is_foreign_item query.

This can be written in terms of `DefKind`. This does not deserve the cost of a query.
2023-05-18 17:37:09 +05:30
Dylan DPC
08efb9d652
Rollup merge of #111633 - nnethercote:avoid-ref-format, r=WaffleLapkin
Avoid `&format("...")` calls in error message code.

Some error message cleanups. Best reviewed one commit at a time.

r? `@davidtwco`
2023-05-18 10:52:35 +05:30
Camille GILLOT
37209dcddd Retire is_foreign_item query. 2023-05-17 15:32:17 +00:00
Dylan DPC
291ced5e9a
Rollup merge of #111588 - MU001999:diag/improve-e0782, r=fee1-dead
Emits E0599 when meeting `MyTrait::missing_method`

Fixes #111312
2023-05-17 19:11:55 +05:30
mu001999
db64512422 Emits E0599 when meeting MyTrait::missing_method 2023-05-17 16:59:39 +08:00
Dylan DPC
e7176dbfd8
Rollup merge of #111648 - Nilstrieb:language-items, r=WaffleLapkin
Remove `LangItems::require`

It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
2023-05-17 11:13:56 +05:30
Matthias Krüger
426dbcdf92
Rollup merge of #111533 - clubby789:drop-tracking-error, r=oli-obk
Handle error body in generator layout

Fixes #111468

I feel like making this query return `Option<GeneratorLayout>` might be better but had some issues with that approach
2023-05-16 20:12:16 +02:00
Nilstrieb
c3efa51947 Remove LangItems::require
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it
gives us a negative diff.
2023-05-16 19:53:38 +02:00
Nicholas Nethercote
01e33a3600 Avoid &format("...") calls in error message code.
Error message all end up passing into a function as an `impl
Into<{D,Subd}iagnosticMessage>`. If an error message is creatd as
`&format("...")` that means we allocate a string (in the `format!`
call), then take a reference, and then clone (allocating again) the
reference to produce the `{D,Subd}iagnosticMessage`, which is silly.

This commit removes the leading `&` from a lot of these cases. This
means the original `String` is moved into the
`{D,Subd}iagnosticMessage`, avoiding the double allocations. This
requires changing some function argument types from `&str` to `String`
(when all arguments are `String`) or `impl
Into<{D,Subd}iagnosticMessage>` (when some arguments are `String` and
some are `&str`).
2023-05-16 17:59:56 +10:00
Matthias Krüger
2f0b456903
Rollup merge of #111578 - Zoxc:query-macro-move, r=cjgillot
Move expansion of query macros in rustc_middle to rustc_middle::query

This moves the expansion of `define_callbacks!` and `define_feedable!` from `rustc_middle::ty::query` to `rustc_middle::query`.

This means that types used in queries are both imported and used in `rustc_middle::query` instead of being split between these modules. It also decouples `rustc_middle::ty::query` further from `rustc_middle` which is helpful since we want to move `rustc_middle::ty::query` to the query system crates.
2023-05-15 17:12:46 +02:00
John Kåre Alsaker
fff20a703d Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
bors
8d18c32b61 Auto merge of #111570 - compiler-errors:ct-err, r=BoxyUwU
Rename const error methods for consistency

renames `ty::Const`'s methods for creating a `ConstKind::Error` to be in the same naming style as `ty::Ty`'s equivalent methods.

r? `@BoxyUwU`
2023-05-15 01:03:29 +00:00
Michael Goulet
8e163f9dce Rename const error methods for consistency 2023-05-14 20:32:51 +00:00
clubby789
f77971e221 Handle error body when in generator layout 2023-05-13 16:45:19 +01:00
Oli Scherer
e2daccc4ac Add a convenience function 2023-05-12 10:25:34 +00:00
Oli Scherer
31ae7c46bd Invert IgnoreRegions to CheckRegions 2023-05-12 10:24:17 +00:00
Oli Scherer
f08b517597 Require impl Trait in associated types to appear in method signatures 2023-05-12 10:24:03 +00:00
Michael Goulet
341d6dfba5
Rollup merge of #106038 - aliemjay:opaque-implied, r=lcnr
use implied bounds when checking opaque types

During opaque type inference, we check for the well-formedness of the hidden type in the opaque type's own environment, not the one of the defining site, which are different in the case of TAIT.

However in the case of associated-type-impl-trait, we don't use implied bounds from the impl header. This caused us to reject the following:
```rust
trait Service<Req> {
    type Output;
    fn call(req: Req) -> Self::Output;
}

impl<'a, Req> Service<&'a Req> for u8 {
    type Output= impl Sized; // we can't prove WF of hidden type  `WF(&'a Req)` although it's implied by the impl
    //~^ ERROR type parameter Req doesn't live long enough
    fn call(req: &'a Req) -> Self::Output {
        req
    }
}
```

although adding an explicit bound would make it pass:
```diff
- impl<'a, Req> Service<&'a Req> for u8 {
+ impl<'a, Req> Service<&'a Req> for u8  where Req: 'a, {
```

I believe it should pass as we already allow the concrete type to be used:
```diff
impl<'a, Req> Service<&'a Req> for u8 {
-    type Output= impl Sized;
+    type Output= &'a Req;
```

Fixes #95922

Builds on #105982

cc ``@lcnr`` (because implied bounds)

r? ``@oli-obk``
2023-05-11 17:43:06 -07:00
Matthias Krüger
363d158cd8
Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot
Various changes to name resolution of anon consts

Sorry this PR is kind of all over the place ^^'

Fixes #111012

- Rewrites anon const nameres to all go through `fn resolve_anon_const` explicitly instead of `visit_anon_const` to ensure that we do not accidentally resolve anon consts as if they are allowed to use generics when they aren't. Also means that we dont have bits of code for resolving anon consts that will get out of sync (i.e. legacy const generics and resolving path consts that were parsed as type arguments)
- Renames two of the `LifetimeRibKind`, `AnonConst -> ConcreteAnonConst` and `ConstGeneric -> ConstParamTy`
- Noticed while doing this that under `generic_const_exprs` all lifetimes currently get resolved to errors without any error being emitted which was causing a bunch of tests to pass without their bugs having been fixed, incidentally fixed that in this PR and marked those tests as `// known-bug:`. I'm fine to break those since `generic_const_exprs` is a very unstable incomplete feature and this PR _does_ make generic_const_exprs "less broken" as a whole, also I can't be assed to figure out what the underlying causes of all of them are. This PR reopens #77357 #83993
- Changed `generics_of` to stop providing generics and predicates to enum variant discriminant anon consts since those are not allowed to use generic parameters
- Updated the error for non 'static lifetime in const arguments and the error for non 'static lifetime in const param tys to use `derive(Diagnostic)`

I have a vague idea why const-arg-in-const-arg.rs, in-closure.rs and simple.rs have started failing which is unfortunate since these were deliberately made to work, I think lifetime resolution being broken just means this regressed at some point and nobody noticed because the tests were not testing anything :( I'm fine breaking these too for the same reason as the tests for #77357 #83993. I couldn't get `// known-bug` to work for these ICEs and just kept getting different stderr between CI and local `--bless` so I just removed them and will create an issue to track re-adding (and fixing) the bugs if this PR lands.

r? `@cjgillot` cc `@compiler-errors`
2023-05-09 20:49:32 +02:00
Dylan DPC
f748bb1402
Rollup merge of #111252 - matthewjasper:min-spec-improvements, r=compiler-errors
Min specialization improvements

- Don't allow specialization impls with no items, such implementations are probably not correct and only occur as mistakes in the compiler and standard library
- Fix a missing normalization call
- Adds spans for lifetime errors from overly general specializations

Closes #79457
Closes #109815
2023-05-09 12:33:46 +05:30
Michael Goulet
29ac429c9b
Rollup merge of #109410 - fmease:iat-alias-kind-inherent, r=compiler-errors
Introduce `AliasKind::Inherent` for inherent associated types

Allows us to check (possibly generic) inherent associated types for well-formedness.
Type inference now also works properly.

Follow-up to #105961. Supersedes #108430.
Fixes #106722.
Fixes #108957.
Fixes #109768.
Fixes #109789.
Fixes #109790.

~Not to be merged before #108860 (`AliasKind::Weak`).~

CC `@jackh726`
r? `@compiler-errors`

`@rustbot` label T-types F-inherent_associated_types
2023-05-08 09:30:21 -07:00
Yuki Okushi
c145d93395
Rollup merge of #111211 - compiler-errors:negative-bounds-super, r=TaKO8Ki
Don't compute trait super bounds unless they're positive

Fixes #111207

The comment is modified to explain the rationale for why we even have this recursive call to supertraits in the first place, which doesn't apply to negative bounds since they don't elaborate at all.
2023-05-08 19:41:49 +09:00
bors
ea0c22ea4f Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, r=Mark-Simulacrum
enable `rust_2018_idioms` lint group for doctests

With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests.

Resolves #106086
Resolves #99144

Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-08 04:50:28 +00:00
bors
0dddad0dc5 Auto merge of #111161 - compiler-errors:rtn-super, r=cjgillot
Support return-type bounds on associated methods from supertraits

Support `T: Trait<method(): Bound>` when `method` comes from a supertrait, aligning it with the behavior of associated type bounds (both equality and trait bounds).

The only wrinkle is that I have to extend `super_predicates_that_define_assoc_type` to look for *all* items, not just `AssocKind::Ty`. This will also be needed to support `feature(associated_const_equality)` as well, which is subtly broken when it comes to supertraits, though this PR does not fix those yet. There's a slight chance there's a perf regression here, in which case I guess I could split it out into a separate query.
2023-05-07 11:18:22 +00:00
Ali MJ Al-Nasrawy
d548747c85 use implied bounds when checking opaque types 2023-05-07 01:41:20 +03:00
ozkanonur
4e7c14fe9f enable rust_2018_idioms for doctests
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-07 00:12:29 +03:00
Matthias Krüger
bcc9aa01b5
Rollup merge of #110577 - compiler-errors:drop-impl-fulfill, r=lcnr
Use fulfillment to check `Drop` impl compatibility

Use an `ObligationCtxt` to ensure that a `Drop` impl does not have stricter requirements than the ADT that it's implemented for, rather than using a `SimpleEqRelation` to (more or less) syntactically equate predicates on an ADT with predicates on an impl.

r? types

### Some background

The old code reads:

```rust
// An earlier version of this code attempted to do this checking
// via the traits::fulfill machinery. However, it ran into trouble
// since the fulfill machinery merely turns outlives-predicates
// 'a:'b and T:'b into region inference constraints. It is simpler
// just to look for all the predicates directly.
```

I'm not sure what this means, but perhaps in the 8 years since that this comment was written (cc #23638) it's gotten easier to process region constraints after doing fulfillment? I don't know how this logic differs from anything we do in the `compare_impl_item` module. Ironically, later on it says:

```rust
// However, it may be more efficient in the future to batch
// the analysis together via the fulfill (see comment above regarding
// the usage of the fulfill machinery), rather than the
// repeated `.iter().any(..)` calls.
```

Also:
* Removes `SimpleEqRelation` which was far too syntactical in its relation.
* Fixes #110557
2023-05-06 13:30:03 +02:00
Matthew Jasper
f46eabb9e5 Report nicer lifetime errors for specialization
Add an obligation cause for these error so that the error points to the
implementations that caused the error.
2023-05-05 22:19:56 +01:00
Boxy
442617c046 misc nameres changes for anon consts 2023-05-05 21:31:35 +01:00
Matthew Jasper
bd928a0b5e Disallow (min) specialization imps with no items
Such implementations are usually mistakes and are not used in the
compiler or standard library (after this commit) so forbid them with
`min_specialization`.
2023-05-05 16:19:18 +01:00
Takayuki Maeda
0a64dac604 remove unnecessary attribute from a diagnostic 2023-05-05 17:28:52 +09:00
Michael Goulet
964fb67a5f Use fulfillment to check Drop impl compatibility 2023-05-04 18:05:58 +00:00
Michael Goulet
930eece9d3 Don't compute trait super bounds unless they're positive 2023-05-04 17:24:13 +00:00
León Orell Valerian Liehr
e8139dfd5a
IAT: Introduce AliasKind::Inherent 2023-05-04 16:59:10 +02:00
bors
eac35583d2 Auto merge of #111174 - matthiaskrgr:rollup-ncnqivh, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #110859 (Explicitly reject negative and reservation drop impls)
 - #111020 (Validate resolution for SelfCtor too.)
 - #111024 (Use the full Fingerprint when stringifying Svh)
 - #111027 (Remove `allow(rustc::potential_query_instability)` for `builtin_macros`)
 - #111039 (Encode def span for foreign return-position `impl Trait` in trait)
 - #111070 (Don't suffix `RibKind` variants)
 - #111094 (Add needs-unwind annotations to tests that need stack unwinding)
 - #111103 (correctly recurse when expanding anon consts)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-05-04 13:44:38 +00:00
Matthias Krüger
6fca1a9259
Rollup merge of #110859 - compiler-errors:no-negative-drop-impls, r=oli-obk
Explicitly reject negative and reservation drop impls

Fixes #110858

It doesn't really make sense for a type to have a `!Drop` impl. Or at least, I don't want us to implicitly assign a meaning to it by the way the compiler *currently* handles it (incompletely), and rather I would like to see a PR (or an RFC...) assign a meaning to `!Drop` if we actually wanted one for it.
2023-05-04 08:09:03 +02:00
bors
6f8c0557e0 Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnr
Replace `tcx.mk_trait_ref` with `TraitRef::new`

First step in implementing https://github.com/rust-lang/compiler-team/issues/616
r? `@lcnr`
2023-05-04 05:54:09 +00:00
Michael Goulet
76802e31a1 Error message for ambiguous RTN from super bounds 2023-05-03 21:09:50 +00:00
Michael Goulet
fef2f5b815 Rename things to reflect that they're not item specific 2023-05-03 20:13:32 +00:00
Michael Goulet
20a83144b2 Support RTN on associated methods from supertraits 2023-05-03 19:41:15 +00:00
Dylan DPC
80df4ab403
Rollup merge of #110791 - compiler-errors:negative-bounds, r=oli-obk
Implement negative bounds for internal testing purposes

Implements partial support the `!` negative polarity on trait bounds. This is incomplete, but should allow us to at least be able to play with the feature.

Not even gonna consider them as a public-facing feature, but I'm implementing them because would've been nice to have in UI tests, for example in #110671.
2023-05-04 00:17:23 +05:30
Nicholas Nethercote
6b62f37402 Restrict From<S> for {D,Subd}iagnosticMessage.
Currently a `{D,Subd}iagnosticMessage` can be created from any type that
impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static,
str>`, which are reasonable. It also includes `&String`, which is pretty
weird, and results in many places making unnecessary allocations for
patterns like this:
```
self.fatal(&format!(...))
```
This creates a string with `format!`, takes a reference, passes the
reference to `fatal`, which does an `into()`, which clones the
reference, doing a second allocation. Two allocations for a single
string, bleh.

This commit changes the `From` impls so that you can only create a
`{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static,
str>`. This requires changing all the places that currently create one
from a `&String`. Most of these are of the `&format!(...)` form
described above; each one removes an unnecessary static `&`, plus an
allocation when executed. There are also a few places where the existing
use of `&String` was more reasonable; these now just use `clone()` at
the call site.

As well as making the code nicer and more efficient, this is a step
towards possibly using `Cow<'static, str>` in
`{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing
the `From<&'a str>` impls to `From<&'static str>`, which is doable, but
I'm not yet sure if it's worthwhile.
2023-05-03 08:44:39 +10:00
Michael Goulet
03469c3f2e Make negative trait bounds work with the old trait solver 2023-05-02 22:36:25 +00:00
Michael Goulet
86f50b9f5c Disallow associated type constraints on negative bounds 2023-05-02 22:36:24 +00:00
Michael Goulet
6e01e910cb Implement negative bounds 2023-05-02 22:36:24 +00:00
Dylan DPC
be4f9f5bec
Rollup merge of #110512 - compiler-errors:fix-elaboration-with-associated-type-bounds, r=spastorino
Fix elaboration with associated type bounds

When computing a trait's supertrait predicates, do not add any associated type *trait* bounds to that list of supertrait predicates. This is because supertrait predicates are expected to have the same `Self` type as the trait.

For example, given:

```rust
trait Foo: Bar<Assoc: Send>
```

Before, we would compute that the supertrait predicates of `T: Foo` are `T: Bar` and `<T as Bar>::Assoc: Send`. However, the last bound is a trait predicate for a totally different type than `T`, and existing code that uses supertrait bounds such as vtable construction, closure fn signature deduction, etc. all rely on the invariant that we have a list of predicates for self type `T`.

Fixes #76593

The reason for all the extra diagnostic noise is that we're recomputing predicates with a different filter now. These diagnostics should be deduplicated for any end-user though.

---

This does bring up an interesting question -- is the predicate `<T as Bar>::Assoc: Send` an implied bound of `T: Foo`? Because currently the only bounds implied by a (non-alias) trait are its supertraits. I guess I could fix this too, but it would require even more changes, and I'm inclined to punt this question along.
2023-05-02 11:44:51 +05:30
Dylan DPC
b727132e23
Rollup merge of #108161 - WaffleLapkin:const_param_ty, r=BoxyUwU
Add `ConstParamTy` trait

This is a bit sketch, but idk.
r? `@BoxyUwU`

Yet to be done:
- [x] ~~Figure out if it's okay to implement `StructuralEq` for primitives / possibly remove their special casing~~ (it should be okay, but maybe not in this PR...)
- [ ] Maybe refactor the code a little bit
- [x] Use a macro to make impls a bit nicer

Future work:
- [ ] Actually™ use the trait when checking if a `const` generic type is allowed
- [ ] _Really_ refactor the surrounding code
- [ ] Refactor `marker.rs` into multiple modules for each "theme" of markers
2023-05-02 11:44:50 +05:30
Michael Goulet
bec7193072 Don't use implied trait predicates in gather_explicit_predicates_of 2023-05-01 15:45:28 +00:00
Michael Goulet
8ea71f264e Do not consider associated type bounds for super_predicates_that_define_assoc_type 2023-05-01 15:45:28 +00:00
Michael Goulet
0bcfff48a5 Simplify type_parameter_bounds_in_generics 2023-05-01 15:45:28 +00:00
Scott McMurray
5292d48b85 Codegen fewer instructions in mem::replace 2023-04-30 22:33:04 -07:00
Lukas Markeffsky
fc63926e18 remove unused muts 2023-04-28 20:19:48 +02:00
bors
43a78029b4 Auto merge of #110837 - scottmcm:offset-for-add, r=compiler-errors
Use MIR's `Offset` for pointer `add` too

~~Status: draft while waiting for #110822 to land, since this is built atop that.~~
~~r? `@ghost~~`

Canonical Rust code has mostly moved to `add`/`sub` on pointers, which take `usize`, instead of `offset` which takes `isize`.  (And, relatedly, when `sub_ptr` was added it turned out it replaced every single in-tree use of `offset_from`, because `usize` is just so much more useful than `isize` in Rust.)

Unfortunately, `intrinsics::offset` could only accept `*const` and `isize`, so there's a *huge* amount of type conversions back and forth being done.  They're identity conversions in the backend, but still end up producing quite a lot of unhelpful MIR.

This PR changes `intrinsics::offset` to accept `*const` *and* `*mut` along with `isize` *and* `usize`.  Conveniently, the backends and CTFE already handle this, since MIR's `BinOp::Offset` [already supports all four combinations](adaac6b166/compiler/rustc_const_eval/src/transform/validate.rs (L523-L528)).

To demonstrate the difference, I added some `mir-opt/pre-codegen/` tests around slice indexing.  Here's the difference to `[T]::get_mut`, since it uses `<*mut _>::add` internally:
```diff
`@@` -79,30 +70,21 `@@` fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
         StorageLive(_12);                // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
         StorageLive(_9);                 // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
         _9 = _8 as *mut u32 (PtrToPtr);  // scope 11 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        StorageLive(_13);                // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        _13 = _2 as isize (IntToInt);    // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        StorageLive(_14);                // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        StorageLive(_15);                // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        _15 = _9 as *const u32 (Pointer(MutToConstPointer)); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        _14 = Offset(move _15, _13);     // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        StorageDead(_15);                // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        _7 = move _14 as *mut u32 (PtrToPtr); // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        StorageDead(_14);                // scope 15 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
-        StorageDead(_13);                // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
+        _7 = Offset(_9, _2);             // scope 13 at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL
         StorageDead(_9);                 // scope 6 at $SRC_DIR/core/src/slice/index.rs:LL:COL
         StorageDead(_12);                // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
         StorageDead(_11);                // scope 3 at $SRC_DIR/core/src/slice/index.rs:LL:COL
```
1c1c8e442a (diff-a841b6a4538657add3f39bc895744331453d0625e7aace128b1f604f0b63c8fdR80)
2023-04-28 09:26:59 +00:00
Scott McMurray
e1da77c76d Also use mir::Offset for pointer add 2023-04-27 22:44:42 -07:00
Michael Goulet
bd146c72ac Explicitly reject negative and reservation drop impls 2023-04-27 17:02:17 +00:00
Maybe Waffle
9a716dafbe Add a ConstParamTy trait 2023-04-27 15:46:21 +00:00
Boxy
842419712a rename needs_subst to has_param 2023-04-27 08:35:19 +01:00
Boxy
f04b8fe0af rename needs_infer to has_infer 2023-04-27 08:35:19 +01:00
Matthias Krüger
e47562c674
Rollup merge of #110835 - nnethercote:strict-region-folders-2, r=compiler-errors
Make some region folders a little stricter.

Because certain regions cannot occur in them.

r? ``@compiler-errors``
2023-04-26 18:51:44 +02:00
Matthias Krüger
309496cf29
Rollup merge of #108760 - clubby789:autolintstuff, r=wesleywiser
Add lint to deny diagnostics composed of static strings

r? ghost

I'm hoping to have a lint that semi-automatically converts simple diagnostics such as `struct_span_err(span, "msg").help("msg").span_note(span2, "msg").emit()` to typed session diagnostics. It's quite hacky and not entirely working because of problems with `x fix` but should hopefully help reduce some of the work.
I'm going to start trying to apply what I can from this, but opening this as a draft in case anyone wants to develop on it.

cc #100717
2023-04-26 18:51:40 +02:00
Maybe Waffle
1b8c7784e5 Add new ToPredicate impls and TraitRef methods to remove some ty::Binber::dummy calls 2023-04-26 11:48:17 +00:00
Nicholas Nethercote
8216b7f229 Make some region folders a little stricter.
Because certain regions cannot occur in them.
2023-04-26 10:14:16 +10:00
Matthias Krüger
297b222066
Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, r=compiler-errors
Switch to `EarlyBinder` for `explicit_item_bounds`

Part of the work to finish https://github.com/rust-lang/rust/issues/105779.

This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`.

r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 😃)
2023-04-25 21:06:32 +02:00
clubby789
0138513635 Fix static string lints 2023-04-25 18:59:55 +01:00
Maybe Waffle
c727edc0b7 Remove some useless ty::Binder::dummy calls 2023-04-25 16:47:00 +00:00
Maybe Waffle
46b01abbcd Replace tcx.mk_trait_ref with ty::TraitRef::new 2023-04-25 16:12:44 +00:00
bors
a7aa20517c Auto merge of #110325 - obeis:hir-analysis-migrate-diagnostics-4, r=davidtwco
Migrate `rustc_hir_analysis` to session diagnostic [Part 4]

Part 4: Finishing `check/mod.rs` file

r? `@compiler-errors`
2023-04-25 13:45:20 +00:00
Yuki Okushi
a373623d55
Rollup merge of #110681 - klensy:cut-dep, r=lcnr
drop few unused crates, gate libc under unix for rustc_codegen_ssa

Small cleanup.
2023-04-25 02:33:29 +09:00
Yuki Okushi
cefb479242
Rollup merge of #110539 - WaffleLapkin:split_index_vec&slice, r=cjgillot
Move around `{Idx, IndexVec, IndexSlice}` adjacent code

r? ``@scottmcm``
2023-04-25 02:33:25 +09:00
Maybe Waffle
e496fbec92 Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
bors
b72460fe46 Auto merge of #110672 - Ezrashaw:allow-array-simd-in-inline-asm, r=workingjubilee
allow array-style simd in inline asm

Required for [MCP#621](https://github.com/rust-lang/compiler-team/issues/621) to be implemented.

r? `@workingjubilee`
2023-04-24 13:51:04 +00:00
Matthias Krüger
3ecae2932c
Rollup merge of #110706 - scottmcm:transmute_unchecked, r=oli-obk
Add `intrinsics::transmute_unchecked`

This takes a whole 3 lines in `compiler/` since it lowers to `CastKind::Transmute` in MIR *exactly* the same as the existing `intrinsics::transmute` does, it just doesn't have the fancy checking in `hir_typeck`.

Added to enable experimenting with the request in <https://github.com/rust-lang/rust/pull/106281#issuecomment-1496648190> and because the portable-simd folks might be interested for dependently-sized array-vector conversions.

It also simplifies a couple places in `core`.

See also https://github.com/rust-lang/rust/pull/108442#issuecomment-1474777273, where `CastKind::Transmute` was added having exactly these semantics before the lang meeting (which I wasn't in) independently expressed interest.
2023-04-24 07:53:25 +02:00
Matthias Krüger
12858d9a61
Rollup merge of #110700 - compiler-errors:fn-ret-fn, r=oli-obk
Don't infer fn return type to return itself

Fixes #110687
2023-04-23 20:06:33 +02:00
Ezra Shaw
d31e8a499b
allow array-style simd in inline asm 2023-04-23 19:28:50 +12:00
Scott McMurray
1de2257c3f Add intrinsics::transmute_unchecked
This takes a whole 3 lines in `compiler/` since it lowers to `CastKind::Transmute` in MIR *exactly* the same as the existing `intrinsics::transmute` does, it just doesn't have the fancy checking in `hir_typeck`.

Added to enable experimenting with the request in <https://github.com/rust-lang/rust/pull/106281#issuecomment-1496648190> and because the portable-simd folks might be interested for dependently-sized array-vector conversions.

It also simplifies a couple places in `core`.
2023-04-22 17:22:03 -07:00
Michael Goulet
c8874e2445 Don't infer fn return type to return itself 2023-04-22 19:30:47 +00:00
klensy
3338ee3ca7 drop unused deps, gate libc under unix for one crate 2023-04-22 15:22:21 +03:00
Oli Scherer
1ce80e210d Allow LocalDefId as the argument to def_path_str 2023-04-21 22:27:20 +00:00
Oli Scherer
e18d1f8d2e Leave it to the query system to invoke the typeck query instead of invoking it eagerly.
Later queries that are run on all body owners will invoke typeck as they need information from its result to perform their own logic
2023-04-21 22:12:45 +00:00
Obei Sideg
06ff310cf9 Migrate rustc_hir_analysis to session diagnostic
Part 4: Finishing `check/mod.rs` file
2023-04-21 23:50:03 +03:00
bors
1f5768bc67 Auto merge of #96840 - cjgillot:query-feed, r=oli-obk
Allow to feed a value in another query's cache and remove `WithOptConstParam`

I used it to remove `WithOptConstParam` queries, as an example.

The idea is that a query (here `typeck(function)`) can write into another query's cache (here `type_of(anon const)`). The dependency node for `type_of` would depend on all the current dependencies of `typeck`.

There is still an issue with cycles: if `type_of(anon const)` is accessed before `typeck(function)`, we will still have the usual cycle.  The way around this issue is to `ensure` that `typeck(function)` is called before accessing `type_of(anon const)`.

When replayed, we may the following cases:
- `typeck` is green, in that case `type_of` is green too, and all is right;
- `type_of` is green, `typeck` may still be marked as red (it depends on strictly more things than `type_of`) -> we verify that the saved value and the re-computed value of `type_of` have the same hash;
- `type_of` is red, then `typeck` is red -> it's the caller responsibility to ensure `typeck` is recomputed *before* `type_of`.

As `anon consts` have their own `DefPathData`, it's not possible to have the def-id of the anon-const point to something outside the original function, but the general case may have to be resolved before using this device more broadly.

There is an open question about loading from the on-disk cache.  If `typeck` is loaded from the on-disk cache, the side-effect does not happen. The regular `type_of` implementation can go and fetch the correct value from the decoded `typeck` results, and the dep-graph will check that the hashes match, but I'm not sure we want to rely on this behaviour.

I specifically allowed to feed the value to `type_of` from inside a call to `type_of`.  In that case, the dep-graph will check that the fingerprints of both values match.

This implementation is still very sensitive to cycles, and requires that we call `typeck(function)` before `typeck(anon const)`.  The reason is that `typeck(anon const)` calls `type_of(anon const)`, which calls `typeck(function)`, which feeds `type_of(anon const)`, and needs to build the MIR so needs `typeck(anon const)`.  The latter call would not cycle, since `type_of(anon const)` has been set, but I'd rather not remove the cycle check.
2023-04-21 08:04:58 +00:00
Matthias Krüger
7d046551a7
Rollup merge of #110555 - compiler-errors:subst-missing-trait-items, r=cjgillot
Substitute missing trait items suggestion correctly

Properly substitute missing item suggestions, so that when they reference generics from their parent trait they actually have the right time for the impl.

Also, some other minor tweaks like using `/* Type */` to signify a GAT's type is actually missing, and fixing generic arg suggestions for GATs in general.
2023-04-21 06:44:29 +02:00
Kyle Matsuda
e54854f6a9 add subst_identity_iter and subst_identity_iter_copied methods on EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls 2023-04-20 12:36:50 -06:00
Kyle Matsuda
f3b279fcc5 add EarlyBinder to output of explicit_item_bounds; replace bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query 2023-04-20 12:36:50 -06:00