Commit Graph

92 Commits

Author SHA1 Message Date
Oli Scherer
6166cd6b50 Avoid looking at HIR for trait and impl items 2025-06-30 08:45:43 +00:00
Michael Goulet
250b5d204f Make missing lifetime suggestion verbose 2025-06-24 18:59:42 +00:00
Boxy
377d8fa4e3 Reviews 2025-06-18 17:51:22 +01:00
Boxy
ae65625252 Dont replace escaping bound vars in item sigs 2025-06-17 14:48:17 +01:00
Boxy
2a950b5637 Test whether we use DeepRejectCtxt 2025-06-17 14:18:34 +01:00
Boxy
442862bc78 Don't build ParamEnv and do trait solving in ItemCtxts 2025-06-17 14:18:34 +01:00
Oli Scherer
bfe4c5f78c Move opaque type checks from the hir item types visitor onto the wfcheck of the opaqe type itself 2025-06-05 10:30:09 +00:00
León Orell Valerian Liehr
8c37c8c3e6 Preserve generic args in suggestions for ambiguous associated items
Most notably, this preserves the `(..)` of ambiguous RTN paths.
2025-05-06 17:04:03 +02:00
Michael Goulet
12d3021ef0 Deeply normalize in the new solver in WF 2025-05-05 15:52:38 +00:00
Vadim Petrochenkov
b3f75353a2 UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
Oli Scherer
cb4751d4b8 Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
许杰友 Jieyou Xu (Joe)
6c60abf51a Rollup merge of #137633 - compiler-errors:no-implied-bounds-hack-unless-bevy, r=lcnr
Only use implied bounds hack if bevy, and use deeply normalize in implied bounds hack

Consolidates the implied bounds computation mode into a single function, which deeply normalizes, and if it's in **compat** mode (for bevy), it extracts outlives bounds from the infcx.

Previously, we were using the implied bounds compat mode in two cases:
1. During WF, if it detects `ParamSet`
2. EVERYWHERE ELSE (lol) -- e.g. borrowck, predicate entailment, etc.

While I think this is fine, and the net effect was just that we emitted fewer diagnostics, it makes me uncomfortable that all crates were using the supposed "compat" code.

Fixes #137767
2025-03-05 21:46:42 +08:00
Michael Goulet
d759958131 Only use implied bounds hack if bevy, and use deeply normalize in implied bounds hack 2025-03-04 18:18:48 +00:00
Noah Lev
177e7ff548 mgca: Lower all const paths as ConstArgKind::Path
When `#![feature(min_generic_const_args)]` is enabled, we now lower all
const paths in generic arg position to `hir::ConstArgKind::Path`. We
then lower assoc const paths to `ty::ConstKind::Unevaluated` since we
can no longer use the anon const expression lowering machinery. In the
process of implementing this, I factored out `hir_ty_lowering` code that
is now shared between lowering assoc types and assoc consts.

This PR also introduces a `#[type_const]` attribute for trait assoc
consts that are allowed as const args. However, we still need to
implement code to check that assoc const definitions satisfy
`#[type_const]` if present (basically is it a const path or a
monomorphic anon const).
2025-03-04 10:11:13 -05:00
Michael Goulet
0a7ab1d6df More sophisticated span trimming 2025-02-21 00:41:17 +00:00
Esteban Küber
f0845adb0c Show diff suggestion format on verbose replacement
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --> $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
2025-02-10 20:21:39 +00:00
Michael Goulet
304b3cfcb2 Manually walk into WF obligations in BestObligation proof tree visitor 2025-01-31 18:21:58 +00:00
León Orell Valerian Liehr
454c09e355 Spruce up the docs of several queries related to the type/trait system and const eval 2024-12-27 11:44:23 +01:00
dianne
d7d6238b23 use backticks instead of single quotes when reporting "use of unstable library feature"
This is consistent with all other diagnostics I could find containing
features and enables the use of `DiagSymbolList` for generalizing
diagnostics for unstable library features to multiple features.
2024-11-03 13:55:52 -08:00
Michael Goulet
dbf06d2170 Get rid of predicates_defined_on 2024-08-24 18:25:41 -04:00
León Orell Valerian Liehr
fdf8f024ad Improve the impl and diag output of lint type_alias_bounds 2024-07-23 01:48:03 +02:00
León Orell Valerian Liehr
63a54d93be Don't suppress lint type_alias_bounds for ty aliases containing inherent assoc tys 2024-07-23 01:26:26 +02:00
long-long-float
332b41dbce Use ordinal number in argument error
Fix error message

