about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-07 06:32:56 +0000
committerbors <bors@rust-lang.org>2016-01-07 06:32:56 +0000
commit91b27ec9beb8455426da3efd26dfc9155058f5bd (patch)
tree07d71c78a97c65aeda0f6ad440c9b966b1472150 /src/libcore
parent440671751e818dfb20525a16a00011b8227eeaa7 (diff)
parent6dd3f6143e384927a15b165b1c64e1d7c06faa0a (diff)
Auto merge of #30724 - nikomatsakis:feature-gate-defaulted-type-parameters, r=pnkfelix
It was recently realized that we accept defaulted type parameters everywhere, without feature gate, even though the only place that we really *intended* to accept them were on types. This PR adds a lint warning unless the "type-parameter-defaults" feature is enabled. This should eventually become a hard error.

This is a [breaking-change] in that new feature gates are required (or simply removing the defaults, which is probably a better choice as they have little effect at this time). Results of a [crater run][crater] suggest that approximately 5-15 crates are affected. I didn't do the measurement quite right so that run cannot distinguish "true" regressions from "non-root" regressions, but even the upper bound of 15 affected crates seems relatively minimal.

[crater]: https://gist.github.com/nikomatsakis/760c6a67698bd24253bf

cc @rust-lang/lang
r? @pnkfelix
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/iter.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 6f052f964c6..a30e5b1372a 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -2132,7 +2132,7 @@ pub trait Iterator {
     /// ```
     #[unstable(feature = "iter_arith", reason = "bounds recently changed",
                issue = "27739")]
-    fn sum<S=<Self as Iterator>::Item>(self) -> S where
+    fn sum<S>(self) -> S where
         S: Add<Self::Item, Output=S> + Zero,
         Self: Sized,
     {
@@ -2157,7 +2157,7 @@ pub trait Iterator {
     /// ```
     #[unstable(feature="iter_arith", reason = "bounds recently changed",
                issue = "27739")]
-    fn product<P=<Self as Iterator>::Item>(self) -> P where
+    fn product<P>(self) -> P where
         P: Mul<Self::Item, Output=P> + One,
         Self: Sized,
     {