]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #53364 - varkor:gat-warn-broken, r=pnkfelix
authorkennytm <kennytm@gmail.com>
Thu, 16 Aug 2018 16:13:23 +0000 (00:13 +0800)
committerGitHub <noreply@github.com>
Thu, 16 Aug 2018 16:13:23 +0000 (00:13 +0800)
Warn if the user tries to use GATs

GATs are currently broken, but still accessible behind a feature gate. This leads to people attempting to use them and then immediately encountering ICEs (or other broken behaviour). Here, we emit a warning if the user tries to use any feature associated with GATs, hopefully making it obvious that ICEs and the like are expected. For the meantime, this seems better than continually getting reported errors (for example: [here](https://github.com/rust-lang/rust/issues?q=is%3Aissue+gat+is%3Aclosed) and [here](https://github.com/rust-lang/rust/issues?utf8=%E2%9C%93&q=is%3Aissue+generic_associated_types+is%3Aclosed)).

21 files changed:
src/libsyntax/feature_gate.rs
src/test/ui/rfc1598-generic-associated-types/collections.rs
src/test/ui/rfc1598-generic-associated-types/collections.stderr
src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs
src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr
src/test/ui/rfc1598-generic-associated-types/empty_generics.rs
src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr
src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.rs [new file with mode: 0644]
src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr [new file with mode: 0644]
src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr [new file with mode: 0644]
src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs
src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr
src/test/ui/rfc1598-generic-associated-types/iterable.rs
src/test/ui/rfc1598-generic-associated-types/iterable.stderr
src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs
src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr
src/test/ui/rfc1598-generic-associated-types/pointer_family.rs
src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr
src/test/ui/rfc1598-generic-associated-types/shadowing.stderr [new file with mode: 0644]
src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs
src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr

index f837bead6a08527e0647badba922205ecf5801d3..395e5c98652326091ed5ce6f79d573698426722c 100644 (file)
@@ -1922,6 +1922,11 @@ fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
         err.emit();
     }
 
+    // Some features are known to be incomplete and using them is likely to have
+    // unanticipated results, such as compiler crashes. We warn the user about these
+    // to alert them.
+    let incomplete_features = ["generic_associated_types"];
+
     let mut features = Features::new();
     let mut edition_enabled_features = FxHashMap();
 
@@ -1957,6 +1962,16 @@ fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
                 continue
             };
 
+            if incomplete_features.iter().any(|f| *f == name.as_str()) {
+                span_handler.struct_span_warn(
+                    mi.span,
+                    &format!(
+                        "the feature `{}` is incomplete and may cause the compiler to crash",
+                        name
+                    )
+                ).emit();
+            }
+
             if let Some(edition) = ALL_EDITIONS.iter().find(|e| name == e.feature_name()) {
                 if *edition <= crate_edition {
                     continue
index e71166ed65bba4ec9bbb6030dc8ab481a6a468e6..a6dbb03d379db532db316179d640a98ee089b0ab 100644 (file)
@@ -9,10 +9,11 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 #![feature(associated_type_defaults)]
 
-//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
-//follow-up PR
+// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
+// follow-up PR.
 
 // A Collection trait and collection families. Based on
 // http://smallcultfollowing.com/babysteps/blog/2016/11/03/
index 8c31ab2ca88e4d71a88dda2c6d1b759b1c3444d0..0e7d6ace1bb1d0560a1dabffcdc871f87d1748a4 100644 (file)
@@ -1,29 +1,35 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/collections.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/collections.rs:65:90
+  --> $DIR/collections.rs:66:90
    |
 LL | fn floatify<C>(ints: &C) -> <<C as Collection<i32>>::Family as CollectionFamily>::Member<f32>
    |                                                                                          ^^^ type parameter not allowed
 
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/collections.rs:77:69
+  --> $DIR/collections.rs:78:69
    |
 LL | fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
    |                                                                     ^^^ type parameter not allowed
 
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/collections.rs:26:71
+  --> $DIR/collections.rs:27:71
    |
 LL |         <<Self as Collection<T>>::Family as CollectionFamily>::Member<U>;
    |                                                                       ^ type parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/collections.rs:33:50
+  --> $DIR/collections.rs:34:50
    |
 LL |     fn iterate<'iter>(&'iter self) -> Self::Iter<'iter>;
    |                                                  ^^^^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/collections.rs:59:50
+  --> $DIR/collections.rs:60:50
    |
 LL |     fn iterate<'iter>(&'iter self) -> Self::Iter<'iter> {
    |                                                  ^^^^^ lifetime parameter not allowed
