glacier icon indicating copy to clipboard operation
glacier copied to clipboard

ices/110726.rs: fixed with errors

Open github-actions[bot] opened this issue 1 year ago • 0 comments

Issue: https://github.com/rust-lang/rust/issues/110726

fn foo<'a>() -> impl Sized + 'a {
    let i: i32 = foo();
    i
}

fn main() {}

=== stdout ===
=== stderr ===
warning: function cannot return without recursing
 --> /home/runner/work/glacier/glacier/ices/110726.rs:1:1
  |
1 | fn foo<'a>() -> impl Sized + 'a {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
2 |     let i: i32 = foo();
  |                  ----- recursive call site
  |
  = help: a `loop` may express intention better if this is on purpose
  = note: `#[warn(unconditional_recursion)]` on by default

error[E0792]: expected generic lifetime parameter, found `'_`
 --> /home/runner/work/glacier/glacier/ices/110726.rs:2:18
  |
1 | fn foo<'a>() -> impl Sized + 'a {
  |                              -- this generic parameter must be used with a generic lifetime parameter
2 |     let i: i32 = foo();
  |                  ^^^^^

error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0792`.
==============

github-actions[bot] avatar Mar 31 '24 03:03 github-actions[bot]