forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make invalid_type_param_default lint show up in cargo future-compat r…
…eports and remove the feature gate that silenced the lint
- 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 | ||
|