index 04294100315264ec5f1a26bb3a6834da7e86500b..88a660b3a5afe51d16028566a03b1423362a334a 100644 (file)
@@ -9,11 +9,12 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 
 use std::ops::Deref;
 
-//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
-//follow-up PR
+// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
+// follow-up PR.
 
 trait Foo {
     type Bar<'a, 'b>;
index 1746122eb49f41d68b726acf25b086e6cda7e555..5c85698fa55c702e796c282b90c61418e26aa151 100644 (file)
@@ -1,17 +1,23 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/construct_with_other_type.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/construct_with_other_type.rs:26:46
+  --> $DIR/construct_with_other_type.rs:27:46
    |
 LL |     type Baa<'a>: Deref<Target = <Self::Quux<'a> as Foo>::Bar<'a, 'static>>;
    |                                              ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/construct_with_other_type.rs:26:63
+  --> $DIR/construct_with_other_type.rs:27:63
    |
 LL |     type Baa<'a>: Deref<Target = <Self::Quux<'a> as Foo>::Bar<'a, 'static>>;
    |                                                               ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/construct_with_other_type.rs:34:40
+  --> $DIR/construct_with_other_type.rs:35:40
    |
 LL |     type Baa<'a> = &'a <T as Foo>::Bar<'a, 'static>;
    |                                        ^^ lifetime parameter not allowed
index b12c075d1329178ca5f797339919262b8543ddc4..d8a2a1b73f7ef084078e2728c3467c9a431114c9 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 
 trait Foo {
     type Bar<,>;
index aff3044e9a14dc753341557ba1693ef4e876622e..2670c3aa142b204be287aa319e7a778505337c2b 100644 (file)
@@ -1,8 +1,14 @@
 error: expected one of `>`, identifier, or lifetime, found `,`
-  --> $DIR/empty_generics.rs:14:14
+  --> $DIR/empty_generics.rs:15:14
    |
 LL |     type Bar<,>;
    |              ^ expected one of `>`, identifier, or lifetime here
 
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/empty_generics.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error: aborting due to previous error
 
diff --git a/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.rs b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.rs
new file mode 100644 (file)
index 0000000..7f48408
--- /dev/null
@@ -0,0 +1,16 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// run-pass
+
+#![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
+
+fn main() {}
diff --git a/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr
new file mode 100644 (file)
index 0000000..67682dc
--- /dev/null
@@ -0,0 +1,6 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/gat-incomplete-warning.rs:13:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr
new file mode 100644 (file)
index 0000000..97d5482
--- /dev/null
@@ -0,0 +1,6 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/generic-associated-types-where.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
index 263b3cb42eb4f32d465de767687b79ea25f954cf..267272ded8c06876777d8cb4f2ed8181ac1c70aa 100644 (file)
@@ -9,11 +9,12 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 
 use std::ops::Deref;
 
-//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
-//follow-up PR
+// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
+// follow-up PR.
 
 trait Iterable {
     type Item<'a>;
index d48c21477b310668bfa620ace9f6314c561a08e0..79b29902ccdf05fb2c6bf9d6025cd4fcd20c47c1 100644 (file)
@@ -1,29 +1,35 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0261]: use of undeclared lifetime name `'b`
-  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:22:37
+  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:23:37
    |
 LL |         + Deref<Target = Self::Item<'b>>;
    |                                     ^^ undeclared lifetime
 
 error[E0261]: use of undeclared lifetime name `'undeclared`
-  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:26:41
+  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:27:41
    |
 LL |     fn iter<'a>(&'a self) -> Self::Iter<'undeclared>;
    |                                         ^^^^^^^^^^^ undeclared lifetime
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:20:47
+  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:21:47
    |
 LL |     type Iter<'a>: Iterator<Item = Self::Item<'a>>
    |                                               ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:22:37
+  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:23:37
    |
 LL |         + Deref<Target = Self::Item<'b>>;
    |                                     ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:26:41
+  --> $DIR/generic_associated_type_undeclared_lifetimes.rs:27:41
    |
 LL |     fn iter<'a>(&'a self) -> Self::Iter<'undeclared>;
    |                                         ^^^^^^^^^^^ lifetime parameter not allowed