Fix tests

Format
2024-07-14 13:50:09 +09:00
Jubilee
e7b07ea7a1 Rollup merge of #125978 - fmease:cleanup-hir-ty-lowering-consolidate-assoc-item-access-checking, r=davidtwco
Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking

Use `probe_assoc_item` (for hygienically probing an assoc item and checking if it's accessible wrt. visibility and stability) for assoc item constraints, too, not just for assoc type paths and make the privacy error translatable.
2024-06-12 03:57:19 -07:00
León Orell Valerian Liehr
c59a2b2746 Cleanup: HIR ty lowering: Consolidate assoc item access checking 2024-06-04 23:13:16 +02:00
Oli Scherer
39b39da40b Stop proving outlives constraints on regions we already reported errors on 2024-05-29 09:27:07 +00:00
Oli Scherer
a04ac26a9d Allow type_of to return partially non-error types if the type was already tainted 2024-05-28 11:55:20 +00:00
Michael Goulet
119c7bbef7 Report better WF obligation leaf obligations in new solver 2024-05-16 21:08:42 -04:00
Oli Scherer
dadece067e Let inherent associated types constrain opaque types during projection 2024-04-19 16:12:54 +00:00
Michael Goulet
ce5f8c93fa Bless test fallout (duplicate diagnostics) 2024-03-20 13:00:34 -04:00
Michael Goulet
01e6b43a07 Mark some next-solver-behavior tests explicitly with revisions 2024-03-10 23:23:46 -04:00
Michael Goulet
383051092f Ignore tests w/ current/next revisions from compare-mode=next-solver 2024-03-10 21:18:41 -04:00
Oli Scherer
ae50e36dfa Merge collect_mod_item_types query into check_well_formed 2024-03-07 14:26:31 +00:00
Michael Goulet
003b920591 Don't grab variances if we're invariant 2024-03-01 18:11:45 +00:00
Santiago Pastorino
23ae3dbb31 Make infer higher ranked equate use bidirectional subtyping in invariant context 2024-02-29 15:27:56 -03:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Oli Scherer
5f6390f947 Continue compilation after check_mod_type_wf errors 2024-02-14 11:00:30 +00:00
Esteban Küber
3691ab8e7a Use only one label for multiple unsatisfied bounds on type (astconv) 2024-01-26 20:47:11 +00:00
lcnr
058ab53dc5 use implied bounds compat mode in MIR borrowck 2024-01-19 15:27:32 +01:00
Jack Huey
a9e30e6cdf Don't use compat versions of implied bounds in ImpliedOutlivesBounds query 2024-01-17 22:03:06 -05:00
George-lewis
d56cdd48cb Bless tests
Update tests
2024-01-13 12:46:58 -05:00
Oli Scherer
af7f8f9811 Silence follow up errors if astconv already errored 2024-01-11 09:03:26 +00:00
Oli Scherer
0978f6e010 Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
Eric Holk
aaa3e7642b Update test outputs 2023-12-22 11:01:07 -08:00
lcnr
11d16c4082 update use of feature flags 2023-12-14 15:22:37 +01:00
Santiago Pastorino
440f46dc16 Get rid of infer vars in inherent assoc types selection by using probe 2023-11-25 17:48:09 -03:00
Santiago Pastorino
8694b0973a Do not erase late bound regions, replace them with placeholders 2023-11-25 15:31:39 -03:00
Nilstrieb
41e8d152dc Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Oli Scherer
beaf46f7e5 Work around the fact that check_mod_type_wf may spuriously return ErrorGuaranteed, even if that error is only emitted by check_modwitem_types 2023-10-25 12:04:54 +00:00
Esteban Küber
890e92feed Unify suggestion wording 2023-10-17 17:33:55 +00:00