1
Fork 0

Auto merge of #127670 - compiler-errors:no-type-length-limit, r=jackh726

Gate the type length limit check behind a nightly flag

Effectively disables the type length limit by introducing a `-Zenforce-type-length-limit` which defaults to **`false`**, since making the length limit actually be enforced ended up having a worse fallout than expected. We still keep the code around, but the type length limit attr is now a noop (except for its usage in some diagnostics code?).

r? `@lcnr` -- up to you to decide what team consensus we need here since this reverses an FCP decision.

Reopens #125460 (if we decide to reopen it or keep it closed)
Effectively reverses the decision FCP'd in #125507
Closes #127346
This commit is contained in:
bors 2024-07-14 12:44:07 +00:00
commit 88fa119c77
17 changed files with 54 additions and 58 deletions

View file

@ -541,7 +541,9 @@ impl<'tcx> Instance<'tcx> {
// which means that rustc basically hangs.
//
// Bail out in these cases to avoid that bad user experience.
if !tcx.type_length_limit().value_within_limit(type_length(args)) {
if tcx.sess.opts.unstable_opts.enforce_type_length_limit
&& !tcx.type_length_limit().value_within_limit(type_length(args))
{
return Ok(None);
}