index 38967dbbe4530ea4ab28da1943889f4ef1e8d54f..b52b6e024219a194059a82fafc80a78b594c0d88 100644 (file)
@@ -9,11 +9,12 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 
 use std::ops::Deref;
 
-//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
-//follow-up PR
+// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
+// follow-up PR.
 
 trait Iterable {
     type Item<'a>;
index 737a29ec2c8be46ced3f82ad9674b416b6ca9b73..de3563c14eb7c44208e92020c0d3c3a7604cffef 100644 (file)
@@ -1,35 +1,41 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/iterable.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/iterable.rs:20:47
+  --> $DIR/iterable.rs:21:47
    |
 LL |     type Iter<'a>: Iterator<Item = Self::Item<'a>>;
    |                                               ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/iterable.rs:49:53
+  --> $DIR/iterable.rs:50:53
    |
 LL | fn make_iter<'a, I: Iterable>(it: &'a I) -> I::Iter<'a> {
    |                                                     ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/iterable.rs:54:60
+  --> $DIR/iterable.rs:55:60
    |
 LL | fn get_first<'a, I: Iterable>(it: &'a I) -> Option<I::Item<'a>> {
    |                                                            ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/iterable.rs:23:41
+  --> $DIR/iterable.rs:24:41
    |
 LL |     fn iter<'a>(&'a self) -> Self::Iter<'a>;
    |                                         ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/iterable.rs:32:41
+  --> $DIR/iterable.rs:33:41
    |
 LL |     fn iter<'a>(&'a self) -> Self::Iter<'a> {
    |                                         ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/iterable.rs:43:41
+  --> $DIR/iterable.rs:44:41
    |
 LL |     fn iter<'a>(&'a self) -> Self::Iter<'a> {
    |                                         ^^ lifetime parameter not allowed
index 51527d4117c2c04c35ec02748bb9a1b0401ffb8e..82e82e6dbccaf3bfd01c9d5a334b46d8fb1ee82b 100644 (file)
@@ -9,12 +9,13 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 #![feature(associated_type_defaults)]
 
-//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
-//follow-up PR
+// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
+// follow-up PR.
 
-//FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`
+// FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`.
 
 trait Foo {
     type A<'a>;
index c8d37a51fa96bd5cd73e1c6161a89c453bca1b62..e47daf2ae1bbae0198480b1f05a18199c2e36c9f 100644 (file)
@@ -1,29 +1,35 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/parameter_number_and_kind.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/parameter_number_and_kind.rs:26:27
+  --> $DIR/parameter_number_and_kind.rs:27:27
    |
 LL |     type FOk<T> = Self::E<'static, T>;
    |                           ^^^^^^^ lifetime parameter not allowed
 
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/parameter_number_and_kind.rs:26:36
+  --> $DIR/parameter_number_and_kind.rs:27:36
    |
 LL |     type FOk<T> = Self::E<'static, T>;
    |                                    ^ type parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/parameter_number_and_kind.rs:29:26
+  --> $DIR/parameter_number_and_kind.rs:30:26
    |
 LL |     type FErr1 = Self::E<'static, 'static>; // Error
    |                          ^^^^^^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/parameter_number_and_kind.rs:31:29
+  --> $DIR/parameter_number_and_kind.rs:32:29
    |
 LL |     type FErr2<T> = Self::E<'static, T, u32>; // Error
    |                             ^^^^^^^ lifetime parameter not allowed
 
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/parameter_number_and_kind.rs:31:38
+  --> $DIR/parameter_number_and_kind.rs:32:38
    |
 LL |     type FErr2<T> = Self::E<'static, T, u32>; // Error
    |                                      ^ type parameter not allowed
index cbeeb1d6ca7b292686f21deaa02e27405e47ace6..0300ad06194e76c726cbcee4574d56e9e7cc14d0 100644 (file)
@@ -9,8 +9,9 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 
-//FIXME(#44265): "type parameter not allowed" errors will be addressed in a follow-up PR
+// FIXME(#44265): "type parameter not allowed" errors will be addressed in a follow-up PR.
 
 use std::rc::Rc;
 use std::sync::Arc;
index 3e772eee4f4920ae0feedd4f6e260458b2b285fc..3be0481dc67e85f0d4cefdcd04455ef254faa209 100644 (file)
@@ -1,23 +1,29 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/pointer_family.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/pointer_family.rs:46:21
+  --> $DIR/pointer_family.rs:47:21
    |
 LL |     bar: P::Pointer<String>,
    |                     ^^^^^^ type parameter not allowed
 
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/pointer_family.rs:21:42
+  --> $DIR/pointer_family.rs:22:42
    |
 LL |     fn new<T>(value: T) -> Self::Pointer<T>;
    |                                          ^ type parameter not allowed
 
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/pointer_family.rs:29:42
+  --> $DIR/pointer_family.rs:30:42
    |
 LL |     fn new<T>(value: T) -> Self::Pointer<T> {
    |                                          ^ type parameter not allowed
 
 error[E0109]: type parameters are not allowed on this type
-  --> $DIR/pointer_family.rs:39:42
+  --> $DIR/pointer_family.rs:40:42
    |
 LL |     fn new<T>(value: T) -> Self::Pointer<T> {
    |                                          ^ type parameter not allowed
diff --git a/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr b/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr
new file mode 100644 (file)
index 0000000..f2d626f
--- /dev/null
@@ -0,0 +1,6 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/shadowing.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
index 522ddb5dc135e36e162d34cc5bfb34e2f27f427b..aa90886fdfd65c6787ffebe7d051c95e1217ad60 100644 (file)
@@ -9,8 +9,9 @@
 // except according to those terms.
 
 #![feature(generic_associated_types)]
+//~^ WARNING the feature `generic_associated_types` is incomplete
 
-//FIXME(#44265): "lifetime parameter not allowed on this type" errors will be addressed in a
+// FIXME(#44265): "lifetime parameter not allowed on this type" errors will be addressed in a
 // follow-up PR
 
 use std::fmt::Display;
index 12e206cbd476af56a70098be716d39a69b699fc8..4aca8d476877b78e53165b448978c41e246ec6c0 100644 (file)
@@ -1,29 +1,35 @@
+warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash
+  --> $DIR/streaming_iterator.rs:11:12
+   |
+LL | #![feature(generic_associated_types)]
+   |            ^^^^^^^^^^^^^^^^^^^^^^^^
+
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/streaming_iterator.rs:27:41
+  --> $DIR/streaming_iterator.rs:28:41
    |
 LL |     bar: <T as StreamingIterator>::Item<'static>,
    |                                         ^^^^^^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/streaming_iterator.rs:35:64
+  --> $DIR/streaming_iterator.rs:36:64
    |
 LL | fn foo<T>(iter: T) where T: StreamingIterator, for<'a> T::Item<'a>: Display { /* ... */ }
    |                                                                ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/streaming_iterator.rs:21:48
+  --> $DIR/streaming_iterator.rs:22:48
    |
 LL |     fn next<'a>(&'a self) -> Option<Self::Item<'a>>;
    |                                                ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/streaming_iterator.rs:47:37
+  --> $DIR/streaming_iterator.rs:48:37
    |
 LL |     type Item<'a> = (usize, I::Item<'a>);
    |                                     ^^ lifetime parameter not allowed
 
 error[E0110]: lifetime parameters are not allowed on this type
-  --> $DIR/streaming_iterator.rs:49:48
+  --> $DIR/streaming_iterator.rs:50:48
    |
 LL |     fn next<'a>(&'a self) -> Option<Self::Item<'a>> {
    |                                                ^^ lifetime parameter not allowed