Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/101852.rs: fixed with errors #1653

Merged
merged 1 commit into from
Oct 15, 2023
Merged

ices/101852.rs: fixed with errors #1653

merged 1 commit into from
Oct 15, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#101852

pub fn ice(
    x: impl AsRef<str>,
) -> impl IntoIterator<Item = ()> {
    vec![].append(&mut ice(x.as_ref()));

    Vec::new()
}

fn main() {}
=== stdout ===
=== stderr ===
warning: function cannot return without recursing
 --> /home/runner/work/glacier/glacier/ices/101852.rs:1:1
  |
1 | / pub fn ice(
2 | |     x: impl AsRef<str>,
3 | | ) -> impl IntoIterator<Item = ()> {
  | |_________________________________^ cannot return without recursing
4 |       vec![].append(&mut ice(x.as_ref()));
  |                          --------------- 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 type parameter, found `&str`
 --> /home/runner/work/glacier/glacier/ices/101852.rs:4:5
  |
2 |     x: impl AsRef<str>,
  |        --------------- this generic parameter must be used with a generic type parameter
3 | ) -> impl IntoIterator<Item = ()> {
4 |     vec![].append(&mut ice(x.as_ref()));
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: function cannot return without recursing
 --> /home/runner/work/glacier/glacier/ices/101852.rs:1:1
  |
1 | / pub fn ice(
2 | |     x: impl AsRef<str>,
3 | | ) -> impl IntoIterator<Item = ()> {
  | |_________________________________^ cannot return without recursing
4 |       vec![].append(&mut ice(x.as_ref()));
  |                          --------------- 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 type parameter, found `&str`
 --> /home/runner/work/glacier/glacier/ices/101852.rs:4:5
  |
2 |     x: impl AsRef<str>,
  |        --------------- this generic parameter must be used with a generic type parameter
3 | ) -> impl IntoIterator<Item = ()> {
4 |     vec![].append(&mut ice(x.as_ref()));
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0792`.
==============
@JohnTitor JohnTitor merged commit 10be4c0 into master Oct 15, 2023
@JohnTitor JohnTitor deleted the autofix/ices/101852.rs branch October 15, 2023 03:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants