File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ // issue: rust-lang/rust#101852
2
+ // ICE opaque type with non-universal region substs
3
+
4
+ pub fn ice ( x : impl AsRef < str > ) -> impl IntoIterator < Item = ( ) > {
5
+ //~^ WARN function cannot return without recursing
6
+ vec ! [ ] . append ( & mut ice ( x. as_ref ( ) ) ) ;
7
+ //~^ ERROR expected generic type parameter, found `&str`
8
+
9
+ Vec :: new ( )
10
+ }
11
+
12
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ warning: function cannot return without recursing
2
+ --> $DIR/recursive-ice-101862.rs:4:1
3
+ |
4
+ LL | pub fn ice(x: impl AsRef<str>) -> impl IntoIterator<Item = ()> {
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
6
+ LL |
7
+ LL | vec![].append(&mut ice(x.as_ref()));
8
+ | --------------- recursive call site
9
+ |
10
+ = help: a `loop` may express intention better if this is on purpose
11
+ = note: `#[warn(unconditional_recursion)]` on by default
12
+
13
+ error[E0792]: expected generic type parameter, found `&str`
14
+ --> $DIR/recursive-ice-101862.rs:6:5
15
+ |
16
+ LL | pub fn ice(x: impl AsRef<str>) -> impl IntoIterator<Item = ()> {
17
+ | --------------- this generic parameter must be used with a generic type parameter
18
+ LL |
19
+ LL | vec![].append(&mut ice(x.as_ref()));
20
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21
+
22
+ error: aborting due to 1 previous error; 1 warning emitted
23
+
24
+ For more information about this error, try `rustc --explain E0792`.
You can’t perform that action at this time.
0 commit comments