-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #127655 - RalfJung:invalid_type_param_default, r=comp…
…iler-errors turn `invalid_type_param_default` into a `FutureReleaseErrorReportInDeps` `````@rust-lang/types````` I assume the plan is still to disallow this? It has been a future-compat lint for a long time, seems ripe to go for hard error. However, turns out that outright removing it right now would lead to [tons of crater regressions](#127655 (comment)), so for now this PR just makes this future-compat lint show up in cargo's reports, so people are warned when they use a dependency that is affected by this. Fixes #27336 by removing the feature gate (so there's no way to silence the lint even on nightly) CC #36887
- Loading branch information
Showing
12 changed files
with
115 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 0 additions & 21 deletions
21
tests/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#![feature(default_type_parameter_fallback)] | ||
|
||
fn avg<T=T::Item>(_: T) {} | ||
//~^ ERROR generic parameters with a default cannot use forward declared identifiers | ||
//~| ERROR defaults for type parameters | ||
//~| WARN previously accepted | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,30 @@ | ||
error[E0128]: generic parameters with a default cannot use forward declared identifiers | ||
--> $DIR/issue-26812.rs:3:10 | ||
--> $DIR/issue-26812.rs:1:10 | ||
| | ||
LL | fn avg<T=T::Item>(_: T) {} | ||
| ^^^^^^^ defaulted generic parameters cannot be forward declared | ||
|
||
error: aborting due to 1 previous error | ||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions | ||
--> $DIR/issue-26812.rs:1:8 | ||
| | ||
LL | fn avg<T=T::Item>(_: T) {} | ||
| ^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> | ||
= note: `#[deny(invalid_type_param_default)]` on by default | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0128`. | ||
Future incompatibility report: Future breakage diagnostic: | ||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions | ||
--> $DIR/issue-26812.rs:1:8 | ||
| | ||
LL | fn avg<T=T::Item>(_: T) {} | ||
| ^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> | ||
= note: `#[deny(invalid_type_param_default)]` on by default | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions | ||
--> $DIR/default_type_parameter_in_fn_or_impl.rs:3:8 | ||
| | ||
LL | fn avg<T=i32>(_: T) {} | ||
| ^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> | ||
= note: `#[deny(invalid_type_param_default)]` on by default | ||
|
||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions | ||
--> $DIR/default_type_parameter_in_fn_or_impl.rs:8:6 | ||
| | ||
LL | impl<T=i32> S<T> {} | ||
| ^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions | ||
--> $DIR/default_type_parameter_in_fn_or_impl.rs:3:8 | ||
| | ||
LL | fn avg<T=i32>(_: T) {} | ||
| ^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> | ||
= note: `#[deny(invalid_type_param_default)]` on by default | ||
|
||
Future breakage diagnostic: | ||
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions | ||
--> $DIR/default_type_parameter_in_fn_or_impl.rs:8:6 | ||
| | ||
LL | impl<T=i32> S<T> {} | ||
| ^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887> | ||
= note: `#[deny(invalid_type_param_default)]` on by default | ||
|