Rollup merge of #128020 - compiler-errors:nlb-no-const, r=BoxyUwU

Just totally fully deny late-bound consts

Kinda don't care about supporting this until we have where clauses on binders. They're super busted and should be reworked in due time, and they are approximately 100% useless until then 😸

Fixes #127970
Fixes #127009

r? ``@BoxyUwU``
This commit is contained in:
Jubilee 2024-07-21 17:44:29 -07:00 committed by GitHub
commit 2ef7699a1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 110 additions and 30 deletions

View file

@ -2094,11 +2094,7 @@ pub fn deny_non_region_late_bound(
format!("late-bound {what} parameter not allowed on {where_}"),
);
let guar = if tcx.features().non_lifetime_binders && first {
diag.emit()
} else {
diag.delay_as_bug()
};
let guar = diag.emit_unless(!tcx.features().non_lifetime_binders || !first);
first = false;
*arg = ResolvedArg::Error(guar);